ErrorDetailHttpMessageConverter extends AbstractHttpMessageConverter<ErrorDetail> { private static void writeInternalCSV(ErrorDetail errorDetail, Writer writer) throws IOException { writer.write("URI;" + errorDetail.getRequest() + ";\n"); writer.write("Status;" + errorDetail.getStatus() + " (" + errorDetail.getStatus().getReasonPhrase() + ");\n"); writer.write("Message;" + errorDetail.getMessage() + ";\n"); writer.write("Time;" + errorDetail.getWhen() + ";\n"); } ErrorDetailHttpMessageConverter(MediaType... supportedMediaTypes);   }
@Test public void writeInternalCSV() throws IOException { String output = convertErrorDetailFor(MEDIA_TYPE_TEXT_CSV); assertThat(output, containsString("Status")); assertThat(output, containsString(Integer.toString(TEST_ERROR_DETAIL.getStatus().value()))); assertThat(output, containsString(";")); }