@Test public void afterAttempt_SessionTokenCapitalized_ShouldStillWork() { Request<?> request = getRequest(); request.setAWSRequestMetrics(getMetrics(1)); request.getHeaders().clear(); Map<String, String> headers = new HashMap<String, String>(); headers.put(SignerConstants.X_AMZ_SECURITY_TOKEN, SECURITY_TOKENS); request.setHeaders(headers); requestHandler.afterAttempt(getContext(request)); ArgumentCaptor<ApiCallAttemptMonitoringEvent> monitoringEventArgumentCaptor = ArgumentCaptor.forClass(ApiCallAttemptMonitoringEvent.class); verify(agentMonitoringListener, times(1)).handleEvent(monitoringEventArgumentCaptor.capture()); verify(customMonitoringListener, times(1)).handleEvent(any(ApiCallAttemptMonitoringEvent.class)); ApiCallAttemptMonitoringEvent event = monitoringEventArgumentCaptor.getValue(); verifyRequiredEntries(event); verifySuccessfulAttemptEvent(event); }
@Override public void afterAttempt(HandlerAfterAttemptContext context) { ApiCallAttemptMonitoringEvent event = generateApiCallAttemptMonitoringEvent(context); context.getRequest().addHandlerContext(LAST_CALL_ATTEMPT, event); handToMonitoringListeners(event); }
ClientSideMonitoringRequestHandler extends RequestHandler2 { @Override public void afterAttempt(HandlerAfterAttemptContext context) { ApiCallAttemptMonitoringEvent event = generateApiCallAttemptMonitoringEvent(context); context.getRequest().addHandlerContext(LAST_CALL_ATTEMPT, event); handToMonitoringListeners(event); } }
ClientSideMonitoringRequestHandler extends RequestHandler2 { @Override public void afterAttempt(HandlerAfterAttemptContext context) { ApiCallAttemptMonitoringEvent event = generateApiCallAttemptMonitoringEvent(context); context.getRequest().addHandlerContext(LAST_CALL_ATTEMPT, event); handToMonitoringListeners(event); } ClientSideMonitoringRequestHandler(String clientId, Collection<MonitoringListener> monitoringListeners); }
ClientSideMonitoringRequestHandler extends RequestHandler2 { @Override public void afterAttempt(HandlerAfterAttemptContext context) { ApiCallAttemptMonitoringEvent event = generateApiCallAttemptMonitoringEvent(context); context.getRequest().addHandlerContext(LAST_CALL_ATTEMPT, event); 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 afterAttempt(HandlerAfterAttemptContext context) { ApiCallAttemptMonitoringEvent event = generateApiCallAttemptMonitoringEvent(context); context.getRequest().addHandlerContext(LAST_CALL_ATTEMPT, event); 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);  }