@Override protected ImapResponseMessage createResponse(MailboxMetaData.Children children, MailboxMetaData.Selectability selectability, String name, char hierarchyDelimiter, MailboxType type) { return new XListResponse(children, selectability, name, hierarchyDelimiter, type); } }
@Override protected ImapResponseMessage createResponse(boolean noInferior, boolean noSelect, boolean marked, boolean unmarked, boolean hasChildren, boolean hasNoChildren, String mailboxName, char delimiter, MailboxType type) { return new XListResponse(noInferior, noSelect, marked, unmarked, hasChildren, hasNoChildren, mailboxName, delimiter, type); } }
@Test public void encoderShouldAcceptXListResponse() { assertThat(encoder.isAcceptable( new XListResponse( MailboxMetaData.Children.HAS_CHILDREN, MailboxMetaData.Selectability.NONE, "name", '.', MailboxType.INBOX))) .isTrue(); }
@Test public void encodeShouldAddXListAttributeWhenTypeIsInbox() throws Exception { XListResponse input = new XListResponse(Children.HAS_CHILDREN, Selectability.NONE, nameParameter, '.', MailboxType.INBOX); ListingEncodingUtils.encodeListingResponse("XLIST", composer, input); assertThat(writer.getString()).isEqualTo("* XLIST (\\HasChildren \\Inbox) \".\" \"mailbox\"\r\n"); } }
@Test public void encoderShouldIncludeListCommand() throws Exception { encoder.encode( new XListResponse( MailboxMetaData.Children.HAS_CHILDREN, MailboxMetaData.Selectability.NONE, "name", '.', MailboxType.INBOX), composer, new FakeImapSession()); assertThat(writer.getString()).startsWith("* XLIST"); } }