@Test public void readResponse_withPartlyConsumingCallbackThatThrows_shouldReadAllDataAndThrow() throws Exception { ImapResponseParser parser = createParser("* {4}\r\ntest\r\n"); TestImapResponseCallback callback = TestImapResponseCallback.readBytesAndThrow(2); try { parser.readResponse(callback); fail(); } catch (ImapResponseParserException e) { assertEquals("readResponse(): Exception in callback method", e.getMessage()); assertEquals(ImapResponseParserTestException.class, e.getCause().getClass()); } assertAllInputConsumed(); }
public ImapResponse readResponse() throws IOException { return readResponse(null); }
ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } }
ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); }
ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); ImapResponse readResponse(); ImapResponse readResponse(ImapResponseCallback callback); }
ImapResponseParser { public ImapResponse readResponse() throws IOException { return readResponse(null); } ImapResponseParser(PeekableInputStream in); ImapResponse readResponse(); ImapResponse readResponse(ImapResponseCallback callback);  }