@Test public void testGetIncidents() { YearMonth from = YearMonth.of(2017, 01); YearMonth to = YearMonth.of(2017, 02); StepVerifier.create(new CrawlerImpl().getSightings(from, to)) .expectNextMatches(s -> { LocalDateTime eventDateTime = s.getEventDateTime(); return eventDateTime.getYear() == 2017 && (eventDateTime.getMonth().equals(Month.JANUARY) || eventDateTime.getMonth().equals(Month.FEBRUARY)); }) .thenCancel() .verify(Duration.ofSeconds(5)); }
@Override public Flux<Sighting> getSightings(YearMonth from, YearMonth to) { int months = (int) from.until(to, ChronoUnit.MONTHS) + 1; return Flux.range(0, months) .map(from::plusMonths) .flatMap(this::getSightings); }
CrawlerImpl implements Crawler { @Override public Flux<Sighting> getSightings(YearMonth from, YearMonth to) { int months = (int) from.until(to, ChronoUnit.MONTHS) + 1; return Flux.range(0, months) .map(from::plusMonths) .flatMap(this::getSightings); } }
CrawlerImpl implements Crawler { @Override public Flux<Sighting> getSightings(YearMonth from, YearMonth to) { int months = (int) from.until(to, ChronoUnit.MONTHS) + 1; return Flux.range(0, months) .map(from::plusMonths) .flatMap(this::getSightings); }  }
CrawlerImpl implements Crawler { @Override public Flux<Sighting> getSightings(YearMonth from, YearMonth to) { int months = (int) from.until(to, ChronoUnit.MONTHS) + 1; return Flux.range(0, months) .map(from::plusMonths) .flatMap(this::getSightings); }  @Override Flux<Sighting> getSightings(YearMonth from, YearMonth to); @Override Flux<Sighting> getSightings(YearMonth yearMonth); }
CrawlerImpl implements Crawler { @Override public Flux<Sighting> getSightings(YearMonth from, YearMonth to) { int months = (int) from.until(to, ChronoUnit.MONTHS) + 1; return Flux.range(0, months) .map(from::plusMonths) .flatMap(this::getSightings); }  @Override Flux<Sighting> getSightings(YearMonth from, YearMonth to); @Override Flux<Sighting> getSightings(YearMonth yearMonth);  }