use of org.springframework.roo.classpath.details.FieldMetadataBuilder in project spring-roo by spring-projects.
the class ThymeleafControllerIntegrationTestMetadata method getEntityServiceField.
/**
* Builds and returns the entity service field, annotated with @MockBean
*
* @param the service {@link JavaType}
* @return {@link FieldMetadataBuilder}
*/
private FieldMetadataBuilder getEntityServiceField(JavaType service) {
JavaSymbolName fieldName = new JavaSymbolName(String.format("%sService", StringUtils.uncapitalize(service.getSimpleTypeName())));
FieldMetadataBuilder fieldBuilder = new FieldMetadataBuilder(this.getId(), Modifier.PUBLIC, fieldName, service, null);
// Add @Autowired
fieldBuilder.addAnnotation(new AnnotationMetadataBuilder(SpringJavaType.MOCK_BEAN));
return fieldBuilder;
}
Aggregations