AgentMonitoring { public void setAgentInterface( AgentMessagingInterface agentInterface ) { this.agentInterface = agentInterface; } AgentMonitoring(); void start(); void stop(); void handlerAppears( IMonitoringHandler handler ); void handlerDisappears( IMonitoringHandler handler ); void setAgentInterface( AgentMessagingInterface agentInterface ); static void listHandlers( List<IMonitoringHandler> handlers, Logger logger );  }
@Test @SuppressWarnings( "unchecked" ) public void testExtensibilityNotifications_defaultHandlers() throws Exception { AgentMonitoring am = new AgentMonitoring(); am.setAgentInterface( new MyAgentInterface( null )); List<IMonitoringHandler> handlers = TestUtils.getInternalField( am, "handlers", List.class ); Assert.assertEquals( 3, handlers.size()); Assert.assertEquals( FileHandler.class, handlers.get( 0 ).getClass()); Assert.assertEquals( NagiosHandler.class, handlers.get( 1 ).getClass()); Assert.assertEquals( RestHandler.class, handlers.get( 2 ).getClass()); }