@Test public void testRedirectRequestToStubShouldReturnFalseWhenResponseDescriptorIsNull() { given(request.getBody()).willReturn(requestBody); given(stubDescriptorEvaluator.findResponseDescriptor(stubDescriptors, request)).willReturn(null); boolean actual = underTest.redirectRequestToStub(request); assertEquals(actual, false); }
public boolean redirectRequestToStub(final WilmaHttpRequest request) { boolean redirect; ResponseDescriptorDTO responseDescriptorDTO = stubDescriptorEvaluator.findResponseDescriptor(stubDescriptors, request); if (responseDescriptorDTO == null) { responseDescriptorDTO = stubModeEvaluator.getResponseDescriptorForStubMode(request, operationMode); } redirect = responseDescriptorDTO != null; if (redirect) { request.addHeaderUpdate(WilmaHttpEntity.WILMA_LOGGER_ID, request.getWilmaMessageId()); saveInResponseDescriptorMap(request, responseDescriptorDTO); } return redirect; }
RoutingService { public boolean redirectRequestToStub(final WilmaHttpRequest request) { boolean redirect; ResponseDescriptorDTO responseDescriptorDTO = stubDescriptorEvaluator.findResponseDescriptor(stubDescriptors, request); if (responseDescriptorDTO == null) { responseDescriptorDTO = stubModeEvaluator.getResponseDescriptorForStubMode(request, operationMode); } redirect = responseDescriptorDTO != null; if (redirect) { request.addHeaderUpdate(WilmaHttpEntity.WILMA_LOGGER_ID, request.getWilmaMessageId()); saveInResponseDescriptorMap(request, responseDescriptorDTO); } return redirect; } }
RoutingService { public boolean redirectRequestToStub(final WilmaHttpRequest request) { boolean redirect; ResponseDescriptorDTO responseDescriptorDTO = stubDescriptorEvaluator.findResponseDescriptor(stubDescriptors, request); if (responseDescriptorDTO == null) { responseDescriptorDTO = stubModeEvaluator.getResponseDescriptorForStubMode(request, operationMode); } redirect = responseDescriptorDTO != null; if (redirect) { request.addHeaderUpdate(WilmaHttpEntity.WILMA_LOGGER_ID, request.getWilmaMessageId()); saveInResponseDescriptorMap(request, responseDescriptorDTO); } return redirect; }  }
RoutingService { public boolean redirectRequestToStub(final WilmaHttpRequest request) { boolean redirect; ResponseDescriptorDTO responseDescriptorDTO = stubDescriptorEvaluator.findResponseDescriptor(stubDescriptors, request); if (responseDescriptorDTO == null) { responseDescriptorDTO = stubModeEvaluator.getResponseDescriptorForStubMode(request, operationMode); } redirect = responseDescriptorDTO != null; if (redirect) { request.addHeaderUpdate(WilmaHttpEntity.WILMA_LOGGER_ID, request.getWilmaMessageId()); saveInResponseDescriptorMap(request, responseDescriptorDTO); } return redirect; }  boolean redirectRequestToStub(final WilmaHttpRequest request); ResponseDescriptorDTO getResponseDescriptorDTOAndRemove(final String key); void setOperationMode(final OperationMode operationMode); Map<String, StubDescriptor> getStubDescriptors(); boolean isStubModeOn(); void performModification(final StubDescriptorModificationCommand command); }
RoutingService { public boolean redirectRequestToStub(final WilmaHttpRequest request) { boolean redirect; ResponseDescriptorDTO responseDescriptorDTO = stubDescriptorEvaluator.findResponseDescriptor(stubDescriptors, request); if (responseDescriptorDTO == null) { responseDescriptorDTO = stubModeEvaluator.getResponseDescriptorForStubMode(request, operationMode); } redirect = responseDescriptorDTO != null; if (redirect) { request.addHeaderUpdate(WilmaHttpEntity.WILMA_LOGGER_ID, request.getWilmaMessageId()); saveInResponseDescriptorMap(request, responseDescriptorDTO); } return redirect; }  boolean redirectRequestToStub(final WilmaHttpRequest request); ResponseDescriptorDTO getResponseDescriptorDTOAndRemove(final String key); void setOperationMode(final OperationMode operationMode); Map<String, StubDescriptor> getStubDescriptors(); boolean isStubModeOn(); void performModification(final StubDescriptorModificationCommand command);  }