use of gov.cms.qpp.conversion.model.error.LocalizedError in project qpp-conversion-tool by CMSgov.
the class CpcQualityMeasureSectionValidatorTest method tooFewGroupAmeasures.
@Test
void tooFewGroupAmeasures() {
Node node = setupMeasures(new String[] { groupAmeasures[0] });
LocalizedError message = CpcGroupMinimum.A.makeError(groupAmeasures);
validator.internalValidateSingleNode(node);
assertThat(validator.getDetails()).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(message);
}
use of gov.cms.qpp.conversion.model.error.LocalizedError in project qpp-conversion-tool by CMSgov.
the class QualityMeasureIdValidatorTest method testInternalDenexcepMultipleSupPopulationsMissingMeasureId.
@Test
void testInternalDenexcepMultipleSupPopulationsMissingMeasureId() {
LocalizedError countMessage = ErrorCode.POPULATION_CRITERIA_COUNT_INCORRECT.format("CMS52v5", 2, SubPopulationLabel.DENEXCEP.name(), 1);
LocalizedError uuidMessage = ErrorCode.QUALITY_MEASURE_ID_INCORRECT_UUID.format("CMS52v5", SubPopulationLabel.DENEXCEP.name(), MULTIPLE_POPULATION_DENOM_EXCEPTION_DENEXCEP1_GUID);
Node measureReferenceResultsNode = createCorrectMeasureReference(MULTIPLE_POPULATION_DENOM_EXCEPTION_GUID).removeSubPopulationMeasureData(SubPopulationLabel.DENEXCEP.name(), MULTIPLE_POPULATION_DENOM_EXCEPTION_DENEXCEP1_GUID).build();
Set<Detail> details = objectUnderTest.validateSingleNode(measureReferenceResultsNode);
assertWithMessage("Incorrect validation error.").that(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(countMessage, uuidMessage);
}
use of gov.cms.qpp.conversion.model.error.LocalizedError in project qpp-conversion-tool by CMSgov.
the class QualityMeasureIdValidatorTest method testInternalDenexcepMultipleSupPopulationsInvalidMeasureId.
@Test
void testInternalDenexcepMultipleSupPopulationsInvalidMeasureId() {
LocalizedError message = ErrorCode.QUALITY_MEASURE_ID_INCORRECT_UUID.format("CMS52v5", SubPopulationLabel.DENEXCEP.name(), MULTIPLE_POPULATION_DENOM_EXCEPTION_DENEXCEP1_GUID);
Node measureReferenceResultsNode = createCorrectMeasureReference(MULTIPLE_POPULATION_DENOM_EXCEPTION_GUID).replaceSubPopulationMeasureData(SubPopulationLabel.DENEXCEP.name(), MULTIPLE_POPULATION_DENOM_EXCEPTION_DENEXCEP1_GUID, SubPopulationLabel.DENEXCEP.name(), MULTIPLE_POPULATION_DENOM_EXCEPTION_DENEXCEP1_GUID + "INVALID").build();
Set<Detail> details = objectUnderTest.validateSingleNode(measureReferenceResultsNode);
assertWithMessage("Incorrect validation error.").that(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(message);
}
use of gov.cms.qpp.conversion.model.error.LocalizedError 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);
}
use of gov.cms.qpp.conversion.model.error.LocalizedError in project qpp-conversion-tool by CMSgov.
the class CheckerTest method testHasMeasuresFailure.
@Test
void testHasMeasuresFailure() {
String measureId = "measureId";
String expectedMeasure = "DogCow";
String anotherMeausure1 = "asdf";
String anotherMeausure2 = "jkl;";
String anotherMeausure3 = "qwerty";
LocalizedError validationError = error("measure failure");
Node section = new Node();
Node measure1 = new Node();
measure1.putValue(measureId, anotherMeausure1);
Node measure2 = new Node();
measure2.putValue(measureId, anotherMeausure2);
Node measure3 = new Node();
measure3.putValue(measureId, anotherMeausure3);
section.addChildNodes(measure1, measure2, measure3);
Checker checker = Checker.check(section, details);
checker.hasMeasures(validationError, expectedMeasure);
assertWithMessage("The validation error string did not match up.").that(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(validationError);
}
Aggregations