This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 12fe9052679e65e66dee8978a6de6e1ca6081898 Author: Benoit Tellier <[email protected]> AuthorDate: Tue Mar 19 11:09:11 2019 +0700 JAMES-2684 Remove InMemoryIntegrationResources 'with' prefixes --- .../elasticsearch/ElasticSearchIntegrationTest.java | 3 +-- .../lucene/search/LuceneMessageSearchIndexTest.java | 2 +- .../inmemory/MemoryMailboxManagerProvider.java | 4 ++-- .../mail/InMemoryMailboxManagerAttachmentTest.java | 2 +- .../manager/InMemoryIntegrationResources.java | 20 ++++++++++---------- .../InMemoryMessageIdManagerSideEffectTest.java | 6 +++--- .../james/vault/DeletedMessageVaultHookTest.java | 2 +- .../store/search/SimpleMessageSearchIndexTest.java | 2 +- .../elasticsearch/host/ElasticSearchHostSystem.java | 6 +++--- .../inmemory/host/InMemoryHostSystem.java | 4 ++-- .../lucenesearch/host/LuceneSearchHostSystem.java | 6 +++--- .../rabbitmq/host/RabbitMQEventBusHostSystem.java | 6 +++--- .../org/apache/james/pop3server/POP3ServerTest.java | 2 +- 13 files changed, 32 insertions(+), 33 deletions(-) diff --git a/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java b/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java index a35790b..3e4b13e 100644 --- a/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java +++ b/mailbox/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java @@ -38,7 +38,6 @@ import org.apache.james.mailbox.elasticsearch.json.MessageToElasticSearchJson; import org.apache.james.mailbox.elasticsearch.query.CriterionConverter; import org.apache.james.mailbox.elasticsearch.query.QueryConverter; import org.apache.james.mailbox.elasticsearch.search.ElasticSearchSearcher; -import org.apache.james.mailbox.events.MailboxListener; import org.apache.james.mailbox.inmemory.InMemoryId; import org.apache.james.mailbox.inmemory.InMemoryMessageId; import org.apache.james.mailbox.inmemory.manager.InMemoryIntegrationResources; @@ -102,7 +101,7 @@ public class ElasticSearchIntegrationTest extends AbstractMessageSearchIndexTest ThreadFactory threadFactory = NamedThreadFactory.withClassName(getClass()); InMemoryIntegrationResources resources = new InMemoryIntegrationResources.Factory() - .withListeningSearchIndex(preInstanciationStage -> new ElasticSearchListeningMessageSearchIndex( + .listeningSearchIndex(preInstanciationStage -> new ElasticSearchListeningMessageSearchIndex( preInstanciationStage.getMapperFactory(), new ElasticSearchIndexer(client, Executors.newSingleThreadExecutor(threadFactory), diff --git a/mailbox/lucene/src/test/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndexTest.java b/mailbox/lucene/src/test/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndexTest.java index b3df12b..9f509c9 100644 --- a/mailbox/lucene/src/test/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndexTest.java +++ b/mailbox/lucene/src/test/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndexTest.java @@ -38,7 +38,7 @@ public class LuceneMessageSearchIndexTest extends AbstractMessageSearchIndexTest @Override protected void initializeMailboxManager() { InMemoryIntegrationResources resources = new InMemoryIntegrationResources.Factory() - .withListeningSearchIndex(Throwing.function(preInstanciationStage -> new LuceneMessageSearchIndex( + .listeningSearchIndex(Throwing.function(preInstanciationStage -> new LuceneMessageSearchIndex( preInstanciationStage.getMapperFactory(), new InMemoryId.Factory(), new RAMDirectory(), new InMemoryMessageId.Factory(), preInstanciationStage.getSessionProvider()))) diff --git a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/MemoryMailboxManagerProvider.java b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/MemoryMailboxManagerProvider.java index 9ee8b3e..e65b5d0 100644 --- a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/MemoryMailboxManagerProvider.java +++ b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/MemoryMailboxManagerProvider.java @@ -30,8 +30,8 @@ public class MemoryMailboxManagerProvider { public static InMemoryMailboxManager provideMailboxManager(Set<PreDeletionHook> preDeletionHooks) { return new InMemoryIntegrationResources.Factory() - .withAnnotationLimits(LIMIT_ANNOTATIONS, LIMIT_ANNOTATION_SIZE) - .withPreDeletionHooks(preDeletionHooks) + .annotationLimits(LIMIT_ANNOTATIONS, LIMIT_ANNOTATION_SIZE) + .preDeletionHooks(preDeletionHooks) .create() .getMailboxManager(); } diff --git a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxManagerAttachmentTest.java b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxManagerAttachmentTest.java index a4f7a17..e3c3b6d 100644 --- a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxManagerAttachmentTest.java +++ b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxManagerAttachmentTest.java @@ -47,7 +47,7 @@ public class InMemoryMailboxManagerAttachmentTest extends AbstractMailboxManager mailboxManager = new InMemoryIntegrationResources.Factory().create().getMailboxManager(); parseFailingMailboxManager = new InMemoryIntegrationResources.Factory() - .withMessageParser(failingMessageParser) + .messageParser(failingMessageParser) .create().getMailboxManager(); super.setUp(); diff --git a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/manager/InMemoryIntegrationResources.java b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/manager/InMemoryIntegrationResources.java index ca4b21d..8431f3b 100644 --- a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/manager/InMemoryIntegrationResources.java +++ b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/manager/InMemoryIntegrationResources.java @@ -97,55 +97,55 @@ public class InMemoryIntegrationResources implements IntegrationResources<StoreM this.listenersToBeRegistered = ImmutableList.builder(); } - public Factory withMessageParser(MessageParser messageParser) { + public Factory messageParser(MessageParser messageParser) { this.messageParser = Optional.of(messageParser); return this; } - public Factory withQuotaManager(QuotaManager quotaManager) { + public Factory quotaManager(QuotaManager quotaManager) { this.quotaManager = Optional.of(quotaManager); return this; } - public Factory withAuthenticator(Authenticator authenticator) { + public Factory authenticator(Authenticator authenticator) { this.authenticator = Optional.of(authenticator); return this; } - public Factory withAuthorizator(Authorizator authorizator) { + public Factory authorizator(Authorizator authorizator) { this.authorizator = Optional.of(authorizator); return this; } - public Factory withEventBus(EventBus eventBus) { + public Factory eventBus(EventBus eventBus) { this.eventBus = Optional.of(eventBus); return this; } - public Factory withAnnotationLimits(int limitAnnotationCount, int limitAnnotationSize) { + public Factory annotationLimits(int limitAnnotationCount, int limitAnnotationSize) { this.limitAnnotationCount = Optional.of(limitAnnotationCount); this.limitAnnotationSize = Optional.of(limitAnnotationSize); return this; } - public Factory withPreDeletionHooks(Collection<PreDeletionHook> preDeletionHooks) { + public Factory preDeletionHooks(Collection<PreDeletionHook> preDeletionHooks) { this.preDeletionHooksInstanciators.addAll(preDeletionHooks.stream() .map(this::toFactory) .collect(Guavate.toImmutableList())); return this; } - public Factory withPreDeletionHook(Function<MailboxManagerPreInstanciationStage, PreDeletionHook> preDeletionHook) { + public Factory preDeletionHook(Function<MailboxManagerPreInstanciationStage, PreDeletionHook> preDeletionHook) { this.preDeletionHooksInstanciators.add(preDeletionHook); return this; } - public Factory withSearchIndex(Function<MailboxManagerPreInstanciationStage, MessageSearchIndex> searchIndex) { + public Factory searchIndex(Function<MailboxManagerPreInstanciationStage, MessageSearchIndex> searchIndex) { this.searchIndexInstanciator = Optional.of(searchIndex); return this; } - public Factory withListeningSearchIndex(Function<MailboxManagerPreInstanciationStage, ListeningMessageSearchIndex> searchIndex) { + public Factory listeningSearchIndex(Function<MailboxManagerPreInstanciationStage, ListeningMessageSearchIndex> searchIndex) { this.searchIndexInstanciator = Optional.of(stage -> { ListeningMessageSearchIndex listeningMessageSearchIndex = searchIndex.apply(stage); listenersToBeRegistered.add(listeningMessageSearchIndex); diff --git a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/manager/InMemoryMessageIdManagerSideEffectTest.java b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/manager/InMemoryMessageIdManagerSideEffectTest.java index f7d4da3..60121d4 100644 --- a/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/manager/InMemoryMessageIdManagerSideEffectTest.java +++ b/mailbox/memory/src/test/java/org/apache/james/mailbox/inmemory/manager/InMemoryMessageIdManagerSideEffectTest.java @@ -42,9 +42,9 @@ public class InMemoryMessageIdManagerSideEffectTest extends AbstractMessageIdMan InMemoryMessageId.Factory messageIdFactory = new InMemoryMessageId.Factory(); InMemoryIntegrationResources resources = new InMemoryIntegrationResources.Factory() - .withEventBus(eventBus) - .withPreDeletionHooks(preDeletionHooks) - .withQuotaManager(quotaManager) + .eventBus(eventBus) + .preDeletionHooks(preDeletionHooks) + .quotaManager(quotaManager) .create(); return new MessageIdManagerTestSystem(resources.getMessageIdManager(), diff --git a/mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/DeletedMessageVaultHookTest.java b/mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/DeletedMessageVaultHookTest.java index d7b4df4..c9d5bba 100644 --- a/mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/DeletedMessageVaultHookTest.java +++ b/mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/DeletedMessageVaultHookTest.java @@ -99,7 +99,7 @@ class DeletedMessageVaultHookTest { DeletedMessageConverter deletedMessageConverter = new DeletedMessageConverter(); InMemoryIntegrationResources resources = new InMemoryIntegrationResources.Factory() - .withPreDeletionHook(preInstanciationStage -> new DeletedMessageVaultHook(preInstanciationStage.getSessionProvider(), messageVault, deletedMessageConverter, preInstanciationStage.getMapperFactory(), clock)) + .preDeletionHook(preInstanciationStage -> new DeletedMessageVaultHook(preInstanciationStage.getSessionProvider(), messageVault, deletedMessageConverter, preInstanciationStage.getMapperFactory(), clock)) .create(); mailboxManager = resources.getMailboxManager(); diff --git a/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndexTest.java b/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndexTest.java index bfbb547..2c449e1 100644 --- a/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndexTest.java +++ b/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndexTest.java @@ -32,7 +32,7 @@ public class SimpleMessageSearchIndexTest extends AbstractMessageSearchIndexTest @Override protected void initializeMailboxManager() { InMemoryIntegrationResources resources = new InMemoryIntegrationResources.Factory() - .withSearchIndex(preInstanciationStage -> new SimpleMessageSearchIndex( + .searchIndex(preInstanciationStage -> new SimpleMessageSearchIndex( preInstanciationStage.getMapperFactory(), preInstanciationStage.getMapperFactory(), new PDFTextExtractor())) diff --git a/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java b/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java index 8a6ff38..41a0622 100644 --- a/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java +++ b/mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java @@ -93,9 +93,9 @@ public class ElasticSearchHostSystem extends JamesImapHostSystem { ThreadFactory threadFactory = NamedThreadFactory.withClassName(getClass()); InMemoryIntegrationResources resources = new InMemoryIntegrationResources.Factory() - .withAuthenticator(authenticator) - .withAuthorizator(authorizator) - .withListeningSearchIndex(preInstanciationStage -> new ElasticSearchListeningMessageSearchIndex( + .authenticator(authenticator) + .authorizator(authorizator) + .listeningSearchIndex(preInstanciationStage -> new ElasticSearchListeningMessageSearchIndex( preInstanciationStage.getMapperFactory(), new ElasticSearchIndexer(client, Executors.newSingleThreadExecutor(threadFactory), diff --git a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java index 8608b89..8a647ff 100644 --- a/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java +++ b/mpt/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java @@ -52,8 +52,8 @@ public class InMemoryHostSystem extends JamesImapHostSystem { public void beforeTest() throws Exception { super.beforeTest(); InMemoryIntegrationResources resources = new InMemoryIntegrationResources.Factory() - .withAuthenticator(authenticator) - .withAuthorizator(authorizator) + .authenticator(authenticator) + .authorizator(authorizator) .create(); this.mailboxManager = resources.getMailboxManager(); this.perUserMaxQuotaManager = resources.getMaxQuotaManager(); diff --git a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/host/LuceneSearchHostSystem.java b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/host/LuceneSearchHostSystem.java index 2cbf272..21bdf90 100644 --- a/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/host/LuceneSearchHostSystem.java +++ b/mpt/impl/imap-mailbox/lucenesearch/src/test/java/org/apache/james/mpt/imapmailbox/lucenesearch/host/LuceneSearchHostSystem.java @@ -90,9 +90,9 @@ public class LuceneSearchHostSystem extends JamesImapHostSystem { FSDirectory fsDirectory = FSDirectory.open(tempFile); InMemoryIntegrationResources resources = new InMemoryIntegrationResources.Factory() - .withAuthorizator(authorizator) - .withAuthenticator(authenticator) - .withListeningSearchIndex(Throwing.function(preInstanciationStage -> new LuceneMessageSearchIndex( + .authorizator(authorizator) + .authenticator(authenticator) + .listeningSearchIndex(Throwing.function(preInstanciationStage -> new LuceneMessageSearchIndex( preInstanciationStage.getMapperFactory(), new InMemoryId.Factory(), fsDirectory, new InMemoryMessageId.Factory(), preInstanciationStage.getSessionProvider()))) diff --git a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/host/RabbitMQEventBusHostSystem.java b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/host/RabbitMQEventBusHostSystem.java index 078f006..2bea41e 100644 --- a/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/host/RabbitMQEventBusHostSystem.java +++ b/mpt/impl/imap-mailbox/rabbitmq/src/test/java/org/apache/james/mpt/imapmailbox/rabbitmq/host/RabbitMQEventBusHostSystem.java @@ -76,9 +76,9 @@ public class RabbitMQEventBusHostSystem extends JamesImapHostSystem { eventBus.start(); resources = new InMemoryIntegrationResources.Factory() - .withEventBus(eventBus) - .withAuthenticator(authenticator) - .withAuthorizator(authorizator) + .eventBus(eventBus) + .authenticator(authenticator) + .authorizator(authorizator) .create(); ImapProcessor defaultImapProcessorFactory = diff --git a/server/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java b/server/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java index 7625412..d5730a8 100644 --- a/server/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java +++ b/server/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java @@ -712,7 +712,7 @@ public class POP3ServerTest { protocolHandlerChain.put("usersrepository", UsersRepository.class, usersRepository); mailboxManager = new InMemoryIntegrationResources.Factory() - .withAuthenticator((userid, passwd) -> { + .authenticator((userid, passwd) -> { try { return usersRepository.test(userid, passwd.toString()); } catch (UsersRepositoryException e) { --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
