Add seeOther shortcut to ServerResponse.BodyBuilder
This commit is contained in:
@@ -105,6 +105,17 @@ public class DefaultServerResponseBuilderTests {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void seeOther() throws Exception {
|
||||
URI location = URI.create("http://example.com");
|
||||
Mono<ServerResponse> result = ServerResponse.seeOther(location).build();
|
||||
StepVerifier.create(result)
|
||||
.expectNextMatches(response -> HttpStatus.SEE_OTHER.equals(response.statusCode()) &&
|
||||
location.equals(response.headers().getLocation()))
|
||||
.expectComplete()
|
||||
.verify();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void temporaryRedirect() throws Exception {
|
||||
URI location = URI.create("http://example.com");
|
||||
|
||||
Reference in New Issue
Block a user