Search in sources :

Example 6 with QrdaDecoder

use of gov.cms.qpp.conversion.decode.QrdaDecoder in project qpp-conversion-tool by CMSgov.

the class NoArgThrowableConstructor method testRegistryGetProgramSpecificConverterHandler.

@Test
void testRegistryGetProgramSpecificConverterHandler() {
    context.setProgram(Program.CPC);
    registry.register(new ComponentKey(TemplateId.PLACEHOLDER, Program.ALL), Placeholder.class);
    registry.register(new ComponentKey(TemplateId.PLACEHOLDER, Program.CPC), AnotherPlaceholder.class);
    QrdaDecoder decoder = registry.get(TemplateId.PLACEHOLDER);
    assertWithMessage("Registry should return %s instance.", AnotherPlaceholder.class.getName()).that(decoder).isInstanceOf(AnotherPlaceholder.class);
}
Also used : QrdaDecoder(gov.cms.qpp.conversion.decode.QrdaDecoder) Test(org.junit.jupiter.api.Test)

Example 7 with QrdaDecoder

use of gov.cms.qpp.conversion.decode.QrdaDecoder in project qpp-conversion-tool by CMSgov.

the class NoArgThrowableConstructor method testRegistryGetHandlerWithNoArgMalcontentedConstructor.

@Test
void testRegistryGetHandlerWithNoArgMalcontentedConstructor() {
    registry.register(new ComponentKey(TemplateId.PLACEHOLDER, Program.ALL), NoArgMalcontentedConstructor.class);
    QrdaDecoder decoder = registry.get(TemplateId.PLACEHOLDER);
    assertThat(decoder).isNull();
}
Also used : QrdaDecoder(gov.cms.qpp.conversion.decode.QrdaDecoder) Test(org.junit.jupiter.api.Test)

Example 8 with QrdaDecoder

use of gov.cms.qpp.conversion.decode.QrdaDecoder in project qpp-conversion-tool by CMSgov.

the class NoArgThrowableConstructor method testRegistryGetHandlerWithMalcontentedConstructor.

@Test
void testRegistryGetHandlerWithMalcontentedConstructor() {
    registry.register(new ComponentKey(TemplateId.PLACEHOLDER, Program.ALL), MalcontentedConstructor.class);
    QrdaDecoder decoder = registry.get(TemplateId.PLACEHOLDER);
    assertThat(decoder).isNull();
}
Also used : QrdaDecoder(gov.cms.qpp.conversion.decode.QrdaDecoder) Test(org.junit.jupiter.api.Test)

Aggregations

QrdaDecoder (gov.cms.qpp.conversion.decode.QrdaDecoder)8 Test (org.junit.jupiter.api.Test)8