@Test public void shouldThrowWhenTargetNull() throws Exception { MetadataHandler handlerToTest = new MetadataHandler(httpClientMock); when(mockRequest.getMethod()).thenReturn("GET"); thrown.expect(CodedException.class); thrown.expect(hasProperty("faultCode", is(X_INVALID_REQUEST))); thrown.expectMessage(CoreMatchers.containsString("Target must not be null")); handlerToTest.createRequestProcessor(null, mockRequest, mockResponse, null); }
@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);   }