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";
|
return "/spring5/*id";
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("//**")
|
@GetMapping("/resources/**")
|
||||||
public String wildcardTakingZeroOrMorePathSegments() {
|
public String wildcardTakingZeroOrMorePathSegments() {
|
||||||
return "//**";
|
return "/resources/**";
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/{baeldung:[a-z]+}")
|
@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("/{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"))))
|
.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("/files/{*filepaths}", new ClassPathResource("files/")))
|
||||||
.and(RouterFunctions.resources("//**", new ClassPathResource("/")));
|
.and(RouterFunctions.resources("/resources/**", new ClassPathResource("resources/")));
|
||||||
}
|
}
|
||||||
|
|
||||||
WebServer start() throws Exception {
|
WebServer start() throws Exception {
|
||||||
|
@ -108,9 +108,9 @@ public class ExploreSpring5URLPatternUsingRouterFunctionsIntegrationTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenRouter_whenAccess_thenGot() throws Exception {
|
public void givenRouter_whenAccess_thenGot() {
|
||||||
client.get()
|
client.get()
|
||||||
.uri("//test/test.txt")
|
.uri("/resources/test/test.txt")
|
||||||
.exchange()
|
.exchange()
|
||||||
.expectStatus()
|
.expectStatus()
|
||||||
.isOk()
|
.isOk()
|
||||||
|
@ -72,12 +72,12 @@ public class PathPatternsUsingHandlerMethodIntegrationTest {
|
|||||||
public void givenHandlerMethod_whenURLWithWildcardTakingZeroOrMorePathSegments_then200() {
|
public void givenHandlerMethod_whenURLWithWildcardTakingZeroOrMorePathSegments_then200() {
|
||||||
|
|
||||||
client.get()
|
client.get()
|
||||||
.uri("//baeldung")
|
.uri("/resources/baeldung")
|
||||||
.exchange()
|
.exchange()
|
||||||
.expectStatus()
|
.expectStatus()
|
||||||
.is2xxSuccessful()
|
.is2xxSuccessful()
|
||||||
.expectBody()
|
.expectBody()
|
||||||
.equals("//**");
|
.equals("/resources/**");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user