use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class AciProportionDenominatorEncoderTest method runEncoder.
private void runEncoder() {
AciProportionDenominatorEncoder encoder = new AciProportionDenominatorEncoder(new Context());
try {
encoder.internalEncode(json, aciProportionDenominatorNode);
} catch (EncodeException e) {
throw new RuntimeException(e);
}
encoder.setNodes(nodes);
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class AciProportionNumeratorEncoderTest method testInternalEncode.
@Test
void testInternalEncode() throws EncodeException {
AciProportionNumeratorEncoder aciProportionNumeratorEncoder = new AciProportionNumeratorEncoder(new Context());
aciProportionNumeratorEncoder.internalEncode(jsonWrapper, aciProportionNumeratorNode);
assertThat(jsonWrapper.getInteger("numerator")).isEqualTo(600);
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class TemplateIdTest method testGetTemplateIdHistoricalWithExtension.
@Test
void testGetTemplateIdHistoricalWithExtension() {
Context context = new Context();
context.setHistorical(true);
assertThat(TemplateId.CLINICAL_DOCUMENT.getTemplateId(context)).isEqualTo(TemplateId.CLINICAL_DOCUMENT.getRoot());
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class TemplateIdTest method testInvalidExtensionFindWithNoExtensionEnforcement.
@ParameterizedTest
@EnumSource(value = TemplateId.class, mode = EXCLUDE, names = { "CLINICAL_DOCUMENT" })
void testInvalidExtensionFindWithNoExtensionEnforcement(TemplateId templateId) {
TemplateId actual = TemplateId.getTemplateId(templateId.getRoot(), "nonExistingExtension", new Context());
assertThat(actual).isSameAs(templateId);
}
use of gov.cms.qpp.conversion.Context 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