@Test public void shouldNotCreateProcessorForPostRequest() throws Exception { when(mockRequest.getMethod()).thenReturn("POST"); MetadataHandler handlerToTest = new MetadataHandler(httpClientMock); MessageProcessorBase returnValue = handlerToTest.createRequestProcessor("something", mockRequest, mockResponse, null); assertNull("Was expecting a null return value", returnValue); }
@Override MessageProcessorBase createRequestProcessor(String target, HttpServletRequest request, HttpServletResponse response, OpMonitoringData opMonitoringData) throws Exception { log.trace("createRequestProcessor({})", target); if (!isGetRequest(request)) { return null; } if (target == null) { throw new CodedException(X_INVALID_REQUEST, "Target must not be null"); } MetadataClientRequestProcessor processor = new MetadataClientRequestProcessor(target, request, response); if (processor.canProcess()) { log.trace("Processing with MetadataClientRequestProcessor"); return processor; } return null; }
MetadataHandler extends AbstractClientProxyHandler { @Override MessageProcessorBase createRequestProcessor(String target, HttpServletRequest request, HttpServletResponse response, OpMonitoringData opMonitoringData) throws Exception { log.trace("createRequestProcessor({})", target); if (!isGetRequest(request)) { return null; } if (target == null) { throw new CodedException(X_INVALID_REQUEST, "Target must not be null"); } MetadataClientRequestProcessor processor = new MetadataClientRequestProcessor(target, request, response); if (processor.canProcess()) { log.trace("Processing with MetadataClientRequestProcessor"); return processor; } return null; } }
MetadataHandler extends AbstractClientProxyHandler { @Override MessageProcessorBase createRequestProcessor(String target, HttpServletRequest request, HttpServletResponse response, OpMonitoringData opMonitoringData) throws Exception { log.trace("createRequestProcessor({})", target); if (!isGetRequest(request)) { return null; } if (target == null) { throw new CodedException(X_INVALID_REQUEST, "Target must not be null"); } MetadataClientRequestProcessor processor = new MetadataClientRequestProcessor(target, request, response); if (processor.canProcess()) { log.trace("Processing with MetadataClientRequestProcessor"); return processor; } return null; } MetadataHandler(HttpClient client); }
MetadataHandler extends AbstractClientProxyHandler { @Override MessageProcessorBase createRequestProcessor(String target, HttpServletRequest request, HttpServletResponse response, OpMonitoringData opMonitoringData) throws Exception { log.trace("createRequestProcessor({})", target); if (!isGetRequest(request)) { return null; } if (target == null) { throw new CodedException(X_INVALID_REQUEST, "Target must not be null"); } MetadataClientRequestProcessor processor = new MetadataClientRequestProcessor(target, request, response); if (processor.canProcess()) { log.trace("Processing with MetadataClientRequestProcessor"); return processor; } return null; } MetadataHandler(HttpClient client);  }
MetadataHandler extends AbstractClientProxyHandler { @Override MessageProcessorBase createRequestProcessor(String target, HttpServletRequest request, HttpServletResponse response, OpMonitoringData opMonitoringData) throws Exception { log.trace("createRequestProcessor({})", target); if (!isGetRequest(request)) { return null; } if (target == null) { throw new CodedException(X_INVALID_REQUEST, "Target must not be null"); } MetadataClientRequestProcessor processor = new MetadataClientRequestProcessor(target, request, response); if (processor.canProcess()) { log.trace("Processing with MetadataClientRequestProcessor"); return processor; } return null; } MetadataHandler(HttpClient client);   }