use of gov.cms.qpp.conversion.PathSource in project qpp-conversion-tool by CMSgov.
the class IaSectionRoundTripTest method testIaSectionConvertsIaCategory.
@Test
void testIaSectionConvertsIaCategory() {
Converter converter = new Converter(new PathSource(file));
JsonWrapper qpp = converter.transform();
String iaCategory = JsonHelper.readJsonAtJsonPath(qpp.toString(), "$.measurementSets[2].category", String.class);
assertWithMessage("Must contain a category").that(iaCategory).isEqualTo("ia");
}
use of gov.cms.qpp.conversion.PathSource in project qpp-conversion-tool by CMSgov.
the class IaSectionRoundTripTest method testIaSectionConvertsMeasurePerformed.
@Test
void testIaSectionConvertsMeasurePerformed() {
Converter converter = new Converter(new PathSource(file));
JsonWrapper qpp = converter.transform();
Boolean measurePerformed = JsonHelper.readJsonAtJsonPath(qpp.toString(), "$.measurementSets[2].measurements[0].value", Boolean.class);
assertWithMessage("Must contain a measure performed").that(measurePerformed).isTrue();
}
use of gov.cms.qpp.conversion.PathSource 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.PathSource 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.PathSource 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);
}
Aggregations