protected void setUp(Injector injector) throws Exception { // calls all doSettings() for me and my parents PrivilegedAccessor.invokeAllStaticMethods(this.getClass(), "doSettings", null); this.injector = injector; // calls all doSettings() for me and my children // rs=new RouterService(callback); assertEquals("unexpected port", SERVER_PORT, NetworkSettings.PORT.getValue()); lifecycleManager = injector.getInstance(LifecycleManager.class); connectionServices = injector.getInstance(ConnectionServices.class); blockingConnectionFactory = injector.getInstance(BlockingConnectionFactory.class); pingReplyFactory = injector.getInstance(PingReplyFactory.class); headersFactory = injector.getInstance(HeadersFactory.class); lifecycleManager.start(); connectionServices.connect(); Thread.sleep(2000); assertEquals("unexpected port", SERVER_PORT, NetworkSettings.PORT.getValue()); }