@Test public void annotation_not_present() { EntityDAOLocator locator = newMock(EntityDAOLocator.class); PlasticClass plasticClass = newMock(PlasticClass.class); TransformationSupport support = newMock(TransformationSupport.class); MutableComponentModel model = newMock(MutableComponentModel.class); expect(plasticClass.getFieldsWithAnnotation(InjectEntitySelectSupport.class)).andReturn(new ArrayList<PlasticField>()); replay(); new InjectEntitySelectSupportWorker(locator).transform(plasticClass, support, model); verify(); }
public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model) { for(final PlasticField field : plasticClass.getFieldsWithAnnotation(InjectEntitySelectSupport.class)) { addModelMethod(plasticClass, field); addEncoderMethod(plasticClass, field); } }
InjectEntitySelectSupportWorker implements ComponentClassTransformWorker2 { public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model) { for(final PlasticField field : plasticClass.getFieldsWithAnnotation(InjectEntitySelectSupport.class)) { addModelMethod(plasticClass, field); addEncoderMethod(plasticClass, field); } } }
InjectEntitySelectSupportWorker implements ComponentClassTransformWorker2 { public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model) { for(final PlasticField field : plasticClass.getFieldsWithAnnotation(InjectEntitySelectSupport.class)) { addModelMethod(plasticClass, field); addEncoderMethod(plasticClass, field); } } InjectEntitySelectSupportWorker(final EntityDAOLocator locator); }
InjectEntitySelectSupportWorker implements ComponentClassTransformWorker2 { public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model) { for(final PlasticField field : plasticClass.getFieldsWithAnnotation(InjectEntitySelectSupport.class)) { addModelMethod(plasticClass, field); addEncoderMethod(plasticClass, field); } } InjectEntitySelectSupportWorker(final EntityDAOLocator locator); void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model); }
InjectEntitySelectSupportWorker implements ComponentClassTransformWorker2 { public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model) { for(final PlasticField field : plasticClass.getFieldsWithAnnotation(InjectEntitySelectSupport.class)) { addModelMethod(plasticClass, field); addEncoderMethod(plasticClass, field); } } InjectEntitySelectSupportWorker(final EntityDAOLocator locator); void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model);  }