Search in sources :

Example 26 with Detail

use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.

the class QualityMeasureIdValidatorTest method testInternalIPPMeasure.

@Test
void testInternalIPPMeasure() {
    Node measureReferenceResultsNode = createCorrectMeasureReference(REQUIRES_DENOM_EXCEPTION_GUID).replaceSubPopulationMeasureData(SubPopulationLabel.IPOP.name(), REQUIRES_DENOM_EXCEPTION_IPOP_GUID, "IPP", REQUIRES_DENOM_EXCEPTION_IPOP_GUID).build();
    Set<Detail> details = objectUnderTest.validateSingleNode(measureReferenceResultsNode);
    assertWithMessage("There must not be any validation errors.").that(details).isEmpty();
}
Also used : Node(gov.cms.qpp.conversion.model.Node) Detail(gov.cms.qpp.conversion.model.error.Detail) Test(org.junit.jupiter.api.Test)

Example 27 with Detail

use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.

the class QualityMeasureIdValidatorTest method testHorriblyInvalidMeasureIdGetsNoSuggestions.

@Test
void testHorriblyInvalidMeasureIdGetsNoSuggestions() {
    String measureId = "InvalidMeasureId";
    Node measureReferenceResultsNode = new MeasureReferenceBuilder().addMeasureId(measureId).addSubPopulationMeasureDataWithCounts(SubPopulationLabel.IPOP.name(), REQUIRES_DENOM_EXCLUSION_IPOP_GUID, ONE_HUNDRED).addSubPopulationMeasureDataWithCounts(SubPopulationLabel.DENOM.name(), REQUIRES_DENOM_EXCLUSION_DENOM_GUID, ONE_HUNDRED).addSubPopulationMeasureDataWithCounts(SubPopulationLabel.NUMER.name(), REQUIRES_DENOM_EXCLUSION_NUMER_GUID, ONE_HUNDRED).addSubPopulationMeasureDataWithCounts(SubPopulationLabel.DENEX.name(), REQUIRES_DENOM_EXCLUSION_DENEX_GUID, ONE_HUNDRED).build();
    Set<Detail> details = objectUnderTest.validateSingleNode(measureReferenceResultsNode);
    assertWithMessage("There must be one validation errors.").that(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(ErrorCode.MEASURE_GUID_MISSING.format(measureId, Collections.emptyList()));
}
Also used : Node(gov.cms.qpp.conversion.model.Node) Detail(gov.cms.qpp.conversion.model.error.Detail) Test(org.junit.jupiter.api.Test)

Example 28 with Detail

use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.

the class QualityMeasureIdValidatorTest method testIncorrectUuid.

@Test
void testIncorrectUuid() {
    Node measureReferenceResultsNode = createCorrectMeasureReference(MULTIPLE_POPULATION_DENOM_EXCEPTION_GUID).replaceSubPopulationMeasureData(SubPopulationLabel.NUMER.name(), MULTIPLE_POPULATION_DENOM_EXCEPTION_NUMER1_GUID, SubPopulationLabel.NUMER.name(), "incorrectUUID").build();
    Set<Detail> details = objectUnderTest.validateSingleNode(measureReferenceResultsNode);
    LocalizedError expectedErrorMessage = ErrorCode.QUALITY_MEASURE_ID_INCORRECT_UUID.format("CMS52v5", SubPopulationLabel.NUMER.name(), MULTIPLE_POPULATION_DENOM_EXCEPTION_NUMER1_GUID);
    assertWithMessage("Incorrect validation error.").that(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(expectedErrorMessage);
}
Also used : Node(gov.cms.qpp.conversion.model.Node) LocalizedError(gov.cms.qpp.conversion.model.error.LocalizedError) Detail(gov.cms.qpp.conversion.model.error.Detail) Test(org.junit.jupiter.api.Test)

Example 29 with Detail

use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.

the class QualityMeasureIdValidatorTest method testInternalExistingDenexcepMeasure.

@Test
void testInternalExistingDenexcepMeasure() {
    Node measureReferenceResultsNode = createCorrectMeasureReference(REQUIRES_DENOM_EXCEPTION_GUID).build();
    Set<Detail> details = objectUnderTest.validateSingleNode(measureReferenceResultsNode);
    assertWithMessage("There must not be any validation errors.").that(details).isEmpty();
}
Also used : Node(gov.cms.qpp.conversion.model.Node) Detail(gov.cms.qpp.conversion.model.error.Detail) Test(org.junit.jupiter.api.Test)

Example 30 with Detail

use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.

the class QualityMeasureSectionValidatorTest method duplicateEcqMeasureLevelUp.

@Test
void duplicateEcqMeasureLevelUp() {
    String xpath = manipulatorHandler.getCannedPath(MarkupManipulationHandler.CannedPath.ECQM_PARENT);
    List<Detail> errorDetails = manipulatorHandler.executeScenario(xpath, false);
    assertThat(errorDetails).comparingElementsUsing(DetailsErrorEquals.INSTANCE).contains(new FormattedErrorCode(ErrorCode.MEASURE_GUID_MISSING, ErrorCode.MEASURE_GUID_MISSING.getMessage()));
}
Also used : FormattedErrorCode(gov.cms.qpp.conversion.model.error.FormattedErrorCode) Detail(gov.cms.qpp.conversion.model.error.Detail) Test(org.junit.jupiter.api.Test)

Aggregations

Detail (gov.cms.qpp.conversion.model.error.Detail)123 Test (org.junit.jupiter.api.Test)108 Node (gov.cms.qpp.conversion.model.Node)105 LocalizedError (gov.cms.qpp.conversion.model.error.LocalizedError)16 Converter (gov.cms.qpp.conversion.Converter)9 AllErrors (gov.cms.qpp.conversion.model.error.AllErrors)9 TransformException (gov.cms.qpp.conversion.model.error.TransformException)9 PathSource (gov.cms.qpp.conversion.PathSource)8 ArrayList (java.util.ArrayList)6 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)6 Context (gov.cms.qpp.conversion.Context)4 Test (org.junit.Test)4 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)4 QrdaDecoderEngine (gov.cms.qpp.conversion.decode.QrdaDecoderEngine)3 FormattedErrorCode (gov.cms.qpp.conversion.model.error.FormattedErrorCode)3 Path (java.nio.file.Path)2 LinkedHashSet (java.util.LinkedHashSet)2 InputStreamSupplierSource (gov.cms.qpp.conversion.InputStreamSupplierSource)1 JsonWrapper (gov.cms.qpp.conversion.encode.JsonWrapper)1 TemplateId (gov.cms.qpp.conversion.model.TemplateId)1