You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by to...@apache.org on 2015/06/01 23:48:47 UTC

[38/50] [abbrv] incubator-usergrid git commit: Fixed PermissionsResourceIT errors

Fixed PermissionsResourceIT errors


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

Branch: refs/heads/USERGRID-628
Commit: ab81cbe196c4a5a09160466380d1616e74623a26
Parents: 0d4fa2b
Author: GERey <gr...@apigee.com>
Authored: Mon Jun 1 08:51:11 2015 -0700
Committer: GERey <gr...@apigee.com>
Committed: Mon Jun 1 08:51:11 2015 -0700

----------------------------------------------------------------------
 .../collection/users/PermissionsResourceIT.java | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ab81cbe1/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/PermissionsResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/PermissionsResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/PermissionsResourceIT.java
index 31f5f89..8a1734f 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/PermissionsResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/PermissionsResourceIT.java
@@ -131,20 +131,20 @@ public class PermissionsResourceIT extends AbstractRestIT {
         refreshIndex();
 
         //Create a user that is in the group.
-        node = this.app().collection("groups").entity(groupPath).collection("users").entity(USER).post();
+        node = this.app().collection("groups").entity(groupPath).collection("users").entity(user).post();
 
         assertNull( node.get( "error" ) );
 
         refreshIndex();
 
         //Get the user and make sure that they are part of the group
-        Collection groups = this.app().collection("users").entity(USER).collection("groups").get();
+        Collection groups = this.app().collection("users").entity(user).collection("groups").get();
 
         assertEquals(groups.next().get("name"), groupPath);
 
         // now delete the group
 
-        ApiResponse response = this.app().collection("groups").entity(groupPath).collection("users").entity(USER).delete();
+        ApiResponse response = this.app().collection("groups").entity(groupPath).collection("users").entity(user).delete();
 
         assertNull( response.getError() );
 
@@ -153,11 +153,11 @@ public class PermissionsResourceIT extends AbstractRestIT {
         //Check that the user no longer exists in the group
         int status = 0;
         try {
-            groups = this.app().collection("users").entity(USER).collection("groups").get();
-            assertFalse(groups.hasNext());
+            this.app().collection("users").entity(user).collection("groups").entity( groupPath ).collection( "users" ).entity( user ).get();
+            fail("Should not have been able to retrieve the user as it was deleted");
         }catch (UniformInterfaceException e){
             status=e.getResponse().getStatus();
-            fail();
+            assertEquals( 404,status );
         }
 
     }
@@ -257,7 +257,9 @@ public class PermissionsResourceIT extends AbstractRestIT {
         refreshIndex();
 
         // get the reviews and assert they were created
-        Collection reviews = this.app().collection("reviews").get();
+        QueryParameters queryParameters = new QueryParameters();
+        queryParameters.setQuery( "select * ORDER BY created" );
+        Collection reviews = this.app().collection("reviews").get(queryParameters);
 
         assertEquals( "noca",reviews.next().get("name") );
         assertEquals("4peaks", reviews.next().get( "name" ));
@@ -304,7 +306,9 @@ public class PermissionsResourceIT extends AbstractRestIT {
         refreshIndex();
 
         // get all reviews as reviewer2
-        reviews =  this.app().collection("reviews").get();
+        queryParameters = new QueryParameters();
+        queryParameters.setQuery( "select * ORDER BY created" );
+        reviews =  this.app().collection("reviews").get(queryParameters);
 
         assertEquals("noca", reviews.next().get("name").toString());
         assertEquals("4peaks", reviews.next().get("name").toString());