use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class QrdaValidatorTest method testNoNodes.
@Test
public void testNoNodes() {
// set-up
Node testRootNode = new Node();
// execute
List<Detail> details = objectUnderTest.validate(testRootNode);
// assert
assertNodeList(nodesPassedIntoValidateSingleNode, 0, null, null, null);
assertWithMessage("The validation errors (incorrectly) has a single node error and an error from the and optional templateId").that(details).doesNotContain(TEST_VALIDATION_ERROR_FOR_SINGLE_NODE);
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class QrdaValidatorTest method testOptionalValidation.
@Test
public void testOptionalValidation() {
// set-up
Node testRootNode = new Node();
testRootNode.setType(TEST_OPTIONAL_TEMPLATE_ID);
final String testKey = "testKey";
final String testValue = "testValue";
testRootNode.putValue(testKey, testValue);
// execute
List<Detail> details = objectUnderTest.validate(testRootNode);
// assert
assertNodeList(nodesPassedIntoValidateSingleNode, 0, null, null, null);
assertWithMessage("The validation errors (incorrectly) has a single node error and an error from the and optional templateId").that(details).doesNotContain(TEST_VALIDATION_ERROR_FOR_SINGLE_NODE);
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class QrdaValidatorTest method testValidateSingleNode.
@Test
public void testValidateSingleNode() {
// set-up
Node testRootNode = new Node(TEST_REQUIRED_TEMPLATE_ID);
final String testKey = "testKey";
final String testValue = "testValue";
testRootNode.putValue(testKey, testValue);
// execute
List<Detail> details = objectUnderTest.validate(testRootNode);
// assert
assertNodeList(nodesPassedIntoValidateSingleNode, 1, TEST_REQUIRED_TEMPLATE_ID, testKey, testValue);
assertWithMessage("The validation errors is missing items from the expected templateId").that(details).contains(TEST_VALIDATION_ERROR_FOR_SINGLE_NODE);
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class QualityMeasureIdValidatorTest method testTooManyCriteriaExists.
@Test
void testTooManyCriteriaExists() {
Node measureReferenceResultsNode = createCorrectMeasureReference(MULTIPLE_POPULATION_DENOM_EXCEPTION_GUID).addSubPopulationMeasureDataWithCounts(SubPopulationLabel.NUMER.name(), MULTIPLE_POPULATION_DENOM_EXCEPTION_NUMER1_GUID, ONE_HUNDRED).build();
Set<Detail> details = objectUnderTest.validateSingleNode(measureReferenceResultsNode);
LocalizedError expectedErrorMessage = ErrorCode.POPULATION_CRITERIA_COUNT_INCORRECT.format("CMS52v5", 3, SubPopulationLabel.NUMER.name(), 4);
assertWithMessage("Incorrect validation error.").that(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(expectedErrorMessage);
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class QualityMeasureIdValidatorTest method validateMissingMeasureId.
@Test
void validateMissingMeasureId() {
Node measureReferenceResultsNode = createMeasureReferenceResultsNode(false, true);
Set<Detail> details = objectUnderTest.validateSingleNode(measureReferenceResultsNode);
assertWithMessage("Incorrect validation error.").that(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(ErrorCode.MEASURE_GUID_MISSING);
}
Aggregations