StubResponseHeaderConfigurer { public void setResponseContentTypeAndStatus(final HttpServletResponse resp, final ResponseDescriptorDTO responseDescriptorDTO) { ResponseDescriptorAttributes attributes = responseDescriptorDTO.getResponseDescriptor().getAttributes(); resp.setContentType(attributes.getMimeType()); resp.setStatus(Integer.valueOf(attributes.getCode())); }  void addWilmaInfoToResponseHeader(final HttpServletRequest req, final HttpServletResponse resp, final String dialogDescriptorName); void setResponseContentTypeAndStatus(final HttpServletResponse resp, final ResponseDescriptorDTO responseDescriptorDTO); void setErrorResponseContentTypeAndStatus(final HttpServletResponse resp);  }
@Test public void testSetResponseContentTypeAndStatusShouldSetContentTypeAndStatusCodeOnResponse() { String statusCode = "404"; Template template = new Template(null, null, null); ResponseDescriptorAttributes attributes = new ResponseDescriptorAttributes.Builder().delay(0).code(statusCode).template(template) .mimeType(MimeType.TEXT.getOfficialMimeType()).build(); given(responseDescriptorDTO.getResponseDescriptor().getAttributes()).willReturn(attributes); underTest.setResponseContentTypeAndStatus(response, responseDescriptorDTO); verify(response).setStatus(Integer.valueOf(statusCode)); verify(response).setContentType(MimeType.TEXT.getOfficialMimeType()); }