Skip to content

Commit 93046d0

Browse files
committed
Polish
1 parent 6855c55 commit 93046d0

File tree

1 file changed

+12
-6
lines changed
  • spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet

1 file changed

+12
-6
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequestTests.java

+12-6
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,13 @@ public void toAnyEndpointShouldNotMatchOtherPath() {
7575
@Test
7676
public void toAnyEndpointWhenServletPathNotEmptyShouldMatch() {
7777
RequestMatcher matcher = EndpointRequest.toAnyEndpoint();
78-
assertMatcher(matcher, "/actuator", "/spring").matches("/spring", "/actuator/foo");
79-
assertMatcher(matcher, "/actuator", "/spring").matches("/spring", "/actuator/bar");
78+
assertMatcher(matcher, "/actuator", "/spring").matches("/spring",
79+
"/actuator/foo");
80+
assertMatcher(matcher, "/actuator", "/spring").matches("/spring",
81+
"/actuator/bar");
8082
assertMatcher(matcher, "/actuator", "/spring").matches("/spring", "/actuator");
81-
assertMatcher(matcher, "/actuator", "/spring").doesNotMatch("/spring", "/actuator/baz");
83+
assertMatcher(matcher, "/actuator", "/spring").doesNotMatch("/spring",
84+
"/actuator/baz");
8285
assertMatcher(matcher, "/actuator", "/spring").doesNotMatch("", "/actuator/foo");
8386
}
8487

@@ -128,7 +131,8 @@ public void toLinksWhenBasePathEmptyShouldNotMatch() {
128131
@Test
129132
public void toLinksWhenServletPathNotEmptyShouldNotMatch() {
130133
RequestMatcher matcher = EndpointRequest.toLinks();
131-
RequestMatcherAssert assertMatcher = assertMatcher(matcher, "/actuator", "/spring");
134+
RequestMatcherAssert assertMatcher = assertMatcher(matcher, "/actuator",
135+
"/spring");
132136
assertMatcher.matches("/spring/actuator");
133137
}
134138

@@ -197,7 +201,8 @@ private RequestMatcherAssert assertMatcher(RequestMatcher matcher, String basePa
197201
return assertMatcher(matcher, mockPathMappedEndpoints(basePath));
198202
}
199203

200-
private RequestMatcherAssert assertMatcher(RequestMatcher matcher, String basePath, String servletPath) {
204+
private RequestMatcherAssert assertMatcher(RequestMatcher matcher, String basePath,
205+
String servletPath) {
201206
return assertMatcher(matcher, mockPathMappedEndpoints(basePath), servletPath);
202207
}
203208

@@ -232,7 +237,8 @@ private RequestMatcherAssert assertMatcher(RequestMatcher matcher,
232237
properties.setBasePath(pathMappedEndpoints.getBasePath());
233238
}
234239
}
235-
context.registerBean(DispatcherServletPathProvider.class, () -> () -> servletPath);
240+
DispatcherServletPathProvider pathProvider = () -> servletPath;
241+
context.registerBean(DispatcherServletPathProvider.class, () -> pathProvider);
236242
return assertThat(new RequestMatcherAssert(context, matcher));
237243
}
238244

0 commit comments

Comments
 (0)