Polish "Use diamond operator where feasible"
See gh-31916
This commit is contained in:
@@ -138,8 +138,7 @@ class BodyExtractorsTests {
|
||||
@Test
|
||||
void toMonoParameterizedTypeReference() {
|
||||
BodyExtractor<Mono<Map<String, String>>, ReactiveHttpInputMessage> extractor =
|
||||
BodyExtractors.toMono(new ParameterizedTypeReference<>() {
|
||||
});
|
||||
BodyExtractors.toMono(new ParameterizedTypeReference<>() {});
|
||||
|
||||
byte[] bytes = "{\"username\":\"foo\",\"password\":\"bar\"}".getBytes(StandardCharsets.UTF_8);
|
||||
DefaultDataBuffer dataBuffer = DefaultDataBufferFactory.sharedInstance.wrap(ByteBuffer.wrap(bytes));
|
||||
@@ -184,8 +183,7 @@ class BodyExtractorsTests {
|
||||
@Test // SPR-15758
|
||||
void toMonoWithEmptyBodyAndNoContentType() {
|
||||
BodyExtractor<Mono<Map<String, String>>, ReactiveHttpInputMessage> extractor =
|
||||
BodyExtractors.toMono(new ParameterizedTypeReference<>() {
|
||||
});
|
||||
BodyExtractors.toMono(new ParameterizedTypeReference<>() {});
|
||||
|
||||
MockServerHttpRequest request = MockServerHttpRequest.post("/").body(Flux.empty());
|
||||
Mono<Map<String, String>> result = extractor.extract(request, this.context);
|
||||
|
||||
@@ -124,8 +124,7 @@ class WebClientDataBufferAllocatingTests extends AbstractDataBufferAllocatingTes
|
||||
Mono<Map<String, String>> mono = this.webClient.get()
|
||||
.uri("/sample").accept(MediaType.APPLICATION_JSON)
|
||||
.retrieve()
|
||||
.bodyToMono(new ParameterizedTypeReference<>() {
|
||||
});
|
||||
.bodyToMono(new ParameterizedTypeReference<>() {});
|
||||
|
||||
StepVerifier.create(mono).expectError(WebClientResponseException.class).verify(Duration.ofSeconds(3));
|
||||
assertThat(this.server.getRequestCount()).isEqualTo(1);
|
||||
|
||||
@@ -197,8 +197,7 @@ class WebClientIntegrationTests {
|
||||
Mono<ValueContainer<Pojo>> result = this.webClient.get()
|
||||
.uri("/json").accept(MediaType.APPLICATION_JSON)
|
||||
.retrieve()
|
||||
.bodyToMono(new ParameterizedTypeReference<>() {
|
||||
});
|
||||
.bodyToMono(new ParameterizedTypeReference<>() {});
|
||||
|
||||
StepVerifier.create(result)
|
||||
.assertNext(c -> assertThat(c.getContainerValue()).isEqualTo(new Pojo("foofoo", "barbar")))
|
||||
@@ -805,8 +804,7 @@ class WebClientIntegrationTests {
|
||||
.uri("/greeting")
|
||||
.retrieve()
|
||||
.onStatus(HttpStatusCode::is5xxServerError, response -> Mono.just(new MyException("500 error!")))
|
||||
.bodyToMono(new ParameterizedTypeReference<>() {
|
||||
});
|
||||
.bodyToMono(new ParameterizedTypeReference<>() {});
|
||||
|
||||
StepVerifier.create(result)
|
||||
.expectError(MyException.class)
|
||||
|
||||
@@ -318,8 +318,7 @@ public class DefaultServerRequestTests {
|
||||
DefaultServerRequest request = new DefaultServerRequest(MockServerWebExchange.from(mockRequest), messageReaders);
|
||||
|
||||
Mono<Map<String, String>> resultMono = request.bodyToMono(
|
||||
new ParameterizedTypeReference<>() {
|
||||
});
|
||||
new ParameterizedTypeReference<>() {});
|
||||
StepVerifier.create(resultMono)
|
||||
.expectError(ServerWebInputException.class)
|
||||
.verify();
|
||||
|
||||
@@ -100,8 +100,7 @@ class SseHandlerFunctionIntegrationTests extends AbstractRouterFunctionIntegrati
|
||||
.uri("/event")
|
||||
.accept(TEXT_EVENT_STREAM)
|
||||
.retrieve()
|
||||
.bodyToFlux(new ParameterizedTypeReference<>() {
|
||||
});
|
||||
.bodyToFlux(new ParameterizedTypeReference<>() {});
|
||||
|
||||
StepVerifier.create(result)
|
||||
.consumeNextWith( event -> {
|
||||
|
||||
@@ -134,8 +134,7 @@ class SseIntegrationTests extends AbstractHttpHandlerIntegrationTests {
|
||||
.uri("/event")
|
||||
.accept(TEXT_EVENT_STREAM)
|
||||
.retrieve()
|
||||
.bodyToFlux(new ParameterizedTypeReference<>() {
|
||||
});
|
||||
.bodyToFlux(new ParameterizedTypeReference<>() {});
|
||||
|
||||
verifyPersonEvents(result);
|
||||
}
|
||||
@@ -148,8 +147,7 @@ class SseIntegrationTests extends AbstractHttpHandlerIntegrationTests {
|
||||
.uri("/event")
|
||||
.accept(TEXT_EVENT_STREAM)
|
||||
.retrieve()
|
||||
.bodyToFlux(new ParameterizedTypeReference<>() {
|
||||
});
|
||||
.bodyToFlux(new ParameterizedTypeReference<>() {});
|
||||
|
||||
verifyPersonEvents(result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user