DependencyInjector icon indicating copy to clipboard operation
DependencyInjector copied to clipboard

Cannot mock injector

Open ljacqu opened this issue 9 years ago • 0 comments

For what it's worth, the following does not work:

@RunWith(DelayedInjectionRunner.class)
public class MyTest {
  @Mock
  private Injector injector;
}

Delayed injection runner is using an injector internally, and then tries to register the mock Injector field with the injector. But the real injector in the test runner already registered itself...

ljacqu avatar Jul 17 '16 19:07 ljacqu