コード例 #1
0
 @Test
 public void singleConversion() {
   Mono<User> mono = repository.findFirst();
   Single<User> single = fromMonoToSingle(mono);
   TestSubscriber<User> testSubscriber = new TestSubscriber<>();
   testSubscriber
       .bindTo(fromSingleToMono(single))
       .await()
       .assertValues(User.SKYLER)
       .assertComplete();
 }
コード例 #2
0
 @Test
 public void completableFutureConversion() {
   Mono<User> mono = repository.findFirst();
   CompletableFuture<User> future = fromMonoToCompletableFuture(mono);
   TestSubscriber<User> testSubscriber = new TestSubscriber<>();
   testSubscriber
       .bindTo(fromCompletableFutureToMono(future))
       .await()
       .assertValues(User.SKYLER)
       .assertComplete();
 }
コード例 #3
0
 @Test
 public void observableConversion() {
   Flux<User> flux = repository.findAll();
   Observable<User> observable = fromFluxToObservable(flux);
   TestSubscriber<User> testSubscriber = new TestSubscriber<>();
   testSubscriber
       .bindTo(fromObservableToFlux(observable))
       .await()
       .assertValues(User.SKYLER, User.JESSE, User.WALTER, User.SAUL)
       .assertComplete();
 }