### Question:
HttpResponseFactory { public static HttpResponse createOKResponse(String message) { HttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK); response.headers().set(HttpHeaders.Names.CONTENT_TYPE, APPLICATION_JSON); ChannelBuffer buf = ChannelBuffers.copiedBuffer(message.getBytes(CharsetUtil.UTF_8)); response.setContent(buf); response.headers().set(HttpHeaders.Names.CONTENT_LENGTH, buf.array().length); return response; }  static HttpResponse createISEResponse(); static HttpResponse createUnauthorizedResponse(String message); static HttpResponse createNotFoundResponse(); static HttpResponse createOKResponse(String message); static HttpResponse createResponse(HttpResponseStatus httpStatus, String message); static final String NOT_FOUND_CONTENT; static final String APPLICATION_JSON; }### Answer:
@Test public void when_OK_response_set_header_and_body() throws Exception { mockNoGlobalErrors(); String message = "OK message"; HttpResponse response = HttpResponseFactory.createOKResponse(message); assertEquals(response.getStatus(), HttpResponseStatus.OK); assertEquals(response.headers().get(HttpHeaders.CONTENT_TYPE), HttpResponseFactory.APPLICATION_JSON); String responseMsg = new String(response.getContent().array()); assertEquals(responseMsg, message); }