@Test public void testWriteResponseShouldProcessResponse() throws IOException { given(stubResponseGenerator.generateResponse(req, resp)).willReturn(byteArray); underTest.writeResponse(req, resp); verify(stubResponseProcessor).processResponse(req, resp, byteArray); }
public void writeResponse(final HttpServletRequest req, final HttpServletResponse resp) throws IOException { byte[] responseBody = stubResponseGenerator.generateResponse(req, resp); if (responseBody != null) { responseBody = stubResponseProcessor.processResponse(req, resp, responseBody); writeResponseToOutputStream(resp, responseBody); } else { writeErrorResponse(resp); logger.warn("Wilma has got an unwanted request from this address: " + req.getRemoteAddr()); } }
StubResponseWriter { public void writeResponse(final HttpServletRequest req, final HttpServletResponse resp) throws IOException { byte[] responseBody = stubResponseGenerator.generateResponse(req, resp); if (responseBody != null) { responseBody = stubResponseProcessor.processResponse(req, resp, responseBody); writeResponseToOutputStream(resp, responseBody); } else { writeErrorResponse(resp); logger.warn("Wilma has got an unwanted request from this address: " + req.getRemoteAddr()); } } }
StubResponseWriter { public void writeResponse(final HttpServletRequest req, final HttpServletResponse resp) throws IOException { byte[] responseBody = stubResponseGenerator.generateResponse(req, resp); if (responseBody != null) { responseBody = stubResponseProcessor.processResponse(req, resp, responseBody); writeResponseToOutputStream(resp, responseBody); } else { writeErrorResponse(resp); logger.warn("Wilma has got an unwanted request from this address: " + req.getRemoteAddr()); } }  }
StubResponseWriter { public void writeResponse(final HttpServletRequest req, final HttpServletResponse resp) throws IOException { byte[] responseBody = stubResponseGenerator.generateResponse(req, resp); if (responseBody != null) { responseBody = stubResponseProcessor.processResponse(req, resp, responseBody); writeResponseToOutputStream(resp, responseBody); } else { writeErrorResponse(resp); logger.warn("Wilma has got an unwanted request from this address: " + req.getRemoteAddr()); } }  void writeResponse(final HttpServletRequest req, final HttpServletResponse resp); }
StubResponseWriter { public void writeResponse(final HttpServletRequest req, final HttpServletResponse resp) throws IOException { byte[] responseBody = stubResponseGenerator.generateResponse(req, resp); if (responseBody != null) { responseBody = stubResponseProcessor.processResponse(req, resp, responseBody); writeResponseToOutputStream(resp, responseBody); } else { writeErrorResponse(resp); logger.warn("Wilma has got an unwanted request from this address: " + req.getRemoteAddr()); } }  void writeResponse(final HttpServletRequest req, final HttpServletResponse resp);  }