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

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:TestRestTemplateTests.java   
@Test
public void options() throws Exception {
    TestRestTemplate template = new TestRestTemplate(
            HttpClientOption.ENABLE_REDIRECTS);
    CustomHttpComponentsClientHttpRequestFactory factory = (CustomHttpComponentsClientHttpRequestFactory) template
            .getRestTemplate().getRequestFactory();
    RequestConfig config = factory.getRequestConfig();
    assertThat(config.isRedirectsEnabled()).isTrue();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SampleJettySslApplicationTests.java   
@Test
public void testHome() throws Exception {
    TestRestTemplate testRestTemplate = new TestRestTemplate(HttpClientOption.SSL);
    ResponseEntity<String> entity = testRestTemplate
            .getForEntity("https://localhost:" + this.port, String.class);
    assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
    assertThat(entity.getBody()).isEqualTo("Hello World");
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SampleTomcatSslApplicationTests.java   
@Test
public void testHome() throws Exception {
    TestRestTemplate testRestTemplate = new TestRestTemplate(HttpClientOption.SSL);
    ResponseEntity<String> entity = testRestTemplate
            .getForEntity("https://localhost:" + this.port, String.class);
    assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
    assertThat(entity.getBody()).isEqualTo("Hello, world");
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SampleUndertowSslApplicationTests.java   
@Test
public void testHome() throws Exception {
    TestRestTemplate testRestTemplate = new TestRestTemplate(HttpClientOption.SSL);
    ResponseEntity<String> entity = testRestTemplate
            .getForEntity("https://localhost:" + this.port, String.class);
    assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
    assertThat(entity.getBody()).isEqualTo("Hello World");
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SampleTomcatSslApplicationTests.java   
@Test
public void testHome() throws Exception {
    TestRestTemplate testRestTemplate = new TestRestTemplate(HttpClientOption.SSL);
    ResponseEntity<String> entity = testRestTemplate
            .getForEntity("https://localhost:" + this.port, String.class);
    assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
    assertThat(entity.getBody()).isEqualTo("Hello, world");
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SampleJetty8SslApplicationTests.java   
@Test
public void testHome() throws Exception {
    TestRestTemplate testRestTemplate = new TestRestTemplate(HttpClientOption.SSL);
    ResponseEntity<String> entity = testRestTemplate
            .getForEntity("https://localhost:" + this.port, String.class);
    assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
    assertThat(entity.getBody()).isEqualTo("Hello World");
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SampleTomcatSslApplicationTests.java   
@Test
public void testHome() throws Exception {
    TestRestTemplate testRestTemplate = new TestRestTemplate(HttpClientOption.SSL);
    ResponseEntity<String> entity = testRestTemplate
            .getForEntity("https://localhost:" + this.port, String.class);
    assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
    assertThat(entity.getBody()).isEqualTo("Hello, world");
}
项目:spring-boot-concourse    文件:TestRestTemplateTests.java   
@Test
public void options() throws Exception {
    TestRestTemplate template = new TestRestTemplate(
            HttpClientOption.ENABLE_REDIRECTS);
    CustomHttpComponentsClientHttpRequestFactory factory = (CustomHttpComponentsClientHttpRequestFactory) template
            .getRestTemplate().getRequestFactory();
    RequestConfig config = factory.getRequestConfig();
    assertThat(config.isRedirectsEnabled()).isTrue();
}
项目:spring-boot-concourse    文件:SampleJettySslApplicationTests.java   
@Test
public void testHome() throws Exception {
    TestRestTemplate testRestTemplate = new TestRestTemplate(HttpClientOption.SSL);
    ResponseEntity<String> entity = testRestTemplate
            .getForEntity("https://localhost:" + this.port, String.class);
    assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
    assertThat(entity.getBody()).isEqualTo("Hello World");
}
项目:spring-boot-concourse    文件:SampleUndertowSslApplicationTests.java   
@Test
public void testHome() throws Exception {
    TestRestTemplate testRestTemplate = new TestRestTemplate(HttpClientOption.SSL);
    ResponseEntity<String> entity = testRestTemplate
            .getForEntity("https://localhost:" + this.port, String.class);
    assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
    assertThat(entity.getBody()).isEqualTo("Hello World");
}
项目:spring-boot-concourse    文件:SampleJetty8SslApplicationTests.java   
@Test
public void testHome() throws Exception {
    TestRestTemplate testRestTemplate = new TestRestTemplate(HttpClientOption.SSL);
    ResponseEntity<String> entity = testRestTemplate
            .getForEntity("https://localhost:" + this.port, String.class);
    assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
    assertThat(entity.getBody()).isEqualTo("Hello World");
}
项目:spring-boot-concourse    文件:SampleTomcatSslApplicationTests.java   
@Test
public void testHome() throws Exception {
    TestRestTemplate testRestTemplate = new TestRestTemplate(HttpClientOption.SSL);
    ResponseEntity<String> entity = testRestTemplate
            .getForEntity("https://localhost:" + this.port, String.class);
    assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
    assertThat(entity.getBody()).isEqualTo("Hello, world");
}
项目:angularjs-springmvc-sample-boot    文件:PostStory.java   
@Before
public void setup() {
    clearData();
    initData();
    this.baseUrl = "http://localhost:" + port;
    this.restTemplate = new TestRestTemplate("admin", "test123", new HttpClientOption[]{});
}