@ -27,7 +27,8 @@ import org.springframework.boot.test.context.TestConfiguration;
@@ -27,7 +27,8 @@ import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.test.web.client.TestRestTemplate ;
import org.springframework.boot.web.client.RestTemplateBuilder ;
import org.springframework.context.annotation.Bean ;
import org.springframework.http.HttpHeaders ;
import org.springframework.http.HttpStatus ;
import org.springframework.http.ResponseEntity ;
import static org.assertj.core.api.Assertions.assertThat ;
@ -39,8 +40,9 @@ class MySpringBootTests {
@@ -39,8 +40,9 @@ class MySpringBootTests {
@Test
void testRequest ( ) {
HttpHeaders headers = this . template . getForEntity ( "/example" , String . class ) . getHeaders ( ) ;
assertThat ( headers . getLocation ( ) ) . hasHost ( "other.example.com" ) ;
ResponseEntity < String > response = this . template . getForEntity ( "/example" , String . class ) ;
assertThat ( response . getStatusCode ( ) ) . isEqualTo ( HttpStatus . OK ) ;
// Other assertions to verify the response
}
@TestConfiguration ( proxyBeanMethods = false )