use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class MeasureDataValidatorTest method duplicateAggregateCountsFails.
@Test
void duplicateAggregateCountsFails() throws Exception {
Node aggregateCount = new Node(TemplateId.ACI_AGGREGATE_COUNT);
aggregateCount.putValue("aggregateCount", "100");
aggregateCount.putValue("aggregateCount", "200", false);
Node testNode = new Node(TemplateId.MEASURE_DATA_CMS_V2);
testNode.addChildNodes(aggregateCount);
MeasureDataValidator validator = new MeasureDataValidator();
validator.internalValidateSingleNode(testNode);
Set<Detail> errors = validator.getDetails();
assertWithMessage("missing error").that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(ErrorCode.AGGREGATE_COUNT_VALUE_NOT_SINGULAR);
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class MeasureDataValidatorTest method invalidAggregateCount.
@Test
void invalidAggregateCount() throws Exception {
Node aggregateCount = new Node(TemplateId.ACI_AGGREGATE_COUNT);
Node testNode = new Node(TemplateId.MEASURE_DATA_CMS_V2);
testNode.addChildNode(aggregateCount);
aggregateCount.putValue("aggregateCount", "error");
MeasureDataValidator validator = new MeasureDataValidator();
validator.internalValidateSingleNode(testNode);
Set<Detail> errors = validator.getDetails();
assertWithMessage("Should result in a type error").that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(ErrorCode.AGGREGATE_COUNT_VALUE_NOT_INTEGER);
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class MeasurePerformedValidatorTest method internalValidateSingleNodeN.
@Test
void internalValidateSingleNodeN() throws Exception {
Node measurePerformedNode = new Node(TemplateId.MEASURE_PERFORMED);
measurePerformedNode.putValue("measurePerformed", "N");
MeasurePerformedValidator validator = new MeasurePerformedValidator();
Set<Detail> errors = validator.validateSingleNode(measurePerformedNode);
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 MeasurePerformedValidatorTest method internalValidateSingleNodeY.
/**
* Validate a correct set of Nodes
*
* @throws Exception on test error
*/
@Test
void internalValidateSingleNodeY() throws Exception {
Node measurePerformedNode = new Node(TemplateId.MEASURE_PERFORMED);
measurePerformedNode.putValue("measurePerformed", "Y");
MeasurePerformedValidator validator = new MeasurePerformedValidator();
Set<Detail> errors = validator.validateSingleNode(measurePerformedNode);
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 MeasurePerformedValidatorTest method internalValidateSingleNodeInvalid.
@Test
void internalValidateSingleNodeInvalid() throws Exception {
Node measurePerformedNode = new Node(TemplateId.MEASURE_PERFORMED);
measurePerformedNode.putValue("measurePerformed", "wrong value");
MeasurePerformedValidator validator = new MeasurePerformedValidator();
Set<Detail> errors = validator.validateSingleNode(measurePerformedNode);
assertWithMessage("Should result in a single type error").that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(ErrorCode.IA_MEASURE_INVALID_TYPE);
}
Aggregations