Search in sources :

Example 26 with PdpClient

use of gov.cms.ab2d.common.model.PdpClient in project ab2d by CMSgov.

the class JobProcessorUnitTest method createClient.

private PdpClient createClient() {
    PdpClient pdpClient = new PdpClient();
    pdpClient.setClientId("Harry_Potter");
    pdpClient.setEnabled(TRUE);
    pdpClient.setContract(createContract());
    return pdpClient;
}
Also used : PdpClient(gov.cms.ab2d.common.model.PdpClient)

Example 27 with PdpClient

use of gov.cms.ab2d.common.model.PdpClient in project ab2d by CMSgov.

the class CoverageCheckIntegrationTest method setUp.

@BeforeEach
void setUp() {
    enabledContracts = pdpClientService.getAllEnabledContracts();
    enabledContracts.forEach(contract -> pdpClientService.disableClient(contract.getContractNumber()));
    PdpClient client = dataSetup.setupNonStandardClient("special", "TEST", List.of("SPONSOR"));
    contract = client.getContract();
    contract.setAttestedOn(ATTESTATION_TIME.toOffsetDateTime());
    contractRepo.saveAndFlush(contract);
}
Also used : PdpClient(gov.cms.ab2d.common.model.PdpClient) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 28 with PdpClient

use of gov.cms.ab2d.common.model.PdpClient in project ab2d by CMSgov.

the class CoverageCheckIntegrationTest method verifyCoverage_whenZContractIgnore.

@DisplayName("Verify coverage ignores contracts being updated")
@Test
void verifyCoverage_whenZContractIgnore() {
    PdpClient client = dataSetup.setupNonStandardClient("special2", "Z5555", List.of("SPONSOR"));
    Contract contract = client.getContract();
    contract.setAttestedOn(ATTESTATION_TIME.toOffsetDateTime());
    contract.setUpdateMode(Contract.UpdateMode.NONE);
    contract.setContractType(Contract.ContractType.CLASSIC_TEST);
    contractRepo.saveAndFlush(contract);
    CoverageVerificationException exception = assertThrows(CoverageVerificationException.class, () -> coverageDriver.verifyCoverage());
    assertFalse(exception.getAlertMessage().contains("Z5555"));
}
Also used : PdpClient(gov.cms.ab2d.common.model.PdpClient) Contract(gov.cms.ab2d.common.model.Contract) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) DisplayName(org.junit.jupiter.api.DisplayName)

Example 29 with PdpClient

use of gov.cms.ab2d.common.model.PdpClient in project ab2d by CMSgov.

the class WorkerServiceDisengagementTest method createClient2.

private PdpClient createClient2() {
    PdpClient pdpClient = new PdpClient();
    int clientNum = getIntRandom();
    pdpClient.setId((long) clientNum);
    pdpClient.setClientId("testclient2" + clientNum);
    pdpClient.setOrganization("testclient2" + clientNum);
    pdpClient.setEnabled(true);
    pdpClient.setContract(dataSetup.setupContract("TST-34"));
    pdpClient = pdpClientRepository.save(pdpClient);
    dataSetup.queueForCleanup(pdpClient);
    return pdpClient;
}
Also used : PdpClient(gov.cms.ab2d.common.model.PdpClient)

Example 30 with PdpClient

use of gov.cms.ab2d.common.model.PdpClient in project ab2d by CMSgov.

the class WorkerServiceDisengagementTest method createClient.

private PdpClient createClient() {
    PdpClient pdpClient = new PdpClient();
    int clientNum = getIntRandom();
    pdpClient.setId((long) clientNum);
    pdpClient.setClientId("testclient" + clientNum);
    pdpClient.setOrganization("testclient" + clientNum);
    pdpClient.setEnabled(true);
    pdpClient.setContract(dataSetup.setupContract("TST-12"));
    pdpClient = pdpClientRepository.save(pdpClient);
    dataSetup.queueForCleanup(pdpClient);
    return pdpClient;
}
Also used : PdpClient(gov.cms.ab2d.common.model.PdpClient)

Aggregations

PdpClient (gov.cms.ab2d.common.model.PdpClient)43 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)11 BeforeEach (org.junit.jupiter.api.BeforeEach)8 Test (org.junit.jupiter.api.Test)7 Contract (gov.cms.ab2d.common.model.Contract)6 Job (gov.cms.ab2d.common.model.Job)5 ApiResponseEvent (gov.cms.ab2d.eventlogger.events.ApiResponseEvent)5 Role (gov.cms.ab2d.common.model.Role)4 PdpClientDTO (gov.cms.ab2d.common.dto.PdpClientDTO)3 LoggableEvent (gov.cms.ab2d.eventlogger.LoggableEvent)3 ApiRequestEvent (gov.cms.ab2d.eventlogger.events.ApiRequestEvent)3 ContractToContractCoverageMapping (gov.cms.ab2d.worker.config.ContractToContractCoverageMapping)3 ThreadPoolTaskExecutor (org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor)3 TooManyRequestsException (gov.cms.ab2d.api.controller.TooManyRequestsException)2 BFDClient (gov.cms.ab2d.bfd.client.BFDClient)2 ContractDTO (gov.cms.ab2d.common.dto.ContractDTO)2 StaleJob (gov.cms.ab2d.common.dto.StaleJob)2 StartJobDTO (gov.cms.ab2d.common.dto.StartJobDTO)2 JobOutput (gov.cms.ab2d.common.model.JobOutput)2 LogManager (gov.cms.ab2d.eventlogger.LogManager)2