@Test
public void javax_inject_annotation_on_field()
{
ObjectLocator ol = mockObjectLocator();
FieldInjectionViaInject target = new FieldInjectionViaInject();
final SymbolSource ss = mockSymbolSource();
IAnswer answer = new IAnswer()
{
public Object answer() throws Throwable
{
Object[] args = EasyMock.getCurrentArguments();
AnnotationProvider ap = (AnnotationProvider) args[1];
// Verify that annotations on the field are accessible.
assertNotNull(ap.getAnnotation(Builtin.class));
return ss;
}
};
expect(ol.getObject(eq(SymbolSource.class), isA(AnnotationProvider.class))).andAnswer(answer);
replay();
InternalUtils.injectIntoFields(target, ol, null, tracker);