JAVA-24463 Fixing Failed tests from spring-5-reactive (#14881)

Co-authored-by: timis1 <noreplay@yahoo.com>
This commit is contained in:
timis1 2023-10-03 07:17:04 +03:00 committed by GitHub
parent b52e2cc3d1
commit e331611860
4 changed files with 7 additions and 7 deletions

View File

@ -22,9 +22,9 @@ public class PathPatternController {
return "/spring5/*id";
}
@GetMapping("//**")
@GetMapping("/resources/**")
public String wildcardTakingZeroOrMorePathSegments() {
return "//**";
return "/resources/**";
}
@GetMapping("/{baeldung:[a-z]+}")

View File

@ -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 {

View File

@ -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()

View File

@ -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