From 8a1162005240518815c5f86f6ccd2f927f346dff Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 29 Mar 2016 20:56:56 -0700 Subject: [PATCH] Fix failing test due to SPR-14093 --- .../autoconfigure/EndpointWebMvcAutoConfigurationTests.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfigurationTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfigurationTests.java index bccd2a41a8..32cfce561b 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfigurationTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfigurationTests.java @@ -68,6 +68,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; import org.springframework.http.client.ClientHttpRequest; import org.springframework.http.client.ClientHttpResponse; import org.springframework.http.client.SimpleClientHttpRequestFactory; @@ -496,6 +497,9 @@ public class EndpointWebMvcAutoConfigurationTests { .createRequest(new URI("http://localhost:" + port + url), HttpMethod.GET); try { ClientHttpResponse response = request.execute(); + if (HttpStatus.NOT_FOUND.equals(response.getStatusCode())) { + throw new FileNotFoundException(); + } try { String actual = StreamUtils.copyToString(response.getBody(), Charset.forName("UTF-8"));