### Question:
KenoDrawingCrawler { @Schedule(hour = "*", minute = "0", second = "0") public void crawlKenoDrawings() { if (runJobs.get()) { final ObjectId activityLogObjectId = new ObjectId(); activityLogController.saveActivityLog(activityLogObjectId, ActivityType.DRAWING_CRAWLER_KENO, "text", "Starting KENO drawing crawler."); try { progress = 0; int start = 13; int end = dateTimeService.getDateTimeNowEurope().getYear() - 2000; int progressIncrement = 100 / (end - start); for (int i = start; i <= end; i++) { progress += progressIncrement; Document document; if (i != end) { document = Jsoup.connect(URL + i + ".html").userAgent(USER_AGENT).referrer(REFERRER).get(); } else { document = Jsoup.connect(URL_CURRENT_YEAR).userAgent(USER_AGENT).referrer(REFERRER).get(); } Element select = document.getElementsByClass("spiel77Wrap").first(); final Elements results = select.getElementsByClass("item"); for (Element result : results) { String drawingDate = result.getElementsByTag("h3").first().text(); final Elements numbersLIs = result.select("table.keno tbody>tr>td"); List<Integer> allNumbers = new ArrayList<>(20); for (Element numberLi : numbersLIs) { try { allNumbers.add(Integer.parseInt(numberLi.text())); } catch (NumberFormatException nfex) { allNumbers.add(null); } } final KenoDrawing kenoDrawing = new KenoDrawing(); final String[] split = drawingDate.split(","); final String[] splitDate = split[1].trim().split("\\."); kenoDrawing.setDate(dateTimeService.getDateTimeNowEurope() .withYear(Integer.parseInt(splitDate[2])).withMonth(Integer.parseInt(splitDate[1])) .withDayOfMonth(Integer.parseInt(splitDate[0])).withHour(19).withMinute(10).withSecond(0).withNano(0)); List<Integer> drawingNumbers = allNumbers.subList(0, 20); drawingNumbers.sort(Integer::compare); kenoDrawing.setNumbers(drawingNumbers.toArray(new Integer[20])); final Query<KenoDrawing> query = datastore.createQuery(KenoDrawing.class).disableValidation(); query.and( query.criteria("date").equal(kenoDrawing.getDate()), query.criteria("className").equal(KenoDrawing.class.getName()) ); if (query.get() == null) { datastore.save(kenoDrawing); } } } activityLogController.saveActivityLog(activityLogObjectId, ActivityType.DRAWING_CRAWLER_KENO, "text", "Finished KENO drawing crawler."); } catch (Exception ex) { logger.log(Level.SEVERE, ex.getMessage(), ex); } } }  @Schedule(hour = "*", minute = "0", second = "0") void crawlKenoDrawings(); Integer getProgress(); void setProgress(Integer progress);  }### Answer:
@Test public void testCrawlKenoDrawings() throws Exception { KenoDrawingCrawler cut = new KenoDrawingCrawler(); cut.datastore = getDatastore(); cut.dateTimeService = new DateTimeService(); cut.crawlKenoDrawings(); final Query<KenoDrawing> query = getDatastore().createQuery(KenoDrawing.class).disableValidation(); final List<KenoDrawing> importedDrawings = query.asList(); assertThat(importedDrawings, notNullValue()); assertThat(importedDrawings.get(0).getLotteryIdentifier(), is(KenoLottery.IDENTIFIER)); assertThat(importedDrawings.size(), greaterThanOrEqualTo(1369)); }