@Test void eventShouldDoNothingIfDoNotHaveMailboxDeletionEvent() throws Exception { MailboxListener.MailboxEvent event = new MailboxListener.MailboxAdded(null, null, MAILBOX_PATH, MAILBOX_ID, Event.EventId.random()); listener.event(event); verifyNoMoreInteractions(mailboxSessionMapperFactory); verifyNoMoreInteractions(annotationMapper); }
@Override public void event(Event event) { if (event instanceof MailboxDeletion) { MailboxSession mailboxSession = sessionProvider.createSystemSession(event.getUsername()); AnnotationMapper annotationMapper = mailboxSessionMapperFactory.getAnnotationMapper(mailboxSession); MailboxId mailboxId = ((MailboxDeletion) event).getMailboxId(); deleteRelatedAnnotations(mailboxId, annotationMapper); } }
MailboxAnnotationListener implements MailboxListener.GroupMailboxListener { @Override public void event(Event event) { if (event instanceof MailboxDeletion) { MailboxSession mailboxSession = sessionProvider.createSystemSession(event.getUsername()); AnnotationMapper annotationMapper = mailboxSessionMapperFactory.getAnnotationMapper(mailboxSession); MailboxId mailboxId = ((MailboxDeletion) event).getMailboxId(); deleteRelatedAnnotations(mailboxId, annotationMapper); } } }
MailboxAnnotationListener implements MailboxListener.GroupMailboxListener { @Override public void event(Event event) { if (event instanceof MailboxDeletion) { MailboxSession mailboxSession = sessionProvider.createSystemSession(event.getUsername()); AnnotationMapper annotationMapper = mailboxSessionMapperFactory.getAnnotationMapper(mailboxSession); MailboxId mailboxId = ((MailboxDeletion) event).getMailboxId(); deleteRelatedAnnotations(mailboxId, annotationMapper); } } @Inject  MailboxAnnotationListener(MailboxSessionMapperFactory mailboxSessionMapperFactory, SessionProvider sessionProvider); }
MailboxAnnotationListener implements MailboxListener.GroupMailboxListener { @Override public void event(Event event) { if (event instanceof MailboxDeletion) { MailboxSession mailboxSession = sessionProvider.createSystemSession(event.getUsername()); AnnotationMapper annotationMapper = mailboxSessionMapperFactory.getAnnotationMapper(mailboxSession); MailboxId mailboxId = ((MailboxDeletion) event).getMailboxId(); deleteRelatedAnnotations(mailboxId, annotationMapper); } } @Inject  MailboxAnnotationListener(MailboxSessionMapperFactory mailboxSessionMapperFactory, SessionProvider sessionProvider); @Override Group getDefaultGroup(); @Override void event(Event event); }
MailboxAnnotationListener implements MailboxListener.GroupMailboxListener { @Override public void event(Event event) { if (event instanceof MailboxDeletion) { MailboxSession mailboxSession = sessionProvider.createSystemSession(event.getUsername()); AnnotationMapper annotationMapper = mailboxSessionMapperFactory.getAnnotationMapper(mailboxSession); MailboxId mailboxId = ((MailboxDeletion) event).getMailboxId(); deleteRelatedAnnotations(mailboxId, annotationMapper); } } @Inject  MailboxAnnotationListener(MailboxSessionMapperFactory mailboxSessionMapperFactory, SessionProvider sessionProvider); @Override Group getDefaultGroup(); @Override void event(Event event); static final Group GROUP; }