james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [james-project] 13/23: JAMES-2442 static configuration for restassured
Date Fri, 06 Sep 2019 02:02:04 GMT
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 cda82593d273e30ea4aeead514084f4a5a65a781
Author: Benoit Tellier <btellier@linagora.com>
AuthorDate: Tue Sep 3 10:22:27 2019 +0700

    JAMES-2442 static configuration for restassured
---
 .../james/mailets/RemoteDeliveryErrorTest.java     | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorTest.java
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorTest.java
index a91cb3a..ab839d2 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorTest.java
@@ -56,6 +56,7 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 
+import io.restassured.RestAssured;
 import io.restassured.builder.RequestSpecBuilder;
 import io.restassured.builder.ResponseSpecBuilder;
 import io.restassured.http.ContentType;
@@ -157,6 +158,9 @@ public class RemoteDeliveryErrorTest {
             .fluent()
             .addDomain(DEFAULT_DOMAIN)
             .addUser(FROM, PASSWORD);
+
+        RestAssured.requestSpecification = requestSpecification();
+        RestAssured.enableLoggingOfRequestAndResponseIfValidationFails();
     }
 
     @After
@@ -167,7 +171,7 @@ public class RemoteDeliveryErrorTest {
 
     @Test
     public void remoteDeliveryShouldBounceWhenAlwaysRCPT421() throws Exception {
-        given(requestSpecification())
+        with()
             .body(ALWAYS_421_RCPT_BEHAVIOR)
             .put("/smtpBehaviors");
 
@@ -183,7 +187,7 @@ public class RemoteDeliveryErrorTest {
 
     @Test
     public void remoteDeliveryShouldBounceWhenAlwaysFROM421() throws Exception {
-        given(requestSpecification())
+        with()
             .body(ALWAYS_421_FROM_BEHAVIOR)
             .put("/smtpBehaviors");
 
@@ -199,7 +203,7 @@ public class RemoteDeliveryErrorTest {
 
     @Test
     public void remoteDeliveryShouldBounceWhenAlwaysDATA421() throws Exception {
-        given(requestSpecification())
+        with()
             .body(ALWAYS_421_DATA_BEHAVIOR)
             .put("/smtpBehaviors");
 
@@ -215,7 +219,7 @@ public class RemoteDeliveryErrorTest {
 
     @Test
     public void remoteDeliveryShouldNotRetryWHenRCPT500() throws Exception {
-        given(requestSpecification())
+        with()
             .body(SINGLE_500_RCPT_BEHAVIOR)
             .put("/smtpBehaviors");
 
@@ -231,7 +235,7 @@ public class RemoteDeliveryErrorTest {
 
     @Test
     public void remoteDeliveryShouldNotRetryWHenFROM500() throws Exception {
-        given(requestSpecification())
+        with()
             .body(SINGLE_500_FROM_BEHAVIOR)
             .put("/smtpBehaviors");
 
@@ -247,7 +251,7 @@ public class RemoteDeliveryErrorTest {
 
     @Test
     public void remoteDeliveryShouldNotRetryWHenDATA500() throws Exception {
-        given(requestSpecification())
+        with()
             .body(SINGLE_500_DATA_BEHAVIOR)
             .put("/smtpBehaviors");
 
@@ -263,7 +267,7 @@ public class RemoteDeliveryErrorTest {
 
     @Test
     public void remoteDeliveryShouldRetryWhenRCPT421() throws Exception {
-        given(requestSpecification())
+        with()
             .body(TWICE_421_RCPT_BEHAVIOR)
             .put("/smtpBehaviors");
 
@@ -282,7 +286,7 @@ public class RemoteDeliveryErrorTest {
 
     @Test
     public void remoteDeliveryShouldRetryWhenFROM421() throws Exception {
-        given(requestSpecification())
+        with()
             .body(TWICE_421_FROM_BEHAVIOR)
             .put("/smtpBehaviors");
 
@@ -301,7 +305,7 @@ public class RemoteDeliveryErrorTest {
 
     @Test
     public void remoteDeliveryShouldRetryWhenDATA421() throws Exception {
-        given(requestSpecification())
+        with()
             .body(TWICE_421_DATA_BEHAVIOR)
             .put("/smtpBehaviors");
 


---------------------------------------------------------------------
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