PlainTextReport implements Reportable { @Override public void renderToStream(final OutputStream outputStream) { final Charset charset = StandardCharsets.UTF_8; try (final PrintStream report = new PrintStream(outputStream, false, charset.displayName())) { renderToPrintStream(report); } catch (final UnsupportedEncodingException e) { throw new ReportException("Encoding charset '" + charset + "' not supported", e); } } PlainTextReport(final Trace trace, final ReportSettings settings); @Override void renderToStream(final OutputStream outputStream);  }
@Test void testOutputStreamClosed() throws IOException { final OutputStream outputStreamMock = mock(OutputStream.class); final ReportSettings settings = ReportSettings.builder().verbosity(ReportVerbosity.SUMMARY) .build(); new PlainTextReport(this.traceMock, settings).renderToStream(outputStreamMock); verify(outputStreamMock).close(); }