Tag: spring-webflux

  • How to test multiple input events using StepVerifier

    How to test multiple input events using StepVerifier

    0 I want to test receiving multiple events for GraphQl subscription. For this I tried to use the following code: StepVerifier stepVerifier = StepVerifier.create(flux) .expectSubscription() .expectNext(expectingEvent1) .expectNext(expectingEvent2) .thenCancel() .verifyLater(); graphQlService.sendEvent(sendingEvent1); graphQlService.sendEvent(sendingEvent2); stepVerifier.verify(); Method sendEvent contains the following logic: fluxSinks.forEach(fluxSink -> fluxSink.next(response)); But it seems that in this test only the first event is sent, judging…