  @Test
  public void numberOfViews() {

    StatisticDocument statisticDocument1 = new StatisticDocument();
    statisticDocument1.setId("Stat1");
    statisticDocument1.setEventType(EventType.SHORTENER_VIEWED);

    StatisticDocument statisticDocument2 = new StatisticDocument();
    statisticDocument2.setId("Stat2");
    statisticDocument2.setEventType(EventType.SHORTENER_VIEWED);

    Mockito.when(repository.findByEventType(any(EventType.class))).thenReturn(Flux.just
        (statisticDocument1,
            statisticDocument2));

    Mono<Long> source = stub.eventsCount(EventType.SHORTENER_VIEWED);
    StepVerifier.create(source)
        .expectNext(2L)
        .expectComplete().verify();
  }