Fix failing test due to SPR-14093

This commit is contained in:
Phillip Webb 2016-03-29 20:56:56 -07:00
parent 091245052f
commit 8a11620052
1 changed files with 4 additions and 0 deletions

View File

@ -68,6 +68,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.client.ClientHttpRequest; import org.springframework.http.client.ClientHttpRequest;
import org.springframework.http.client.ClientHttpResponse; import org.springframework.http.client.ClientHttpResponse;
import org.springframework.http.client.SimpleClientHttpRequestFactory; import org.springframework.http.client.SimpleClientHttpRequestFactory;
@ -496,6 +497,9 @@ public class EndpointWebMvcAutoConfigurationTests {
.createRequest(new URI("http://localhost:" + port + url), HttpMethod.GET); .createRequest(new URI("http://localhost:" + port + url), HttpMethod.GET);
try { try {
ClientHttpResponse response = request.execute(); ClientHttpResponse response = request.execute();
if (HttpStatus.NOT_FOUND.equals(response.getStatusCode())) {
throw new FileNotFoundException();
}
try { try {
String actual = StreamUtils.copyToString(response.getBody(), String actual = StreamUtils.copyToString(response.getBody(),
Charset.forName("UTF-8")); Charset.forName("UTF-8"));