@Test public void afterResponse_customMonitoringListenerThrowException_shouldNotAffectAgentListener() { Request<?> request = getRequest(); Response<?> response = getResponse(request); doThrow(new RuntimeException("Oops")).when(customMonitoringListener).handleEvent(any(ApiMonitoringEvent.class)); requestHandler.afterResponse(request, response); verify(agentMonitoringListener, times(1)).handleEvent(any(ApiMonitoringEvent.class)); verify(customMonitoringListener, times(1)).handleEvent(any(ApiMonitoringEvent.class)); }
@Override public void afterResponse(Request<?> request, Response<?> response) { ApiCallMonitoringEvent event = generateApiCallMonitoringEvent(request); handToMonitoringListeners(event); }
ClientSideMonitoringRequestHandler extends RequestHandler2 { @Override public void afterResponse(Request<?> request, Response<?> response) { ApiCallMonitoringEvent event = generateApiCallMonitoringEvent(request); handToMonitoringListeners(event); } }
ClientSideMonitoringRequestHandler extends RequestHandler2 { @Override public void afterResponse(Request<?> request, Response<?> response) { ApiCallMonitoringEvent event = generateApiCallMonitoringEvent(request); handToMonitoringListeners(event); } ClientSideMonitoringRequestHandler(String clientId, Collection<MonitoringListener> monitoringListeners); }
ClientSideMonitoringRequestHandler extends RequestHandler2 { @Override public void afterResponse(Request<?> request, Response<?> response) { ApiCallMonitoringEvent event = generateApiCallMonitoringEvent(request); handToMonitoringListeners(event); } ClientSideMonitoringRequestHandler(String clientId, Collection<MonitoringListener> monitoringListeners); @Override void afterAttempt(HandlerAfterAttemptContext context); @Override void afterResponse(Request<?> request, Response<?> response); @Override void afterError(Request<?> request, Response<?> response, Exception e); }
ClientSideMonitoringRequestHandler extends RequestHandler2 { @Override public void afterResponse(Request<?> request, Response<?> response) { ApiCallMonitoringEvent event = generateApiCallMonitoringEvent(request); handToMonitoringListeners(event); } ClientSideMonitoringRequestHandler(String clientId, Collection<MonitoringListener> monitoringListeners); @Override void afterAttempt(HandlerAfterAttemptContext context); @Override void afterResponse(Request<?> request, Response<?> response); @Override void afterError(Request<?> request, Response<?> response, Exception e);  }