@Test void concurrentEventShouldNotSkipAddedEventsEmittedDuringInitialisation() throws Exception { AtomicInteger successCount = new AtomicInteger(0); doAnswer(generateEmitEventAnswer(successCount)) .when(eventBus) .register(any(MailboxListener.class), eq(mailboxIdRegistrationKey)); SelectedMailboxImpl selectedMailbox = new SelectedMailboxImpl( mailboxManager, eventBus, imapSession, messageManager); assertThat(selectedMailbox.getLastUid().get()).isEqualTo(EMITTED_EVENT_UID); }
@Override public synchronized Optional<MessageUid> getLastUid() { return uidMsnConverter.getLastUid(); }
SelectedMailboxImpl implements SelectedMailbox, MailboxListener { @Override public synchronized Optional<MessageUid> getLastUid() { return uidMsnConverter.getLastUid(); } }
SelectedMailboxImpl implements SelectedMailbox, MailboxListener { @Override public synchronized Optional<MessageUid> getLastUid() { return uidMsnConverter.getLastUid(); } SelectedMailboxImpl(MailboxManager mailboxManager, EventBus eventBus, ImapSession session, MessageManager messageManager); }
SelectedMailboxImpl implements SelectedMailbox, MailboxListener { @Override public synchronized Optional<MessageUid> getLastUid() { return uidMsnConverter.getLastUid(); } SelectedMailboxImpl(MailboxManager mailboxManager, EventBus eventBus, ImapSession session, MessageManager messageManager); @Override synchronized Optional<MessageUid> getFirstUid(); @Override synchronized Optional<MessageUid> getLastUid(); @Override synchronized void deselect(); @Override synchronized boolean removeRecent(MessageUid uid); @Override synchronized boolean addRecent(MessageUid uid); @Override synchronized Collection<MessageUid> getRecent(); @Override synchronized int recentCount(); @Override MailboxPath getPath(); @Override MailboxId getMailboxId(); @Override synchronized boolean isRecent(MessageUid uid); @Override synchronized boolean isRecentUidRemoved(); @Override synchronized void resetRecentUidRemoved(); @Override synchronized void resetEvents(); @Override synchronized NullableMessageSequenceNumber remove(MessageUid uid); @Override synchronized void resetExpungedUids(); final synchronized boolean isSilentFlagChanges(); final synchronized void setSilentFlagChanges(boolean silentFlagChanges); @Override final synchronized boolean isSizeChanged(); @Override final synchronized boolean isDeletedByOtherSession(); @Override synchronized Collection<MessageUid> flagUpdateUids(); @Override synchronized Collection<MessageUid> expungedUids(); @Override Flags getApplicableFlags(); @Override boolean hasNewApplicableFlags(); @Override synchronized void resetNewApplicableFlags(); @Override synchronized void event(Event event); @Override synchronized NullableMessageSequenceNumber msn(MessageUid uid); @Override synchronized Optional<MessageUid> uid(int msn); @Override synchronized long existsCount(); }
SelectedMailboxImpl implements SelectedMailbox, MailboxListener { @Override public synchronized Optional<MessageUid> getLastUid() { return uidMsnConverter.getLastUid(); } SelectedMailboxImpl(MailboxManager mailboxManager, EventBus eventBus, ImapSession session, MessageManager messageManager); @Override synchronized Optional<MessageUid> getFirstUid(); @Override synchronized Optional<MessageUid> getLastUid(); @Override synchronized void deselect(); @Override synchronized boolean removeRecent(MessageUid uid); @Override synchronized boolean addRecent(MessageUid uid); @Override synchronized Collection<MessageUid> getRecent(); @Override synchronized int recentCount(); @Override MailboxPath getPath(); @Override MailboxId getMailboxId(); @Override synchronized boolean isRecent(MessageUid uid); @Override synchronized boolean isRecentUidRemoved(); @Override synchronized void resetRecentUidRemoved(); @Override synchronized void resetEvents(); @Override synchronized NullableMessageSequenceNumber remove(MessageUid uid); @Override synchronized void resetExpungedUids(); final synchronized boolean isSilentFlagChanges(); final synchronized void setSilentFlagChanges(boolean silentFlagChanges); @Override final synchronized boolean isSizeChanged(); @Override final synchronized boolean isDeletedByOtherSession(); @Override synchronized Collection<MessageUid> flagUpdateUids(); @Override synchronized Collection<MessageUid> expungedUids(); @Override Flags getApplicableFlags(); @Override boolean hasNewApplicableFlags(); @Override synchronized void resetNewApplicableFlags(); @Override synchronized void event(Event event); @Override synchronized NullableMessageSequenceNumber msn(MessageUid uid); @Override synchronized Optional<MessageUid> uid(int msn); @Override synchronized long existsCount();  }