@Test public void buildShouldRelyOnPreloadedMailboxes() throws Exception { MailboxPath inbox = MailboxPath.inbox(user); Optional<MailboxId> inboxId = mailboxManager.createMailbox(inbox, mailboxSession); Optional<MailboxId> otherId = mailboxManager.createMailbox(inbox.child("child", '.'), mailboxSession); InMemoryId preLoadedId = InMemoryId.of(45); Mailbox retrievedMailbox = sut.builder() .id(otherId.get()) .session(mailboxSession) .usingPreloadedMailboxesMetadata(Optional.of(ImmutableList.of(new MailboxMetaData( inbox, preLoadedId, DELIMITER, MailboxMetaData.Children.NO_INFERIORS, MailboxMetaData.Selectability.NONE, MailboxACL.EMPTY, MailboxCounters.builder() .mailboxId(preLoadedId) .count(0) .unseen(0) .build())))) .build() .get(); assertThat(retrievedMailbox.getParentId()) .contains(preLoadedId); }
public MailboxBuilder builder() { QuotaLoader defaultQuotaLoader = new DefaultQuotaLoader(quotaRootResolver, quotaManager); return new MailboxBuilder(this, defaultQuotaLoader); }
MailboxFactory { public MailboxBuilder builder() { QuotaLoader defaultQuotaLoader = new DefaultQuotaLoader(quotaRootResolver, quotaManager); return new MailboxBuilder(this, defaultQuotaLoader); } }
MailboxFactory { public MailboxBuilder builder() { QuotaLoader defaultQuotaLoader = new DefaultQuotaLoader(quotaRootResolver, quotaManager); return new MailboxBuilder(this, defaultQuotaLoader); } @Inject  MailboxFactory(MailboxManager mailboxManager, QuotaManager quotaManager, QuotaRootResolver quotaRootResolver); }
MailboxFactory { public MailboxBuilder builder() { QuotaLoader defaultQuotaLoader = new DefaultQuotaLoader(quotaRootResolver, quotaManager); return new MailboxBuilder(this, defaultQuotaLoader); } @Inject  MailboxFactory(MailboxManager mailboxManager, QuotaManager quotaManager, QuotaRootResolver quotaRootResolver); MailboxBuilder builder(); }
MailboxFactory { public MailboxBuilder builder() { QuotaLoader defaultQuotaLoader = new DefaultQuotaLoader(quotaRootResolver, quotaManager); return new MailboxBuilder(this, defaultQuotaLoader); } @Inject  MailboxFactory(MailboxManager mailboxManager, QuotaManager quotaManager, QuotaRootResolver quotaRootResolver); MailboxBuilder builder();  }