From 137bb6f27a504fd9bf99171c95275f99e9631bcc Mon Sep 17 00:00:00 2001 From: Ryan Michela Date: Tue, 10 Jul 2018 09:38:21 -0700 Subject: [PATCH] Fix ChainedCallIntegrationTest --- .../ChainedCallIntegrationTest.java | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) 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));