use of gov.cms.ab2d.worker.processor.coverage.CoverageVerificationException in project ab2d by CMSgov.
the class CoverageCheckQuartzJobTest method whenVerificationException_alertWithIssues.
@DisplayName("Report issues when verification detects issues")
@Test
void whenVerificationException_alertWithIssues() {
when(propertiesService.isInMaintenanceMode()).thenReturn(false);
doThrow(new CoverageVerificationException("testing123", List.of("alertalert"))).when(coverageDriver).verifyCoverage();
CoverageCheckQuartzJob job = new CoverageCheckQuartzJob(logManager, coverageDriver, propertiesService);
JobExecutionException exception = assertThrows(JobExecutionException.class, () -> job.executeInternal(null));
assertTrue(exception.getMessage().contains("testing123"));
verify(propertiesService, times(1)).isInMaintenanceMode();
verify(coverageDriver, times(1)).verifyCoverage();
verify(logManager, times(1)).alert(argThat(alert -> alert.contains("alertalert") && alert.contains("Coverage verification failed")), anyList());
}
Aggregations