@Test public void needFullIndexing_should_return_true_if_no_incremental_index_done_yet_because_there_is_no_baseline_date() { final Long projectId = Long.valueOf(12); final Date lastFullIndexDate = new Date(); cut.lastFullIndexDates.put(projectId, lastFullIndexDate); final boolean needing = cut.needFullIndexing(projectId, new Date()); assertThat(needing).isTrue(); }
boolean needFullIndexing(Long projectId, Date now) { return lastFullIndexDates.get(projectId) == null || lastIncrementalIndexDates.get(projectId) == null || diffHours(now, lastFullIndexDates.get(projectId)) >= 1; }
DefectService { boolean needFullIndexing(Long projectId, Date now) { return lastFullIndexDates.get(projectId) == null || lastIncrementalIndexDates.get(projectId) == null || diffHours(now, lastFullIndexDates.get(projectId)) >= 1; } }
DefectService { boolean needFullIndexing(Long projectId, Date now) { return lastFullIndexDates.get(projectId) == null || lastIncrementalIndexDates.get(projectId) == null || diffHours(now, lastFullIndexDates.get(projectId)) >= 1; }  }
DefectService { boolean needFullIndexing(Long projectId, Date now) { return lastFullIndexDates.get(projectId) == null || lastIncrementalIndexDates.get(projectId) == null || diffHours(now, lastFullIndexDates.get(projectId)) >= 1; }  Optional<DefectAdapter> getAdapter(long projectId); List<DefectAdapter> getAdapters(); @Scheduled(fixedDelayString = "${ara.defectSyncSchedulingDelayInMilliseconds}", initialDelayString = "${ara.defectSyncSchedulingInitialDelayInMilliseconds}") @Transactional void updateStatuses(); @Transactional void fullIndex(Project project, DefectAdapter defectAdapter); @Transactional void incrementalIndex(Project project, DefectAdapter defectAdapter, Date since); @Transactional void refreshDefectExistences(long projectId); }
DefectService { boolean needFullIndexing(Long projectId, Date now) { return lastFullIndexDates.get(projectId) == null || lastIncrementalIndexDates.get(projectId) == null || diffHours(now, lastFullIndexDates.get(projectId)) >= 1; }  Optional<DefectAdapter> getAdapter(long projectId); List<DefectAdapter> getAdapters(); @Scheduled(fixedDelayString = "${ara.defectSyncSchedulingDelayInMilliseconds}", initialDelayString = "${ara.defectSyncSchedulingInitialDelayInMilliseconds}") @Transactional void updateStatuses(); @Transactional void fullIndex(Project project, DefectAdapter defectAdapter); @Transactional void incrementalIndex(Project project, DefectAdapter defectAdapter, Date since); @Transactional void refreshDefectExistences(long projectId);  }