import org.junit.Test;
import org.wamblee.inject.Injector;
-
public class ComponentInstantiationInjectorTest {
-
+
@Test
- public void testListener() {
+ public void testListener() {
WicketTester tester = new WicketTester();
- tester.getApplication().addComponentInstantiationListener(new ComponentInstantiationInjector());
-
- Injector injector = mock(Injector.class);
- TestInjectorFactory.setMockInjector(injector);
-
+ tester.getApplication().addComponentInstantiationListener(
+ new ComponentInstantiationInjector());
+
+ Injector injector = mock(Injector.class);
+ TestInjectorFactory.setMockInjector(injector);
+
Component component = new WebMarkupContainer("hello");
-
- // Verify the injector was called with the component as an argument.
- verify(injector).inject(same(component));
+
+ // Verify the injector was called with the component as an argument.
+ verify(injector).inject(same(component));
}
}