use of org.apache.james.mailbox.store.search.MessageSearchIndex in project tmail-backend by linagora.
the class DeleteEncryptedProjectionHookTest method createMailboxManager.
CassandraMailboxManager createMailboxManager(CassandraMailboxSessionMapperFactory mapperFactory) {
Preconditions.checkNotNull(encryptedEmailContentStore);
InVMEventBus eventBus = new InVMEventBus(new InVmEventDelivery(new RecordingMetricFactory()), EventBusTestFixture.RETRY_BACKOFF_CONFIGURATION, new MemoryEventDeadLetters());
StoreRightManager storeRightManager = new StoreRightManager(mapperFactory, new UnionMailboxACLResolver(), eventBus);
StoreMailboxAnnotationManager annotationManager = new StoreMailboxAnnotationManager(mapperFactory, storeRightManager);
SessionProviderImpl sessionProvider = new SessionProviderImpl(mock(Authenticator.class), mock(Authorizator.class));
QuotaComponents quotaComponents = QuotaComponents.disabled(sessionProvider, mapperFactory);
AttachmentContentLoader attachmentContentLoader = null;
MessageSearchIndex index = new SimpleMessageSearchIndex(mapperFactory, mapperFactory, new DefaultTextExtractor(), attachmentContentLoader);
StoreMessageIdManager messageIdManager = new StoreMessageIdManager(storeRightManager, mapperFactory, eventBus, quotaComponents.getQuotaManager(), new DefaultUserQuotaRootResolver(sessionProvider, mapperFactory), PreDeletionHooks.NO_PRE_DELETION_HOOK);
DeleteEncryptedProjectionHook preDeleteEncryptedProjectionHook = new DeleteEncryptedProjectionHook(encryptedEmailContentStore, sessionProvider, messageIdManager, mapperFactory);
PreDeletionHooks preDeletionHooks = new PreDeletionHooks(ImmutableSet.of(preDeleteEncryptedProjectionHook), new RecordingMetricFactory());
CassandraMailboxManager cassandraMailboxManager = new CassandraMailboxManager(mapperFactory, sessionProvider, new NoMailboxPathLocker(), new MessageParser(), new CassandraMessageId.Factory(), eventBus, annotationManager, storeRightManager, quotaComponents, index, MailboxManagerConfiguration.DEFAULT, preDeletionHooks, new NaiveThreadIdGuessingAlgorithm());
eventBus.register(new MailboxAnnotationListener(mapperFactory, sessionProvider));
eventBus.register(mapperFactory.deleteMessageListener());
return cassandraMailboxManager;
}
Aggregations