Java Code Examples for org.springframework.boot.web.client.RestTemplateBuilder#configure()
The following examples show how to use
org.springframework.boot.web.client.RestTemplateBuilder#configure() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestRestTemplateBasicLiveTest.java From tutorials with MIT License | 5 votes |
@Test public void givenRestTemplateWrapper_whenSendGetForEntity_thenStatusOk() { RestTemplateBuilder restTemplateBuilder = new RestTemplateBuilder(); restTemplateBuilder.configure(restTemplate); TestRestTemplate testRestTemplate = new TestRestTemplate(restTemplateBuilder); ResponseEntity<String> response = testRestTemplate.getForEntity(FOO_RESOURCE_URL + "/1", String.class); assertThat(response.getStatusCode(), equalTo(HttpStatus.OK)); }
Example 2
Source File: TestRestTemplateBasicLiveTest.java From tutorials with MIT License | 5 votes |
@Test public void givenRestTemplateWrapperWithCredentials_whenSendGetForEntity_thenStatusOk() { RestTemplateBuilder restTemplateBuilder = new RestTemplateBuilder(); restTemplateBuilder.configure(restTemplate); TestRestTemplate testRestTemplate = new TestRestTemplate(restTemplateBuilder, "user", "passwd"); ResponseEntity<String> response = testRestTemplate.getForEntity(URL_SECURED_BY_AUTHENTICATION, String.class); assertThat(response.getStatusCode(), equalTo(HttpStatus.OK)); }
Example 3
Source File: TestRestTemplateBasicLiveTest.java From tutorials with MIT License | 5 votes |
@Test public void givenRestTemplateWrapper_whenSendGetForEntity_thenStatusOk() { RestTemplateBuilder restTemplateBuilder = new RestTemplateBuilder(); restTemplateBuilder.configure(restTemplate); TestRestTemplate testRestTemplate = new TestRestTemplate(restTemplateBuilder); ResponseEntity<Foo> response = testRestTemplate.getForEntity(FOO_RESOURCE_URL + "/1", Foo.class); assertThat(response.getStatusCode(), equalTo(HttpStatus.OK)); }
Example 4
Source File: TestRestTemplateBasicLiveTest.java From tutorials with MIT License | 5 votes |
@Test public void givenRestTemplateWrapperWithCredentials_whenSendGetForEntity_thenStatusOk() { RestTemplateBuilder restTemplateBuilder = new RestTemplateBuilder(); restTemplateBuilder.configure(restTemplate); TestRestTemplate testRestTemplate = new TestRestTemplate(restTemplateBuilder, "user", "passwd"); ResponseEntity<String> response = testRestTemplate.getForEntity(URL_SECURED_BY_AUTHENTICATION, String.class); assertThat(response.getStatusCode(), equalTo(HttpStatus.OK)); }