JAVA-24463 Fixing Failed tests from spring-5-reactive (#14881)
Co-authored-by: timis1 <noreplay@yahoo.com>
This commit is contained in:
parent
b52e2cc3d1
commit
e331611860
@ -22,9 +22,9 @@ public class PathPatternController {
|
||||
return "/spring5/*id";
|
||||
}
|
||||
|
||||
@GetMapping("//**")
|
||||
@GetMapping("/resources/**")
|
||||
public String wildcardTakingZeroOrMorePathSegments() {
|
||||
return "//**";
|
||||
return "/resources/**";
|
||||
}
|
||||
|
||||
@GetMapping("/{baeldung:[a-z]+}")
|
||||
|
@ -29,7 +29,7 @@ public class ExploreSpring5URLPatternUsingRouterFunctions {
|
||||
.andRoute(GET("/{var1}_{var2}"), serverRequest -> ok().body(fromValue(serverRequest.pathVariable("var1") + " , " + serverRequest.pathVariable("var2"))))
|
||||
.andRoute(GET("/{baeldung:[a-z]+}"), serverRequest -> ok().body(fromValue("/{baeldung:[a-z]+} was accessed and baeldung=" + serverRequest.pathVariable("baeldung"))))
|
||||
.and(RouterFunctions.resources("/files/{*filepaths}", new ClassPathResource("files/")))
|
||||
.and(RouterFunctions.resources("//**", new ClassPathResource("/")));
|
||||
.and(RouterFunctions.resources("/resources/**", new ClassPathResource("resources/")));
|
||||
}
|
||||
|
||||
WebServer start() throws Exception {
|
||||
|
@ -108,9 +108,9 @@ public class ExploreSpring5URLPatternUsingRouterFunctionsIntegrationTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenRouter_whenAccess_thenGot() throws Exception {
|
||||
public void givenRouter_whenAccess_thenGot() {
|
||||
client.get()
|
||||
.uri("//test/test.txt")
|
||||
.uri("/resources/test/test.txt")
|
||||
.exchange()
|
||||
.expectStatus()
|
||||
.isOk()
|
||||
|
@ -72,12 +72,12 @@ public class PathPatternsUsingHandlerMethodIntegrationTest {
|
||||
public void givenHandlerMethod_whenURLWithWildcardTakingZeroOrMorePathSegments_then200() {
|
||||
|
||||
client.get()
|
||||
.uri("//baeldung")
|
||||
.uri("/resources/baeldung")
|
||||
.exchange()
|
||||
.expectStatus()
|
||||
.is2xxSuccessful()
|
||||
.expectBody()
|
||||
.equals("//**");
|
||||
.equals("/resources/**");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
x
Reference in New Issue
Block a user