#1152 - Allow adding path segments to links created via WebFluxLinkBuilder.
WebFluxLinkBuilder now allows to call ….slash(…) in symmetry to other LinkBuilder implementations.
This commit is contained in:
@@ -187,7 +187,7 @@ class WebFluxLinkBuilderTest {
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // #1150
|
||||
void considersContextPath() {
|
||||
|
||||
MockServerHttpRequest request = MockServerHttpRequest.get("http://localhost:8080/context/api") //
|
||||
@@ -201,6 +201,19 @@ class WebFluxLinkBuilderTest {
|
||||
});
|
||||
}
|
||||
|
||||
@Test // #1152
|
||||
void allowsAppendingPathSegments() {
|
||||
|
||||
MockServerHttpRequest request = MockServerHttpRequest.get("http://localhost:8080/api") //
|
||||
.build();
|
||||
|
||||
WebFluxLink link = linkTo(methodOn(TestController.class).deep()).slash("foo").withSelfRel();
|
||||
|
||||
verify(request, link, result -> {
|
||||
assertThat(result.getHref()).endsWith("/api/employees/foo");
|
||||
});
|
||||
}
|
||||
|
||||
private void verify(@Nullable MockServerHttpRequest request, WebFluxLink link, Consumer<Link> verifications) {
|
||||
|
||||
Mono<Link> mono = link.toMono();
|
||||
|
||||
Reference in New Issue
Block a user