}
@Test
public void injection_provider_threw_exception() {
ObjectLocator locator = mockObjectLocator();
InjectionProvider ip = newMock(InjectionProvider.class);
Inject annotation = newInject();
ClassTransformation ct = mockClassTransformation();
MutableComponentModel model = mockMutableComponentModel();
TransformField field = newMock(TransformField.class);
RuntimeException failure = new RuntimeException("Oops.");
train_matchFields(ct, field);
train_getName(field, "myfield");
train_getAnnotation(field, Inject.class, annotation);
train_getType(field, REQUEST_CLASS_NAME);
train_toClass(ct, REQUEST_CLASS_NAME, Request.class);
expect(
ip.provideInjection("myfield", Request.class, locator, ct,
model)).andThrow(failure);
train_getClassName(ct, "foo.bar.Baz");
replay();