usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [16/51] [abbrv] git commit: Added in test that checks to see if you can delete a single connection with a connection attached.
Date Thu, 16 Jan 2014 17:30:12 GMT
Added in test that checks to see if you can delete a single connection with a connection attached.


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

Branch: refs/heads/two-dot-o
Commit: 79a34a2a5bfa3b39ac64b2ce51162346acf51ea2
Parents: 5a57e87
Author: GERey <greyes@apigee.com>
Authored: Mon Jan 13 15:55:15 2014 -0800
Committer: GERey <greyes@apigee.com>
Committed: Mon Jan 13 15:55:15 2014 -0800

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


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/79a34a2a/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 ab29ea8..a9495c4 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
@@ -8,6 +8,7 @@ import java.util.UUID;
 import javax.ws.rs.core.MediaType;
 
 import org.codehaus.jackson.JsonNode;
+import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.usergrid.rest.AbstractRestIT;
@@ -17,6 +18,7 @@ import org.usergrid.rest.test.resource.CustomCollection;
 import com.sun.jersey.api.client.ClientResponse;
 import com.sun.jersey.api.client.UniformInterfaceException;
 
+import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.usergrid.utils.MapUtils.hashMap;
@@ -190,4 +192,24 @@ public class ConnectionResourceTest extends AbstractRestIT {
 
         assertEquals( "Should point to thing2 as an entity connection", thing2Id, returned
);
     }
+
+    @Test //USERGRID-3011
+    public void connectionsDeleteSecondEntityInConnectionTest() {
+
+        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( "thing2" ).delete();
+
+        assertNull (things.entity( thing1Id).connection("likes").entity( thing2Id).get());
+
+
+    }
+
 }


Mime
View raw message