@Test public void getAll() { StatisticDocument statisticDocument1 = new StatisticDocument(); statisticDocument1.setId("Stat1"); Mockito.when(repository.findAll()).thenReturn(Flux.just(statisticDocument1)); Flux<StatisticDocument> source = stub.getAll(); StepVerifier.create(source) .expectNext(statisticDocument1) .expectComplete().verify(); }
@Override public Flux<StatisticDocument> getAll() { log.debug(() -> "getAll() ->"); return repository.findAll() .takeLast(100); }
StatisticServiceImpl implements StatisticService { @Override public Flux<StatisticDocument> getAll() { log.debug(() -> "getAll() ->"); return repository.findAll() .takeLast(100); } }
StatisticServiceImpl implements StatisticService { @Override public Flux<StatisticDocument> getAll() { log.debug(() -> "getAll() ->"); return repository.findAll() .takeLast(100); } @Autowired  StatisticServiceImpl(StatisticRepository repository,
                              ShortenerSubscriber shortenerSubscriber,
                              UserSubscriber userSubscriber); }
StatisticServiceImpl implements StatisticService { @Override public Flux<StatisticDocument> getAll() { log.debug(() -> "getAll() ->"); return repository.findAll() .takeLast(100); } @Autowired  StatisticServiceImpl(StatisticRepository repository,
                              ShortenerSubscriber shortenerSubscriber,
                              UserSubscriber userSubscriber); void subscribeToEvents(); @Override Flux<StatisticDocument> getAll(); @Override Mono<Long> eventsCount(EventType type); }
StatisticServiceImpl implements StatisticService { @Override public Flux<StatisticDocument> getAll() { log.debug(() -> "getAll() ->"); return repository.findAll() .takeLast(100); } @Autowired  StatisticServiceImpl(StatisticRepository repository,
                              ShortenerSubscriber shortenerSubscriber,
                              UserSubscriber userSubscriber); void subscribeToEvents(); @Override Flux<StatisticDocument> getAll(); @Override Mono<Long> eventsCount(EventType type);  }