Search in sources :

Example 6 with CoverageSearchEvent

use of gov.cms.ab2d.coverage.model.CoverageSearchEvent in project ab2d by CMSgov.

the class CoverageCheckIntegrationTest method runSearchAndLeaveOld.

private void runSearchAndLeaveOld(CoveragePeriod period) {
    coverageService.submitSearch(period.getId(), "testing");
    startSearchAndPullEvent();
    CoverageSearchEvent success = new CoverageSearchEvent();
    success.setCoveragePeriod(period);
    success.setDescription("testing");
    success.setNewStatus(CoverageJobStatus.SUCCESSFUL);
    success.setOldStatus(CoverageJobStatus.IN_PROGRESS);
    coverageSearchEventRepo.saveAndFlush(success);
    period = coveragePeriodRepo.findById(period.getId()).get();
    period.setStatus(CoverageJobStatus.SUCCESSFUL);
    coveragePeriodRepo.saveAndFlush(period);
}
Also used : CoverageSearchEvent(gov.cms.ab2d.coverage.model.CoverageSearchEvent)

Example 7 with CoverageSearchEvent

use of gov.cms.ab2d.coverage.model.CoverageSearchEvent in project ab2d by CMSgov.

the class CoverageCheckIntegrationTest method insertAndLeaveDuplicates.

private void insertAndLeaveDuplicates(CoveragePeriod period, Set<Identifiers> identifiers) {
    coverageService.submitSearch(period.getId(), "testing");
    CoverageSearchEvent progress = startSearchAndPullEvent();
    coverageService.insertCoverage(progress.getId(), identifiers);
    CoverageSearchEvent success = new CoverageSearchEvent();
    success.setCoveragePeriod(period);
    success.setDescription("testing");
    success.setNewStatus(CoverageJobStatus.SUCCESSFUL);
    success.setOldStatus(CoverageJobStatus.IN_PROGRESS);
    coverageSearchEventRepo.saveAndFlush(success);
    period = coveragePeriodRepo.findById(period.getId()).get();
    period.setStatus(CoverageJobStatus.SUCCESSFUL);
    coveragePeriodRepo.saveAndFlush(period);
}
Also used : CoverageSearchEvent(gov.cms.ab2d.coverage.model.CoverageSearchEvent)

Example 8 with CoverageSearchEvent

use of gov.cms.ab2d.coverage.model.CoverageSearchEvent in project ab2d by CMSgov.

the class CoverageCheckPredicatesIntegrationTest method insertAndRunSearch.

private void insertAndRunSearch(CoveragePeriod period, Set<Identifiers> identifiers) {
    coverageService.submitSearch(period.getId(), "testing");
    CoverageSearchEvent progress = startSearchAndPullEvent();
    coverageService.insertCoverage(progress.getId(), identifiers);
    coverageService.completeSearch(period.getId(), "testing");
}
Also used : CoverageSearchEvent(gov.cms.ab2d.coverage.model.CoverageSearchEvent)

Example 9 with CoverageSearchEvent

use of gov.cms.ab2d.coverage.model.CoverageSearchEvent in project ab2d by CMSgov.

the class CoverageCheckPredicatesIntegrationTest method runSearchAndLeaveOld.

private void runSearchAndLeaveOld(CoveragePeriod period) {
    coverageService.submitSearch(period.getId(), "testing");
    startSearchAndPullEvent();
    CoverageSearchEvent success = new CoverageSearchEvent();
    success.setCoveragePeriod(period);
    success.setDescription("testing");
    success.setNewStatus(CoverageJobStatus.SUCCESSFUL);
    success.setOldStatus(CoverageJobStatus.IN_PROGRESS);
    coverageSearchEventRepo.saveAndFlush(success);
    period = coveragePeriodRepo.findById(period.getId()).get();
    period.setStatus(CoverageJobStatus.SUCCESSFUL);
    coveragePeriodRepo.saveAndFlush(period);
}
Also used : CoverageSearchEvent(gov.cms.ab2d.coverage.model.CoverageSearchEvent)

Example 10 with CoverageSearchEvent

use of gov.cms.ab2d.coverage.model.CoverageSearchEvent in project ab2d by CMSgov.

the class CoverageCheckPredicatesIntegrationTest method insertAndLeaveDuplicates.

private void insertAndLeaveDuplicates(CoveragePeriod period, Set<Identifiers> identifiers) {
    coverageService.submitSearch(period.getId(), "testing");
    CoverageSearchEvent progress = startSearchAndPullEvent();
    coverageService.insertCoverage(progress.getId(), identifiers);
    CoverageSearchEvent success = new CoverageSearchEvent();
    success.setCoveragePeriod(period);
    success.setDescription("testing");
    success.setNewStatus(CoverageJobStatus.SUCCESSFUL);
    success.setOldStatus(CoverageJobStatus.IN_PROGRESS);
    coverageSearchEventRepo.saveAndFlush(success);
    period = coveragePeriodRepo.findById(period.getId()).get();
    period.setStatus(CoverageJobStatus.SUCCESSFUL);
    coveragePeriodRepo.saveAndFlush(period);
}
Also used : CoverageSearchEvent(gov.cms.ab2d.coverage.model.CoverageSearchEvent)

Aggregations

CoverageSearchEvent (gov.cms.ab2d.coverage.model.CoverageSearchEvent)55 Test (org.junit.jupiter.api.Test)38 DisplayName (org.junit.jupiter.api.DisplayName)37 CoveragePeriod (gov.cms.ab2d.coverage.model.CoveragePeriod)26 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)26 CoverageSearch (gov.cms.ab2d.coverage.model.CoverageSearch)22 Identifiers (gov.cms.ab2d.coverage.model.Identifiers)22 CoverageMapping (gov.cms.ab2d.coverage.model.CoverageMapping)20 LinkedHashSet (java.util.LinkedHashSet)15 CoverageCount (gov.cms.ab2d.coverage.model.CoverageCount)14 List (java.util.List)13 ContractDTO (gov.cms.ab2d.common.dto.ContractDTO)12 ContractForCoverageDTO (gov.cms.ab2d.coverage.model.ContractForCoverageDTO)12 CoverageJobStatus (gov.cms.ab2d.coverage.model.CoverageJobStatus)12 CoveragePagingRequest (gov.cms.ab2d.coverage.model.CoveragePagingRequest)12 CoveragePagingResult (gov.cms.ab2d.coverage.model.CoveragePagingResult)12 CoverageSearchDiff (gov.cms.ab2d.coverage.model.CoverageSearchDiff)12 CoverageSummary (gov.cms.ab2d.coverage.model.CoverageSummary)12 OffsetDateTime (java.time.OffsetDateTime)12 Collections.disjoint (java.util.Collections.disjoint)12