久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    • <bdo id='vvaBz'></bdo><ul id='vvaBz'></ul>

      <small id='vvaBz'></small><noframes id='vvaBz'>

        <i id='vvaBz'><tr id='vvaBz'><dt id='vvaBz'><q id='vvaBz'><span id='vvaBz'><b id='vvaBz'><form id='vvaBz'><ins id='vvaBz'></ins><ul id='vvaBz'></ul><sub id='vvaBz'></sub></form><legend id='vvaBz'></legend><bdo id='vvaBz'><pre id='vvaBz'><center id='vvaBz'></center></pre></bdo></b><th id='vvaBz'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='vvaBz'><tfoot id='vvaBz'></tfoot><dl id='vvaBz'><fieldset id='vvaBz'></fieldset></dl></div>

      1. <legend id='vvaBz'><style id='vvaBz'><dir id='vvaBz'><q id='vvaBz'></q></dir></style></legend>

        <tfoot id='vvaBz'></tfoot>

        使用動(dòng)態(tài)值覆蓋 Junit Test 中的默認(rèn) Spring-Boot app

        Override default Spring-Boot application.properties settings in Junit Test with dynamic value(使用動(dòng)態(tài)值覆蓋 Junit Test 中的默認(rèn) Spring-Boot application.properties 設(shè)置)
            <tfoot id='5vJig'></tfoot>

              <tbody id='5vJig'></tbody>

            1. <i id='5vJig'><tr id='5vJig'><dt id='5vJig'><q id='5vJig'><span id='5vJig'><b id='5vJig'><form id='5vJig'><ins id='5vJig'></ins><ul id='5vJig'></ul><sub id='5vJig'></sub></form><legend id='5vJig'></legend><bdo id='5vJig'><pre id='5vJig'><center id='5vJig'></center></pre></bdo></b><th id='5vJig'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='5vJig'><tfoot id='5vJig'></tfoot><dl id='5vJig'><fieldset id='5vJig'></fieldset></dl></div>
              1. <small id='5vJig'></small><noframes id='5vJig'>

                <legend id='5vJig'><style id='5vJig'><dir id='5vJig'><q id='5vJig'></q></dir></style></legend>
                • <bdo id='5vJig'></bdo><ul id='5vJig'></ul>
                • 本文介紹了使用動(dòng)態(tài)值覆蓋 Junit Test 中的默認(rèn) Spring-Boot application.properties 設(shè)置的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我想在測(cè)試中覆蓋 application.properties 中定義的屬性,但 @TestPropertySource 只允許提供預(yù)定義的值.

                  I want to override properties defined in application.properties in tests, but @TestPropertySource only allows to provide predefined values.

                  我需要在隨機(jī)端口 N 上啟動(dòng)服務(wù)器,然后將此端口傳遞給 spring-boot 應(yīng)用程序.端口必須是臨時(shí)的,以允許同時(shí)在同一主機(jī)上運(yùn)行多個(gè)測(cè)試.

                  What I need is to start a server on a random port N, then pass this port to spring-boot application. The port has to be ephemeral to allow running multiple tests on the same host at the same time.

                  我不是指嵌入式http服務(wù)器(jetty),而是在測(cè)試開(kāi)始時(shí)啟動(dòng)的一些不同的服務(wù)器(例如zookeeper)并且被測(cè)試的應(yīng)用程序必須連接到它.

                  I don't mean the embedded http server (jetty), but some different server that is started at the beginning of the test (e.g. zookeeper) and the application being tested has to connect to it.

                  實(shí)現(xiàn)這一目標(biāo)的最佳方法是什么?

                  What's the best way to achieve this?

                  (這是一個(gè)類(lèi)似的問(wèn)題,但答案沒(méi)有提到臨時(shí)端口的解決方案 - 在 Junit 測(cè)試中覆蓋默認(rèn) Spring-Boot application.properties 設(shè)置)

                  (here's a similar question, but answers do not mention a solution for ephemeral ports - Override default Spring-Boot application.properties settings in Junit Test)

                  推薦答案

                  從 Spring Framework 5.2.5 和 Spring Boot 2.2.6 開(kāi)始,您可以在測(cè)試中使用 Dynamic Properties:

                  As of Spring Framework 5.2.5 and Spring Boot 2.2.6 you can use Dynamic Properties in tests:

                  @DynamicPropertySource
                  static void dynamicProperties(DynamicPropertyRegistry registry) {
                      registry.add("property.name", "value");
                  }
                  

                  這篇關(guān)于使用動(dòng)態(tài)值覆蓋 Junit Test 中的默認(rèn) Spring-Boot application.properties 設(shè)置的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測(cè) 32 位 int 上的整數(shù)溢出?)
                  Local variables before return statements, does it matter?(return 語(yǔ)句之前的局部變量,這有關(guān)系嗎?)
                  How to convert Integer to int?(如何將整數(shù)轉(zhuǎn)換為整數(shù)?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內(nèi)創(chuàng)建一個(gè)隨機(jī)打亂數(shù)字的 int 數(shù)組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠?qū)?0xff000000 存儲(chǔ)為 int?)
                    <tfoot id='9Qwo2'></tfoot>

                    <small id='9Qwo2'></small><noframes id='9Qwo2'>

                      <tbody id='9Qwo2'></tbody>

                    <i id='9Qwo2'><tr id='9Qwo2'><dt id='9Qwo2'><q id='9Qwo2'><span id='9Qwo2'><b id='9Qwo2'><form id='9Qwo2'><ins id='9Qwo2'></ins><ul id='9Qwo2'></ul><sub id='9Qwo2'></sub></form><legend id='9Qwo2'></legend><bdo id='9Qwo2'><pre id='9Qwo2'><center id='9Qwo2'></center></pre></bdo></b><th id='9Qwo2'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='9Qwo2'><tfoot id='9Qwo2'></tfoot><dl id='9Qwo2'><fieldset id='9Qwo2'></fieldset></dl></div>
                      <legend id='9Qwo2'><style id='9Qwo2'><dir id='9Qwo2'><q id='9Qwo2'></q></dir></style></legend>
                            <bdo id='9Qwo2'></bdo><ul id='9Qwo2'></ul>

                          • 主站蜘蛛池模板: 色在线免费视频 | 久草热在线 | 欧美特级黄色 | 欧美一区二区免费电影 | 精品久久香蕉国产线看观看亚洲 | 99久久免费观看 | 久久久噜噜噜www成人网 | 日本不卡一二三 | 欧美成年网站 | 欧美国产日韩在线 | 美女天天干天天操 | 精品国产一区二区三区成人影院 | 黄色三级免费 | 国产精品综合网 | 久久小视频 | 国产激情一区二区三区 | 4h影视| 天天干天天谢 | 免费亚洲一区二区 | 欧美成人一区二区三区 | 日韩一区中文字幕 | 精品国产乱码一区二区三 | 99久热| 91精品国产综合久久久动漫日韩 | 日韩欧美在线一区 | 夜夜草导航 | 成人免费黄视频 | 成人欧美一区二区三区黑人孕妇 | 国产精品九九九 | 黄色一级视频免费 | 天堂成人av | 中文字幕第一页在线 | 久久香蕉精品视频 | 亚洲高清在线观看 | 国产在线精品一区二区三区 | 国产免费一区 | 四虎永久在线精品免费一区二 | 欧美日本韩国一区二区 | 最新av在线播放 | 一区视频在线 | 成人在线免费观看视频 |