use of uk.gov.justice.services.adapter.rest.processor.RestProcessor in project microservice_framework by CJSCommonPlatform.
the class RestAdapterGenerator_CodeStructureTest method shouldAddAnnotatedRestProcessorProperty.
@Test
public void shouldAddAnnotatedRestProcessorProperty() throws Exception {
generator.run(restRamlWithCommandApiDefaults().with(defaultPostResource().withRelativeUri("/some/path")).build(), configurationWithBasePackage(BASE_PACKAGE, outputFolder, new CommonGeneratorProperties()));
final Class<?> resourceClass = compiler.compiledClassOf(BASE_PACKAGE, "resource", "DefaultCommandApiSomePathResource");
final Field dispatcher = resourceClass.getDeclaredField("restProcessor");
assertThat(dispatcher, not(nullValue()));
assertThat(dispatcher.getType(), equalTo(RestProcessor.class));
assertThat(dispatcher.getAnnotation(Inject.class), not(nullValue()));
assertThat(dispatcher.getModifiers(), is(0));
}
Aggregations