use of de.symeda.sormas.backend.caze.CaseFacadeEjb.CaseFacadeEjbLocal in project SORMAS-Project by hzi-braunschweig.
the class CaseFacadeEjbTest method testArchiveAllArchivableCases.
@Test
public void testArchiveAllArchivableCases() {
RDCFEntities rdcf = creator.createRDCFEntities();
UserReferenceDto user = creator.createUser(rdcf).toReference();
PersonReferenceDto person = creator.createPerson("Walter", "Schuster").toReference();
// One archived case
CaseDataDto case1 = creator.createCase(user, person, rdcf);
CaseFacadeEjbLocal cut = getBean(CaseFacadeEjbLocal.class);
cut.archive(case1.getUuid(), null);
// One other case
CaseDataDto case2 = creator.createCase(user, person, rdcf);
assertTrue(cut.isArchived(case1.getUuid()));
assertFalse(cut.isArchived(case2.getUuid()));
// Case of "today" shouldn't be archived
cut.archiveAllArchivableCases(70, LocalDate.now().plusDays(69));
assertTrue(cut.isArchived(case1.getUuid()));
assertFalse(cut.isArchived(case2.getUuid()));
// Case of "yesterday" should be archived
cut.archiveAllArchivableCases(70, LocalDate.now().plusDays(71));
assertTrue(cut.isArchived(case1.getUuid()));
assertTrue(cut.isArchived(case2.getUuid()));
}
Aggregations