use of uk.gov.justice.services.adapter.rest.mapping.ActionMapper in project microservice_framework by CJSCommonPlatform.
the class RestAdapterGenerator_CodeStructureTest method shouldAddActionMapperBean.
@Test
public void shouldAddActionMapperBean() throws Exception {
generator.run(restRamlWithCommandApiDefaults().with(resource("/user").with(defaultGetAction())).build(), configurationWithBasePackage(BASE_PACKAGE, outputFolder, new CommonGeneratorProperties()));
final Class<?> resourceClass = compiler.compiledClassOf(BASE_PACKAGE, "resource", "DefaultCommandApiUserResource");
final Field mapping = resourceClass.getDeclaredField("actionMapper");
assertThat(mapping, not(nullValue()));
assertThat(mapping.getType(), equalTo(ActionMapper.class));
assertThat(mapping.getAnnotation(Inject.class), not(nullValue()));
assertThat(mapping.getAnnotation(Named.class), not(nullValue()));
assertThat(mapping.getAnnotation(Named.class).value(), is("DefaultCommandApiUserResourceActionMapper"));
assertThat(mapping.getModifiers(), is(0));
}
Aggregations