use of gov.cms.ab2d.common.dto.ContractDTO in project ab2d by CMSgov.
the class ContractToContractCoverageMapping method init.
@PostConstruct
public static void init() {
modelMapper = new ModelMapper();
modelMapper.getConfiguration().setSkipNullEnabled(true);
Converter<ContractDTO, ContractForCoverageDTO> coverageContractDTOConverter = new AbstractConverter<>() {
@Override
protected ContractForCoverageDTO convert(ContractDTO source) {
// NOSONAR
return new ContractForCoverageDTO(source.getContractNumber(), source.getAttestedOn(), ContractForCoverageDTO.ContractType.valueOf(source.getContractType().toString()));
}
};
Converter<Contract, ContractForCoverageDTO> contractToConverageDto = new AbstractConverter<>() {
@Override
protected ContractForCoverageDTO convert(Contract source) {
// NOSONAR
return new ContractForCoverageDTO(source.getContractNumber(), source.getAttestedOn(), ContractForCoverageDTO.ContractType.valueOf(source.getContractType().toString()));
}
};
modelMapper.addConverter(coverageContractDTOConverter);
modelMapper.addConverter(contractToConverageDto);
}
use of gov.cms.ab2d.common.dto.ContractDTO in project ab2d by CMSgov.
the class ContractProcessorInvalidPatientTest method setup.
@BeforeEach
void setup() {
contractWorkerClient = new ContractWorkerClientMock();
contract = new ContractDTO(contractId, contractId, OffsetDateTime.now().minusYears(50), null);
SearchConfig searchConfig = new SearchConfig(tmpDirFolder.getAbsolutePath(), STREAMING_DIR, FINISHED_DIR, 0, 0, 1, 2);
job.setJobUuid(jobId);
job.setContractNumber(contract.getContractNumber());
JobRepository jobRepository = new StubJobRepository(job);
patientClaimsProcessor = new PatientClaimsProcessorImpl(bfdClient, eventLogger, searchConfig);
JobProgressServiceImpl jobProgressUpdateService = new JobProgressServiceImpl(jobRepository);
jobProgressUpdateService.initJob(jobId);
JobChannelService jobChannelService = new JobChannelStubServiceImpl(jobProgressUpdateService);
ThreadPoolTaskExecutor aggTP = new ThreadPoolTaskExecutor();
aggTP.initialize();
cut = new ContractProcessorImpl(contractWorkerClient, jobRepository, coverageDriver, patientClaimsProcessor, eventLogger, requestQueue, jobChannelService, jobProgressUpdateService, mapping, aggTP, searchConfig);
ReflectionTestUtils.setField(cut, "eobJobPatientQueueMaxSize", 1);
ReflectionTestUtils.setField(cut, "eobJobPatientQueuePageSize", 1);
jobChannelService.sendUpdate(jobId, JobMeasure.FAILURE_THRESHHOLD, 100);
ReflectionTestUtils.setField(patientClaimsProcessor, "earliestDataDate", "01/01/2020");
}
use of gov.cms.ab2d.common.dto.ContractDTO in project ab2d by CMSgov.
the class JobPreProcessorUnitTest method setUp.
@BeforeEach
void setUp() {
contract = new ContractDTO("JPP5678", "JPP5678", null, null);
cut = new JobPreProcessorImpl(contractWorkerClient, jobRepository, eventLogger, coverageDriver);
job = createJob();
}
use of gov.cms.ab2d.common.dto.ContractDTO in project ab2d by CMSgov.
the class CoverageDriverTest method createClient.
private PdpClientDTO createClient(Contract contract, String clientId, @Nullable String roleName) {
PdpClientDTO client = new PdpClientDTO();
client.setClientId(clientId);
client.setOrganization(clientId);
client.setEnabled(true);
ContractDTO contractDTO = new ContractDTO(contract.getContractNumber(), contract.getContractName(), contract.getAttestedOn(), contract.getContractType());
client.setContract(contractDTO);
client.setRole(roleName);
return client;
}
use of gov.cms.ab2d.common.dto.ContractDTO in project ab2d by CMSgov.
the class CoverageDriverUnitTest method periodUpdateFailsThenThrowException.
@DisplayName("Coverage period update fails then throw exception")
@Test
void periodUpdateFailsThenThrowException() {
CoverageDriverException exception = assertThrows(CoverageDriverException.class, () -> {
ContractDTO contract = new ContractDTO("contractNum", null, null, null);
CoveragePeriod coveragePeriod = new CoveragePeriod();
coveragePeriod.setContractNumber(contract.getContractNumber());
coveragePeriod.setModified(OffsetDateTime.now().plus(1, ChronoUnit.HOURS));
coveragePeriod.setStatus(CoverageJobStatus.FAILED);
Job job = new Job();
job.setCreatedAt(OffsetDateTime.now());
driver.checkCoveragePeriodValidity(job, coveragePeriod);
});
assertTrue(exception.getMessage().contains("attempts to pull coverage information"));
}
Aggregations