* annotation processors is called with the extension parameter in a middle
* position. Specifically, verifies that the heuristic processor updates
* injection names and preserves their ordering.
*/
public void testBarAnnotationProcessedFirstInMiddle() throws Exception {
JavaImplementation type = javaImplementationFactory.createJavaImplementation();
Constructor<Foo2> ctor = Foo2.class.getConstructor(String.class, String.class, String.class);
JavaConstructorImpl<Foo2> definition = new JavaConstructorImpl<Foo2>(ctor);
type.setConstructor(definition);
// insert placeholder for first param, which would be done by a
// processor
definition.getParameters()[0].setName("");
Property property = factory.createProperty();
// Hack to add a property member
JavaElementImpl element = new JavaElementImpl("myBar", String.class, null);
type.getPropertyMembers().put("myBar", element);
property.setName("myBar");
definition.getParameters()[1].setName("myBar");
type.getProperties().add(property);
visitEnd(Foo2.class, type);
assertEquals("baz", definition.getParameters()[0].getName());
assertEquals(2, type.getProperties().size());
assertEquals(1, type.getReferences().size());
}