@Test public void testAddHistoryItem() { WebHookHistoryRepository historyRepository = setupMocks(); assertEquals(2, historyRepository.getTotalCount()); }
@Override public void addHistoryItem(WebHookHistoryItem histoyItem) { this.webHookHistoryItems.put(histoyItem.getWebHookExecutionStats().getTrackingId(), histoyItem); if (histoyItem.getWebHookExecutionStats().isEnabled() && ! histoyItem.getWebHookExecutionStats().isErrored()) { okCounter.incrementAndGet(); } else if (histoyItem.getWebHookExecutionStats().isEnabled()) { erroredCounter.incrementAndGet(); } else if (! histoyItem.getWebHookExecutionStats().isEnabled()) { disabledCounter.incrementAndGet(); } totalCounter.incrementAndGet(); }
WebHookHistoryRepositoryImpl implements WebHookHistoryRepository { @Override public void addHistoryItem(WebHookHistoryItem histoyItem) { this.webHookHistoryItems.put(histoyItem.getWebHookExecutionStats().getTrackingId(), histoyItem); if (histoyItem.getWebHookExecutionStats().isEnabled() && ! histoyItem.getWebHookExecutionStats().isErrored()) { okCounter.incrementAndGet(); } else if (histoyItem.getWebHookExecutionStats().isEnabled()) { erroredCounter.incrementAndGet(); } else if (! histoyItem.getWebHookExecutionStats().isEnabled()) { disabledCounter.incrementAndGet(); } totalCounter.incrementAndGet(); } }
WebHookHistoryRepositoryImpl implements WebHookHistoryRepository { @Override public void addHistoryItem(WebHookHistoryItem histoyItem) { this.webHookHistoryItems.put(histoyItem.getWebHookExecutionStats().getTrackingId(), histoyItem); if (histoyItem.getWebHookExecutionStats().isEnabled() && ! histoyItem.getWebHookExecutionStats().isErrored()) { okCounter.incrementAndGet(); } else if (histoyItem.getWebHookExecutionStats().isEnabled()) { erroredCounter.incrementAndGet(); } else if (! histoyItem.getWebHookExecutionStats().isEnabled()) { disabledCounter.incrementAndGet(); } totalCounter.incrementAndGet(); }  }
WebHookHistoryRepositoryImpl implements WebHookHistoryRepository { @Override public void addHistoryItem(WebHookHistoryItem histoyItem) { this.webHookHistoryItems.put(histoyItem.getWebHookExecutionStats().getTrackingId(), histoyItem); if (histoyItem.getWebHookExecutionStats().isEnabled() && ! histoyItem.getWebHookExecutionStats().isErrored()) { okCounter.incrementAndGet(); } else if (histoyItem.getWebHookExecutionStats().isEnabled()) { erroredCounter.incrementAndGet(); } else if (! histoyItem.getWebHookExecutionStats().isEnabled()) { disabledCounter.incrementAndGet(); } totalCounter.incrementAndGet(); }  @Override void addHistoryItem(WebHookHistoryItem histoyItem); @Override WebHookHistoryItem getHistoryItem(String trackingId); @Override PagedList<WebHookHistoryItem> findHistoryItemsForProject(String projectId, int pageNumber, int pageSize); @Override PagedList<WebHookHistoryItem> findHistoryItemsForBuildType(String buildTypeId, int pageNumber, int pageSize); @Override PagedList<WebHookHistoryItem> findHistoryItemsForBuild(Long buildId, int pageNumber, int pageSize); @Override PagedList<WebHookHistoryItem> findHistoryItemsForWebHookConfigId(String webHookId, int pageNumber, int pageSize); @Override Map<String, Integer> findHistoryItemCountsForWebHookConfigId(String webhookId); @Override PagedList<WebHookHistoryItem> findHistoryErroredItems(int pageNumber, int pageSize); @Override PagedList<WebHookHistoryItem> findHistoryDisabledItems(int pageNumber, int pageSize); @Override PagedList<WebHookHistoryItem> findHistoryOkItems(int pageNumber, int pageSize); @Override PagedList<WebHookHistoryItem> findHistoryAllItems(int pageNumber, int pageSize); @Override Map<LocalDate, List<WebHookHistoryItem>> findHistoryDisabledItemsGroupedByDay(LocalDate untilDate, int numberOfDays); @Override Map<LocalDate, List<WebHookHistoryItem>> findHistoryErroredItemsGroupedByDay(LocalDate untilDate, int numberOfDays); @Override Map<LocalDate, List<WebHookHistoryItem>> findHistoryOkItemsGroupedByDay(LocalDate untilDate, int numberOfDays); @Override Map<LocalDate, List<WebHookHistoryItem>> findHistoryAllItemsGroupedByDay(LocalDate untilDate, int numberOfDays); @Override int getTotalCount(); @Override int getDisabledCount(); @Override int getErroredCount(); @Override int getOkCount(); @Override int getTotalStoreItems(); }
WebHookHistoryRepositoryImpl implements WebHookHistoryRepository { @Override public void addHistoryItem(WebHookHistoryItem histoyItem) { this.webHookHistoryItems.put(histoyItem.getWebHookExecutionStats().getTrackingId(), histoyItem); if (histoyItem.getWebHookExecutionStats().isEnabled() && ! histoyItem.getWebHookExecutionStats().isErrored()) { okCounter.incrementAndGet(); } else if (histoyItem.getWebHookExecutionStats().isEnabled()) { erroredCounter.incrementAndGet(); } else if (! histoyItem.getWebHookExecutionStats().isEnabled()) { disabledCounter.incrementAndGet(); } totalCounter.incrementAndGet(); }  @Override void addHistoryItem(WebHookHistoryItem histoyItem); @Override WebHookHistoryItem getHistoryItem(String trackingId); @Override PagedList<WebHookHistoryItem> findHistoryItemsForProject(String projectId, int pageNumber, int pageSize); @Override PagedList<WebHookHistoryItem> findHistoryItemsForBuildType(String buildTypeId, int pageNumber, int pageSize); @Override PagedList<WebHookHistoryItem> findHistoryItemsForBuild(Long buildId, int pageNumber, int pageSize); @Override PagedList<WebHookHistoryItem> findHistoryItemsForWebHookConfigId(String webHookId, int pageNumber, int pageSize); @Override Map<String, Integer> findHistoryItemCountsForWebHookConfigId(String webhookId); @Override PagedList<WebHookHistoryItem> findHistoryErroredItems(int pageNumber, int pageSize); @Override PagedList<WebHookHistoryItem> findHistoryDisabledItems(int pageNumber, int pageSize); @Override PagedList<WebHookHistoryItem> findHistoryOkItems(int pageNumber, int pageSize); @Override PagedList<WebHookHistoryItem> findHistoryAllItems(int pageNumber, int pageSize); @Override Map<LocalDate, List<WebHookHistoryItem>> findHistoryDisabledItemsGroupedByDay(LocalDate untilDate, int numberOfDays); @Override Map<LocalDate, List<WebHookHistoryItem>> findHistoryErroredItemsGroupedByDay(LocalDate untilDate, int numberOfDays); @Override Map<LocalDate, List<WebHookHistoryItem>> findHistoryOkItemsGroupedByDay(LocalDate untilDate, int numberOfDays); @Override Map<LocalDate, List<WebHookHistoryItem>> findHistoryAllItemsGroupedByDay(LocalDate untilDate, int numberOfDays); @Override int getTotalCount(); @Override int getDisabledCount(); @Override int getErroredCount(); @Override int getOkCount(); @Override int getTotalStoreItems();  }