#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:
Oliver Drotbohm
2019-12-09 12:07:41 +01:00
parent 8e96eafb37
commit 26c44dcc98
2 changed files with 28 additions and 1 deletions

View File

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