You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2014/01/16 18:30:18 UTC

[22/51] [abbrv] git commit: Added two tests proving issue 3011. The tests create a connection between two objects and tries to delete the entities associated with the connection without disbanding the connection.

Added two tests proving issue 3011. The tests create a connection between two objects and tries to delete the entities associated with the connection without disbanding the connection.


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

Branch: refs/heads/two-dot-o
Commit: 4a28f6bcd79c0ecebdddde04568fcda5b0f6b6f6
Parents: 79a34a2
Author: GERey <gr...@apigee.com>
Authored: Wed Jan 15 13:05:44 2014 -0800
Committer: GERey <gr...@apigee.com>
Committed: Wed Jan 15 13:05:44 2014 -0800

----------------------------------------------------------------------
 .../users/ConnectionResourceTest.java           | 23 +++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4a28f6bc/stack/rest/src/test/java/org/usergrid/rest/applications/users/ConnectionResourceTest.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/usergrid/rest/applications/users/ConnectionResourceTest.java b/stack/rest/src/test/java/org/usergrid/rest/applications/users/ConnectionResourceTest.java
index a9495c4..7850b68 100644
--- a/stack/rest/src/test/java/org/usergrid/rest/applications/users/ConnectionResourceTest.java
+++ b/stack/rest/src/test/java/org/usergrid/rest/applications/users/ConnectionResourceTest.java
@@ -207,8 +207,29 @@ public class ConnectionResourceTest extends AbstractRestIT {
 
         JsonNode response = things.entity( "thing2" ).delete();
 
-        assertNull (things.entity( thing1Id).connection("likes").entity( thing2Id).get());
+        JsonNode node = things.entity ( "thing2" ).get();
 
+        assertNull(node);
+
+    }
+
+    @Test //USERGRID-3011
+    public void connectionsDeleteFirstEntityInConnectionTest() {
+
+        CustomCollection things = context.collection( "things" );
+
+        UUID thing1Id = getEntityId( things.create( hashMap( "name", "thing1" ) ), 0 );
+
+        UUID thing2Id = getEntityId( things.create( hashMap( "name", "thing2" ) ), 0 );
+
+        //create the connection
+        things.entity( thing1Id ).connection( "likes" ).entity( thing2Id ).post();
+
+        JsonNode response = things.entity( "thing1" ).delete();
+
+        JsonNode node = things.entity ( "thing1" ).get();
+
+        assertNull(node);
 
     }