BodyWriter implements ProcessorConstants, AngularConstants { public void write(Writer writer, InputStream body) throws IOException { try (BufferedReader reader = new BufferedReader(new InputStreamReader(body))) { String line; while ((line = reader.readLine()) != null) { writer.write(line); writer.write("\n"); } } }  void write(Writer writer, InputStream body); InputStream getInputStream(String resource);  }
@Test public void testWrite() throws Exception { System.out.println("write"); InputStream body = new ByteArrayInputStream("LINE1\nLINE2\n".getBytes(Charset.defaultCharset())); Writer writer = WriterTest.getMockWriter(); instance.write(writer, body); List<String> allValues = WriterTest.captureWrite(writer); assertThat(allValues).contains("LINE1", "LINE2"); }