@Test public void throwOnClosed() throws IOException { final InputStream in = new ByteArrayInputStream(new byte[]{}) { @Override public int read(byte[] var1) throws IOException { throw new IOException("closed"); } }; final RequestReader reader = new RequestReader(in); boolean thrown = false; try { reader.read(); } catch (IOException ex) { thrown = true; } assertThat(thrown).isTrue(); }
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();  }