Search in sources :

Example 1 with JobRepository

use of gov.cms.ab2d.common.repository.JobRepository 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");
}
Also used : JobChannelStubServiceImpl(gov.cms.ab2d.worker.service.JobChannelStubServiceImpl) JobChannelService(gov.cms.ab2d.worker.service.JobChannelService) ContractDTO(gov.cms.ab2d.common.dto.ContractDTO) ContractWorkerClientMock(gov.cms.ab2d.worker.util.ContractWorkerClientMock) ThreadPoolTaskExecutor(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor) SearchConfig(gov.cms.ab2d.worker.config.SearchConfig) JobRepository(gov.cms.ab2d.common.repository.JobRepository) StubJobRepository(gov.cms.ab2d.worker.repository.StubJobRepository) StubJobRepository(gov.cms.ab2d.worker.repository.StubJobRepository) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ContractDTO (gov.cms.ab2d.common.dto.ContractDTO)1 JobRepository (gov.cms.ab2d.common.repository.JobRepository)1 SearchConfig (gov.cms.ab2d.worker.config.SearchConfig)1 StubJobRepository (gov.cms.ab2d.worker.repository.StubJobRepository)1 JobChannelService (gov.cms.ab2d.worker.service.JobChannelService)1 JobChannelStubServiceImpl (gov.cms.ab2d.worker.service.JobChannelStubServiceImpl)1 ContractWorkerClientMock (gov.cms.ab2d.worker.util.ContractWorkerClientMock)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 ThreadPoolTaskExecutor (org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor)1