Java 类org.springframework.boot.test.web.client.LocalHostUriTemplateHandler 实例源码

项目:spring-rest-basis    文件:StreamingTest.java   
@Bean
@Primary
public TestRestTemplate zg2TestRestTemplate(ObjectProvider<RestTemplateBuilder> builderProvider, Environment environment) {
    SimpleModule sm = new SimpleModule();
    Zg2proRestTemplate rt = new Zg2proRestTemplate(sm);
    TestRestTemplate trt = new TestRestTemplate(rt);
    trt.setUriTemplateHandler(new LocalHostUriTemplateHandler(environment));
    return trt;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SpringBootTestContextCustomizer.java   
@Override
public void setApplicationContext(ApplicationContext applicationContext)
        throws BeansException {
    RestTemplateBuilder builder = getRestTemplateBuilder(applicationContext);
    TestRestTemplate template = new TestRestTemplate(builder.build());
    template.setUriTemplateHandler(
            new LocalHostUriTemplateHandler(applicationContext.getEnvironment()));
    this.object = template;
}
项目:spring-boot-concourse    文件:SpringBootTestContextCustomizer.java   
@Override
public void setApplicationContext(ApplicationContext applicationContext)
        throws BeansException {
    RestTemplateBuilder builder = getRestTemplateBuilder(applicationContext);
    TestRestTemplate template = new TestRestTemplate(builder.build());
    template.setUriTemplateHandler(
            new LocalHostUriTemplateHandler(applicationContext.getEnvironment()));
    this.object = template;
}