james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [james-project] 09/11: JAMES-2713 Change params config for RequestSpecification The params default update strategy is MERGE. So we will have conflict when request 2 webAdmin APIs in a testcase. We change params update strategy to REPLACE
Date Thu, 18 Apr 2019 07:00:24 GMT
This is an automated email from the ASF dual-hosted git repository.

aduprat pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 76336eb4bc97eaf1105ddb51ae6d5f5ec6bc3ce7
Author: datph <dphamhoang@linagora.com>
AuthorDate: Thu Apr 11 18:23:44 2019 +0700

    JAMES-2713 Change params config for RequestSpecification
    The params default update strategy is MERGE. So we will have conflict when
    request 2 webAdmin APIs in a testcase. We change params update strategy to REPLACE
---
 .../james/jmap/methods/integration/DeletedMessagesVaultTest.java   | 6 +++++-
 .../src/test/java/org/apache/james/webadmin/WebAdminUtils.java     | 7 ++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/DeletedMessagesVaultTest.java
b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/DeletedMessagesVaultTest.java
index 6c76951..8ab9e11 100644
--- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/DeletedMessagesVaultTest.java
+++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/DeletedMessagesVaultTest.java
@@ -21,6 +21,7 @@ package org.apache.james.jmap.methods.integration;
 
 import static io.restassured.RestAssured.given;
 import static io.restassured.RestAssured.with;
+import static io.restassured.config.ParamConfig.UpdateStrategy.REPLACE;
 import static org.apache.james.jmap.HttpJmapAuthentication.authenticateJamesUser;
 import static org.apache.james.jmap.JmapCommonRequests.getLastMessageId;
 import static org.apache.james.jmap.JmapCommonRequests.getOutboxId;
@@ -73,6 +74,7 @@ import com.google.common.base.Strings;
 import com.google.common.collect.ImmutableList;
 
 import io.restassured.RestAssured;
+import io.restassured.config.ParamConfig;
 import io.restassured.parsing.Parser;
 import io.restassured.specification.RequestSpecification;
 
@@ -164,7 +166,9 @@ public abstract class DeletedMessagesVaultTest {
         homerAccessToken = authenticateJamesUser(baseUri(jmapServer), HOMER, PASSWORD);
         bartAccessToken = authenticateJamesUser(baseUri(jmapServer), BART, BOB_PASSWORD);
 
-        webAdminApi = WebAdminUtils.spec(jmapServer.getProbe(WebAdminGuiceProbe.class).getWebAdminPort());
+        webAdminApi = WebAdminUtils.spec(jmapServer.getProbe(WebAdminGuiceProbe.class).getWebAdminPort())
+            .config(WebAdminUtils.defaultConfig()
+                .paramConfig(new ParamConfig(REPLACE, REPLACE, REPLACE)));
     }
 
     @After
diff --git a/server/protocols/webadmin/webadmin-core/src/test/java/org/apache/james/webadmin/WebAdminUtils.java
b/server/protocols/webadmin/webadmin-core/src/test/java/org/apache/james/webadmin/WebAdminUtils.java
index a2c3a2a..b5a02fa 100644
--- a/server/protocols/webadmin/webadmin-core/src/test/java/org/apache/james/webadmin/WebAdminUtils.java
+++ b/server/protocols/webadmin/webadmin-core/src/test/java/org/apache/james/webadmin/WebAdminUtils.java
@@ -34,6 +34,7 @@ import org.apache.james.webadmin.authentication.NoAuthenticationFilter;
 import com.github.steveash.guavate.Guavate;
 
 import io.restassured.builder.RequestSpecBuilder;
+import io.restassured.config.RestAssuredConfig;
 import io.restassured.http.ContentType;
 import io.restassured.specification.RequestSpecification;
 
@@ -68,10 +69,14 @@ public class WebAdminUtils {
         return new RequestSpecBuilder()
             .setContentType(ContentType.JSON)
             .setAccept(ContentType.JSON)
-            .setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(StandardCharsets.UTF_8)))
+            .setConfig(defaultConfig())
             .setPort(port.getValue());
     }
 
+    public static RestAssuredConfig defaultConfig() {
+        return newConfig().encoderConfig(encoderConfig().defaultContentCharset(StandardCharsets.UTF_8));
+    }
+
     public static RequestSpecification spec(Port port) {
         return given().spec(buildRequestSpecification(port).build());
     }


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


Mime
View raw message