usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject incubator-usergrid git commit: Fixed test by changing ordering of token retrieval.
Date Wed, 03 Jun 2015 16:48:37 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o-dev 68c65f070 -> c57edaa30


Fixed test by changing ordering of token retrieval.


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

Branch: refs/heads/two-dot-o-dev
Commit: c57edaa3008d8a5d70e6938fcf623f0db053deb7
Parents: 68c65f0
Author: GERey <greyes@apigee.com>
Authored: Wed Jun 3 09:48:34 2015 -0700
Committer: GERey <greyes@apigee.com>
Committed: Wed Jun 3 09:48:34 2015 -0700

----------------------------------------------------------------------
 .../rest/applications/ApplicationCreateIT.java         | 13 +++++++------
 .../rest/test/resource2point0/ClientSetup.java         |  8 +++++---
 2 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c57edaa3/stack/rest/src/test/java/org/apache/usergrid/rest/applications/ApplicationCreateIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/ApplicationCreateIT.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/ApplicationCreateIT.java
index 4929a4c..dbf3e82 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/ApplicationCreateIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/ApplicationCreateIT.java
@@ -34,8 +34,7 @@ import java.util.*;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+
 
 
 public class ApplicationCreateIT extends AbstractRestIT {
@@ -48,14 +47,16 @@ public class ApplicationCreateIT extends AbstractRestIT {
      */
     @Test
     public void testCreateAndImmediateGet() throws Exception {
-        
+
         String orgName = clientSetup.getOrganizationName();
         String appName = clientSetup.getAppName() + "_new_app";
+        Token orgAdminToken = getAdminToken(clientSetup.getUsername(), clientSetup.getPassword());
+
         Map applicationMap = new HashMap<String, Object>(  );
         applicationMap.put( "name", appName );
 
-        Entity appCreateResponse = this.management().orgs().organization( orgName ).apps().post(
-            clientSetup.getSuperuserToken(),applicationMap );
+        this.management().orgs().organization( orgName ).apps().post(
+            orgAdminToken,applicationMap );
 
         Entity response = this.management().orgs().organization( orgName ).addToPath( "apps"
).addToPath( appName ).get();
 
@@ -74,7 +75,7 @@ public class ApplicationCreateIT extends AbstractRestIT {
         String random = RandomStringUtils.randomAlphabetic(10);
         String orgName = clientSetup.getOrganizationName();
         String appName = "testCreateAndImmediateList_app_" + random;
-        Token orgAdminToken = getAdminToken(clientSetup.getUsername(), clientSetup.getPassword());
+        Token orgAdminToken = getAdminToken( clientSetup.getUsername(), clientSetup.getPassword()
);
 
         for ( int i=0; i<appCount; i++ ) {
            createAppWithCollection( orgName, appName + i, orgAdminToken, new ArrayList<>()
);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c57edaa3/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
index 605e2e7..51bf09e 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/ClientSetup.java
@@ -118,12 +118,14 @@ public class ClientSetup implements TestRule {
         organization = restClient.management().orgs()
                                  .post( new Organization( orgName, username, username + "@usergrid.com",
username,
                                      username, null ) );
-       // refreshIndex();
-        clientCredentials = restClient.management().orgs().organization( orgName ).credentials().get();
-        //refreshIndex();
 
         restClient.management().token().get(username,password);
 
+        // refreshIndex();
+        clientCredentials = restClient.management().orgs().organization( orgName ).credentials().get(null,true);
+        //refreshIndex();
+
+
         ApiResponse appResponse = restClient.management().orgs().organization(organization.getName()).app().post(new
Application(appName));
         appUuid = ( String ) appResponse.getEntities().get( 0 ).get( "uuid" );
         refreshIndex();


Mime
View raw message