diff --git a/reactor/reactor-grpc-test/src/test/java/com/salesforce/reactorgrpc/ChainedCallIntegrationTest.java b/reactor/reactor-grpc-test/src/test/java/com/salesforce/reactorgrpc/ChainedCallIntegrationTest.java index ee249fe2..1feb9035 100644 --- a/reactor/reactor-grpc-test/src/test/java/com/salesforce/reactorgrpc/ChainedCallIntegrationTest.java +++ b/reactor/reactor-grpc-test/src/test/java/com/salesforce/reactorgrpc/ChainedCallIntegrationTest.java @@ -80,24 +80,30 @@ public void stopServer() throws InterruptedException { public void servicesCanCallOtherServices() throws InterruptedException { ReactorGreeterGrpc.ReactorGreeterStub stub = ReactorGreeterGrpc.newReactorStub(channel); - Mono input = Mono.just(request("X")); - Mono one = stub.sayHello(input) + Mono chain = Mono.just(request("X")) + // one -> one + .compose(stub::sayHello) .map(ChainedCallIntegrationTest::bridge) - .doOnSuccess(System.out::println); - Flux two = stub.sayHelloRespStream(one) + .doOnSuccess(System.out::println) + // one -> many + .as(stub::sayHelloRespStream) .map(ChainedCallIntegrationTest::bridge) - .doOnNext(System.out::println); - Flux three = stub.sayHelloBothStream(two) + .doOnNext(System.out::println) + // many -> many + .compose(stub::sayHelloBothStream) .map(ChainedCallIntegrationTest::bridge) - .doOnNext(System.out::println); - Mono four = stub.sayHelloReqStream(three) + .doOnNext(System.out::println) + // many -> one + .as(stub::sayHelloReqStream) .map(ChainedCallIntegrationTest::bridge) - .doOnSuccess(System.out::println); - Mono five = stub.sayHello(four) + .doOnSuccess(System.out::println) + // one -> one + .compose(stub::sayHello) .map(HelloResponse::getMessage) .doOnSuccess(System.out::println); - StepVerifier.create(five) + + StepVerifier.create(chain) .expectNext("[<{[X]}> :: :: <\\[X]\\> :: <([X])>]") .expectComplete() .verify(Duration.ofSeconds(2));