Remove headers(HttpHeaders)
This commit removes the headers(HttpHeaders) method on ClientRequest and ServerResponse, in favor of headers(Consumer<HttpHeaders>), which is more flexible.
This commit is contained in:
@@ -253,10 +253,12 @@ public class DefaultServerResponseBuilderTests {
|
||||
|
||||
@Test
|
||||
public void headers() throws Exception {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
Mono<ServerResponse> result = ServerResponse.ok().headers(headers).build();
|
||||
HttpHeaders newHeaders = new HttpHeaders();
|
||||
newHeaders.set("foo", "bar");
|
||||
Mono<ServerResponse> result =
|
||||
ServerResponse.ok().headers(headers -> headers.addAll(newHeaders)).build();
|
||||
StepVerifier.create(result)
|
||||
.expectNextMatches(response -> headers.equals(response.headers()))
|
||||
.expectNextMatches(response -> newHeaders.equals(response.headers()))
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user