MailboxPath { public boolean isInbox() { return DefaultMailboxes.INBOX.equalsIgnoreCase(name); } MailboxPath(String namespace, Username user, String name);  MailboxPath(MailboxPath mailboxPath);  MailboxPath(MailboxPath mailboxPath, String name); static MailboxPath inbox(MailboxSession session); static MailboxPath inbox(Username username); static MailboxPath forUser(Username username, String mailboxName); String getNamespace(); Username getUser(); String getName(); boolean belongsTo(MailboxSession mailboxSession); MailboxPath child(String childName, char delimiter); List<MailboxPath> getHierarchyLevels(char delimiter); String getName(char delimiter); MailboxPath sanitize(char delimiter); MailboxPath assertAcceptable(char pathDelimiter); String asString(); boolean isInbox(); @Override String toString(); @Override final boolean equals(Object o); @Override final int hashCode(); @Deprecated String getFullName(char delimiter); static final int MAX_MAILBOX_NAME_LENGTH; }
@Test void isInboxShouldReturnTrueWhenINBOX() { MailboxPath mailboxPath = new MailboxPath(MailboxConstants.USER_NAMESPACE, USER, DefaultMailboxes.INBOX); assertThat(mailboxPath.isInbox()).isTrue(); }
@Test void isInboxShouldReturnTrueWhenINBOXWithOtherCase() { MailboxPath mailboxPath = new MailboxPath(MailboxConstants.USER_NAMESPACE, USER, "InBoX"); assertThat(mailboxPath.isInbox()).isTrue(); }
@Test void isInboxShouldReturnFalseWhenOtherThanInbox() { MailboxPath mailboxPath = new MailboxPath(MailboxConstants.USER_NAMESPACE, USER, DefaultMailboxes.ARCHIVE); assertThat(mailboxPath.isInbox()).isFalse(); }