<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ###40.3.11 使用Spock測試Spring Boot應用 如果想使用Spock測試Spring Boot應用,你需要為應用添加Spock的`spock-spring`依賴,該依賴已將Spring測試框架集成進Spock,怎么使用Spock測試Spring Boot應用取決于你使用的Spock版本。 **注** Spring Boot為Spock 1.0提供依賴管理,如果希望使用Spock 1.1,你需要覆蓋`build.gradle`或`pom.xml`文件中的`spock.version`屬性。 當使用Spock 1.1時,只能使用[上述注解](http://docs.spring.io/spring-boot/docs/1.4.1.RELEASE/reference/htmlsingle/#boot-features-testing-spring-boot-applications),你可以使用`@SpringBootTest`注解你的`Specification`以滿足測試需求。 當使用Spock 1.0時,`@SpringBootTest`將不能用于web項目,你需要使用`@SpringApplicationConfiguration`和`@WebIntegrationTest(randomPort = true)`。 不能使用`@SpringBootTest`也就意味著你失去了自動配置的`TestRestTemplate` bean,不過可以通過以下配置創建一個等價的bean: ```java @Configuration static class TestRestTemplateConfiguration { @Bean public TestRestTemplate testRestTemplate( ObjectProvider<RestTemplateBuilder> builderProvider, Environment environment) { RestTemplateBuilder builder = builderProvider.getIfAvailable(); TestRestTemplate template = builder == null ? new TestRestTemplate() : new TestRestTemplate(builder.build()); template.setUriTemplateHandler(new LocalHostUriTemplateHandler(environment)); return template; } } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看