@Test public void testWhenActualSequenceIsNotNullShouldWaitForSequenceResponses() throws InterruptedException { WilmaSequence sequence = Mockito.mock(WilmaSequence.class); given(wilmaRequest.getHeader(WilmaHttpEntity.WILMA_SEQUENCE_ID)).willReturn("abcd"); String[] sequenceIds = new String[]{"id"}; given(headerCreator.resolveSequenceHeader("abcd")).willReturn(sequenceIds); given(matcher.matchSequenceKeyWithDescriptor(SEQUENCE_DESCRIPTOR_KEY, sequenceIds)).willReturn(sequence); underTest.generateResponse(request, response); verify(sequenceResponseGuard).waitForResponses(wilmaRequest, sequence); }
public byte[] generateResponse(final HttpServletRequest req, final HttpServletResponse resp) { String wilmaLoggerId = req.getHeader(WilmaHttpRequest.WILMA_LOGGER_ID); byte[] result = null; if (wilmaLoggerId != null) { ResponseDescriptorDTO responseDescriptorDTO = mapBasedResponseDescriptorAccess.getResponseDescriptor(wilmaLoggerId); Set<ResponseFormatterDescriptor> responseFormatterDescriptors = responseDescriptorDTO.getResponseDescriptor().getResponseFormatters(); WilmaHttpRequest wilmaRequest = httpServletRequestTransformer.transformToWilmaHttpRequest(wilmaLoggerId, req, responseDescriptorDTO); stubResponseHeaderConfigurer.addWilmaInfoToResponseHeader(req, resp, responseDescriptorDTO.getDialogDescriptorName()); result = generate(resp, responseDescriptorDTO, responseFormatterDescriptors, wilmaRequest); } return result; }
StubResponseGenerator { public byte[] generateResponse(final HttpServletRequest req, final HttpServletResponse resp) { String wilmaLoggerId = req.getHeader(WilmaHttpRequest.WILMA_LOGGER_ID); byte[] result = null; if (wilmaLoggerId != null) { ResponseDescriptorDTO responseDescriptorDTO = mapBasedResponseDescriptorAccess.getResponseDescriptor(wilmaLoggerId); Set<ResponseFormatterDescriptor> responseFormatterDescriptors = responseDescriptorDTO.getResponseDescriptor().getResponseFormatters(); WilmaHttpRequest wilmaRequest = httpServletRequestTransformer.transformToWilmaHttpRequest(wilmaLoggerId, req, responseDescriptorDTO); stubResponseHeaderConfigurer.addWilmaInfoToResponseHeader(req, resp, responseDescriptorDTO.getDialogDescriptorName()); result = generate(resp, responseDescriptorDTO, responseFormatterDescriptors, wilmaRequest); } return result; } }
StubResponseGenerator { public byte[] generateResponse(final HttpServletRequest req, final HttpServletResponse resp) { String wilmaLoggerId = req.getHeader(WilmaHttpRequest.WILMA_LOGGER_ID); byte[] result = null; if (wilmaLoggerId != null) { ResponseDescriptorDTO responseDescriptorDTO = mapBasedResponseDescriptorAccess.getResponseDescriptor(wilmaLoggerId); Set<ResponseFormatterDescriptor> responseFormatterDescriptors = responseDescriptorDTO.getResponseDescriptor().getResponseFormatters(); WilmaHttpRequest wilmaRequest = httpServletRequestTransformer.transformToWilmaHttpRequest(wilmaLoggerId, req, responseDescriptorDTO); stubResponseHeaderConfigurer.addWilmaInfoToResponseHeader(req, resp, responseDescriptorDTO.getDialogDescriptorName()); result = generate(resp, responseDescriptorDTO, responseFormatterDescriptors, wilmaRequest); } return result; }  }
StubResponseGenerator { public byte[] generateResponse(final HttpServletRequest req, final HttpServletResponse resp) { String wilmaLoggerId = req.getHeader(WilmaHttpRequest.WILMA_LOGGER_ID); byte[] result = null; if (wilmaLoggerId != null) { ResponseDescriptorDTO responseDescriptorDTO = mapBasedResponseDescriptorAccess.getResponseDescriptor(wilmaLoggerId); Set<ResponseFormatterDescriptor> responseFormatterDescriptors = responseDescriptorDTO.getResponseDescriptor().getResponseFormatters(); WilmaHttpRequest wilmaRequest = httpServletRequestTransformer.transformToWilmaHttpRequest(wilmaLoggerId, req, responseDescriptorDTO); stubResponseHeaderConfigurer.addWilmaInfoToResponseHeader(req, resp, responseDescriptorDTO.getDialogDescriptorName()); result = generate(resp, responseDescriptorDTO, responseFormatterDescriptors, wilmaRequest); } return result; }  byte[] generateResponse(final HttpServletRequest req, final HttpServletResponse resp); }
StubResponseGenerator { public byte[] generateResponse(final HttpServletRequest req, final HttpServletResponse resp) { String wilmaLoggerId = req.getHeader(WilmaHttpRequest.WILMA_LOGGER_ID); byte[] result = null; if (wilmaLoggerId != null) { ResponseDescriptorDTO responseDescriptorDTO = mapBasedResponseDescriptorAccess.getResponseDescriptor(wilmaLoggerId); Set<ResponseFormatterDescriptor> responseFormatterDescriptors = responseDescriptorDTO.getResponseDescriptor().getResponseFormatters(); WilmaHttpRequest wilmaRequest = httpServletRequestTransformer.transformToWilmaHttpRequest(wilmaLoggerId, req, responseDescriptorDTO); stubResponseHeaderConfigurer.addWilmaInfoToResponseHeader(req, resp, responseDescriptorDTO.getDialogDescriptorName()); result = generate(resp, responseDescriptorDTO, responseFormatterDescriptors, wilmaRequest); } return result; }  byte[] generateResponse(final HttpServletRequest req, final HttpServletResponse resp);  }