@Test public void decodeMessageShouldReturnRequestWithOneDepthOption() throws DecodingException { InputStream inputStream = new ByteArrayInputStream((INBOX + " (DEPTH 1) (MAXSIZE 1024) (/shared/comment /private/comment) \n").getBytes(StandardCharsets.US_ASCII)); ImapRequestStreamLineReader lineReader = new ImapRequestStreamLineReader(inputStream, outputStream); GetAnnotationRequest request = (GetAnnotationRequest)parser.decode(lineReader, TAG, session); assertThat(request.getTag()).isEqualTo(TAG); assertThat(request.getCommand()).isEqualTo(ImapConstants.GETANNOTATION_COMMAND); assertThat(request.getMailboxName()).isEqualTo(INBOX); assertThat(request.getDepth()).isEqualTo(Depth.ONE); assertThat(request.getMaxsize()).contains(1024); assertThat(request.getKeys()).contains(SHARED_KEY, PRIVATE_KEY); }
@Override protected ImapMessage decode(ImapRequestLineReader requestReader, Tag tag, ImapSession session) throws DecodingException { try { return buildAnnotationRequest(requestReader, tag); } catch (NullPointerException | IllegalArgumentException | IllegalStateException e) { throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, e.getMessage(), e); } }
GetAnnotationCommandParser extends AbstractImapCommandParser { @Override protected ImapMessage decode(ImapRequestLineReader requestReader, Tag tag, ImapSession session) throws DecodingException { try { return buildAnnotationRequest(requestReader, tag); } catch (NullPointerException | IllegalArgumentException | IllegalStateException e) { throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, e.getMessage(), e); } } }
GetAnnotationCommandParser extends AbstractImapCommandParser { @Override protected ImapMessage decode(ImapRequestLineReader requestReader, Tag tag, ImapSession session) throws DecodingException { try { return buildAnnotationRequest(requestReader, tag); } catch (NullPointerException | IllegalArgumentException | IllegalStateException e) { throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, e.getMessage(), e); } } GetAnnotationCommandParser(StatusResponseFactory statusResponseFactory); }
GetAnnotationCommandParser extends AbstractImapCommandParser { @Override protected ImapMessage decode(ImapRequestLineReader requestReader, Tag tag, ImapSession session) throws DecodingException { try { return buildAnnotationRequest(requestReader, tag); } catch (NullPointerException | IllegalArgumentException | IllegalStateException e) { throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, e.getMessage(), e); } } GetAnnotationCommandParser(StatusResponseFactory statusResponseFactory);  }
GetAnnotationCommandParser extends AbstractImapCommandParser { @Override protected ImapMessage decode(ImapRequestLineReader requestReader, Tag tag, ImapSession session) throws DecodingException { try { return buildAnnotationRequest(requestReader, tag); } catch (NullPointerException | IllegalArgumentException | IllegalStateException e) { throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, e.getMessage(), e); } } GetAnnotationCommandParser(StatusResponseFactory statusResponseFactory);   }