use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class IaMeasureValidatorTest method internalValidateSingleNodeN.
@Test
void internalValidateSingleNodeN() throws Exception {
Node measureNode = new Node(TemplateId.IA_MEASURE);
Node measurePerformedNode = new Node(TemplateId.MEASURE_PERFORMED, measureNode);
measureNode.addChildNode(measurePerformedNode);
measurePerformedNode.putValue("measurePerformed", "N");
IaMeasureValidator validator = new IaMeasureValidator();
Collection<Detail> errors = validator.validateSingleNode(measureNode);
assertWithMessage("no errors should be present").that(errors).isEmpty();
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class IaMeasureValidatorTest method internalValidateSingleNodeY.
/**
* Validate a correct set of Nodes
*
* @throws Exception on test error
*/
@Test
void internalValidateSingleNodeY() throws Exception {
Node measureNode = new Node(TemplateId.IA_MEASURE);
Node measurePerformedNode = new Node(TemplateId.MEASURE_PERFORMED, measureNode);
measureNode.addChildNode(measurePerformedNode);
measurePerformedNode.putValue("measurePerformed", "Y");
IaMeasureValidator validator = new IaMeasureValidator();
Collection<Detail> errors = validator.validateSingleNode(measureNode);
assertWithMessage("no errors should be present").that(errors).isEmpty();
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class IaMeasureValidatorTest method testTooManyChildren.
/**
* Validate a missing child
*
* @throws Exception on test error
*/
@Test
void testTooManyChildren() throws Exception {
Node measureNode = new Node(TemplateId.IA_MEASURE);
Node measurePerformedNode1 = new Node(TemplateId.MEASURE_PERFORMED, measureNode);
Node measurePerformedNode2 = new Node(TemplateId.MEASURE_PERFORMED, measureNode);
measureNode.addChildNode(measurePerformedNode1);
measurePerformedNode1.putValue("measurePerformed", "Y");
measureNode.addChildNode(measurePerformedNode2);
measurePerformedNode1.putValue("measurePerformed", "N");
IaMeasureValidator validator = new IaMeasureValidator();
Set<Detail> errors = validator.validateSingleNode(measureNode);
assertWithMessage("The INCORRECT_CHILDREN_COUNT Error is expected").that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(ErrorCode.IA_MEASURE_INCORRECT_CHILDREN_COUNT);
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class IaSectionValidatorTest method testIncorrectChildValidation.
@Test
void testIncorrectChildValidation() {
Node incorrectAggregateCountNode = new Node(TemplateId.ACI_AGGREGATE_COUNT);
iaSectionNode.addChildNodes(iaMeasureNode, reportingParamActNode, incorrectAggregateCountNode);
Set<Detail> errors = validatorIaSection();
assertWithMessage("Must contain correct children").that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(ErrorCode.IA_SECTION_WRONG_CHILD);
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class QrdaValidatorTest method testValidateMultipleNodes.
@Test
public void testValidateMultipleNodes() {
// set-up
Node testChildNode1 = new Node(TEST_REQUIRED_TEMPLATE_ID);
final String testKey = "testKey";
final String testValue = "testValue";
testChildNode1.putValue(testKey, testValue);
Node testChildNode2 = new Node(TEST_REQUIRED_TEMPLATE_ID);
testChildNode2.putValue(testKey, testValue);
Node testRootNode = new Node();
testRootNode.addChildNode(testChildNode1);
testRootNode.addChildNode(testChildNode2);
// execute
List<Detail> details = objectUnderTest.validate(testRootNode);
// assert
assertNodeList(nodesPassedIntoValidateSingleNode, 2, TEST_REQUIRED_TEMPLATE_ID, testKey, testValue);
assertWithMessage("The validation errors is missing the specific number of single node errors").that(details).containsExactly(TEST_VALIDATION_ERROR_FOR_SINGLE_NODE, TEST_VALIDATION_ERROR_FOR_SINGLE_NODE);
}
Aggregations