### Question:
ImageResponse extends HttpResponse { @Override public void execute(HttpServletResponse resp) throws IOException { resp.setContentType("image/png"); resp.getOutputStream().write(imageBytes); } ImageResponse(byte[] imageBytes); @Override String getText(); @Override void execute(HttpServletResponse resp);  }### Answer:
@Test public void testImageResponseContentType() throws IOException { HttpServletResponse httpServletResponse = new MockHttpServletResponse(); byte[] imageBytes = "image fake".getBytes(); ImageResponse imageResponse = new ImageResponse(imageBytes); imageResponse.execute(httpServletResponse); assertEquals("image/png", httpServletResponse.getContentType()); }