久久久久久久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>

        使用動態值覆蓋 Junit Test 中的默認 Spring-Boot app

        Override default Spring-Boot application.properties settings in Junit Test with dynamic value(使用動態值覆蓋 Junit Test 中的默認 Spring-Boot application.properties 設置)
            <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>
                • 本文介紹了使用動態值覆蓋 Junit Test 中的默認 Spring-Boot application.properties 設置的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

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

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

                  我需要在隨機端口 N 上啟動服務器,然后將此端口傳遞給 spring-boot 應用程序.端口必須是臨時的,以允許同時在同一主機上運行多個測試.

                  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服務器(jetty),而是在測試開始時啟動的一些不同的服務器(例如zookeeper)并且被測試的應用程序必須連接到它.

                  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.

                  實現這一目標的最佳方法是什么?

                  What's the best way to achieve this?

                  (這是一個類似的問題,但答案沒有提到臨時端口的解決方案 - 在 Junit 測試中覆蓋默認 Spring-Boot application.properties 設置)

                  (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 開始,您可以在測試中使用 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");
                  }
                  

                  這篇關于使用動態值覆蓋 Junit Test 中的默認 Spring-Boot application.properties 設置的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關系嗎?)
                  How to convert Integer to int?(如何將整數轉換為整數?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內創建一個隨機打亂數字的 int 數組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠將 0xff000000 存儲為 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>

                          • 主站蜘蛛池模板: 欧美日韩综合一区 | 亚洲永久免费 | 日韩在线视频免费观看 | 中文字幕一区二区三区乱码在线 | 久久av一区二区三区 | 中文字幕一区二区三区乱码图片 | 天天操天天天 | 精品二区视频 | 成人在线播放 | 在线成人福利 | 国产精品theporn| 久久久噜噜噜久久中文字幕色伊伊 | 日韩精品二区 | 在线亚洲欧美 | 一二区成人影院电影网 | 97视频成人 | 日韩成人免费视频 | 欧美亚洲国产精品 | 天天久久| 成人二区| 中文精品一区二区 | 日韩一级免费看 | 亚洲成人av| 亚洲一区二区在线播放 | 精品国产视频 | 欧美三级不卡 | 91国内产香蕉 | 国产福利在线 | 91在线观看网址 | 亚洲综合无码一区二区 | 成人国产精品久久 | 久久久精品视频免费看 | 精品日韩一区 | 日韩av一区二区在线观看 | 久久精品久久综合 | 黄色国产在线播放 | 福利视频一二区 | 国产xxx在线观看 | 欧美一级久久 | 欧美区日韩区 | 色毛片 |