@Test public void twoValid() throws IOException { final String input = "{\"content\":\"package foo;\"}\n{\"content\":\"package bar;\"}\n"; final InputStream in = new ByteArrayInputStream(input.getBytes()); final RequestReader reader = new RequestReader(in); Request request = reader.read(); Request expected = new Request(); expected.content = "package foo;"; assertThat(request.content).isEqualTo(expected.content); assertThat(request).isEqualTo(expected); request = reader.read(); expected = new Request(); expected.content = "package bar;"; assertThat(request.content).isEqualTo(expected.content); assertThat(request).isEqualTo(expected); }
public Request read() throws IOException { final String line = this.reader.readLine(); if (line == null) { throw new CloseException("exception while reading line (null)"); } return mapper.readValue(line, Request.class); }
RequestReader { public Request read() throws IOException { final String line = this.reader.readLine(); if (line == null) { throw new CloseException("exception while reading line (null)"); } return mapper.readValue(line, Request.class); } }
RequestReader { public Request read() throws IOException { final String line = this.reader.readLine(); if (line == null) { throw new CloseException("exception while reading line (null)"); } return mapper.readValue(line, Request.class); } RequestReader(final InputStream in); }
RequestReader { public Request read() throws IOException { final String line = this.reader.readLine(); if (line == null) { throw new CloseException("exception while reading line (null)"); } return mapper.readValue(line, Request.class); } RequestReader(final InputStream in); Request read(); }
RequestReader { public Request read() throws IOException { final String line = this.reader.readLine(); if (line == null) { throw new CloseException("exception while reading line (null)"); } return mapper.readValue(line, Request.class); } RequestReader(final InputStream in); Request read();  }