Suppress warnings in tests
This commit is contained in:
@@ -42,6 +42,7 @@ import static org.springframework.test.web.client.response.MockRestResponseCreat
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 4.1
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class SampleAsyncTests {
|
||||
|
||||
private final AsyncRestTemplate restTemplate = new AsyncRestTemplate();
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.springframework.web.reactive.function.client.ClientRequest;
|
||||
import org.springframework.web.reactive.function.client.ExchangeFunction;
|
||||
import org.springframework.web.reactive.function.client.ExchangeFunctions;
|
||||
|
||||
import static java.time.Duration.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
@@ -53,7 +54,7 @@ public class WebTestClientConnectorTests {
|
||||
|
||||
WiretapConnector wiretapConnector = new WiretapConnector(connector);
|
||||
ExchangeFunction function = ExchangeFunctions.create(wiretapConnector);
|
||||
function.exchange(clientRequest).blockMillis(0);
|
||||
function.exchange(clientRequest).block(ofMillis(0));
|
||||
|
||||
ExchangeResult actual = wiretapConnector.claimRequest("1");
|
||||
assertNotNull(actual);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package org.springframework.test.web.reactive.server.samples;
|
||||
|
||||
import java.net.URI;
|
||||
import java.time.Duration;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
@@ -40,6 +41,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import static java.time.Duration.*;
|
||||
import static org.hamcrest.CoreMatchers.endsWith;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.springframework.http.MediaType.TEXT_EVENT_STREAM;
|
||||
@@ -148,7 +150,7 @@ public class ResponseEntityTests {
|
||||
|
||||
@GetMapping(produces = "text/event-stream")
|
||||
Flux<Person> getPersonStream() {
|
||||
return Flux.intervalMillis(100).onBackpressureBuffer(10).map(index -> new Person("N" + index));
|
||||
return Flux.interval(ofMillis(100)).onBackpressureBuffer(10).map(index -> new Person("N" + index));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
|
||||
Reference in New Issue
Block a user