@Test public void testExecuteSQSActionUnkownProcessor() { Assert.assertFalse(typeRequestProcessor.processRequest( new SQSRequestContext( null, new QueueRequest("unknown", null, null, null), null)) .isSuccessful()); }
@Override public SQSQueueResult processRequest(SQSRequestContext sqsRequestContext) { SQSQueueResult requestResult; QueueRequest queueRequest = sqsRequestContext.getQueueRequest(); logger.info("Attempting to process requestType: {}", queueRequest.getRequestType()); SQSRequestProcessor processor = requestProcessorMap.get(queueRequest.getRequestType()); if(processor == null) { requestResult = new SQSQueueResult() .setSuccessful(false) .setMessage(String.format("No processor found for request type: %1$s", queueRequest.getRequestType())); } else { try { requestResult = processor.processRequest(sqsRequestContext); } catch (Exception e) { logger.error(String.format("Failed to process SQS Action: %1$s", queueRequest.getRequestType()), e); requestResult = new SQSQueueResult(); requestResult.setSuccessful(false); } } return requestResult; }
TypeRequestProcessor implements SQSRequestProcessor { @Override public SQSQueueResult processRequest(SQSRequestContext sqsRequestContext) { SQSQueueResult requestResult; QueueRequest queueRequest = sqsRequestContext.getQueueRequest(); logger.info("Attempting to process requestType: {}", queueRequest.getRequestType()); SQSRequestProcessor processor = requestProcessorMap.get(queueRequest.getRequestType()); if(processor == null) { requestResult = new SQSQueueResult() .setSuccessful(false) .setMessage(String.format("No processor found for request type: %1$s", queueRequest.getRequestType())); } else { try { requestResult = processor.processRequest(sqsRequestContext); } catch (Exception e) { logger.error(String.format("Failed to process SQS Action: %1$s", queueRequest.getRequestType()), e); requestResult = new SQSQueueResult(); requestResult.setSuccessful(false); } } return requestResult; } }
TypeRequestProcessor implements SQSRequestProcessor { @Override public SQSQueueResult processRequest(SQSRequestContext sqsRequestContext) { SQSQueueResult requestResult; QueueRequest queueRequest = sqsRequestContext.getQueueRequest(); logger.info("Attempting to process requestType: {}", queueRequest.getRequestType()); SQSRequestProcessor processor = requestProcessorMap.get(queueRequest.getRequestType()); if(processor == null) { requestResult = new SQSQueueResult() .setSuccessful(false) .setMessage(String.format("No processor found for request type: %1$s", queueRequest.getRequestType())); } else { try { requestResult = processor.processRequest(sqsRequestContext); } catch (Exception e) { logger.error(String.format("Failed to process SQS Action: %1$s", queueRequest.getRequestType()), e); requestResult = new SQSQueueResult(); requestResult.setSuccessful(false); } } return requestResult; } TypeRequestProcessor(); }
TypeRequestProcessor implements SQSRequestProcessor { @Override public SQSQueueResult processRequest(SQSRequestContext sqsRequestContext) { SQSQueueResult requestResult; QueueRequest queueRequest = sqsRequestContext.getQueueRequest(); logger.info("Attempting to process requestType: {}", queueRequest.getRequestType()); SQSRequestProcessor processor = requestProcessorMap.get(queueRequest.getRequestType()); if(processor == null) { requestResult = new SQSQueueResult() .setSuccessful(false) .setMessage(String.format("No processor found for request type: %1$s", queueRequest.getRequestType())); } else { try { requestResult = processor.processRequest(sqsRequestContext); } catch (Exception e) { logger.error(String.format("Failed to process SQS Action: %1$s", queueRequest.getRequestType()), e); requestResult = new SQSQueueResult(); requestResult.setSuccessful(false); } } return requestResult; } TypeRequestProcessor(); @Override SQSQueueResult processRequest(SQSRequestContext sqsRequestContext); void setRequestProcessorMap(
            Map<String, SQSRequestProcessor> requestProcessorMap); }
TypeRequestProcessor implements SQSRequestProcessor { @Override public SQSQueueResult processRequest(SQSRequestContext sqsRequestContext) { SQSQueueResult requestResult; QueueRequest queueRequest = sqsRequestContext.getQueueRequest(); logger.info("Attempting to process requestType: {}", queueRequest.getRequestType()); SQSRequestProcessor processor = requestProcessorMap.get(queueRequest.getRequestType()); if(processor == null) { requestResult = new SQSQueueResult() .setSuccessful(false) .setMessage(String.format("No processor found for request type: %1$s", queueRequest.getRequestType())); } else { try { requestResult = processor.processRequest(sqsRequestContext); } catch (Exception e) { logger.error(String.format("Failed to process SQS Action: %1$s", queueRequest.getRequestType()), e); requestResult = new SQSQueueResult(); requestResult.setSuccessful(false); } } return requestResult; } TypeRequestProcessor(); @Override SQSQueueResult processRequest(SQSRequestContext sqsRequestContext); void setRequestProcessorMap(
            Map<String, SQSRequestProcessor> requestProcessorMap);  }