You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disable child context's /error endpoint if disabled in parent
Previously, EndpointWebMvcChildContextConfiguration would attempt to
create a /error endpoint, irrespective of whether or not the parent
had such an endpoint. If the endpoint was disabled in the parent this
would cause a failure due to the absence of an ErrorAttributes bean.
This commit updates EndpointWebMvcChildContextConfiguration to make
the creation of its /error endpoint conditional on the existence of
an ErrorAttributes bean.
Closesgh-4164
Copy file name to clipboardExpand all lines: spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java
+4-6Lines changed: 4 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -75,9 +75,6 @@ public class EndpointWebMvcChildContextConfiguration {
Copy file name to clipboardExpand all lines: spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfigurationTests.java
+21-1Lines changed: 21 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,7 @@
27
27
importjavax.servlet.http.HttpServletRequest;
28
28
importjavax.servlet.http.HttpServletResponse;
29
29
30
+
importorg.hamcrest.Matcher;
30
31
importorg.junit.After;
31
32
importorg.junit.Before;
32
33
importorg.junit.Test;
@@ -76,6 +77,7 @@
76
77
importstaticorg.hamcrest.Matchers.is;
77
78
importstaticorg.hamcrest.Matchers.not;
78
79
importstaticorg.hamcrest.Matchers.notNullValue;
80
+
importstaticorg.hamcrest.Matchers.startsWith;
79
81
importstaticorg.junit.Assert.assertEquals;
80
82
importstaticorg.junit.Assert.assertFalse;
81
83
importstaticorg.junit.Assert.assertThat;
@@ -146,6 +148,7 @@ public void onDifferentPort() throws Exception {
0 commit comments