Add mechanism to expose mock server results
WebTestClient is an actual client and generally it's only possible to assert the client response (i.e. what goes over HTTP). However, in a mock server scenario technically we have access to the server request and response and can make those available for further assertions. This will be helpful for the WebTestClient integration with MockMvc where many more assertions can be performed on the server request and response when needed. See gh-19647
This commit is contained in:
@@ -244,7 +244,7 @@ class HeaderAssertionTests {
|
||||
MonoProcessor<byte[]> emptyContent = MonoProcessor.fromSink(Sinks.one());
|
||||
emptyContent.onComplete();
|
||||
|
||||
ExchangeResult result = new ExchangeResult(request, response, emptyContent, emptyContent, Duration.ZERO, null);
|
||||
ExchangeResult result = new ExchangeResult(request, response, emptyContent, emptyContent, Duration.ZERO, null, null);
|
||||
return new HeaderAssertions(result, mock(WebTestClient.ResponseSpec.class));
|
||||
}
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ class StatusAssertionTests {
|
||||
MonoProcessor<byte[]> emptyContent = MonoProcessor.fromSink(Sinks.one());
|
||||
emptyContent.onComplete();
|
||||
|
||||
ExchangeResult result = new ExchangeResult(request, response, emptyContent, emptyContent, Duration.ZERO, null);
|
||||
ExchangeResult result = new ExchangeResult(request, response, emptyContent, emptyContent, Duration.ZERO, null, null);
|
||||
return new StatusAssertions(result, mock(WebTestClient.ResponseSpec.class));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user