Package private request and response implementations
Concrete server and client, reactive request and response implementations should not have to be accessed outside their package. They could be seen as private to their HttpHandler adapters and ClientHttpConnector's respectively. The one exception, WebSocket upgrades in spring-webflux, is an internal framework use case, accommodated via downcast + accessors in the abstract base classes.
This commit is contained in:
@@ -103,6 +103,10 @@ public class MockServerHttpRequest extends AbstractServerHttpRequest {
|
||||
return this.cookies;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getNativeRequest() {
|
||||
throw new IllegalStateException("This is a mock. No running server, no native request.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Shortcut to wrap the request with a {@code MockServerWebExchange}.
|
||||
|
||||
@@ -76,6 +76,11 @@ public class MockServerHttpResponse extends AbstractServerHttpResponse {
|
||||
this.writeHandler = writeHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getNativeResponse() {
|
||||
throw new IllegalStateException("This is a mock. No running server, no native response.");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void applyStatusCode() {
|
||||
|
||||
Reference in New Issue
Block a user