Search in sources :

Example 36 with LoggableEvent

use of gov.cms.ab2d.eventlogger.LoggableEvent in project ab2d by CMSgov.

the class FileDeletionServiceTest method deleteUnrelatedTopLevelNdjson.

@DisplayName("Do not delete unrelated top level ndjson file")
@Test
void deleteUnrelatedTopLevelNdjson() throws IOException, URISyntaxException {
    // Not connected to a job
    Path destination = Paths.get(efsMount, TEST_FILE);
    pathsToDelete.add(destination);
    Path source = getSourcePath(TEST_FILE);
    Files.copy(source, destination, StandardCopyOption.REPLACE_EXISTING);
    changeFileCreationDate(destination);
    fileDeletionService.deleteFiles();
    assertFalse(Files.notExists(destination));
    List<LoggableEvent> fileEvents = loggerEventRepository.load(FileEvent.class);
    assertEquals(0, fileEvents.size());
    checkNoOtherEventsLogged();
}
Also used : Path(java.nio.file.Path) LoggableEvent(gov.cms.ab2d.eventlogger.LoggableEvent) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) DisplayName(org.junit.jupiter.api.DisplayName)

Aggregations

LoggableEvent (gov.cms.ab2d.eventlogger.LoggableEvent)36 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)33 Test (org.junit.jupiter.api.Test)22 OffsetDateTime (java.time.OffsetDateTime)11 DisplayName (org.junit.jupiter.api.DisplayName)11 File (java.io.File)8 Path (java.nio.file.Path)7 ApiResponseEvent (gov.cms.ab2d.eventlogger.events.ApiResponseEvent)5 FileEvent (gov.cms.ab2d.eventlogger.events.FileEvent)5 JobStatusChangeEvent (gov.cms.ab2d.eventlogger.events.JobStatusChangeEvent)5 ApiRequestEvent (gov.cms.ab2d.eventlogger.events.ApiRequestEvent)4 ArrayList (java.util.ArrayList)4 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)4 SpringIntegrationTest (org.springframework.integration.test.context.SpringIntegrationTest)4 MvcResult (org.springframework.test.web.servlet.MvcResult)4 ContractDTO (gov.cms.ab2d.common.dto.ContractDTO)3 Job (gov.cms.ab2d.common.model.Job)3 PdpClient (gov.cms.ab2d.common.model.PdpClient)3 ContractSearchEvent (gov.cms.ab2d.eventlogger.events.ContractSearchEvent)3 IBaseBundle (org.hl7.fhir.instance.model.api.IBaseBundle)3