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: Cleanup the imports and add an actual loop in the connection loopback test.
Date Fri, 09 Jan 2015 00:42:18 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/USERGRID-313 d567dd1af -> 9fcb1502f


Cleanup the imports and add an actual loop in the connection loopback test.


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

Branch: refs/heads/USERGRID-313
Commit: 9fcb1502f661a96881e3572319d3c68607cb40c3
Parents: d567dd1
Author: grey <greyes@apigee.com>
Authored: Thu Jan 8 16:42:15 2015 -0800
Committer: grey <greyes@apigee.com>
Committed: Thu Jan 8 16:42:15 2015 -0800

----------------------------------------------------------------------
 .../users/ConnectionResourceTest.java           | 30 +++++++++++---------
 1 file changed, 16 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9fcb1502/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/ConnectionResourceTest.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/ConnectionResourceTest.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/ConnectionResourceTest.java
index 8ab63f7..716b15f 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/ConnectionResourceTest.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/ConnectionResourceTest.java
@@ -17,30 +17,25 @@
 package org.apache.usergrid.rest.applications.collection.users;
 
 
-import java.util.LinkedHashMap;
+import java.io.IOException;
 import java.util.Map;
 import java.util.UUID;
 
-import javax.ws.rs.core.MediaType;
+import org.junit.Before;
+import org.junit.Test;
 
-import com.fasterxml.jackson.databind.JsonNode;
 import org.apache.usergrid.rest.test.resource2point0.AbstractRestIT;
 import org.apache.usergrid.rest.test.resource2point0.endpoints.CollectionEndpoint;
-import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
 import org.apache.usergrid.rest.test.resource2point0.model.Collection;
 import org.apache.usergrid.rest.test.resource2point0.model.Entity;
 import org.apache.usergrid.rest.test.resource2point0.model.User;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-
-import com.sun.jersey.api.client.ClientResponse;
 import com.sun.jersey.api.client.UniformInterfaceException;
-import java.io.IOException;
 
-import static org.apache.usergrid.utils.MapUtils.hashMap;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 
 /**
@@ -103,8 +98,7 @@ public class ConnectionResourceTest extends AbstractRestIT {
         //Set user Scott to get back a nonexistant connection.
         try {
             this.app().collection("users").entity("scott").connection("likes").entity(uuid).get();
-
-            assert ( false );
+            fail("We shouldn't be able to see user1 connection through user2");
         }
         catch ( UniformInterfaceException uie ) {
             assertEquals( 404, uie.getResponse().getStatus() );
@@ -142,6 +136,14 @@ public class ConnectionResourceTest extends AbstractRestIT {
         UUID returned = collection.next().getUuid();
 
         assertEquals( "Should point to thing1 as an incoming entity connection", thing1Id,
returned );
+
+        //Follow the connection through the loop to make sure it works. 
+        Entity thing1Return = this.app().collection("things").entity(thing1Id).connection(
"likes" )
+            .collection( "things" ).entity( thing2Id ).connection( "likes" )
+            .collection( "things" ).entity( thing1Id ).get();
+
+        assertEquals(thing1Id,thing1Return.getUuid());
+
     }
 
 


Mime
View raw message