use of gov.cms.qpp.conversion.model.error.AllErrors in project qpp-conversion-tool by CMSgov.
the class IaSectionValidatorRoundTripTest method testIaSectionValidatorMissingReportingParameters.
@Test
void testIaSectionValidatorMissingReportingParameters() {
Path path = Paths.get("src/test/resources/negative/iaSectionMissingReportingParameter.xml");
Converter converter = new Converter(new PathSource(path));
AllErrors errors = new AllErrors();
try {
converter.transform();
Assertions.fail("Should not reach");
} catch (TransformException exception) {
errors = exception.getDetails();
}
Integer error = errors.getErrors().get(0).getDetails().get(0).getErrorCode();
assertThat(ErrorCode.getByCode(error)).isEqualTo(ErrorCode.IA_SECTION_MISSING_REPORTING_PARAM);
}
use of gov.cms.qpp.conversion.model.error.AllErrors in project qpp-conversion-tool by CMSgov.
the class IaSectionValidatorRoundTripTest method testIaSectionValidatorMissingMeasures.
@Test
void testIaSectionValidatorMissingMeasures() {
Path path = Paths.get("src/test/resources/negative/iaSectionMissingMeasures.xml");
Converter converter = new Converter(new PathSource(path));
AllErrors errors = new AllErrors();
try {
converter.transform();
} catch (TransformException exception) {
errors = exception.getDetails();
}
Integer error = errors.getErrors().get(0).getDetails().get(0).getErrorCode();
assertThat(ErrorCode.getByCode(error)).isEqualTo(ErrorCode.IA_SECTION_MISSING_IA_MEASURE);
}
use of gov.cms.qpp.conversion.model.error.AllErrors in project qpp-conversion-tool by CMSgov.
the class IaSectionValidatorRoundTripTest method testIaSectionValidatorIncorrectChildren.
@Test
void testIaSectionValidatorIncorrectChildren() {
Path path = Paths.get("src/test/resources/negative/iaSectionContainsWrongChild.xml");
Context context = new Context();
context.setDoDefaults(true);
Converter converter = new Converter(new PathSource(path), context);
AllErrors errors = new AllErrors();
try {
converter.transform();
} catch (TransformException exception) {
errors = exception.getDetails();
}
Integer error = errors.getErrors().get(0).getDetails().get(0).getErrorCode();
assertThat(ErrorCode.getByCode(error)).isEqualTo(ErrorCode.IA_SECTION_WRONG_CHILD);
}
use of gov.cms.qpp.conversion.model.error.AllErrors in project qpp-conversion-tool by CMSgov.
the class QualityMeasureIdMultiRoundTripTest method executeScenario.
private List<Detail> executeScenario(String path, boolean remove) {
InputStream modified = manipulator.upsetTheNorm(path, remove);
Converter converter = new Converter(new InputStreamSupplierSource(JUNK_QRDA3_FILE.toString(), modified));
List<Detail> details = new ArrayList<>();
try {
converter.transform();
} catch (TransformException exception) {
AllErrors errors = exception.getDetails();
details.addAll(errors.getErrors().get(0).getDetails());
}
return details;
}
use of gov.cms.qpp.conversion.model.error.AllErrors in project qpp-conversion-tool by CMSgov.
the class QualityMeasureIdMultiRoundTripTest method testRoundTripQualityMeasureIdWithDenomGreaterThanIpop.
@Test
void testRoundTripQualityMeasureIdWithDenomGreaterThanIpop() {
Converter converter = new Converter(new PathSource(DENOM_GREATER_THAN_IPOP));
List<Detail> details = new ArrayList<>();
try {
converter.transform();
} catch (TransformException exception) {
AllErrors errors = exception.getDetails();
details.addAll(errors.getErrors().get(0).getDetails());
}
assertThat(details).hasSize(3);
assertThat(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE).contains(ErrorCode.DENOMINATOR_COUNT_INVALID);
}
Aggregations