use of gov.cms.qpp.conversion.decode.QrdaDecoder in project qpp-conversion-tool by CMSgov.
the class NoArgThrowableConstructor method testRegistryGetHandlerWithNoDefaultConstructor.
@Test
void testRegistryGetHandlerWithNoDefaultConstructor() {
registry.register(new ComponentKey(TemplateId.PLACEHOLDER, Program.ALL), NoDefaultConstructor.class);
QrdaDecoder decoder = registry.get(TemplateId.PLACEHOLDER);
assertWithMessage("Registry without a default constructor should not be constructable").that(decoder).isNull();
}
use of gov.cms.qpp.conversion.decode.QrdaDecoder in project qpp-conversion-tool by CMSgov.
the class NoArgThrowableConstructor method testRegistryGetDefaultConverterHandler.
@Test
void testRegistryGetDefaultConverterHandler() {
context.setProgram(Program.CPC);
registry.register(new ComponentKey(TemplateId.PLACEHOLDER, Program.ALL), Placeholder.class);
QrdaDecoder decoder = registry.get(TemplateId.PLACEHOLDER);
assertWithMessage("Registry should return %s instance.", Placeholder.class.getName()).that(decoder).isInstanceOf(Placeholder.class);
}
use of gov.cms.qpp.conversion.decode.QrdaDecoder in project qpp-conversion-tool by CMSgov.
the class NoArgThrowableConstructor method testRegistry_placeAndFetch.
// This test must reside here in order to call the protected methods on the
// registry
@Test
void testRegistry_placeAndFetch() {
Set<ComponentKey> componentKeys = registry.getComponentKeys(AggregateCountDecoder.class);
assertThat(componentKeys).hasSize(1);
for (ComponentKey componentKey : componentKeys) {
QrdaDecoder decoder = registry.get(componentKey.getTemplate());
assertWithMessage("A handler is expected").that(decoder).isNotNull();
assertWithMessage("Handler should be an instance of the handler for the given XPATH").that(decoder).isInstanceOf(AggregateCountDecoder.class);
}
}
use of gov.cms.qpp.conversion.decode.QrdaDecoder in project qpp-conversion-tool by CMSgov.
the class NoArgThrowableConstructor method testRegistryAddDuplicate.
@Test
void testRegistryAddDuplicate() {
registry.register(new ComponentKey(TemplateId.PLACEHOLDER, Program.ALL), Placeholder.class);
registry.register(new ComponentKey(TemplateId.PLACEHOLDER, Program.ALL), AnotherPlaceholder.class);
QrdaDecoder decoder = registry.get(TemplateId.PLACEHOLDER);
assertWithMessage("Registry should have overwritten id with the second one.").that(decoder).isInstanceOf(AnotherPlaceholder.class);
}
use of gov.cms.qpp.conversion.decode.QrdaDecoder in project qpp-conversion-tool by CMSgov.
the class NoArgThrowableConstructor method testRegistryGetHandlerThatFailsConstruction.
@Test
void testRegistryGetHandlerThatFailsConstruction() {
registry.register(new ComponentKey(TemplateId.PLACEHOLDER, Program.ALL), PrivateConstructor.class);
QrdaDecoder decoder = registry.get(TemplateId.PLACEHOLDER);
assertWithMessage("Registry with a private constructor should be constructable").that(decoder).isNotNull();
}
Aggregations