parent
bb0d4c8ce0
commit
8705df502d
|
|
@ -21,7 +21,7 @@ import java.util.Collections;
|
|||
import org.junit.Test;
|
||||
import org.reactivestreams.Publisher;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.io.buffer.AbstractDataBufferAllocatingTestCase;
|
||||
|
|
@ -58,7 +58,7 @@ public class ByteArrayDecoderTests extends AbstractDataBufferAllocatingTestCase
|
|||
ResolvableType.forClassWithGenerics(Publisher.class, byte[].class),
|
||||
null, Collections.emptyMap());
|
||||
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.consumeNextWith(bytes -> assertArrayEquals("foo".getBytes(), bytes))
|
||||
.consumeNextWith(bytes -> assertArrayEquals("bar".getBytes(), bytes))
|
||||
.expectComplete()
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
import org.reactivestreams.Publisher;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.io.buffer.AbstractDataBufferAllocatingTestCase;
|
||||
|
|
@ -67,7 +67,7 @@ public class ByteArrayEncoderTests extends AbstractDataBufferAllocatingTestCase
|
|||
ResolvableType.forClassWithGenerics(Publisher.class, ByteBuffer.class),
|
||||
null, Collections.emptyMap());
|
||||
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.consumeNextWith(b -> {
|
||||
byte[] buf = new byte[3];
|
||||
b.read(buf);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import java.util.Collections;
|
|||
import org.junit.Test;
|
||||
import org.reactivestreams.Publisher;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.io.buffer.AbstractDataBufferAllocatingTestCase;
|
||||
|
|
@ -58,7 +58,7 @@ public class ByteBufferDecoderTests extends AbstractDataBufferAllocatingTestCase
|
|||
ResolvableType.forClassWithGenerics(Publisher.class, ByteBuffer.class),
|
||||
null, Collections.emptyMap());
|
||||
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.expectNext(ByteBuffer.wrap("foo".getBytes()), ByteBuffer.wrap("bar".getBytes()))
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
import org.reactivestreams.Publisher;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.io.buffer.AbstractDataBufferAllocatingTestCase;
|
||||
|
|
@ -67,7 +67,7 @@ public class ByteBufferEncoderTests extends AbstractDataBufferAllocatingTestCase
|
|||
Flux<DataBuffer> output = this.encoder.encode(source, this.bufferFactory,
|
||||
ResolvableType.forClassWithGenerics(Publisher.class, ByteBuffer.class),
|
||||
null, Collections.emptyMap());
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.consumeNextWith(b -> {
|
||||
byte[] buf = new byte[3];
|
||||
b.read(buf);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import org.junit.Test;
|
|||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.io.buffer.AbstractDataBufferAllocatingTestCase;
|
||||
|
|
@ -65,7 +65,7 @@ public class CharSequenceEncoderTests extends AbstractDataBufferAllocatingTestCa
|
|||
Flux<String> stringFlux = Flux.just("foo");
|
||||
Flux<DataBuffer> output = Flux.from(
|
||||
this.encoder.encode(stringFlux, this.bufferFactory, null, null, Collections.emptyMap()));
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.consumeNextWith(stringConsumer("foo"))
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -76,7 +76,7 @@ public class CharSequenceEncoderTests extends AbstractDataBufferAllocatingTestCa
|
|||
Flux<StringBuilder> stringBuilderFlux = Flux.just(new StringBuilder("foo"));
|
||||
Flux<DataBuffer> output = Flux.from(
|
||||
this.encoder.encode(stringBuilderFlux, this.bufferFactory, null, null, Collections.emptyMap()));
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.consumeNextWith(stringConsumer("foo"))
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import java.util.Collections;
|
|||
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.io.ByteArrayResource;
|
||||
|
|
@ -64,7 +64,7 @@ public class ResourceDecoderTests extends AbstractDataBufferAllocatingTestCase {
|
|||
Flux<Resource> result = this.decoder
|
||||
.decode(source, ResolvableType.forClass(Resource.class), null, Collections.emptyMap());
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.consumeNextWith(resource -> {
|
||||
try {
|
||||
byte[] bytes = StreamUtils.copyToByteArray(resource.getInputStream());
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import java.util.Collections;
|
|||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.io.ByteArrayResource;
|
||||
|
|
@ -64,7 +64,7 @@ public class ResourceEncoderTests extends AbstractDataBufferAllocatingTestCase {
|
|||
ResolvableType.forClass(Resource.class),
|
||||
null, Collections.emptyMap());
|
||||
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.consumeNextWith(stringConsumer(s))
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.io.ByteArrayResource;
|
||||
|
|
@ -81,7 +81,7 @@ public class ResourceRegionEncoderTests extends AbstractDataBufferAllocatingTest
|
|||
ResolvableType.forClass(ResourceRegion.class), MimeTypeUtils.APPLICATION_OCTET_STREAM
|
||||
, Collections.emptyMap());
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.consumeNextWith(stringConsumer("Spring"))
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -111,7 +111,7 @@ public class ResourceRegionEncoderTests extends AbstractDataBufferAllocatingTest
|
|||
return previous;
|
||||
});
|
||||
|
||||
Verifier.create(reduced)
|
||||
StepVerifier.create(reduced)
|
||||
.consumeNextWith(buf -> {
|
||||
String content = DataBufferTestUtils.dumpString(buf, StandardCharsets.UTF_8);
|
||||
String[] ranges = StringUtils.tokenizeToStringArray(content, "\r\n",
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import java.util.Collections;
|
|||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.io.buffer.AbstractDataBufferAllocatingTestCase;
|
||||
|
|
@ -62,7 +62,7 @@ public class StringDecoderTests extends AbstractDataBufferAllocatingTestCase {
|
|||
Flux<String> output = this.decoder.decode(source, ResolvableType.forClass(String.class),
|
||||
null, Collections.emptyMap());
|
||||
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.expectNext("foo", "bar", "baz")
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -77,7 +77,7 @@ public class StringDecoderTests extends AbstractDataBufferAllocatingTestCase {
|
|||
Flux<String> output = decoder.decode(source, ResolvableType.forClass(String.class),
|
||||
null, Collections.emptyMap());
|
||||
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.expectNext("\n", "foo\r", "\n", "bar\r", "\n", "baz")
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -90,7 +90,7 @@ public class StringDecoderTests extends AbstractDataBufferAllocatingTestCase {
|
|||
Flux<String> output = this.decoder.decode(source, ResolvableType.forClass(String.class),
|
||||
null, Collections.emptyMap());
|
||||
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.expectNextCount(0)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -103,7 +103,7 @@ public class StringDecoderTests extends AbstractDataBufferAllocatingTestCase {
|
|||
Flux<String> output = this.decoder.decode(source,
|
||||
ResolvableType.forClass(String.class), null, Collections.emptyMap());
|
||||
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.expectNext("")
|
||||
.expectComplete().verify();
|
||||
|
||||
|
|
@ -116,7 +116,7 @@ public class StringDecoderTests extends AbstractDataBufferAllocatingTestCase {
|
|||
Mono<String> output = this.decoder.decodeToMono(source,
|
||||
ResolvableType.forClass(String.class), null, Collections.emptyMap());
|
||||
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.expectNext("foobarbaz")
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -128,7 +128,7 @@ public class StringDecoderTests extends AbstractDataBufferAllocatingTestCase {
|
|||
Mono<String> output = this.decoder.decodeToMono(source,
|
||||
ResolvableType.forClass(String.class), null, Collections.emptyMap());
|
||||
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.expectNextCount(0)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import java.nio.file.StandardOpenOption;
|
|||
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ public class DataBufferUtilsTests extends AbstractDataBufferAllocatingTestCase {
|
|||
FileChannel channel = FileChannel.open(Paths.get(uri), StandardOpenOption.READ);
|
||||
Flux<DataBuffer> flux = DataBufferUtils.read(channel, this.bufferFactory, 3);
|
||||
|
||||
Verifier.create(flux)
|
||||
StepVerifier.create(flux)
|
||||
.consumeNextWith(stringConsumer("foo"))
|
||||
.consumeNextWith(stringConsumer("bar"))
|
||||
.consumeNextWith(stringConsumer("baz"))
|
||||
|
|
@ -56,7 +56,7 @@ public class DataBufferUtilsTests extends AbstractDataBufferAllocatingTestCase {
|
|||
FileChannel channel = FileChannel.open(Paths.get(uri), StandardOpenOption.READ);
|
||||
Flux<DataBuffer> flux = DataBufferUtils.read(channel, this.bufferFactory, 5);
|
||||
|
||||
Verifier.create(flux)
|
||||
StepVerifier.create(flux)
|
||||
.consumeNextWith(stringConsumer("fooba"))
|
||||
.consumeNextWith(stringConsumer("rbazq"))
|
||||
.consumeNextWith(stringConsumer("ux"))
|
||||
|
|
@ -71,7 +71,7 @@ public class DataBufferUtilsTests extends AbstractDataBufferAllocatingTestCase {
|
|||
InputStream is = DataBufferUtilsTests.class.getResourceAsStream("DataBufferUtilsTests.txt");
|
||||
Flux<DataBuffer> flux = DataBufferUtils.read(is, this.bufferFactory, 3);
|
||||
|
||||
Verifier.create(flux)
|
||||
StepVerifier.create(flux)
|
||||
.consumeNextWith(stringConsumer("foo"))
|
||||
.consumeNextWith(stringConsumer("bar"))
|
||||
.consumeNextWith(stringConsumer("baz"))
|
||||
|
|
@ -88,7 +88,7 @@ public class DataBufferUtilsTests extends AbstractDataBufferAllocatingTestCase {
|
|||
Flux<DataBuffer> flux = Flux.just(foo, bar, baz);
|
||||
Flux<DataBuffer> result = DataBufferUtils.takeUntilByteCount(flux, 5L);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.consumeNextWith(stringConsumer("foo"))
|
||||
.consumeNextWith(stringConsumer("ba"))
|
||||
.expectComplete().verify();
|
||||
|
|
@ -104,7 +104,7 @@ public class DataBufferUtilsTests extends AbstractDataBufferAllocatingTestCase {
|
|||
Flux<DataBuffer> flux = Flux.just(foo, bar, baz);
|
||||
Flux<DataBuffer> result = DataBufferUtils.skipUntilByteCount(flux, 5L);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.consumeNextWith(stringConsumer("r"))
|
||||
.consumeNextWith(stringConsumer("baz"))
|
||||
.expectComplete()
|
||||
|
|
@ -119,7 +119,7 @@ public class DataBufferUtilsTests extends AbstractDataBufferAllocatingTestCase {
|
|||
Flux<DataBuffer> flux = Flux.just(foo, bar, baz);
|
||||
Flux<DataBuffer> result = DataBufferUtils.skipUntilByteCount(flux, 9L);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectNextCount(0)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
import org.reactivestreams.Publisher;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
|
@ -99,7 +99,7 @@ public class DispatcherHandlerErrorTests {
|
|||
this.request.setUri("/does-not-exist");
|
||||
Mono<Void> publisher = this.dispatcherHandler.handle(this.exchange);
|
||||
|
||||
Verifier.create(publisher)
|
||||
StepVerifier.create(publisher)
|
||||
.consumeErrorWith(error -> {
|
||||
assertThat(error, instanceOf(ResponseStatusException.class));
|
||||
assertThat(error.getMessage(),
|
||||
|
|
@ -113,7 +113,7 @@ public class DispatcherHandlerErrorTests {
|
|||
this.request.setUri("/unknown-argument-type");
|
||||
Mono<Void> publisher = this.dispatcherHandler.handle(this.exchange);
|
||||
|
||||
Verifier.create(publisher)
|
||||
StepVerifier.create(publisher)
|
||||
.consumeErrorWith(error -> {
|
||||
assertThat(error, instanceOf(IllegalStateException.class));
|
||||
assertThat(error.getMessage(), startsWith("No resolver for argument [0]"));
|
||||
|
|
@ -126,7 +126,7 @@ public class DispatcherHandlerErrorTests {
|
|||
this.request.setUri("/error-signal");
|
||||
Mono<Void> publisher = this.dispatcherHandler.handle(this.exchange);
|
||||
|
||||
Verifier.create(publisher)
|
||||
StepVerifier.create(publisher)
|
||||
.consumeErrorWith(error -> {
|
||||
assertSame(EXCEPTION, error);
|
||||
})
|
||||
|
|
@ -138,7 +138,7 @@ public class DispatcherHandlerErrorTests {
|
|||
this.request.setUri("/raise-exception");
|
||||
Mono<Void> publisher = this.dispatcherHandler.handle(this.exchange);
|
||||
|
||||
Verifier.<Void>create(publisher)
|
||||
StepVerifier.<Void>create(publisher)
|
||||
.consumeErrorWith(error -> {
|
||||
assertSame(EXCEPTION, error);
|
||||
})
|
||||
|
|
@ -150,7 +150,7 @@ public class DispatcherHandlerErrorTests {
|
|||
this.request.setUri("/unknown-return-type");
|
||||
Mono<Void> publisher = this.dispatcherHandler.handle(this.exchange);
|
||||
|
||||
Verifier.create(publisher)
|
||||
StepVerifier.create(publisher)
|
||||
.consumeErrorWith(error -> {
|
||||
assertThat(error, instanceOf(IllegalStateException.class));
|
||||
assertThat(error.getMessage(), startsWith("No HandlerResultHandler"));
|
||||
|
|
@ -163,7 +163,7 @@ public class DispatcherHandlerErrorTests {
|
|||
this.request.setUri("/request-body").setHeader("Accept", "application/json").setBody("body");
|
||||
Mono<Void> publisher = this.dispatcherHandler.handle(this.exchange);
|
||||
|
||||
Verifier.create(publisher)
|
||||
StepVerifier.create(publisher)
|
||||
.consumeErrorWith(error -> {
|
||||
assertThat(error, instanceOf(NotAcceptableStatusException.class));
|
||||
})
|
||||
|
|
@ -175,7 +175,7 @@ public class DispatcherHandlerErrorTests {
|
|||
this.request.setUri("/request-body").setBody(Mono.error(EXCEPTION));
|
||||
Mono<Void> publisher = this.dispatcherHandler.handle(this.exchange);
|
||||
|
||||
Verifier.create(publisher)
|
||||
StepVerifier.create(publisher)
|
||||
.consumeErrorWith(error -> {
|
||||
assertThat(error, instanceOf(ServerWebInputException.class));
|
||||
assertSame(EXCEPTION, error.getCause());
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import org.hamcrest.Matchers;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.mockito.Mockito;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.cache.concurrent.ConcurrentMapCache;
|
||||
import org.springframework.context.support.GenericApplicationContext;
|
||||
|
|
@ -100,7 +100,7 @@ public class ResourceHandlerRegistryTests {
|
|||
ResourceWebHandler handler = getHandler("/resources/**");
|
||||
handler.handle(this.exchange).blockMillis(5000);
|
||||
|
||||
Verifier.create(this.response.getBody())
|
||||
StepVerifier.create(this.response.getBody())
|
||||
.consumeNextWith(buf -> assertEquals("test stylesheet content",
|
||||
DataBufferTestUtils.dumpString(buf, StandardCharsets.UTF_8)))
|
||||
.expectComplete()
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import org.junit.Test;
|
|||
import org.reactivestreams.Publisher;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.client.reactive.ReactorClientHttpConnector;
|
||||
|
|
@ -74,7 +74,7 @@ public class SseHandlerFunctionIntegrationTests
|
|||
.map(s -> (s.replace("\n", "")))
|
||||
.take(2);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectNext("data:foo 0")
|
||||
.expectNext("data:foo 1")
|
||||
.expectComplete()
|
||||
|
|
@ -97,7 +97,7 @@ public class SseHandlerFunctionIntegrationTests
|
|||
.takeUntil(s -> s.endsWith("foo 1\"}"))
|
||||
.reduce((s1, s2) -> s1 + s2);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectNext("data:{\"name\":\"foo 0\"}data:{\"name\":\"foo 1\"}")
|
||||
.expectComplete()
|
||||
.verify(Duration.ofSeconds(5));
|
||||
|
|
@ -118,7 +118,7 @@ public class SseHandlerFunctionIntegrationTests
|
|||
.map(s -> s.replace("\n", ""))
|
||||
.take(2);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectNext("id:0:bardata:foo")
|
||||
.expectNext("id:1:bardata:foo")
|
||||
.expectComplete()
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
|
@ -527,7 +527,7 @@ public class ResourceWebHandlerTests {
|
|||
this.request.addHeader("Range", "bytes= foo bar");
|
||||
this.exchange.getAttributes().put(PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, "foo.txt");
|
||||
|
||||
Verifier.create(this.handler.handle(this.exchange))
|
||||
StepVerifier.create(this.handler.handle(this.exchange))
|
||||
.expectNextCount(0)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -555,7 +555,7 @@ public class ResourceWebHandlerTests {
|
|||
return previous;
|
||||
});
|
||||
|
||||
Verifier.create(reduced)
|
||||
StepVerifier.create(reduced)
|
||||
.consumeNextWith(buf -> {
|
||||
String content = DataBufferTestUtils.dumpString(buf, StandardCharsets.UTF_8);
|
||||
String[] ranges = StringUtils.tokenizeToStringArray(content, "\r\n", false, true);
|
||||
|
|
@ -598,7 +598,7 @@ public class ResourceWebHandlerTests {
|
|||
}
|
||||
|
||||
private void assertResponseBody(String responseBody) {
|
||||
Verifier.create(this.response.getBody())
|
||||
StepVerifier.create(this.response.getBody())
|
||||
.consumeNextWith(buf -> assertEquals(responseBody,
|
||||
DataBufferTestUtils.dumpString(buf, StandardCharsets.UTF_8)))
|
||||
.expectComplete()
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import java.util.Set;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||
|
|
@ -100,7 +100,7 @@ public class HandlerMethodMappingTests {
|
|||
this.mapping.registerMapping("/fo?", this.handler, this.method2);
|
||||
Mono<Object> result = this.mapping.getHandler(createExchange(HttpMethod.GET, "/foo"));
|
||||
|
||||
Verifier.create(result).expectError(IllegalStateException.class).verify();
|
||||
StepVerifier.create(result).expectError(IllegalStateException.class).verify();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import java.util.Optional;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpRequest;
|
||||
|
|
@ -92,7 +92,7 @@ public class InvocableHandlerMethodTests {
|
|||
InvocableHandlerMethod hm = handlerMethod("singleArg");
|
||||
Mono<HandlerResult> mono = hm.invoke(this.exchange, new BindingContext());
|
||||
|
||||
Verifier.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.expectNextCount(0)
|
||||
.consumeErrorWith(error -> {
|
||||
assertThat(error, instanceOf(IllegalStateException.class));
|
||||
|
|
@ -108,7 +108,7 @@ public class InvocableHandlerMethodTests {
|
|||
addResolver(hm, Mono.error(new UnsupportedMediaTypeStatusException("boo")));
|
||||
Mono<HandlerResult> mono = hm.invoke(this.exchange, new BindingContext());
|
||||
|
||||
Verifier.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.expectNextCount(0)
|
||||
.consumeErrorWith(error -> {
|
||||
assertThat(error, instanceOf(UnsupportedMediaTypeStatusException.class));
|
||||
|
|
@ -123,7 +123,7 @@ public class InvocableHandlerMethodTests {
|
|||
addResolver(hm, Mono.just(1));
|
||||
Mono<HandlerResult> mono = hm.invoke(this.exchange, new BindingContext());
|
||||
|
||||
Verifier.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.expectNextCount(0)
|
||||
.consumeErrorWith(error -> {
|
||||
assertThat(error, instanceOf(IllegalStateException.class));
|
||||
|
|
@ -139,7 +139,7 @@ public class InvocableHandlerMethodTests {
|
|||
InvocableHandlerMethod hm = handlerMethod("exceptionMethod");
|
||||
Mono<HandlerResult> mono = hm.invoke(this.exchange, new BindingContext());
|
||||
|
||||
Verifier.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.expectNextCount(0)
|
||||
.consumeErrorWith(error -> {
|
||||
assertThat(error, instanceOf(IllegalStateException.class));
|
||||
|
|
@ -162,7 +162,7 @@ public class InvocableHandlerMethodTests {
|
|||
}
|
||||
|
||||
private void assertHandlerResultValue(Mono<HandlerResult> mono, String expected) {
|
||||
Verifier.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.consumeNextWith(result -> {
|
||||
Optional<?> optional = result.getReturnValue();
|
||||
assertTrue(optional.isPresent());
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import java.util.function.Consumer;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.annotation.AnnotatedElementUtils;
|
||||
import org.springframework.core.annotation.AnnotationUtils;
|
||||
|
|
@ -164,7 +164,7 @@ public class RequestMappingInfoHandlerMappingTests {
|
|||
this.handlerMapping.registerHandler(new UserController());
|
||||
Mono<Object> mono = this.handlerMapping.getHandler(exchange);
|
||||
|
||||
Verifier.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.expectError(NotAcceptableStatusException.class)
|
||||
.verify();
|
||||
}
|
||||
|
|
@ -353,7 +353,7 @@ public class RequestMappingInfoHandlerMappingTests {
|
|||
@SuppressWarnings("unchecked")
|
||||
private <T> void assertError(Mono<Object> mono, final Class<T> exceptionClass, final Consumer<T> consumer) {
|
||||
|
||||
Verifier.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.consumeErrorWith(error -> {
|
||||
assertEquals(exceptionClass, error.getClass());
|
||||
consumer.accept((T) error);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import java.lang.reflect.Method;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.core.MethodParameter;
|
||||
|
|
@ -119,7 +119,7 @@ public class CookieValueMethodArgumentResolverTests {
|
|||
@Test
|
||||
public void notFound() {
|
||||
Mono<Object> mono = resolver.resolveArgument(this.cookieParameter, this.bindingContext, this.exchange);
|
||||
Verifier.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.expectNextCount(0)
|
||||
.expectError(ServerWebInputException.class)
|
||||
.verify();
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
import rx.Observable;
|
||||
import rx.RxReactiveStreams;
|
||||
import rx.Single;
|
||||
|
|
@ -130,7 +130,7 @@ public class HttpEntityArgumentResolverTests {
|
|||
ResolvableType type = httpEntityType(forClassWithGenerics(Mono.class, String.class));
|
||||
HttpEntity<Mono<String>> entity = resolveValueWithEmptyBody(type);
|
||||
|
||||
Verifier.create(entity.getBody()).expectNextCount(0).expectComplete().verify();
|
||||
StepVerifier.create(entity.getBody()).expectNextCount(0).expectComplete().verify();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -138,7 +138,7 @@ public class HttpEntityArgumentResolverTests {
|
|||
ResolvableType type = httpEntityType(forClassWithGenerics(Flux.class, String.class));
|
||||
HttpEntity<Flux<String>> entity = resolveValueWithEmptyBody(type);
|
||||
|
||||
Verifier.create(entity.getBody()).expectNextCount(0).expectComplete().verify();
|
||||
StepVerifier.create(entity.getBody()).expectNextCount(0).expectComplete().verify();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -146,7 +146,7 @@ public class HttpEntityArgumentResolverTests {
|
|||
ResolvableType type = httpEntityType(forClassWithGenerics(Single.class, String.class));
|
||||
HttpEntity<Single<String>> entity = resolveValueWithEmptyBody(type);
|
||||
|
||||
Verifier.create(RxReactiveStreams.toPublisher(entity.getBody()))
|
||||
StepVerifier.create(RxReactiveStreams.toPublisher(entity.getBody()))
|
||||
.expectNextCount(0)
|
||||
.expectError(ServerWebInputException.class)
|
||||
.verify();
|
||||
|
|
@ -157,7 +157,7 @@ public class HttpEntityArgumentResolverTests {
|
|||
ResolvableType type = httpEntityType(forClassWithGenerics(io.reactivex.Single.class, String.class));
|
||||
HttpEntity<io.reactivex.Single<String>> entity = resolveValueWithEmptyBody(type);
|
||||
|
||||
Verifier.create(entity.getBody().toFlowable())
|
||||
StepVerifier.create(entity.getBody().toFlowable())
|
||||
.expectNextCount(0)
|
||||
.expectError(ServerWebInputException.class)
|
||||
.verify();
|
||||
|
|
@ -168,7 +168,7 @@ public class HttpEntityArgumentResolverTests {
|
|||
ResolvableType type = httpEntityType(forClassWithGenerics(Maybe.class, String.class));
|
||||
HttpEntity<Maybe<String>> entity = resolveValueWithEmptyBody(type);
|
||||
|
||||
Verifier.create(entity.getBody().toFlowable())
|
||||
StepVerifier.create(entity.getBody().toFlowable())
|
||||
.expectNextCount(0)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -179,7 +179,7 @@ public class HttpEntityArgumentResolverTests {
|
|||
ResolvableType type = httpEntityType(forClassWithGenerics(Observable.class, String.class));
|
||||
HttpEntity<Observable<String>> entity = resolveValueWithEmptyBody(type);
|
||||
|
||||
Verifier.create(RxReactiveStreams.toPublisher(entity.getBody()))
|
||||
StepVerifier.create(RxReactiveStreams.toPublisher(entity.getBody()))
|
||||
.expectNextCount(0)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -190,7 +190,7 @@ public class HttpEntityArgumentResolverTests {
|
|||
ResolvableType type = httpEntityType(forClassWithGenerics(io.reactivex.Observable.class, String.class));
|
||||
HttpEntity<io.reactivex.Observable<String>> entity = resolveValueWithEmptyBody(type);
|
||||
|
||||
Verifier.create(entity.getBody().toFlowable(BackpressureStrategy.BUFFER))
|
||||
StepVerifier.create(entity.getBody().toFlowable(BackpressureStrategy.BUFFER))
|
||||
.expectNextCount(0)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -201,7 +201,7 @@ public class HttpEntityArgumentResolverTests {
|
|||
ResolvableType type = httpEntityType(forClassWithGenerics(Flowable.class, String.class));
|
||||
HttpEntity<Flowable<String>> entity = resolveValueWithEmptyBody(type);
|
||||
|
||||
Verifier.create(entity.getBody())
|
||||
StepVerifier.create(entity.getBody())
|
||||
.expectNextCount(0)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -285,7 +285,7 @@ public class HttpEntityArgumentResolverTests {
|
|||
HttpEntity<Flux<String>> httpEntity = resolveValue(type, body);
|
||||
|
||||
assertEquals(this.request.getHeaders(), httpEntity.getHeaders());
|
||||
Verifier.create(httpEntity.getBody())
|
||||
StepVerifier.create(httpEntity.getBody())
|
||||
.expectNext("line1\n")
|
||||
.expectNext("line2\n")
|
||||
.expectNext("line3\n")
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
import rx.Observable;
|
||||
import rx.Single;
|
||||
|
||||
|
|
@ -103,7 +103,7 @@ public class MessageReaderArgumentResolverTests {
|
|||
MethodParameter param = this.testMethod.resolveParam(type);
|
||||
Mono<Object> result = this.resolver.readBody(param, true, this.bindingContext, this.exchange);
|
||||
|
||||
Verifier.create(result).expectError(UnsupportedMediaTypeStatusException.class).verify();
|
||||
StepVerifier.create(result).expectError(UnsupportedMediaTypeStatusException.class).verify();
|
||||
}
|
||||
|
||||
// More extensive "empty body" tests in RequestBody- and HttpEntityArgumentResolverTests
|
||||
|
|
@ -116,7 +116,7 @@ public class MessageReaderArgumentResolverTests {
|
|||
Mono<TestBean> result = (Mono<TestBean>) this.resolver.readBody(
|
||||
param, true, this.bindingContext, this.exchange).block();
|
||||
|
||||
Verifier.create(result).expectError(ServerWebInputException.class).verify();
|
||||
StepVerifier.create(result).expectError(ServerWebInputException.class).verify();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -273,7 +273,7 @@ public class MessageReaderArgumentResolverTests {
|
|||
MethodParameter param = this.testMethod.resolveParam(type);
|
||||
Mono<TestBean> mono = resolveValue(param, body);
|
||||
|
||||
Verifier.create(mono).expectNextCount(0).expectError(ServerWebInputException.class).verify();
|
||||
StepVerifier.create(mono).expectNextCount(0).expectError(ServerWebInputException.class).verify();
|
||||
}
|
||||
|
||||
@Test @SuppressWarnings("unchecked")
|
||||
|
|
@ -283,7 +283,7 @@ public class MessageReaderArgumentResolverTests {
|
|||
MethodParameter param = this.testMethod.resolveParam(type);
|
||||
Flux<TestBean> flux = resolveValue(param, body);
|
||||
|
||||
Verifier.create(flux)
|
||||
StepVerifier.create(flux)
|
||||
.expectNext(new TestBean("f1", "b1"))
|
||||
.expectError(ServerWebInputException.class)
|
||||
.verify();
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
import rx.Completable;
|
||||
import rx.Observable;
|
||||
|
||||
|
|
@ -137,7 +137,7 @@ public class MessageWriterResultHandlerTests {
|
|||
HttpMessageWriter<?> writer = new EncoderHttpMessageWriter<>(new ByteBufferEncoder());
|
||||
Mono<Void> mono = createResultHandler(writer).writeBody(body, returnType(type), this.exchange);
|
||||
|
||||
Verifier.create(mono).expectError(IllegalStateException.class).verify();
|
||||
StepVerifier.create(mono).expectError(IllegalStateException.class).verify();
|
||||
}
|
||||
|
||||
@Test // SPR-12811
|
||||
|
|
@ -194,7 +194,7 @@ public class MessageWriterResultHandlerTests {
|
|||
}
|
||||
|
||||
private void assertResponseBody(String responseBody) {
|
||||
Verifier.create(this.response.getBody())
|
||||
StepVerifier.create(this.response.getBody())
|
||||
.consumeNextWith(buf -> assertEquals(responseBody,
|
||||
DataBufferTestUtils.dumpString(buf, StandardCharsets.UTF_8)))
|
||||
.expectComplete()
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import java.util.Optional;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.core.annotation.SynthesizingMethodParameter;
|
||||
|
|
@ -134,7 +134,7 @@ public class PathVariableMethodArgumentResolverTests {
|
|||
public void handleMissingValue() throws Exception {
|
||||
BindingContext bindingContext = new BindingContext();
|
||||
Mono<Object> mono = this.resolver.resolveArgument(this.paramNamedString, bindingContext, this.exchange);
|
||||
Verifier.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.expectNextCount(0)
|
||||
.expectError(ServerErrorException.class)
|
||||
.verify();
|
||||
|
|
@ -144,8 +144,7 @@ public class PathVariableMethodArgumentResolverTests {
|
|||
public void nullIfNotRequired() throws Exception {
|
||||
BindingContext bindingContext = new BindingContext();
|
||||
Mono<Object> mono = this.resolver.resolveArgument(this.paramNotRequired, bindingContext, this.exchange);
|
||||
Verifier
|
||||
.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.expectNextCount(0)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -156,7 +155,7 @@ public class PathVariableMethodArgumentResolverTests {
|
|||
BindingContext bindingContext = new BindingContext();
|
||||
Mono<Object> mono = this.resolver.resolveArgument(this.paramOptional, bindingContext, this.exchange);
|
||||
|
||||
Verifier.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.consumeNextWith(value -> {
|
||||
assertTrue(value instanceof Optional);
|
||||
assertFalse(((Optional) value).isPresent());
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import java.util.Optional;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.core.DefaultParameterNameDiscoverer;
|
||||
|
|
@ -89,7 +89,7 @@ public class RequestAttributeMethodArgumentResolverTests {
|
|||
public void resolve() throws Exception {
|
||||
MethodParameter param = initMethodParameter(0);
|
||||
Mono<Object> mono = this.resolver.resolveArgument(param, new BindingContext(), this.exchange);
|
||||
Verifier.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.expectNextCount(0)
|
||||
.expectError(ServerWebInputException.class)
|
||||
.verify();
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
import rx.Observable;
|
||||
import rx.RxReactiveStreams;
|
||||
import rx.Single;
|
||||
|
|
@ -126,12 +126,12 @@ public class RequestBodyArgumentResolverTests {
|
|||
public void emptyBodyWithMono() throws Exception {
|
||||
ResolvableType type = forClassWithGenerics(Mono.class, String.class);
|
||||
|
||||
Verifier.create((Mono<Void>) resolveValueWithEmptyBody(type, true))
|
||||
StepVerifier.create((Mono<Void>) resolveValueWithEmptyBody(type, true))
|
||||
.expectNextCount(0)
|
||||
.expectError(ServerWebInputException.class)
|
||||
.verify();
|
||||
|
||||
Verifier.create((Mono<Void>) resolveValueWithEmptyBody(type, false))
|
||||
StepVerifier.create((Mono<Void>) resolveValueWithEmptyBody(type, false))
|
||||
.expectNextCount(0)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -142,12 +142,12 @@ public class RequestBodyArgumentResolverTests {
|
|||
public void emptyBodyWithFlux() throws Exception {
|
||||
ResolvableType type = forClassWithGenerics(Flux.class, String.class);
|
||||
|
||||
Verifier.create((Flux<Void>) resolveValueWithEmptyBody(type, true))
|
||||
StepVerifier.create((Flux<Void>) resolveValueWithEmptyBody(type, true))
|
||||
.expectNextCount(0)
|
||||
.expectError(ServerWebInputException.class)
|
||||
.verify();
|
||||
|
||||
Verifier.create((Flux<Void>) resolveValueWithEmptyBody(type, false))
|
||||
StepVerifier.create((Flux<Void>) resolveValueWithEmptyBody(type, false))
|
||||
.expectNextCount(0)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -158,13 +158,13 @@ public class RequestBodyArgumentResolverTests {
|
|||
ResolvableType type = forClassWithGenerics(Single.class, String.class);
|
||||
|
||||
Single<String> single = resolveValueWithEmptyBody(type, true);
|
||||
Verifier.create(RxReactiveStreams.toPublisher(single))
|
||||
StepVerifier.create(RxReactiveStreams.toPublisher(single))
|
||||
.expectNextCount(0)
|
||||
.expectError(ServerWebInputException.class)
|
||||
.verify();
|
||||
|
||||
single = resolveValueWithEmptyBody(type, false);
|
||||
Verifier.create(RxReactiveStreams.toPublisher(single))
|
||||
StepVerifier.create(RxReactiveStreams.toPublisher(single))
|
||||
.expectNextCount(0)
|
||||
.expectError(ServerWebInputException.class)
|
||||
.verify();
|
||||
|
|
@ -175,13 +175,13 @@ public class RequestBodyArgumentResolverTests {
|
|||
ResolvableType type = forClassWithGenerics(Maybe.class, String.class);
|
||||
|
||||
Maybe<String> maybe = resolveValueWithEmptyBody(type, true);
|
||||
Verifier.create(maybe.toFlowable())
|
||||
StepVerifier.create(maybe.toFlowable())
|
||||
.expectNextCount(0)
|
||||
.expectError(ServerWebInputException.class)
|
||||
.verify();
|
||||
|
||||
maybe = resolveValueWithEmptyBody(type, false);
|
||||
Verifier.create(maybe.toFlowable())
|
||||
StepVerifier.create(maybe.toFlowable())
|
||||
.expectNextCount(0)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -192,13 +192,13 @@ public class RequestBodyArgumentResolverTests {
|
|||
ResolvableType type = forClassWithGenerics(Observable.class, String.class);
|
||||
|
||||
Observable<String> observable = resolveValueWithEmptyBody(type, true);
|
||||
Verifier.create(RxReactiveStreams.toPublisher(observable))
|
||||
StepVerifier.create(RxReactiveStreams.toPublisher(observable))
|
||||
.expectNextCount(0)
|
||||
.expectError(ServerWebInputException.class)
|
||||
.verify();
|
||||
|
||||
observable = resolveValueWithEmptyBody(type, false);
|
||||
Verifier.create(RxReactiveStreams.toPublisher(observable))
|
||||
StepVerifier.create(RxReactiveStreams.toPublisher(observable))
|
||||
.expectNextCount(0)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import java.util.Map;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.core.MethodParameter;
|
||||
|
|
@ -203,7 +203,7 @@ public class RequestHeaderMethodArgumentResolverTests {
|
|||
Mono<Object> mono = resolver.resolveArgument(
|
||||
this.paramNamedValueStringArray, this.bindingContext, this.exchange);
|
||||
|
||||
Verifier.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.expectNextCount(0)
|
||||
.expectError(ServerWebInputException.class)
|
||||
.verify();
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import java.util.Optional;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
|
||||
import org.springframework.core.MethodParameter;
|
||||
|
|
@ -159,7 +159,7 @@ public class RequestParamMethodArgumentResolverTests {
|
|||
Mono<Object> mono = this.resolver.resolveArgument(
|
||||
this.paramNamedStringArray, this.bindingContext, this.exchange);
|
||||
|
||||
Verifier.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.expectNextCount(0)
|
||||
.expectError(ServerWebInputException.class)
|
||||
.verify();
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import java.util.concurrent.CompletableFuture;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
import rx.Completable;
|
||||
import rx.Single;
|
||||
|
||||
|
|
@ -291,7 +291,7 @@ public class ResponseEntityResultHandlerTests {
|
|||
}
|
||||
|
||||
private void assertResponseBody(String responseBody) {
|
||||
Verifier.create(this.response.getBody())
|
||||
StepVerifier.create(this.response.getBody())
|
||||
.consumeNextWith(buf -> assertEquals(responseBody,
|
||||
DataBufferTestUtils.dumpString(buf, StandardCharsets.UTF_8)))
|
||||
.expectComplete()
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import java.util.Optional;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.core.DefaultParameterNameDiscoverer;
|
||||
|
|
@ -96,7 +96,7 @@ public class SessionAttributeMethodArgumentResolverTests {
|
|||
public void resolve() throws Exception {
|
||||
MethodParameter param = initMethodParameter(0);
|
||||
Mono<Object> mono = this.resolver.resolveArgument(param, new BindingContext(), this.exchange);
|
||||
Verifier.create(mono).expectError(ServerWebInputException.class).verify();
|
||||
StepVerifier.create(mono).expectError(ServerWebInputException.class).verify();
|
||||
|
||||
Foo foo = new Foo();
|
||||
when(this.session.getAttribute("foo")).thenReturn(Optional.of(foo));
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import org.springframework.http.codec.BodyExtractors;
|
|||
import org.springframework.http.codec.ServerSentEvent;
|
||||
import org.springframework.http.server.reactive.AbstractHttpHandlerIntegrationTests;
|
||||
import org.springframework.http.server.reactive.HttpHandler;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.client.reactive.ClientRequest;
|
||||
|
|
@ -87,7 +87,7 @@ public class SseIntegrationTests extends AbstractHttpHandlerIntegrationTests {
|
|||
.map(s -> (s.replace("\n", "")))
|
||||
.take(2);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectNext("data:foo 0")
|
||||
.expectNext("data:foo 1")
|
||||
.expectComplete()
|
||||
|
|
@ -109,7 +109,7 @@ public class SseIntegrationTests extends AbstractHttpHandlerIntegrationTests {
|
|||
.takeUntil(s -> s.endsWith("foo 1\"}"))
|
||||
.reduce((s1, s2) -> s1 + s2);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectNext("data:{\"name\":\"foo 0\"}data:{\"name\":\"foo 1\"}")
|
||||
.expectComplete()
|
||||
.verify(Duration.ofSeconds(5L));
|
||||
|
|
@ -129,7 +129,7 @@ public class SseIntegrationTests extends AbstractHttpHandlerIntegrationTests {
|
|||
.map(s -> s.replace("\n", ""))
|
||||
.take(2);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectNext("id:0:bardata:foo")
|
||||
.expectNext("id:1:bardata:foo")
|
||||
.expectComplete()
|
||||
|
|
@ -151,7 +151,7 @@ public class SseIntegrationTests extends AbstractHttpHandlerIntegrationTests {
|
|||
.map(s -> s.replace("\n", ""))
|
||||
.take(2);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectNext("id:0:bardata:foo")
|
||||
.expectNext("id:1:bardata:foo")
|
||||
.expectComplete()
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import org.junit.Test;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.codec.CharSequenceEncoder;
|
||||
import org.springframework.core.io.buffer.DataBuffer;
|
||||
|
|
@ -155,7 +155,7 @@ public class HttpMessageWriterViewTests {
|
|||
|
||||
this.view.render(this.model, MediaType.APPLICATION_JSON, exchange);
|
||||
|
||||
Verifier.create(response.getBody())
|
||||
StepVerifier.create(response.getBody())
|
||||
.consumeNextWith( buf -> assertEquals("{\"foo\":\"f\",\"bar\":\"b\"}",
|
||||
DataBufferTestUtils.dumpString(buf, StandardCharsets.UTF_8))
|
||||
)
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
import rx.Completable;
|
||||
import rx.Single;
|
||||
|
||||
|
|
@ -204,7 +204,7 @@ public class ViewResolutionResultHandlerTests {
|
|||
this.request.setUri("/path");
|
||||
Mono<Void> mono = createResultHandler().handleResult(this.exchange, handlerResult);
|
||||
|
||||
Verifier.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.expectNextCount(0)
|
||||
.expectErrorWith(err -> err.getMessage().equals("Could not resolve view with name 'account'."))
|
||||
.verify();
|
||||
|
|
@ -240,7 +240,7 @@ public class ViewResolutionResultHandlerTests {
|
|||
|
||||
ViewResolutionResultHandler resultHandler = createResultHandler(new TestViewResolver("account"));
|
||||
Mono<Void> mono = resultHandler.handleResult(this.exchange, handlerResult);
|
||||
Verifier.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.expectNextCount(0)
|
||||
.expectError(NotAcceptableStatusException.class)
|
||||
.verify();
|
||||
|
|
@ -293,7 +293,7 @@ public class ViewResolutionResultHandlerTests {
|
|||
}
|
||||
|
||||
private void assertResponseBody(String responseBody) {
|
||||
Verifier.create(this.response.getBody())
|
||||
StepVerifier.create(this.response.getBody())
|
||||
.consumeNextWith(buf -> assertEquals(responseBody,
|
||||
DataBufferTestUtils.dumpString(buf, StandardCharsets.UTF_8)))
|
||||
.expectComplete()
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import org.junit.Before;
|
|||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.context.ApplicationContextException;
|
||||
import org.springframework.context.support.GenericApplicationContext;
|
||||
|
|
@ -123,7 +123,7 @@ public class FreeMarkerViewTests {
|
|||
model.addAttribute("hello", "hi FreeMarker");
|
||||
view.render(model, null, this.exchange);
|
||||
|
||||
Verifier.create(this.response.getBody())
|
||||
StepVerifier.create(this.response.getBody())
|
||||
.consumeNextWith(buf -> {
|
||||
assertEquals("<html><body>hi FreeMarker</body></html>", asString(buf));
|
||||
})
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.codec.ByteBufferDecoder;
|
||||
import org.springframework.core.codec.StringDecoder;
|
||||
|
|
@ -80,7 +80,7 @@ public class BodyExtractorsTests {
|
|||
|
||||
Mono<String> result = extractor.extract(request, this.context);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectNext("foo")
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -100,7 +100,7 @@ public class BodyExtractorsTests {
|
|||
|
||||
Flux<String> result = extractor.extract(request, this.context);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectNext("foo")
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -127,7 +127,7 @@ public class BodyExtractorsTests {
|
|||
};
|
||||
|
||||
Flux<String> result = extractor.extract(request, emptyContext);
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectError(UnsupportedMediaTypeException.class)
|
||||
.verify();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.codec.ByteBufferEncoder;
|
||||
import org.springframework.core.codec.CharSequenceEncoder;
|
||||
|
|
@ -85,11 +85,11 @@ public class BodyInsertersTests {
|
|||
|
||||
MockServerHttpResponse response = new MockServerHttpResponse();
|
||||
Mono<Void> result = inserter.insert(response, this.context);
|
||||
Verifier.create(result).expectComplete().verify();
|
||||
StepVerifier.create(result).expectComplete().verify();
|
||||
|
||||
ByteBuffer byteBuffer = ByteBuffer.wrap(body.getBytes(UTF_8));
|
||||
DataBuffer buffer = new DefaultDataBufferFactory().wrap(byteBuffer);
|
||||
Verifier.create(response.getBody())
|
||||
StepVerifier.create(response.getBody())
|
||||
.expectNext(buffer)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -104,11 +104,11 @@ public class BodyInsertersTests {
|
|||
|
||||
MockServerHttpResponse response = new MockServerHttpResponse();
|
||||
Mono<Void> result = inserter.insert(response, this.context);
|
||||
Verifier.create(result).expectComplete().verify();
|
||||
StepVerifier.create(result).expectComplete().verify();
|
||||
|
||||
ByteBuffer byteBuffer = ByteBuffer.wrap("foo".getBytes(UTF_8));
|
||||
DataBuffer buffer = new DefaultDataBufferFactory().wrap(byteBuffer);
|
||||
Verifier.create(response.getBody())
|
||||
StepVerifier.create(response.getBody())
|
||||
.expectNext(buffer)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -123,11 +123,11 @@ public class BodyInsertersTests {
|
|||
|
||||
MockServerHttpResponse response = new MockServerHttpResponse();
|
||||
Mono<Void> result = inserter.insert(response, this.context);
|
||||
Verifier.create(result).expectComplete().verify();
|
||||
StepVerifier.create(result).expectComplete().verify();
|
||||
|
||||
byte[] expectedBytes = Files.readAllBytes(body.getFile().toPath());
|
||||
|
||||
Verifier.create(response.getBody())
|
||||
StepVerifier.create(response.getBody())
|
||||
.consumeNextWith(dataBuffer -> {
|
||||
byte[] resultBytes = new byte[dataBuffer.readableByteCount()];
|
||||
dataBuffer.read(resultBytes);
|
||||
|
|
@ -148,7 +148,7 @@ public class BodyInsertersTests {
|
|||
|
||||
MockServerHttpResponse response = new MockServerHttpResponse();
|
||||
Mono<Void> result = inserter.insert(response, this.context);
|
||||
Verifier.create(result).expectNextCount(0).expectComplete().verify();
|
||||
StepVerifier.create(result).expectNextCount(0).expectComplete().verify();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -161,7 +161,7 @@ public class BodyInsertersTests {
|
|||
|
||||
MockServerHttpResponse response = new MockServerHttpResponse();
|
||||
Mono<Void> result = inserter.insert(response, this.context);
|
||||
Verifier.create(result).expectNextCount(0).expectComplete().verify();
|
||||
StepVerifier.create(result).expectNextCount(0).expectComplete().verify();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@ import java.util.Collections;
|
|||
import org.jetbrains.annotations.NotNull;
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.codec.ByteBufferEncoder;
|
||||
|
|
@ -68,7 +68,7 @@ public class EncoderHttpMessageWriterTest {
|
|||
MediaType.APPLICATION_OCTET_STREAM, this.response, Collections.emptyMap());
|
||||
|
||||
assertThat(this.response.getHeaders().getContentType(), is(MediaType.APPLICATION_OCTET_STREAM));
|
||||
Verifier.create(this.response.getBodyAsString())
|
||||
StepVerifier.create(this.response.getBodyAsString())
|
||||
.expectNext(payload)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import java.util.Collections;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.io.ByteArrayResource;
|
||||
|
|
@ -73,7 +73,7 @@ public class ResourceHttpMessageWriterTests {
|
|||
Mono<Void> mono = this.writer.write(Mono.just(resource), null,
|
||||
ResolvableType.forClass(Resource.class),
|
||||
MediaType.TEXT_PLAIN, this.request, this.response, Collections.emptyMap());
|
||||
Verifier.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.expectNextCount(0)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -83,7 +83,7 @@ public class ResourceHttpMessageWriterTests {
|
|||
assertThat(this.response.getHeaders().getFirst(HttpHeaders.ACCEPT_RANGES), is("bytes"));
|
||||
|
||||
Mono<String> result = this.response.getBodyAsString();
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectNext("Spring Framework test resource content.")
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -94,7 +94,7 @@ public class ResourceHttpMessageWriterTests {
|
|||
this.request.getHeaders().setRange(Collections.singletonList(HttpRange.createByteRange(0, 5)));
|
||||
Mono<Void> mono = this.writer.write(Mono.just(resource), null, ResolvableType.forClass(Resource.class),
|
||||
MediaType.TEXT_PLAIN, this.request, this.response, Collections.emptyMap());
|
||||
Verifier.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.expectNextCount(0)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -105,7 +105,7 @@ public class ResourceHttpMessageWriterTests {
|
|||
assertThat(this.response.getHeaders().getContentLength(), is(6L));
|
||||
|
||||
Mono<String> result = this.response.getBodyAsString();
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectNext("Spring")
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -117,7 +117,7 @@ public class ResourceHttpMessageWriterTests {
|
|||
|
||||
Mono<Void> mono = this.writer.write(Mono.just(resource), null, ResolvableType.forClass(Resource.class),
|
||||
MediaType.TEXT_PLAIN, this.request, this.response, Collections.emptyMap());
|
||||
Verifier.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.expectNextCount(0)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import org.junit.Test;
|
|||
import org.junit.rules.ExpectedException;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.io.ByteArrayResource;
|
||||
|
|
@ -85,14 +85,14 @@ public class ResourceRegionHttpMessageWriterTests {
|
|||
|
||||
Mono<Void> mono = this.writer.write(Mono.just(region), ResolvableType.forClass(ResourceRegion.class),
|
||||
MediaType.TEXT_PLAIN, this.response, Collections.emptyMap());
|
||||
Verifier.create(mono).expectComplete().verify();
|
||||
StepVerifier.create(mono).expectComplete().verify();
|
||||
|
||||
assertThat(this.response.getHeaders().getContentType(), is(MediaType.TEXT_PLAIN));
|
||||
assertThat(this.response.getHeaders().getFirst(HttpHeaders.CONTENT_RANGE), is("bytes 0-5/39"));
|
||||
assertThat(this.response.getHeaders().getContentLength(), is(6L));
|
||||
|
||||
Mono<String> result = response.getBodyAsString();
|
||||
Verifier.create(result).expectNext("Spring").expectComplete().verify();
|
||||
StepVerifier.create(result).expectNext("Spring").expectComplete().verify();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -109,14 +109,14 @@ public class ResourceRegionHttpMessageWriterTests {
|
|||
|
||||
Mono<Void> mono = this.writer.write(regions, ResolvableType.forClass(ResourceRegion.class),
|
||||
MediaType.TEXT_PLAIN, this.response, hints);
|
||||
Verifier.create(mono).expectComplete().verify();
|
||||
StepVerifier.create(mono).expectComplete().verify();
|
||||
|
||||
HttpHeaders headers = this.response.getHeaders();
|
||||
assertThat(headers.getContentType().toString(), startsWith("multipart/byteranges;boundary=" + boundary));
|
||||
|
||||
Mono<String> result = response.getBodyAsString();
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.consumeNextWith(content -> {
|
||||
String[] ranges = StringUtils
|
||||
.tokenizeToStringArray(content, "\r\n", false, true);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import org.junit.Test;
|
|||
import org.reactivestreams.Publisher;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.io.buffer.AbstractDataBufferAllocatingTestCase;
|
||||
|
|
@ -73,7 +73,7 @@ public class ServerSentEventHttpMessageWriterTests extends AbstractDataBufferAll
|
|||
new MediaType("text", "event-stream"), outputMessage, Collections.emptyMap());
|
||||
|
||||
Publisher<Publisher<DataBuffer>> result = Flux.from(outputMessage.getBodyWithFlush());
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.consumeNextWith(sseConsumer("id:c42\n" + "event:foo\n" + "retry:123\n" +
|
||||
":bla\n:bla bla\n:bla bla bla\n" + "data:bar\n"))
|
||||
.expectComplete()
|
||||
|
|
@ -88,7 +88,7 @@ public class ServerSentEventHttpMessageWriterTests extends AbstractDataBufferAll
|
|||
new MediaType("text", "event-stream"), outputMessage, Collections.emptyMap());
|
||||
|
||||
Publisher<Publisher<DataBuffer>> result = outputMessage.getBodyWithFlush();
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.consumeNextWith(sseConsumer("data:foo\n"))
|
||||
.consumeNextWith(sseConsumer("data:bar\n"))
|
||||
.expectComplete()
|
||||
|
|
@ -103,7 +103,7 @@ public class ServerSentEventHttpMessageWriterTests extends AbstractDataBufferAll
|
|||
new MediaType("text", "event-stream"), outputMessage, Collections.emptyMap());
|
||||
|
||||
Publisher<Publisher<DataBuffer>> result = outputMessage.getBodyWithFlush();
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.consumeNextWith(sseConsumer("data:foo\ndata:bar\n"))
|
||||
.consumeNextWith(sseConsumer("data:foo\ndata:baz\n"))
|
||||
.expectComplete()
|
||||
|
|
@ -119,7 +119,7 @@ public class ServerSentEventHttpMessageWriterTests extends AbstractDataBufferAll
|
|||
new MediaType("text", "event-stream"), outputMessage, Collections.emptyMap());
|
||||
|
||||
Publisher<Publisher<DataBuffer>> result = outputMessage.getBodyWithFlush();
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.consumeNextWith(sseConsumer("data:", "{\"foo\":\"foofoo\",\"bar\":\"barbar\"}", "\n"))
|
||||
.consumeNextWith(sseConsumer("data:", "{\"foo\":\"foofoofoo\",\"bar\":\"barbarbar\"}", "\n"))
|
||||
.expectComplete()
|
||||
|
|
@ -128,7 +128,7 @@ public class ServerSentEventHttpMessageWriterTests extends AbstractDataBufferAll
|
|||
|
||||
private Consumer<Publisher<DataBuffer>> sseConsumer(String... expected) {
|
||||
return publisher -> {
|
||||
Verifier.Step builder = Verifier.create(publisher);
|
||||
StepVerifier.Step builder = StepVerifier.create(publisher);
|
||||
for (String value : expected) {
|
||||
builder = builder.consumeNextWith(stringConsumer(value));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import com.fasterxml.jackson.annotation.JsonView;
|
|||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.io.buffer.AbstractDataBufferAllocatingTestCase;
|
||||
|
|
@ -61,7 +61,7 @@ public class Jackson2JsonDecoderTests extends AbstractDataBufferAllocatingTestCa
|
|||
Flux<Object> flux = new Jackson2JsonDecoder().decode(source, elementType, null,
|
||||
Collections.emptyMap());
|
||||
|
||||
Verifier.create(flux)
|
||||
StepVerifier.create(flux)
|
||||
.expectNext(new Pojo("foofoo", "barbar"))
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -76,7 +76,7 @@ public class Jackson2JsonDecoderTests extends AbstractDataBufferAllocatingTestCa
|
|||
Mono<Object> mono = new Jackson2JsonDecoder().decodeToMono(source, elementType,
|
||||
null, Collections.emptyMap());
|
||||
|
||||
Verifier.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.expectNext(Arrays.asList(new Pojo("f1", "b1"), new Pojo("f2", "b2")))
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -91,7 +91,7 @@ public class Jackson2JsonDecoderTests extends AbstractDataBufferAllocatingTestCa
|
|||
Flux<Object> flux = new Jackson2JsonDecoder().decode(source, elementType, null,
|
||||
Collections.emptyMap());
|
||||
|
||||
Verifier.create(flux)
|
||||
StepVerifier.create(flux)
|
||||
.expectNext(new Pojo("f1", "b1"))
|
||||
.expectNext(new Pojo("f2", "b2"))
|
||||
.expectComplete()
|
||||
|
|
@ -107,7 +107,7 @@ public class Jackson2JsonDecoderTests extends AbstractDataBufferAllocatingTestCa
|
|||
Flux<JacksonViewBean> flux = new Jackson2JsonDecoder()
|
||||
.decode(source, elementType, null, hints).cast(JacksonViewBean.class);
|
||||
|
||||
Verifier.create(flux)
|
||||
StepVerifier.create(flux)
|
||||
.consumeNextWith(b -> {
|
||||
assertTrue(b.getWithView1().equals("with"));
|
||||
assertNull(b.getWithView2());
|
||||
|
|
@ -124,7 +124,7 @@ public class Jackson2JsonDecoderTests extends AbstractDataBufferAllocatingTestCa
|
|||
Mono<Object> mono = new Jackson2JsonDecoder().decodeToMono(source, elementType,
|
||||
null, Collections.emptyMap());
|
||||
|
||||
Verifier.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.expectNextCount(0)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import com.fasterxml.jackson.annotation.JsonView;
|
|||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.io.buffer.AbstractDataBufferAllocatingTestCase;
|
||||
|
|
@ -65,7 +65,7 @@ public class Jackson2JsonEncoderTests extends AbstractDataBufferAllocatingTestCa
|
|||
ResolvableType type = ResolvableType.forClass(Pojo.class);
|
||||
Flux<DataBuffer> output = this.encoder.encode(source, this.bufferFactory, type, null, Collections.emptyMap());
|
||||
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.consumeNextWith(stringConsumer("["))
|
||||
.consumeNextWith(stringConsumer("{\"foo\":\"foo\",\"bar\":\"bar\"}"))
|
||||
.consumeNextWith(stringConsumer(","))
|
||||
|
|
@ -83,7 +83,7 @@ public class Jackson2JsonEncoderTests extends AbstractDataBufferAllocatingTestCa
|
|||
ResolvableType type = ResolvableType.forClass(ParentClass.class);
|
||||
Flux<DataBuffer> output = this.encoder.encode(source, this.bufferFactory, type, null, Collections.emptyMap());
|
||||
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.consumeNextWith(stringConsumer("["))
|
||||
.consumeNextWith(stringConsumer("{\"type\":\"foo\"}"))
|
||||
.consumeNextWith(stringConsumer(","))
|
||||
|
|
@ -104,7 +104,7 @@ public class Jackson2JsonEncoderTests extends AbstractDataBufferAllocatingTestCa
|
|||
Map<String, Object> hints = Collections.singletonMap(Jackson2JsonEncoder.JSON_VIEW_HINT, MyJacksonView1.class);
|
||||
Flux<DataBuffer> output = this.encoder.encode(Mono.just(bean), this.bufferFactory, type, null, hints);
|
||||
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.consumeNextWith(stringConsumer("{\"withView1\":\"with\"}"))
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import java.util.Collections;
|
|||
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.io.buffer.AbstractDataBufferAllocatingTestCase;
|
||||
import org.springframework.core.io.buffer.DataBuffer;
|
||||
|
|
@ -38,7 +38,7 @@ public class JsonObjectDecoderTests extends AbstractDataBufferAllocatingTestCase
|
|||
Flux.just(stringBuffer("{\"foo\": \"foofoo\", \"bar\": \"barbar\"}"));
|
||||
Flux<String> output =
|
||||
decoder.decode(source, null, null, Collections.emptyMap()).map(JsonObjectDecoderTests::toString);
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.expectNext("{\"foo\": \"foofoo\", \"bar\": \"barbar\"}")
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -51,7 +51,7 @@ public class JsonObjectDecoderTests extends AbstractDataBufferAllocatingTestCase
|
|||
stringBuffer(", \"bar\": \"barbar\"}"));
|
||||
Flux<String> output =
|
||||
decoder.decode(source, null, null, Collections.emptyMap()).map(JsonObjectDecoderTests::toString);
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.expectNext("{\"foo\": \"foofoo\", \"bar\": \"barbar\"}")
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -65,7 +65,7 @@ public class JsonObjectDecoderTests extends AbstractDataBufferAllocatingTestCase
|
|||
"[{\"foo\": \"foofoo\", \"bar\": \"barbar\"},{\"foo\": \"foofoofoo\", \"bar\": \"barbarbar\"}]"));
|
||||
Flux<String> output =
|
||||
decoder.decode(source, null, null, Collections.emptyMap()).map(JsonObjectDecoderTests::toString);
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.expectNext("{\"foo\": \"foofoo\", \"bar\": \"barbar\"}")
|
||||
.expectNext("{\"foo\": \"foofoofoo\", \"bar\": \"barbarbar\"}")
|
||||
.expectComplete()
|
||||
|
|
@ -73,7 +73,7 @@ public class JsonObjectDecoderTests extends AbstractDataBufferAllocatingTestCase
|
|||
|
||||
source = Flux.just(stringBuffer("[{\"foo\": \"bar\"},{\"foo\": \"baz\"}]"));
|
||||
output = decoder.decode(source, null, null, Collections.emptyMap()).map(JsonObjectDecoderTests::toString);
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.expectNext("{\"foo\": \"bar\"}")
|
||||
.expectNext("{\"foo\": \"baz\"}")
|
||||
.expectComplete()
|
||||
|
|
@ -89,7 +89,7 @@ public class JsonObjectDecoderTests extends AbstractDataBufferAllocatingTestCase
|
|||
": \"barbar\"},{\"foo\": \"foofoofoo\", \"bar\": \"barbarbar\"}]"));
|
||||
Flux<String> output =
|
||||
decoder.decode(source, null, null, Collections.emptyMap()).map(JsonObjectDecoderTests::toString);
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.expectNext("{\"foo\": \"foofoo\", \"bar\": \"barbar\"}")
|
||||
.expectNext("{\"foo\": \"foofoofoo\", \"bar\": \"barbarbar\"}")
|
||||
.expectComplete()
|
||||
|
|
@ -101,7 +101,7 @@ public class JsonObjectDecoderTests extends AbstractDataBufferAllocatingTestCase
|
|||
stringBuffer("o\": \"baz\"}"),
|
||||
stringBuffer("]"));
|
||||
output = decoder.decode(source, null, null, Collections.emptyMap()).map(JsonObjectDecoderTests::toString);
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.expectNext("{\"foo\": \"bar\"}")
|
||||
.expectNext("{\"foo\": \"baz\"}")
|
||||
.expectComplete()
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import javax.xml.stream.events.XMLEvent;
|
|||
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.io.buffer.AbstractDataBufferAllocatingTestCase;
|
||||
|
|
@ -91,7 +91,7 @@ public class Jaxb2XmlDecoderTests extends AbstractDataBufferAllocatingTestCase {
|
|||
.decode(Flux.just(stringBuffer(POJO_ROOT)), null, null, Collections.emptyMap());
|
||||
Flux<List<XMLEvent>> result = this.decoder.split(xmlEvents, new QName("pojo"));
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.consumeNextWith(events -> {
|
||||
assertEquals(8, events.size());
|
||||
assertStartElement(events.get(0), "pojo");
|
||||
|
|
@ -114,7 +114,7 @@ public class Jaxb2XmlDecoderTests extends AbstractDataBufferAllocatingTestCase {
|
|||
Flux<List<XMLEvent>> result = this.decoder.split(xmlEvents, new QName("pojo"));
|
||||
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.consumeNextWith(events -> {
|
||||
assertEquals(8, events.size());
|
||||
assertStartElement(events.get(0), "pojo");
|
||||
|
|
@ -162,7 +162,7 @@ public class Jaxb2XmlDecoderTests extends AbstractDataBufferAllocatingTestCase {
|
|||
Flux<Object> output = this.decoder.decode(source, ResolvableType.forClass(Pojo.class),
|
||||
null, Collections.emptyMap());
|
||||
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.expectNext(new Pojo("foofoo", "barbar"))
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -174,7 +174,7 @@ public class Jaxb2XmlDecoderTests extends AbstractDataBufferAllocatingTestCase {
|
|||
Flux<Object> output = this.decoder.decode(source, ResolvableType.forClass(TypePojo.class),
|
||||
null, Collections.emptyMap());
|
||||
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.expectNext(new TypePojo("foofoo", "barbar"))
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -186,7 +186,7 @@ public class Jaxb2XmlDecoderTests extends AbstractDataBufferAllocatingTestCase {
|
|||
Flux<Object> output = this.decoder.decode(source, ResolvableType.forClass(Pojo.class),
|
||||
null, Collections.emptyMap());
|
||||
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.expectNext(new Pojo("foo", "bar"))
|
||||
.expectNext(new Pojo("foofoo", "barbar"))
|
||||
.expectComplete()
|
||||
|
|
@ -199,7 +199,7 @@ public class Jaxb2XmlDecoderTests extends AbstractDataBufferAllocatingTestCase {
|
|||
Flux<Object> output = this.decoder.decode(source, ResolvableType.forClass(TypePojo.class),
|
||||
null, Collections.emptyMap());
|
||||
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.expectNext(new TypePojo("foo", "bar"))
|
||||
.expectNext(new TypePojo("foofoo", "barbar"))
|
||||
.expectComplete()
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import java.util.Collections;
|
|||
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.io.buffer.AbstractDataBufferAllocatingTestCase;
|
||||
|
|
@ -69,7 +69,7 @@ public class Jaxb2XmlEncoderTests extends AbstractDataBufferAllocatingTestCase {
|
|||
ResolvableType.forClass(Pojo.class),
|
||||
MediaType.APPLICATION_XML, Collections.emptyMap());
|
||||
|
||||
Verifier.create(output)
|
||||
StepVerifier.create(output)
|
||||
.consumeNextWith(dataBuffer -> {
|
||||
try {
|
||||
String s = DataBufferTestUtils
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import javax.xml.stream.events.XMLEvent;
|
|||
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.io.buffer.AbstractDataBufferAllocatingTestCase;
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ public class XmlEventDecoderTests extends AbstractDataBufferAllocatingTestCase {
|
|||
Flux<XMLEvent> events =
|
||||
this.decoder.decode(Flux.just(stringBuffer(XML)), null, null, Collections.emptyMap());
|
||||
|
||||
Verifier.create(events)
|
||||
StepVerifier.create(events)
|
||||
.consumeNextWith(e -> assertTrue(e.isStartDocument()))
|
||||
.consumeNextWith(e -> assertStartElement(e, "pojo"))
|
||||
.consumeNextWith(e -> assertStartElement(e, "foo"))
|
||||
|
|
@ -68,7 +68,7 @@ public class XmlEventDecoderTests extends AbstractDataBufferAllocatingTestCase {
|
|||
Flux<XMLEvent> events =
|
||||
this.decoder.decode(Flux.just(stringBuffer(XML)), null, null, Collections.emptyMap());
|
||||
|
||||
Verifier.create(events)
|
||||
StepVerifier.create(events)
|
||||
.consumeNextWith(e -> assertTrue(e.isStartDocument()))
|
||||
.consumeNextWith(e -> assertStartElement(e, "pojo"))
|
||||
.consumeNextWith(e -> assertStartElement(e, "foo"))
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import org.junit.Test;
|
|||
import org.reactivestreams.Publisher;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.core.io.buffer.DataBuffer;
|
||||
import org.springframework.http.client.reactive.ReactorClientHttpConnector;
|
||||
|
|
@ -56,7 +56,7 @@ public class FlushingIntegrationTests extends AbstractHttpHandlerIntegrationTest
|
|||
.takeUntil(s -> s.endsWith("data1"))
|
||||
.reduce((s1, s2) -> s1 + s2);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectNext("data0data1")
|
||||
.expectComplete()
|
||||
.verify(Duration.ofSeconds(5L));
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import java.util.Optional;
|
|||
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
|
@ -97,7 +97,7 @@ public class ExchangeFilterFunctionsTests {
|
|||
|
||||
Mono<ClientResponse> result = standardErrors.filter(request, exchange);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectNext(response)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -114,7 +114,7 @@ public class ExchangeFilterFunctionsTests {
|
|||
|
||||
Mono<ClientResponse> result = standardErrors.filter(request, exchange);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectError(WebClientException.class)
|
||||
.verify();
|
||||
}
|
||||
|
|
@ -131,7 +131,7 @@ public class ExchangeFilterFunctionsTests {
|
|||
|
||||
Mono<ClientResponse> result = errorPredicate.filter(request, exchange);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectError(WebClientException.class)
|
||||
.verify();
|
||||
}
|
||||
|
|
@ -148,7 +148,7 @@ public class ExchangeFilterFunctionsTests {
|
|||
|
||||
Mono<ClientResponse> result = errorMapper.filter(request, exchange);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectError(IllegalStateException.class)
|
||||
.verify();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
|
@ -70,7 +70,7 @@ public class WebClientIntegrationTests {
|
|||
.exchange(request)
|
||||
.map(response -> response.headers().asHttpHeaders());
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.consumeNextWith(
|
||||
httpHeaders -> {
|
||||
assertEquals(MediaType.TEXT_PLAIN, httpHeaders.getContentType());
|
||||
|
|
@ -98,7 +98,7 @@ public class WebClientIntegrationTests {
|
|||
.exchange(request)
|
||||
.then(response -> response.body(toMono(String.class)));
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectNext("Hello Spring!")
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -120,7 +120,7 @@ public class WebClientIntegrationTests {
|
|||
Mono<String> result = this.webClient
|
||||
.retrieveMono(request, String.class);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectNext("Hello Spring!")
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -141,7 +141,7 @@ public class WebClientIntegrationTests {
|
|||
Flux<String> result = this.webClient
|
||||
.retrieveFlux(request, String.class);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectNext("Hello Spring!")
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -167,7 +167,7 @@ public class WebClientIntegrationTests {
|
|||
.exchange(request)
|
||||
.then(response -> response.body(toMono(String.class)));
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectNext(content)
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -192,7 +192,7 @@ public class WebClientIntegrationTests {
|
|||
.exchange(request)
|
||||
.then(response -> response.body(toMono(Pojo.class)));
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.consumeNextWith(p -> assertEquals("barbar", p.getBar()))
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -217,7 +217,7 @@ public class WebClientIntegrationTests {
|
|||
.exchange(request)
|
||||
.flatMap(response -> response.body(toFlux(Pojo.class)));
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.consumeNextWith(p -> assertThat(p.getBar(), Matchers.is("bar1")))
|
||||
.consumeNextWith(p -> assertThat(p.getBar(), Matchers.is("bar2")))
|
||||
.expectComplete()
|
||||
|
|
@ -246,7 +246,7 @@ public class WebClientIntegrationTests {
|
|||
.exchange(request)
|
||||
.then(response -> response.body(BodyExtractors.toMono(Pojo.class)));
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.consumeNextWith(p -> assertEquals("BARBAR", p.getBar()))
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -274,7 +274,7 @@ public class WebClientIntegrationTests {
|
|||
.exchange(request)
|
||||
.then(response -> response.body(toMono(String.class)));
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectNext("test")
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
@ -296,7 +296,7 @@ public class WebClientIntegrationTests {
|
|||
Mono<ClientResponse> result = this.webClient
|
||||
.exchange(request);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.consumeNextWith(response -> {
|
||||
assertEquals(HttpStatus.NOT_FOUND, response.statusCode());
|
||||
})
|
||||
|
|
@ -320,7 +320,7 @@ public class WebClientIntegrationTests {
|
|||
Mono<String> result = this.webClient
|
||||
.retrieveMono(request, String.class);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectError(WebClientException.class)
|
||||
.verify(Duration.ofSeconds(3));
|
||||
|
||||
|
|
@ -341,7 +341,7 @@ public class WebClientIntegrationTests {
|
|||
Mono<String> result = this.webClient
|
||||
.retrieveMono(request, String.class);
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectError(WebClientException.class)
|
||||
.verify(Duration.ofSeconds(3));
|
||||
|
||||
|
|
@ -369,7 +369,7 @@ public class WebClientIntegrationTests {
|
|||
Mono<String> result = filteredClient.exchange(request)
|
||||
.then(response -> response.body(toMono(String.class)));
|
||||
|
||||
Verifier.create(result)
|
||||
StepVerifier.create(result)
|
||||
.expectNext("Hello Spring!")
|
||||
.expectComplete()
|
||||
.verify();
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import java.time.Duration;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.subscriber.Verifier;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
|
@ -72,7 +72,7 @@ public class ResponseStatusExceptionHandlerTests {
|
|||
Throwable expected = new IllegalStateException();
|
||||
Mono<Void> mono = this.handler.handle(this.exchange, expected);
|
||||
|
||||
Verifier.create(mono)
|
||||
StepVerifier.create(mono)
|
||||
.consumeErrorWith(actual -> assertSame(expected, actual))
|
||||
.verify();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue