use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class AciMeasurePerformedRnREncoderTest method testInternalEncodeBooleanFalseValue.
@Test
void testInternalEncodeBooleanFalseValue() {
// set-up
JsonWrapper jsonWrapper = new JsonWrapper();
AciMeasurePerformedRnREncoder objectUnderTest = new AciMeasurePerformedRnREncoder(new Context());
aciMeasurePerformedRnR.getChildNodes().get(0).putValue("measurePerformed", "N");
// execute
objectUnderTest.internalEncode(jsonWrapper, aciMeasurePerformedRnR);
// assert
assertThat(jsonWrapper.getString("measureId")).isEqualTo(MEASURE_ID);
assertThat(jsonWrapper.getBoolean("value")).isEqualTo(false);
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class AciMeasurePerformedRnREncoderTest method testInternalEncodeBooleanTrueValue.
@Test
void testInternalEncodeBooleanTrueValue() {
// set-up
JsonWrapper jsonWrapper = new JsonWrapper();
AciMeasurePerformedRnREncoder objectUnderTest = new AciMeasurePerformedRnREncoder(new Context());
aciMeasurePerformedRnR.getChildNodes().get(0).putValue("measurePerformed", "Y");
// execute
objectUnderTest.internalEncode(jsonWrapper, aciMeasurePerformedRnR);
// assert
assertThat(jsonWrapper.getString("measureId")).isEqualTo(MEASURE_ID);
assertThat(jsonWrapper.getBoolean("value")).isEqualTo(true);
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class AciNumeratorDenominatorEncoderTest method testInternalEncode.
@Test
void testInternalEncode() throws EncodeException {
// set-up
JsonWrapper jsonWrapper = new JsonWrapper();
AciNumeratorDenominatorEncoder objectUnderTest = new AciNumeratorDenominatorEncoder(new Context());
// execute
objectUnderTest.internalEncode(jsonWrapper, aciProportionMeasureNode);
// assert
assertThat(jsonWrapper.getString("measureId")).isEqualTo(MEASURE_ID);
assertThat(jsonWrapper.getObject()).isNotNull();
assertThat(jsonWrapper.getObject()).isInstanceOf(Map.class);
assertThat(((Map<?, ?>) jsonWrapper.getObject()).get("value")).isNotNull();
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class AciProportionNumeratorEncoderTest method testEncoderWithoutChild.
@Test
void testEncoderWithoutChild() throws EncodeException {
aciProportionNumeratorNode.getChildNodes().remove(numeratorDenominatorValueNode);
AciProportionNumeratorEncoder aciProportionNumeratorEncoder = new AciProportionNumeratorEncoder(new Context());
aciProportionNumeratorEncoder.internalEncode(jsonWrapper, aciProportionNumeratorNode);
assertThat(jsonWrapper.getInteger("numerator")).isNull();
}
use of gov.cms.qpp.conversion.Context in project qpp-conversion-tool by CMSgov.
the class AciProportionNumeratorEncoderTest method testEncoderWithoutValue.
@Test
void testEncoderWithoutValue() throws EncodeException {
numeratorDenominatorValueNode.putValue("aggregateCount", null);
AciProportionNumeratorEncoder aciProportionNumeratorEncoder = new AciProportionNumeratorEncoder(new Context());
aciProportionNumeratorEncoder.internalEncode(jsonWrapper, aciProportionNumeratorNode);
assertThat(jsonWrapper.getInteger("numerator")).isNull();
}
Aggregations