@@ -75,10 +75,13 @@ public void toAnyEndpointShouldNotMatchOtherPath() {
75
75
@ Test
76
76
public void toAnyEndpointWhenServletPathNotEmptyShouldMatch () {
77
77
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" );
80
82
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" );
82
85
assertMatcher (matcher , "/actuator" , "/spring" ).doesNotMatch ("" , "/actuator/foo" );
83
86
}
84
87
@@ -128,7 +131,8 @@ public void toLinksWhenBasePathEmptyShouldNotMatch() {
128
131
@ Test
129
132
public void toLinksWhenServletPathNotEmptyShouldNotMatch () {
130
133
RequestMatcher matcher = EndpointRequest .toLinks ();
131
- RequestMatcherAssert assertMatcher = assertMatcher (matcher , "/actuator" , "/spring" );
134
+ RequestMatcherAssert assertMatcher = assertMatcher (matcher , "/actuator" ,
135
+ "/spring" );
132
136
assertMatcher .matches ("/spring/actuator" );
133
137
}
134
138
@@ -197,7 +201,8 @@ private RequestMatcherAssert assertMatcher(RequestMatcher matcher, String basePa
197
201
return assertMatcher (matcher , mockPathMappedEndpoints (basePath ));
198
202
}
199
203
200
- private RequestMatcherAssert assertMatcher (RequestMatcher matcher , String basePath , String servletPath ) {
204
+ private RequestMatcherAssert assertMatcher (RequestMatcher matcher , String basePath ,
205
+ String servletPath ) {
201
206
return assertMatcher (matcher , mockPathMappedEndpoints (basePath ), servletPath );
202
207
}
203
208
@@ -232,7 +237,8 @@ private RequestMatcherAssert assertMatcher(RequestMatcher matcher,
232
237
properties .setBasePath (pathMappedEndpoints .getBasePath ());
233
238
}
234
239
}
235
- context .registerBean (DispatcherServletPathProvider .class , () -> () -> servletPath );
240
+ DispatcherServletPathProvider pathProvider = () -> servletPath ;
241
+ context .registerBean (DispatcherServletPathProvider .class , () -> pathProvider );
236
242
return assertThat (new RequestMatcherAssert (context , matcher ));
237
243
}
238
244
0 commit comments