Search in sources :

Example 1 with ContractWorkerClient

use of gov.cms.ab2d.worker.service.ContractWorkerClient in project ab2d by CMSgov.

the class ContractProcessorUnitTest method setUp.

@BeforeEach
void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    patientClaimsProcessor = spy(PatientClaimsProcessorStub.class);
    mapping = new ContractToContractCoverageMapping();
    contract = createContractDTO();
    contractForCoverageDTO = mapping.map(contract);
    PdpClient pdpClient = createClient();
    job = createJob(pdpClient);
    job.setContractNumber(contract.getContractNumber());
    jobRepository = new StubJobRepository(job);
    JobProgressServiceImpl jobProgressImpl = new JobProgressServiceImpl(jobRepository);
    jobProgressImpl.initJob(jobUuid);
    ReflectionTestUtils.setField(jobProgressImpl, "reportProgressDbFrequency", 2);
    ReflectionTestUtils.setField(jobProgressImpl, "reportProgressLogFrequency", 3);
    jobChannelService = new JobChannelStubServiceImpl(jobProgressImpl);
    ThreadPoolTaskExecutor pool = new ThreadPoolTaskExecutor();
    pool.initialize();
    SearchConfig searchConfig = new SearchConfig(efsMountTmpDir.toFile().getAbsolutePath(), STREAMING, FINISHED, 0, 0, 2, 1);
    ContractWorkerClient contractWorkerClient = new ContractWorkerClientMock();
    cut = new ContractProcessorImpl(contractWorkerClient, jobRepository, coverageDriver, patientClaimsProcessor, eventLogger, requestQueue, jobChannelService, jobProgressImpl, mapping, pool, searchConfig);
    // ReflectionTestUtils.setField(cut, "numberPatientRequestsPerThread", 2);
    var outputDirPath = Paths.get(efsMountTmpDir.toString(), jobUuid);
    Files.createDirectories(outputDirPath);
}
Also used : ContractWorkerClient(gov.cms.ab2d.worker.service.ContractWorkerClient) JobChannelStubServiceImpl(gov.cms.ab2d.worker.service.JobChannelStubServiceImpl) PatientClaimsProcessorStub(gov.cms.ab2d.worker.processor.stub.PatientClaimsProcessorStub) ContractWorkerClientMock(gov.cms.ab2d.worker.util.ContractWorkerClientMock) ContractToContractCoverageMapping(gov.cms.ab2d.worker.config.ContractToContractCoverageMapping) ThreadPoolTaskExecutor(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor) SearchConfig(gov.cms.ab2d.worker.config.SearchConfig) StubJobRepository(gov.cms.ab2d.worker.repository.StubJobRepository) PdpClient(gov.cms.ab2d.common.model.PdpClient) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

PdpClient (gov.cms.ab2d.common.model.PdpClient)1 ContractToContractCoverageMapping (gov.cms.ab2d.worker.config.ContractToContractCoverageMapping)1 SearchConfig (gov.cms.ab2d.worker.config.SearchConfig)1 PatientClaimsProcessorStub (gov.cms.ab2d.worker.processor.stub.PatientClaimsProcessorStub)1 StubJobRepository (gov.cms.ab2d.worker.repository.StubJobRepository)1 ContractWorkerClient (gov.cms.ab2d.worker.service.ContractWorkerClient)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