From 7d04ca1e1b233baa5b5318e771c08bb47f3bc6ff Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Fri, 27 Nov 2015 10:56:04 +0000 Subject: [PATCH 1/2] Add tests to assert behaviour of actuator endpoints with context path See gh-4401 --- .../EndpointWebMvcAutoConfigurationTests.java | 30 +++++++++++++++++++ 1 file changed, 30 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 196645dbbe..c416ae0de7 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 @@ -158,6 +158,36 @@ public class EndpointWebMvcAutoConfigurationTests { assertAllClosed(); } + @Test + public void onDifferentPortAndContext() throws Exception { + this.applicationContext.register(RootConfig.class, EndpointConfig.class, + DifferentPortConfig.class, BaseConfiguration.class, + EndpointWebMvcAutoConfiguration.class, ErrorMvcAutoConfiguration.class); + EnvironmentTestUtils.addEnvironment(this.applicationContext, + "management.context-path=/admin"); + this.applicationContext.refresh(); + assertContent("/controller", ports.get().server, "controlleroutput"); + assertContent("/admin/endpoint", ports.get().management, "endpointoutput"); + assertContent("/admin/error", ports.get().management, startsWith("{")); + this.applicationContext.close(); + assertAllClosed(); + } + + @Test + public void onDifferentPortAndMainContext() throws Exception { + this.applicationContext.register(RootConfig.class, EndpointConfig.class, + DifferentPortConfig.class, BaseConfiguration.class, + EndpointWebMvcAutoConfiguration.class, ErrorMvcAutoConfiguration.class); + EnvironmentTestUtils.addEnvironment(this.applicationContext, + "management.context-path=/admin", "server.context-path=/spring"); + this.applicationContext.refresh(); + assertContent("/spring/controller", ports.get().server, "controlleroutput"); + assertContent("/admin/endpoint", ports.get().management, "endpointoutput"); + assertContent("/admin/error", ports.get().management, startsWith("{")); + this.applicationContext.close(); + assertAllClosed(); + } + @Test public void onDifferentPortWithoutErrorMvcAutoConfiguration() throws Exception { this.applicationContext.register(RootConfig.class, EndpointConfig.class, From 1ab05326a92be5fe8d8281d3d0103928b50f9ada Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 27 Nov 2015 15:31:58 +0100 Subject: [PATCH 2/2] Upgrade to Spring Social 1.1.4.RELEASE --- spring-boot-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-dependencies/pom.xml b/spring-boot-dependencies/pom.xml index 5d71bef578..304c7fa881 100644 --- a/spring-boot-dependencies/pom.xml +++ b/spring-boot-dependencies/pom.xml @@ -123,7 +123,7 @@ 1.1.0.RELEASE 3.2.8.RELEASE 1.0.3.RELEASE - 1.1.2.RELEASE + 1.1.4.RELEASE 2.0.2.RELEASE 1.0.2.RELEASE 1.1.2.RELEASE