Sync test fixture MockServerHttpRequest implementation with original

This commit is contained in:
Sam Brannen 2025-06-19 14:23:56 +02:00
parent 8448dc90a4
commit 7ffd4e7cf8
2 changed files with 1 additions and 29 deletions

View File

@ -282,15 +282,6 @@ public final class MockServerHttpRequest extends AbstractServerHttpRequest {
/**
* Add the given header values.
* @param headers the header values
* @deprecated in favor of {@link #headers(HttpHeaders)}
*/
@Deprecated(since = "7.0", forRemoval = true)
B headers(MultiValueMap<String, String> headers);
/**
* Add the given header values.
* @param headers the header values
* @since 7.0
*/
B headers(HttpHeaders headers);
@ -332,12 +323,6 @@ public final class MockServerHttpRequest extends AbstractServerHttpRequest {
*/
B ifUnmodifiedSince(long ifUnmodifiedSince);
/**
* Set the values of the {@code If-Match} header.
* @param ifMatches the new value of the header
*/
B ifMatch(String... ifMatches);
/**
* Set the values of the {@code If-None-Match} header.
* @param ifNoneMatches the new value of the header
@ -483,13 +468,6 @@ public final class MockServerHttpRequest extends AbstractServerHttpRequest {
return this;
}
@Override
@Deprecated(since = "7.0", forRemoval = true)
public BodyBuilder headers(MultiValueMap<String, String> headers) {
this.headers.putAll(headers);
return this;
}
@Override
public BodyBuilder headers(HttpHeaders headers) {
this.headers.putAll(headers);
@ -538,12 +516,6 @@ public final class MockServerHttpRequest extends AbstractServerHttpRequest {
return this;
}
@Override
public BodyBuilder ifMatch(String... ifMatches) {
this.headers.setIfMatch(Arrays.asList(ifMatches));
return this;
}
@Override
public BodyBuilder ifNoneMatch(String... ifNoneMatches) {
this.headers.setIfNoneMatch(Arrays.asList(ifNoneMatches));

View File

@ -480,7 +480,7 @@ class DefaultServerRequestTests {
@Test
void ifMatchValueShouldMatchWhenETagMatches() {
MockServerHttpRequest mockRequest = MockServerHttpRequest.put("/")
.ifMatch("\"first\"", "\"second\"").build();
.header(HttpHeaders.IF_MATCH, "\"first\"", "\"second\"").build();
DefaultServerRequest request = createRequest(mockRequest);
Mono<ServerResponse> result = request.checkNotModified("\"second\"");