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 14a4e6584a38db90e49ea7a62fd8cf2ecbdf6998
Author: Tran Tien Duc <dt...@linagora.com>
AuthorDate: Wed May 22 11:23:09 2019 +0700

    JAMES-2767 Update James with non compatible ES server test
---
 .../java/org/apache/james/backends/es/DockerElasticSearch.java |  8 ++++++--
 .../james/JamesWithNonCompatibleElasticSearchServerTest.java   | 10 ++++------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git 
a/backends-common/elasticsearch/src/test/java/org/apache/james/backends/es/DockerElasticSearch.java
 
b/backends-common/elasticsearch/src/test/java/org/apache/james/backends/es/DockerElasticSearch.java
index 9c66865..c40fb36 100644
--- 
a/backends-common/elasticsearch/src/test/java/org/apache/james/backends/es/DockerElasticSearch.java
+++ 
b/backends-common/elasticsearch/src/test/java/org/apache/james/backends/es/DockerElasticSearch.java
@@ -61,10 +61,14 @@ public class DockerElasticSearch {
     private final DockerGenericContainer eSContainer;
 
     public DockerElasticSearch() {
-        this.eSContainer = new DockerGenericContainer(Images.ELASTICSEARCH_6)
+        this(Images.ELASTICSEARCH_6);
+    }
+
+    public DockerElasticSearch(String imageName) {
+        this.eSContainer = new DockerGenericContainer(imageName)
+            .withExposedPorts(ES_HTTP_PORT)
             .withEnv("discovery.type", "single-node")
             .withAffinityToContainer()
-            .withExposedPorts(ES_HTTP_PORT)
             .waitingFor(new 
HostPortWaitStrategy().withRateLimiter(RateLimiters.TWENTIES_PER_SECOND));
     }
 
diff --git 
a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesWithNonCompatibleElasticSearchServerTest.java
 
b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesWithNonCompatibleElasticSearchServerTest.java
index 5d48196..87347f6 100644
--- 
a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesWithNonCompatibleElasticSearchServerTest.java
+++ 
b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesWithNonCompatibleElasticSearchServerTest.java
@@ -27,8 +27,8 @@ import org.apache.james.backends.es.DockerElasticSearch;
 import org.apache.james.mailbox.extractor.TextExtractor;
 import org.apache.james.mailbox.store.search.PDFTextExtractor;
 import org.apache.james.modules.TestJMAPServerModule;
+import org.apache.james.util.docker.Images;
 import org.junit.jupiter.api.AfterAll;
-import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
@@ -38,12 +38,11 @@ class JamesWithNonCompatibleElasticSearchServerTest {
 
     private static final int LIMIT_MAX_MESSAGES = 10;
 
-    // Should be ES 2 here, not ES 6
-    static DockerElasticSearch dockerES6 = new DockerElasticSearch();
+    static DockerElasticSearch dockerES2 = new 
DockerElasticSearch(Images.ELASTICSEARCH_2);
 
     @RegisterExtension
     static JamesServerExtension testExtension = new JamesServerBuilder()
-        .extension(new DockerElasticSearchExtension(dockerES6))
+        .extension(new DockerElasticSearchExtension(dockerES2))
         .extension(new CassandraExtension())
         .server(configuration -> 
GuiceJamesServer.forConfiguration(configuration)
             .combineWith(ALL_BUT_JMX_CASSANDRA_MODULE)
@@ -54,10 +53,9 @@ class JamesWithNonCompatibleElasticSearchServerTest {
 
     @AfterAll
     static void afterAll() {
-        dockerES6.stop();
+        dockerES2.stop();
     }
 
-    @Disabled("Temporally disable this test")
     @Test
     void 
jamesShouldStopWhenStartingWithANonCompatibleElasticSearchServer(GuiceJamesServer
 server) throws Exception {
         assertThatThrownBy(server::start)


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to