@Test public void oneMalformedOnValid() throws IOException { final String input = "foo\n{\"content\":\"package foo;\"}\n"; final InputStream in = new ByteArrayInputStream(input.getBytes()); final RequestReader reader = new RequestReader(in); boolean thrown = false; try { reader.read(); } catch (IOException ex) { thrown = true; } assertThat(thrown).isTrue(); Request request = reader.read(); Request expected = new Request(); expected.content = "package foo;"; 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();  }