usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [1/2] incubator-usergrid git commit: Add fixes for a majority of RegistrationIt tests
Date Mon, 01 Jun 2015 19:04:12 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o-dev 15e64da84 -> ac2cba266


Add fixes for a majority of RegistrationIt tests


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/6b2155a6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/6b2155a6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/6b2155a6

Branch: refs/heads/two-dot-o-dev
Commit: 6b2155a6b2ef507b276acf8a5374837854beeaa4
Parents: 15e64da
Author: GERey <greyes@apigee.com>
Authored: Mon Jun 1 10:28:39 2015 -0700
Committer: GERey <greyes@apigee.com>
Committed: Mon Jun 1 10:28:39 2015 -0700

----------------------------------------------------------------------
 .../usergrid/rest/management/RegistrationIT.java       | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6b2155a6/stack/rest/src/test/java/org/apache/usergrid/rest/management/RegistrationIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/RegistrationIT.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/management/RegistrationIT.java
index 14c81be..45f62e2 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/RegistrationIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/RegistrationIT.java
@@ -78,16 +78,14 @@ public class RegistrationIT extends AbstractRestIT {
         return StringUtils.substringAfterLast(body, "token=");
     }
 
-    public User postAddAdminToOrg(String organizationName, String email, String password,
String token) throws IOException {
+    public Entity postAddAdminToOrg(String organizationName, String email, String password)
throws IOException {
 
-        User user = this
+        Entity user = this
             .management()
             .orgs()
             .organization(organizationName)
             .users()
-            .getResource(false)
-            .queryParam("access_token", token)
-            .post(User.class, new User().chainPut("email", email).chainPut("password", password));
+            .post(this.getAdminToken(), new User().chainPut("email", email).chainPut("password",
password)  );
 
         assertNotNull(user);
         return user;
@@ -219,8 +217,7 @@ public class RegistrationIT extends AbstractRestIT {
             setTestProperty(PROPERTIES_ADMIN_USERS_REQUIRE_CONFIRMATION, "false");
             setTestProperty(PROPERTIES_SYSADMIN_EMAIL, "sysadmin-1@mockserver.com");
 
-            String t = this.getAdminToken().getAccessToken();
-            postAddAdminToOrg("test-organization", "test-admin@mockserver.com", "password",
t);
+            postAddAdminToOrg(this.clientSetup.getOrganizationName(), UUIDGenerator.newTimeUUID()+"@email.com",
"password");
         } finally {
             setTestProperties(originalProperties);
         }
@@ -242,7 +239,7 @@ public class RegistrationIT extends AbstractRestIT {
             // this should send resetpwd  link in email to newly added org admin user(that
did not exist
             ///in usergrid) and "User Invited To Organization" email
             String adminToken = getAdminToken().getAccessToken();
-            Entity node = postAddAdminToOrg("test-organization", "test-admin-nopwd@mockserver.com",
"", adminToken);
+            Entity node = postAddAdminToOrg("test-organization", "test-admin-nopwd@mockserver.com",
"");
             UUID userId = (UUID) node.getMap("data").get("user").get("uuid");
 
             refreshIndex();


Mime
View raw message