ErrorDetailHttpMessageConverter extends AbstractHttpMessageConverter<ErrorDetail> { private static void writeInternalHTML(ErrorDetail errorDetail, Writer writer) throws IOException { writer.write("<html>\n"); writer.write(" <body>\n"); writer.write(" <h1>Status " + errorDetail.getStatus() + " (" + errorDetail.getStatus().name() + ")</h1>\n"); writer.write(" <p>" + errorDetail.getMessage() + "</p>\n"); writer.write(" </body>\n"); writer.write("</html>\n"); } ErrorDetailHttpMessageConverter(MediaType... supportedMediaTypes);   }
@Test public void writeInternalHTML() throws IOException { String output = convertErrorDetailFor(MediaType.TEXT_HTML); assertThat(output, containsString("<html>")); }