Repository: james-project
Updated Branches:
  refs/heads/master e8b94d178 -> 4a47f7a78


JAMES-1959 Fix master build


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/190004b4
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/190004b4
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/190004b4

Branch: refs/heads/master
Commit: 190004b4520f466aa4e142e923984b0a7e38e6c7
Parents: e8b94d1
Author: benwa <btell...@linagora.com>
Authored: Thu Mar 16 11:31:21 2017 +0700
Committer: benwa <btell...@linagora.com>
Committed: Thu Mar 16 11:31:21 2017 +0700

----------------------------------------------------------------------
 .../integration/JwtFilterIntegrationTest.java   |  6 ++++-
 .../WebAdminServerIntegrationTest.java          | 25 +++++++++++++++-----
 2 files changed, 24 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/190004b4/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/JwtFilterIntegrationTest.java
----------------------------------------------------------------------
diff --git 
a/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/JwtFilterIntegrationTest.java
 
b/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/JwtFilterIntegrationTest.java
index 06fc77c..dee4122 100644
--- 
a/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/JwtFilterIntegrationTest.java
+++ 
b/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/JwtFilterIntegrationTest.java
@@ -67,6 +67,7 @@ public class JwtFilterIntegrationTest {
 
     private GuiceJamesServer guiceJamesServer;
     private DataProbeImpl dataProbe;
+    private WebAdminGuiceProbe webAdminGuiceProbe;
 
     @Before
     public void setUp() throws Exception {
@@ -80,12 +81,12 @@ public class JwtFilterIntegrationTest {
                 binder -> 
binder.bind(JwtConfiguration.class).toInstance(jwtConfiguration));
         guiceJamesServer.start();
         dataProbe = guiceJamesServer.getProbe(DataProbeImpl.class);
+        webAdminGuiceProbe = 
guiceJamesServer.getProbe(WebAdminGuiceProbe.class);
 
         RestAssured.requestSpecification = new RequestSpecBuilder()
             .setContentType(ContentType.JSON)
             .setAccept(ContentType.JSON)
             
.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-            
.setPort(guiceJamesServer.getProbe(WebAdminGuiceProbe.class).getWebAdminPort())
             .build();
     }
 
@@ -97,6 +98,7 @@ public class JwtFilterIntegrationTest {
     @Test
     public void jwtAuthenticationShouldWork() throws Exception {
         given()
+            .port(webAdminGuiceProbe.getWebAdminPort())
             .header(new Header("Authorization", "Bearer " + 
VALID_TOKEN_ADMIN_TRUE))
         .when()
             .put(SPECIFIC_DOMAIN)
@@ -110,6 +112,7 @@ public class JwtFilterIntegrationTest {
     @Test
     public void jwtShouldRejectNonAdminRequests() throws Exception {
         given()
+            .port(webAdminGuiceProbe.getWebAdminPort())
             .header(new Header("Authorization", "Bearer " + 
VALID_TOKEN_ADMIN_FALSE))
         .when()
             .put(SPECIFIC_DOMAIN)
@@ -123,6 +126,7 @@ public class JwtFilterIntegrationTest {
     @Test
     public void jwtShouldRejectInvalidRequests() throws Exception {
         given()
+            .port(webAdminGuiceProbe.getWebAdminPort())
             .header(new Header("Authorization", "Bearer invalid"))
         .when()
             .put(SPECIFIC_DOMAIN)

http://git-wip-us.apache.org/repos/asf/james-project/blob/190004b4/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java
----------------------------------------------------------------------
diff --git 
a/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java
 
b/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java
index c91eec4..5f9c642 100644
--- 
a/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java
+++ 
b/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/WebAdminServerIntegrationTest.java
@@ -60,6 +60,7 @@ public class WebAdminServerIntegrationTest {
 
     private GuiceJamesServer guiceJamesServer;
     private DataProbe dataProbe;
+    private WebAdminGuiceProbe webAdminGuiceProbe;
 
     @Before
     public void setUp() throws Exception {
@@ -67,12 +68,12 @@ public class WebAdminServerIntegrationTest {
                 .overrideWith(new WebAdminConfigurationModule());
         guiceJamesServer.start();
         dataProbe = guiceJamesServer.getProbe(DataProbeImpl.class);
+        webAdminGuiceProbe = 
guiceJamesServer.getProbe(WebAdminGuiceProbe.class);
 
         RestAssured.requestSpecification = new RequestSpecBuilder()
                        .setContentType(ContentType.JSON)
                        .setAccept(ContentType.JSON)
                        
.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-                       
.setPort(guiceJamesServer.getProbe(WebAdminGuiceProbe.class).getWebAdminPort())
                        .build();
     }
 
@@ -83,7 +84,9 @@ public class WebAdminServerIntegrationTest {
 
     @Test
     public void postShouldAddTheGivenDomain() throws Exception {
-        when()
+        given()
+            .port(webAdminGuiceProbe.getWebAdminPort())
+        .when()
             .put(SPECIFIC_DOMAIN)
         .then()
             .statusCode(204);
@@ -95,7 +98,9 @@ public class WebAdminServerIntegrationTest {
     public void deleteShouldRemoveTheGivenDomain() throws Exception {
         dataProbe.addDomain(DOMAIN);
 
-        when()
+        given()
+            .port(webAdminGuiceProbe.getWebAdminPort())
+        .when()
             .delete(SPECIFIC_DOMAIN)
         .then()
             .statusCode(204);
@@ -108,6 +113,7 @@ public class WebAdminServerIntegrationTest {
         dataProbe.addDomain(DOMAIN);
 
         given()
+            .port(webAdminGuiceProbe.getWebAdminPort())
             .body("{\"password\":\"password\"}")
         .when()
             .put(SPECIFIC_USER)
@@ -123,6 +129,7 @@ public class WebAdminServerIntegrationTest {
         dataProbe.addUser(USERNAME, "anyPassword");
 
         given()
+            .port(webAdminGuiceProbe.getWebAdminPort())
             .body("{\"username\":\"" + USERNAME + 
"\",\"password\":\"password\"}")
         .when()
             .delete(SPECIFIC_USER)
@@ -137,7 +144,9 @@ public class WebAdminServerIntegrationTest {
         dataProbe.addDomain(DOMAIN);
         dataProbe.addUser(USERNAME, "anyPassword");
 
-        when()
+        given()
+            .port(webAdminGuiceProbe.getWebAdminPort())
+        .when()
             .get(UserRoutes.USERS)
         .then()
             .statusCode(200)
@@ -149,7 +158,9 @@ public class WebAdminServerIntegrationTest {
         dataProbe.addDomain(DOMAIN);
         dataProbe.addUser(USERNAME, "anyPassword");
 
-        when()
+        given()
+            .port(webAdminGuiceProbe.getWebAdminPort())
+        .when()
             .put(SPECIFIC_MAILBOX)
         .then()
             .statusCode(204);
@@ -163,7 +174,9 @@ public class WebAdminServerIntegrationTest {
         dataProbe.addUser(USERNAME, "anyPassword");
         
guiceJamesServer.getProbe(MailboxProbeImpl.class).createMailbox("#private", 
USERNAME, MAILBOX);
 
-        when()
+        given()
+            .port(webAdminGuiceProbe.getWebAdminPort())
+        .when()
             .delete(SPECIFIC_MAILBOX)
         .then()
             .statusCode(204);


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