@Test public void afterError_customMonitoringListenerThrowException_shouldNotAffectAgentListener() { Request<?> request = getRequest(); Response<?> response = getResponse(request); doThrow(new RuntimeException("Oops")).when(customMonitoringListener).handleEvent(any(ApiMonitoringEvent.class)); requestHandler.afterError(request, response, new AmazonServiceException("test")); verify(agentMonitoringListener, times(1)).handleEvent(any(ApiMonitoringEvent.class)); verify(customMonitoringListener, times(1)).handleEvent(any(ApiMonitoringEvent.class)); }
@Override public void afterError(Request<?> request, Response<?> response, Exception e) { ApiCallMonitoringEvent event = generateApiCallMonitoringEvent(request, e); handToMonitoringListeners(event); }
ClientSideMonitoringRequestHandler extends RequestHandler2 { @Override public void afterError(Request<?> request, Response<?> response, Exception e) { ApiCallMonitoringEvent event = generateApiCallMonitoringEvent(request, e); handToMonitoringListeners(event); } }
ClientSideMonitoringRequestHandler extends RequestHandler2 { @Override public void afterError(Request<?> request, Response<?> response, Exception e) { ApiCallMonitoringEvent event = generateApiCallMonitoringEvent(request, e); handToMonitoringListeners(event); } ClientSideMonitoringRequestHandler(String clientId, Collection<MonitoringListener> monitoringListeners); }
ClientSideMonitoringRequestHandler extends RequestHandler2 { @Override public void afterError(Request<?> request, Response<?> response, Exception e) { ApiCallMonitoringEvent event = generateApiCallMonitoringEvent(request, e); 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 afterError(Request<?> request, Response<?> response, Exception e) { ApiCallMonitoringEvent event = generateApiCallMonitoringEvent(request, e); 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);  }