AgentMonitoringListener extends MonitoringListener { @Override public void handleEvent(MonitoringEvent event) { dispatcher.addWriteTask(event, channel, maxSize); } AgentMonitoringListener(String host, int port); @SdkTestInternalApi  AgentMonitoringListener(DatagramChannel channel, AsynchronousAgentDispatcher dispatcher, int maxSize); @Override void handleEvent(MonitoringEvent event); @Override String toString(); void shutdown();  }
@Test public void delegatesWriteToDispatcher() { ApiCallAttemptMonitoringEvent event = new ApiCallAttemptMonitoringEvent(); monitoringListener.handleEvent(event); verify(dispatcher).addWriteTask(eq(event), eq(channel), eq(8192)); }