Use elementClass and elementTypeRef consistently

This commit is contained in:
Sebastien Deleuze
2019-07-08 11:40:18 +02:00
parent 88d7fede36
commit 08a5196c3a
13 changed files with 118 additions and 117 deletions

View File

@@ -273,8 +273,8 @@ class DefaultWebTestClient implements WebTestClient {
}
@Override
public RequestHeadersSpec<?> body(Object producer, ParameterizedTypeReference<?> elementType) {
this.bodySpec.body(producer, elementType);
public RequestHeadersSpec<?> body(Object producer, ParameterizedTypeReference<?> elementTypeRef) {
this.bodySpec.body(producer, elementTypeRef);
return this;
}
@@ -285,8 +285,8 @@ class DefaultWebTestClient implements WebTestClient {
}
@Override
public <T, S extends Publisher<T>> RequestHeadersSpec<?> body(S publisher, ParameterizedTypeReference<T> elementType) {
this.bodySpec.body(publisher, elementType);
public <T, S extends Publisher<T>> RequestHeadersSpec<?> body(S publisher, ParameterizedTypeReference<T> elementTypeRef) {
this.bodySpec.body(publisher, elementTypeRef);
return this;
}
@@ -379,14 +379,14 @@ class DefaultWebTestClient implements WebTestClient {
}
@Override
public <T> FluxExchangeResult<T> returnResult(Class<T> elementType) {
Flux<T> body = this.response.bodyToFlux(elementType);
public <T> FluxExchangeResult<T> returnResult(Class<T> elementClass) {
Flux<T> body = this.response.bodyToFlux(elementClass);
return new FluxExchangeResult<>(this.exchangeResult, body);
}
@Override
public <T> FluxExchangeResult<T> returnResult(ParameterizedTypeReference<T> elementType) {
Flux<T> body = this.response.bodyToFlux(elementType);
public <T> FluxExchangeResult<T> returnResult(ParameterizedTypeReference<T> elementTypeRef) {
Flux<T> body = this.response.bodyToFlux(elementTypeRef);
return new FluxExchangeResult<>(this.exchangeResult, body);
}
}

View File

@@ -660,11 +660,11 @@ public interface WebTestClient {
* @param producer the producer to write to the request. This must be a
* {@link Publisher} or another producer adaptable to a
* {@code Publisher} via {@link ReactiveAdapterRegistry}
* @param elementType the type reference of elements contained in the producer
* @param elementTypeRef the type reference of elements contained in the producer
* @return spec for decoding the response
* @since 5.2
*/
RequestHeadersSpec<?> body(Object producer, ParameterizedTypeReference<?> elementType);
RequestHeadersSpec<?> body(Object producer, ParameterizedTypeReference<?> elementTypeRef);
/**
* Set the body of the request to the given asynchronous {@code Publisher}.
@@ -679,13 +679,13 @@ public interface WebTestClient {
/**
* Set the body of the request to the given asynchronous {@code Publisher}.
* @param publisher the request body data
* @param elementType the type reference of elements contained in the publisher
* @param elementTypeRef the type reference of elements contained in the publisher
* @param <T> the type of the elements contained in the publisher
* @param <S> the type of the {@code Publisher}
* @return spec for decoding the response
* @since 5.2
*/
<T, S extends Publisher<T>> RequestHeadersSpec<?> body(S publisher, ParameterizedTypeReference<T> elementType);
<T, S extends Publisher<T>> RequestHeadersSpec<?> body(S publisher, ParameterizedTypeReference<T> elementTypeRef);
/**
* Set the body of the request to the given {@code BodyInserter}.
@@ -796,13 +796,13 @@ public interface WebTestClient {
* {@code expectBody(Void.class)} which ensures that resources are
* released regardless of whether the response has content or not.
*/
<T> FluxExchangeResult<T> returnResult(Class<T> elementType);
<T> FluxExchangeResult<T> returnResult(Class<T> elementClass);
/**
* Alternative to {@link #returnResult(Class)} that accepts information
* about a target type with generics.
*/
<T> FluxExchangeResult<T> returnResult(ParameterizedTypeReference<T> elementType);
<T> FluxExchangeResult<T> returnResult(ParameterizedTypeReference<T> elementTypeRef);
}