33import static org .junit .jupiter .api .Assertions .assertEquals ;
44import static org .junit .jupiter .api .Assertions .assertThrows ;
55import static org .junit .jupiter .api .Assertions .assertTrue ;
6+ import static reactor .core .publisher .Sinks .EmitFailureHandler .FAIL_FAST ;
67
78import io .scalecube .services .api .ServiceMessage ;
89import io .scalecube .services .sut .GreetingRequest ;
@@ -292,8 +293,8 @@ public void test_local_bidi_greeting_expect_NotAuthorized() {
292293
293294 // call the service.
294295
295- requests .tryEmitNext (new GreetingRequest ("joe-1" ));
296- requests .tryEmitComplete ( );
296+ requests .emitNext (new GreetingRequest ("joe-1" ), FAIL_FAST );
297+ requests .emitComplete ( FAIL_FAST );
297298
298299 StepVerifier .create (responses )
299300 .expectErrorMessage ("Not authorized" )
@@ -318,7 +319,7 @@ public void test_local_bidi_greeting_message_expect_NotAuthorized() {
318319 .map (ServiceMessage ::data );
319320
320321 StepVerifier .create (responses )
321- .then (() -> requests .tryEmitNext (new GreetingRequest ("joe-1" )))
322+ .then (() -> requests .emitNext (new GreetingRequest ("joe-1" ), FAIL_FAST ))
322323 .expectErrorMessage ("Not authorized" )
323324 .verify (Duration .ofSeconds (3 ));
324325 }
@@ -332,10 +333,10 @@ public void test_local_bidi_greeting_expect_GreetingResponse() {
332333
333334 // call the service.
334335
335- requests .tryEmitNext (new GreetingRequest ("joe-1" ));
336- requests .tryEmitNext (new GreetingRequest ("joe-2" ));
337- requests .tryEmitNext (new GreetingRequest ("joe-3" ));
338- requests .tryEmitComplete ( );
336+ requests .emitNext (new GreetingRequest ("joe-1" ), FAIL_FAST );
337+ requests .emitNext (new GreetingRequest ("joe-2" ), FAIL_FAST );
338+ requests .emitNext (new GreetingRequest ("joe-3" ), FAIL_FAST );
339+ requests .emitComplete ( FAIL_FAST );
339340
340341 // call the service.
341342 Flux <GreetingResponse > responses =
@@ -366,13 +367,13 @@ public void test_local_bidi_greeting_expect_message_GreetingResponse() {
366367 .map (ServiceMessage ::data );
367368
368369 StepVerifier .create (responses )
369- .then (() -> requests .tryEmitNext (new GreetingRequest ("joe-1" )))
370+ .then (() -> requests .emitNext (new GreetingRequest ("joe-1" ), FAIL_FAST ))
370371 .expectNextMatches (resp -> resp .getResult ().equals (" hello to: joe-1" ))
371- .then (() -> requests .tryEmitNext (new GreetingRequest ("joe-2" )))
372+ .then (() -> requests .emitNext (new GreetingRequest ("joe-2" ), FAIL_FAST ))
372373 .expectNextMatches (resp -> resp .getResult ().equals (" hello to: joe-2" ))
373- .then (() -> requests .tryEmitNext (new GreetingRequest ("joe-3" )))
374+ .then (() -> requests .emitNext (new GreetingRequest ("joe-3" ), FAIL_FAST ))
374375 .expectNextMatches (resp -> resp .getResult ().equals (" hello to: joe-3" ))
375- .then (requests :: tryEmitComplete )
376+ .then (() -> requests . emitComplete ( FAIL_FAST ) )
376377 .expectComplete ()
377378 .verify (Duration .ofSeconds (3 ));
378379 }
0 commit comments