-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a separate Guice module for OpenPaaS communication (#1261)
- Loading branch information
1 parent
018d6e2
commit bba278e
Showing
24 changed files
with
885 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...ava/com/linagora/tmail/james/app/DistributedServerWithOpenPaasRabbitMqConfiguredTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.linagora.tmail.james.app; | ||
|
||
import org.apache.james.JamesServerBuilder; | ||
import org.apache.james.JamesServerExtension; | ||
import org.apache.james.SearchConfiguration; | ||
import org.apache.james.backends.redis.RedisExtension; | ||
import org.apache.james.utils.GuiceProbe; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import com.google.inject.multibindings.Multibinder; | ||
|
||
import com.linagora.tmail.OpenPaasModuleChooserConfiguration; | ||
import com.linagora.tmail.combined.identity.LdapExtension; | ||
import com.linagora.tmail.combined.identity.UsersRepositoryClassProbe; | ||
import com.linagora.tmail.combined.identity.UsersRepositoryModuleChooser; | ||
|
||
public class DistributedServerWithOpenPaasRabbitMqConfiguredTest { | ||
@RegisterExtension | ||
static JamesServerExtension | ||
testExtension = new JamesServerBuilder<DistributedJamesConfiguration>(tmpDir -> | ||
DistributedJamesConfiguration.builder() | ||
.workingDirectory(tmpDir) | ||
.configurationFromClasspath() | ||
.searchConfiguration(SearchConfiguration.openSearch()) | ||
.usersRepository(UsersRepositoryModuleChooser.Implementation.COMBINED) | ||
.eventBusKeysChoice(EventBusKeysChoice.REDIS) | ||
.openPassModuleChooserConfiguration(OpenPaasModuleChooserConfiguration.ENABLED) | ||
.build()) | ||
.server(configuration -> DistributedServer.createServer(configuration) | ||
.overrideWith(binder -> Multibinder.newSetBinder(binder, GuiceProbe.class).addBinding().to(UsersRepositoryClassProbe.class))) | ||
.extension(new DockerOpenSearchExtension()) | ||
.extension(new CassandraExtension()) | ||
.extension(new RabbitMQExtension()) | ||
.extension(new LdapExtension()) | ||
.extension(new RedisExtension()) | ||
.lifeCycle(JamesServerExtension.Lifecycle.PER_CLASS) | ||
.build(); | ||
|
||
@Test | ||
void serverShouldStartWithOpenPaasRabbitMqConfigured() { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...est/java/com/linagora/tmail/james/app/MemoryServerWithOpenPaasRabbitMqConfiguredTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.linagora.tmail.james.app; | ||
|
||
import static org.apache.james.data.UsersRepositoryModuleChooser.Implementation.DEFAULT; | ||
|
||
import org.apache.james.JamesServerBuilder; | ||
import org.apache.james.JamesServerExtension; | ||
import org.apache.james.modules.queue.rabbitmq.RabbitMQModule; | ||
import org.apache.james.utils.GuiceProbe; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import com.google.inject.multibindings.Multibinder; | ||
import com.linagora.tmail.OpenPaasModuleChooserConfiguration; | ||
import com.linagora.tmail.encrypted.MailboxConfiguration; | ||
import com.linagora.tmail.encrypted.MailboxManagerClassProbe; | ||
import com.linagora.tmail.module.LinagoraTestJMAPServerModule; | ||
|
||
class MemoryServerWithOpenPaasRabbitMqConfiguredTest { | ||
@RegisterExtension | ||
static JamesServerExtension jamesServerExtension = new JamesServerBuilder<MemoryConfiguration>(tmpDir -> | ||
MemoryConfiguration.builder() | ||
.workingDirectory(tmpDir) | ||
.configurationFromClasspath() | ||
.mailbox(new MailboxConfiguration(false)) | ||
.usersRepository(DEFAULT) | ||
.openPaasModuleChooserConfiguration(OpenPaasModuleChooserConfiguration.ENABLED) | ||
.build()) | ||
.server(configuration -> MemoryServer.createServer(configuration) | ||
.overrideWith(new LinagoraTestJMAPServerModule()) | ||
.overrideWith(binder -> Multibinder.newSetBinder(binder, GuiceProbe.class).addBinding().to(MailboxManagerClassProbe.class)) | ||
.overrideWith(new RabbitMQModule())) | ||
.extension(new RabbitMQExtension()) | ||
.build(); | ||
|
||
@Test | ||
public void serverShouldStartWithOpenPaasRabbitMqConfigured() { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.