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:
Rossen Stoyanchev
2017-09-29 12:46:32 -04:00
parent 95fdfac128
commit 223e27d53d
25 changed files with 153 additions and 72 deletions

View File

@@ -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}.

View File

@@ -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() {