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 35d05230cbb054eabe16955f10a3342d72a33050 Author: Tran Tien Duc <dt...@linagora.com> AuthorDate: Fri Dec 13 14:39:20 2019 +0700 JAMES-3012 Move ReindexingWithEventDeadLettersTest to webadmin-integration-tests --- server/protocols/webadmin-integration-test/pom.xml | 5 --- .../ReindexingWithEventDeadLettersTest.java | 36 ++++++++++++---------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/server/protocols/webadmin-integration-test/pom.xml b/server/protocols/webadmin-integration-test/pom.xml index 87fd9e0..4a48fe4 100644 --- a/server/protocols/webadmin-integration-test/pom.xml +++ b/server/protocols/webadmin-integration-test/pom.xml @@ -184,10 +184,5 @@ <artifactId>testcontainers</artifactId> <scope>test</scope> </dependency> - <dependency> - <groupId>org.apache.james</groupId> - <artifactId>james-server-jmap-draft-integration-testing</artifactId> - <scope>test</scope> - </dependency> </dependencies> </project> diff --git a/server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/ReindexingWithEventDeadLettersTest.java b/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/ReindexingWithEventDeadLettersTest.java similarity index 84% rename from server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/ReindexingWithEventDeadLettersTest.java rename to server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/ReindexingWithEventDeadLettersTest.java index c7ebe8a..3a08205 100644 --- a/server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/rabbitmq/ReindexingWithEventDeadLettersTest.java +++ b/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/ReindexingWithEventDeadLettersTest.java @@ -17,17 +17,16 @@ * under the License. * ****************************************************************/ -package org.apache.james.jmap.rabbitmq; +package org.apache.james.webadmin.integration; import static io.restassured.RestAssured.with; import static org.apache.james.jmap.HttpJmapAuthentication.authenticateJamesUser; +import static org.apache.james.jmap.JMAPTestingConstants.ALICE; +import static org.apache.james.jmap.JMAPTestingConstants.ALICE_PASSWORD; +import static org.apache.james.jmap.JMAPTestingConstants.DOMAIN; +import static org.apache.james.jmap.JMAPTestingConstants.jmapRequestSpecBuilder; import static org.apache.james.jmap.JmapCommonRequests.getDraftId; import static org.apache.james.jmap.JmapCommonRequests.listMessageIdsForAccount; -import static org.apache.james.jmap.JmapURIBuilder.baseUri; -import static org.apache.james.jmap.TestingConstants.ALICE; -import static org.apache.james.jmap.TestingConstants.ALICE_PASSWORD; -import static org.apache.james.jmap.TestingConstants.DOMAIN; -import static org.apache.james.jmap.TestingConstants.jmapRequestSpecBuilder; import static org.assertj.core.api.Assertions.assertThat; import static org.awaitility.Duration.ONE_HUNDRED_MILLISECONDS; @@ -39,13 +38,15 @@ import org.apache.james.DockerElasticSearchExtension; import org.apache.james.GuiceJamesServer; import org.apache.james.JamesServerBuilder; import org.apache.james.JamesServerExtension; -import org.apache.james.jmap.api.access.AccessToken; +import org.apache.james.jmap.AccessToken; +import org.apache.james.jmap.JmapURIBuilder; import org.apache.james.jmap.draft.JmapGuiceProbe; import org.apache.james.jmap.draft.JmapJamesServerContract; import org.apache.james.modules.AwsS3BlobStoreExtension; import org.apache.james.modules.RabbitMQExtension; import org.apache.james.modules.TestJMAPServerModule; import org.apache.james.modules.objectstorage.PayloadCodecFactory; +import org.apache.james.util.Port; import org.apache.james.utils.DataProbeImpl; import org.apache.james.utils.WebAdminGuiceProbe; import org.apache.james.webadmin.WebAdminConfiguration; @@ -54,6 +55,7 @@ import org.awaitility.Awaitility; import org.awaitility.Duration; import org.awaitility.core.ConditionFactory; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; @@ -74,12 +76,12 @@ class ReindexingWithEventDeadLettersTest { private static final DockerElasticSearchExtension dockerElasticSearch = new DockerElasticSearchExtension().withRequestTimeout(java.time.Duration.ofSeconds(1)); private static final JamesServerBuilder.ServerProvider CONFIGURATION_BUILDER = configuration -> GuiceJamesServer - .forConfiguration(configuration) - .combineWith(CassandraRabbitMQJamesServerMain.MODULES) - .overrideWith(new TestJMAPServerModule(LIMIT_TO_10_MESSAGES)) - .overrideWith(JmapJamesServerContract.DOMAIN_LIST_CONFIGURATION_MODULE) - .overrideWith(binder -> binder.bind(WebAdminConfiguration.class) - .toInstance(WebAdminConfiguration.TEST_CONFIGURATION)); + .forConfiguration(configuration) + .combineWith(CassandraRabbitMQJamesServerMain.MODULES) + .overrideWith(new TestJMAPServerModule(LIMIT_TO_10_MESSAGES)) + .overrideWith(JmapJamesServerContract.DOMAIN_LIST_CONFIGURATION_MODULE) + .overrideWith(binder -> binder.bind(WebAdminConfiguration.class) + .toInstance(WebAdminConfiguration.TEST_CONFIGURATION)); @RegisterExtension JamesServerExtension testExtension = new JamesServerBuilder() @@ -100,19 +102,21 @@ class ReindexingWithEventDeadLettersTest { .addDomain(DOMAIN) .addUser(ALICE.asString(), ALICE_PASSWORD); + Port jmapPort = Port.of(jamesServer.getProbe(JmapGuiceProbe.class).getJmapPort()); RestAssured.requestSpecification = jmapRequestSpecBuilder - .setPort(jamesServer.getProbe(JmapGuiceProbe.class).getJmapPort()) + .setPort(jmapPort.getValue()) .build(); RestAssured.defaultParser = Parser.JSON; webAdminApi = WebAdminUtils.spec(jamesServer.getProbe(WebAdminGuiceProbe.class).getWebAdminPort()); - aliceAccessToken = authenticateJamesUser(baseUri(jamesServer), ALICE, ALICE_PASSWORD); + aliceAccessToken = authenticateJamesUser(JmapURIBuilder.baseUri(jmapPort), ALICE, ALICE_PASSWORD); dockerElasticSearch.getDockerES().pause(); Thread.sleep(Duration.TEN_SECONDS.getValueInMS()); // Docker pause is asynchronous and we found no way to poll for it } + @Disabled("JAMES-3011 It's already fails for a long time, but CI didn't detect this when it's not marked as BasicFeature") @Test void indexationShouldBeFailingWhenElasticSearchContainerIsPaused() throws Exception { aliceSavesADraft(); @@ -170,7 +174,7 @@ class ReindexingWithEventDeadLettersTest { "]"; with() - .header("Authorization", aliceAccessToken.serialize()) + .header("Authorization", aliceAccessToken.asString()) .body(requestBody) .post("/jmap"); } --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org