|
|
|
|
@ -121,7 +121,8 @@ public class RSocketClientToServerIntegrationTests {
@@ -121,7 +121,8 @@ public class RSocketClientToServerIntegrationTests {
|
|
|
|
|
|
|
|
|
|
StepVerifier.create(result) |
|
|
|
|
.expectNext("Hello 1").expectNext("Hello 2").expectNext("Hello 3") |
|
|
|
|
.verifyComplete(); |
|
|
|
|
.expectComplete() |
|
|
|
|
.verify(Duration.ofSeconds(5)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
@ -131,7 +132,8 @@ public class RSocketClientToServerIntegrationTests {
@@ -131,7 +132,8 @@ public class RSocketClientToServerIntegrationTests {
|
|
|
|
|
|
|
|
|
|
StepVerifier.create(result) |
|
|
|
|
.expectNext("Hello 1 async").expectNext("Hello 2 async").expectNext("Hello 3 async") |
|
|
|
|
.verifyComplete(); |
|
|
|
|
.expectComplete() |
|
|
|
|
.verify(Duration.ofSeconds(5)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
@ -141,7 +143,7 @@ public class RSocketClientToServerIntegrationTests {
@@ -141,7 +143,7 @@ public class RSocketClientToServerIntegrationTests {
|
|
|
|
|
StepVerifier.create(result) |
|
|
|
|
.expectNext("Hello 0").expectNextCount(6).expectNext("Hello 7") |
|
|
|
|
.thenCancel() |
|
|
|
|
.verify(); |
|
|
|
|
.verify(Duration.ofSeconds(5)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
@ -152,37 +154,46 @@ public class RSocketClientToServerIntegrationTests {
@@ -152,37 +154,46 @@ public class RSocketClientToServerIntegrationTests {
|
|
|
|
|
|
|
|
|
|
StepVerifier.create(result) |
|
|
|
|
.expectNext("Hello 1 async").expectNextCount(8).expectNext("Hello 10 async") |
|
|
|
|
.verifyComplete(); |
|
|
|
|
.thenCancel() // https://github.com/rsocket/rsocket-java/issues/613
|
|
|
|
|
.verify(Duration.ofSeconds(5)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void voidReturnValue() { |
|
|
|
|
Flux<String> result = requester.route("void-return-value").data("Hello").retrieveFlux(String.class); |
|
|
|
|
StepVerifier.create(result).verifyComplete(); |
|
|
|
|
StepVerifier.create(result).expectComplete().verify(Duration.ofSeconds(5)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void voidReturnValueFromExceptionHandler() { |
|
|
|
|
Flux<String> result = requester.route("void-return-value").data("bad").retrieveFlux(String.class); |
|
|
|
|
StepVerifier.create(result).verifyComplete(); |
|
|
|
|
StepVerifier.create(result).expectComplete().verify(Duration.ofSeconds(5)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void handleWithThrownException() { |
|
|
|
|
Mono<String> result = requester.route("thrown-exception").data("a").retrieveMono(String.class); |
|
|
|
|
StepVerifier.create(result).expectNext("Invalid input error handled").verifyComplete(); |
|
|
|
|
StepVerifier.create(result) |
|
|
|
|
.expectNext("Invalid input error handled") |
|
|
|
|
.expectComplete() |
|
|
|
|
.verify(Duration.ofSeconds(5)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void handleWithErrorSignal() { |
|
|
|
|
Mono<String> result = requester.route("error-signal").data("a").retrieveMono(String.class); |
|
|
|
|
StepVerifier.create(result).expectNext("Invalid input error handled").verifyComplete(); |
|
|
|
|
StepVerifier.create(result) |
|
|
|
|
.expectNext("Invalid input error handled") |
|
|
|
|
.expectComplete() |
|
|
|
|
.verify(Duration.ofSeconds(5)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void noMatchingRoute() { |
|
|
|
|
Mono<String> result = requester.route("invalid").data("anything").retrieveMono(String.class); |
|
|
|
|
StepVerifier.create(result).verifyErrorMessage("No handler for destination 'invalid'"); |
|
|
|
|
StepVerifier.create(result) |
|
|
|
|
.expectErrorMessage("No handler for destination 'invalid'") |
|
|
|
|
.verify(Duration.ofSeconds(5)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|