use of uk.ac.ebi.spot.goci.repository.CurationStatusRepository in project goci by EBISPOT.
the class HousekeepingOperationsServiceTest method createHousekeeping.
@Test
public void createHousekeeping() throws Exception {
// Stubbing
when(curationStatusRepository.findByStatus("Awaiting Curation")).thenReturn(AWAITING_CURATION);
when(curatorRepository.findByLastName("Level 1 Curator")).thenReturn(LEVEL_1_CURATOR);
Housekeeping housekeeping = housekeepingOperationsService.createHousekeeping();
verify(curationStatusRepository, times(1)).findByStatus("Awaiting Curation");
verify(curatorRepository, times(1)).findByLastName("Level 1 Curator");
verify(housekeepingRepository, times(1)).save(Matchers.any(Housekeeping.class));
verifyZeroInteractions(studyRepository);
// Assertions
assertThat(housekeeping).extracting(curator -> curator.getCurator().getLastName()).contains("Level 1 Curator");
assertThat(housekeeping).extracting(curationStatus -> curationStatus.getCurationStatus().getStatus()).contains("Awaiting Curation");
assertThat(housekeeping.getStudyAddedDate()).isToday();
}
Aggregations