@Test public void shouldEnrichmentTagsBeOverwritten_true_uploadTagMaxDate_isNotNull_tagMaxDate_isNull() { when(uploadEnrichmentTagRepository.findMaxCreationDate()).thenReturn(new DateTime(2012, 12, 12, 12, 13)); when(enrichmentTagRepository.findMaxCreationDate()).thenReturn(null); boolean shouldEnrichmentTagsBeOverwriten = uploadEnrichmentTagOverwriter.shouldEnrichmentTagsBeOverwritten(); assertTrue(shouldEnrichmentTagsBeOverwriten); }
public boolean shouldEnrichmentTagsBeOverwritten() { DateTime maxUploadEnrichmentTagCreationDate = uploadEnrichmentTagRepository.findMaxCreationDate(); if (maxUploadEnrichmentTagCreationDate != null) { DateTime maxEnrichmentTagCreationDate = enrichmentTagRepository.findMaxCreationDate(); if (maxEnrichmentTagCreationDate == null || maxUploadEnrichmentTagCreationDate.isAfter(maxEnrichmentTagCreationDate.getMillis())) { return true; } } return false; }
UploadEnrichmentTagOverwriter { public boolean shouldEnrichmentTagsBeOverwritten() { DateTime maxUploadEnrichmentTagCreationDate = uploadEnrichmentTagRepository.findMaxCreationDate(); if (maxUploadEnrichmentTagCreationDate != null) { DateTime maxEnrichmentTagCreationDate = enrichmentTagRepository.findMaxCreationDate(); if (maxEnrichmentTagCreationDate == null || maxUploadEnrichmentTagCreationDate.isAfter(maxEnrichmentTagCreationDate.getMillis())) { return true; } } return false; } }
UploadEnrichmentTagOverwriter { public boolean shouldEnrichmentTagsBeOverwritten() { DateTime maxUploadEnrichmentTagCreationDate = uploadEnrichmentTagRepository.findMaxCreationDate(); if (maxUploadEnrichmentTagCreationDate != null) { DateTime maxEnrichmentTagCreationDate = enrichmentTagRepository.findMaxCreationDate(); if (maxEnrichmentTagCreationDate == null || maxUploadEnrichmentTagCreationDate.isAfter(maxEnrichmentTagCreationDate.getMillis())) { return true; } } return false; }  }
UploadEnrichmentTagOverwriter { public boolean shouldEnrichmentTagsBeOverwritten() { DateTime maxUploadEnrichmentTagCreationDate = uploadEnrichmentTagRepository.findMaxCreationDate(); if (maxUploadEnrichmentTagCreationDate != null) { DateTime maxEnrichmentTagCreationDate = enrichmentTagRepository.findMaxCreationDate(); if (maxEnrichmentTagCreationDate == null || maxUploadEnrichmentTagCreationDate.isAfter(maxEnrichmentTagCreationDate.getMillis())) { return true; } } return false; }  boolean shouldEnrichmentTagsBeOverwritten(); @Transactional void overwriteEnrichmentTags(); @Autowired void setUploadEnrichmentTagRepository(UploadEnrichmentTagRepository uploadEnrichmentTagRepository); @Autowired void setEnrichmentTagRepository(EnrichmentTagRepository enrichmentTagRepository); @Autowired void setUploadEnrichmentTagCopier(UploadEnrichmentTagCopier uploadEnrichmentTagCopier); }
UploadEnrichmentTagOverwriter { public boolean shouldEnrichmentTagsBeOverwritten() { DateTime maxUploadEnrichmentTagCreationDate = uploadEnrichmentTagRepository.findMaxCreationDate(); if (maxUploadEnrichmentTagCreationDate != null) { DateTime maxEnrichmentTagCreationDate = enrichmentTagRepository.findMaxCreationDate(); if (maxEnrichmentTagCreationDate == null || maxUploadEnrichmentTagCreationDate.isAfter(maxEnrichmentTagCreationDate.getMillis())) { return true; } } return false; }  boolean shouldEnrichmentTagsBeOverwritten(); @Transactional void overwriteEnrichmentTags(); @Autowired void setUploadEnrichmentTagRepository(UploadEnrichmentTagRepository uploadEnrichmentTagRepository); @Autowired void setEnrichmentTagRepository(EnrichmentTagRepository enrichmentTagRepository); @Autowired void setUploadEnrichmentTagCopier(UploadEnrichmentTagCopier uploadEnrichmentTagCopier);  }