@Test public void testAfterInjection() throws Exception { Initializable initializable = createMock(Initializable.class); initializable.init(); replay(initializable); InitializableInjectionListener underTest = new InitializableInjectionListener(); underTest.afterInjection(initializable); verify(initializable); } }
public <I> void hear(TypeLiteral<I> type, TypeEncounter<I> encounter) { if (InitializableInjectionListener.MATCHER.matches(type)) { encounter.register(this.<I>castListener(new InitializableInjectionListener<Initializable>())); } if (DestroyableInjectionListener.MATCHER.matches(type)) { encounter.register(this.<I>castListener(new DestroyableInjectionListener<Destroyable>(registry))); } }
public <I> void hear(TypeLiteral<I> type, TypeEncounter<I> encounter) { if (InitializableInjectionListener.MATCHER.matches(type)) { encounter.register(this.<I>castListener(new InitializableInjectionListener<Initializable>())); } if (DestroyableInjectionListener.MATCHER.matches(type)) { encounter.register(this.<I>castListener(new DestroyableInjectionListener<Destroyable>(registry))); } }