|
|
|
|
@ -75,6 +75,9 @@ import org.springframework.web.util.UriBuilderFactory;
@@ -75,6 +75,9 @@ import org.springframework.web.util.UriBuilderFactory;
|
|
|
|
|
* |
|
|
|
|
* @author Rossen Stoyanchev |
|
|
|
|
* @since 5.0 |
|
|
|
|
* @see StatusAssertions |
|
|
|
|
* @see HeaderAssertions |
|
|
|
|
* @see JsonPathAssertions |
|
|
|
|
*/ |
|
|
|
|
public interface WebTestClient { |
|
|
|
|
|
|
|
|
|
@ -154,7 +157,7 @@ public interface WebTestClient {
@@ -154,7 +157,7 @@ public interface WebTestClient {
|
|
|
|
|
WebTestClient mutateWith(WebTestClientConfigurer configurer); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Static, factory methods
|
|
|
|
|
// Static factory methods
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Use this server setup to test one `@Controller` at a time. |
|
|
|
|
@ -261,9 +264,9 @@ public interface WebTestClient {
@@ -261,9 +264,9 @@ public interface WebTestClient {
|
|
|
|
|
* Shortcut to build the test client. |
|
|
|
|
*/ |
|
|
|
|
WebTestClient build(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Specification for customizing controller configuration equivalent to, and |
|
|
|
|
* internally delegating to, a {@link WebFluxConfigurer}. |
|
|
|
|
@ -324,9 +327,9 @@ public interface WebTestClient {
@@ -324,9 +327,9 @@ public interface WebTestClient {
|
|
|
|
|
* @see WebFluxConfigurer#configureViewResolvers |
|
|
|
|
*/ |
|
|
|
|
ControllerSpec viewResolvers(Consumer<ViewResolverRegistry> consumer); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Specification for customizing router function configuration. |
|
|
|
|
*/ |
|
|
|
|
@ -336,9 +339,9 @@ public interface WebTestClient {
@@ -336,9 +339,9 @@ public interface WebTestClient {
|
|
|
|
|
* Configure handler strategies. |
|
|
|
|
*/ |
|
|
|
|
RouterFunctionSpec handlerStrategies(HandlerStrategies handlerStrategies); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Steps for customizing the {@link WebClient} used to test with |
|
|
|
|
* internally delegating to a {@link WebClient.Builder}. |
|
|
|
|
@ -433,7 +436,6 @@ public interface WebTestClient {
@@ -433,7 +436,6 @@ public interface WebTestClient {
|
|
|
|
|
* Build the {@link WebTestClient} instance. |
|
|
|
|
*/ |
|
|
|
|
WebTestClient build(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -470,9 +472,9 @@ public interface WebTestClient {
@@ -470,9 +472,9 @@ public interface WebTestClient {
|
|
|
|
|
* @return spec to add headers or perform the exchange |
|
|
|
|
*/ |
|
|
|
|
S uri(Function<UriBuilder, URI> uriFunction); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Specification for adding request headers and performing an exchange. |
|
|
|
|
*/ |
|
|
|
|
@ -570,9 +572,9 @@ public interface WebTestClient {
@@ -570,9 +572,9 @@ public interface WebTestClient {
|
|
|
|
|
* @return spec for decoding the response |
|
|
|
|
*/ |
|
|
|
|
ResponseSpec exchange(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
interface RequestBodySpec extends RequestHeadersSpec<RequestBodySpec> { |
|
|
|
|
/** |
|
|
|
|
* Set the length of the body in bytes, as specified by the |
|
|
|
|
@ -617,13 +619,13 @@ public interface WebTestClient {
@@ -617,13 +619,13 @@ public interface WebTestClient {
|
|
|
|
|
* @return a {@code Mono} with the response |
|
|
|
|
*/ |
|
|
|
|
RequestHeadersSpec<?> syncBody(Object body); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
interface RequestHeadersUriSpec<S extends RequestHeadersSpec<S>> |
|
|
|
|
extends UriSpec<S>, RequestHeadersSpec<S> { |
|
|
|
|
|
|
|
|
|
interface RequestHeadersUriSpec<S extends RequestHeadersSpec<S>> extends UriSpec<S>, RequestHeadersSpec<S> { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
interface RequestBodyUriSpec extends RequestBodySpec, RequestHeadersUriSpec<RequestBodySpec> { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -698,6 +700,7 @@ public interface WebTestClient {
@@ -698,6 +700,7 @@ public interface WebTestClient {
|
|
|
|
|
<T> FluxExchangeResult<T> returnResult(ParameterizedTypeReference<T> elementType); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Spec for expectations on the response body decoded to a single Object. |
|
|
|
|
*/ |
|
|
|
|
@ -718,9 +721,9 @@ public interface WebTestClient {
@@ -718,9 +721,9 @@ public interface WebTestClient {
|
|
|
|
|
* decoded response content. |
|
|
|
|
*/ |
|
|
|
|
EntityExchangeResult<B> returnResult(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Spec for expectations on the response body decoded to a List. |
|
|
|
|
*/ |
|
|
|
|
@ -745,9 +748,9 @@ public interface WebTestClient {
@@ -745,9 +748,9 @@ public interface WebTestClient {
|
|
|
|
|
*/ |
|
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
|
ListBodySpec<E> doesNotContain(E... elements); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Spec for expectations on the response body content. |
|
|
|
|
*/ |
|
|
|
|
@ -791,7 +794,6 @@ public interface WebTestClient {
@@ -791,7 +794,6 @@ public interface WebTestClient {
|
|
|
|
|
* raw response content. |
|
|
|
|
*/ |
|
|
|
|
EntityExchangeResult<byte[]> returnResult(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|