usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [09/17] incubator-usergrid git commit: fix token.getuser
Date Mon, 05 Jan 2015 19:36:02 GMT
fix token.getuser


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

Branch: refs/heads/two-dot-o
Commit: 2a8391ea319e92dbf4a33c0695772cf2bba713bd
Parents: 3864d59
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Tue Dec 23 16:43:55 2014 -0700
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Tue Dec 23 16:43:55 2014 -0700

----------------------------------------------------------------------
 .../rest/applications/collection/users/UserResourceIT.java   | 8 ++++----
 .../usergrid/rest/test/resource2point0/model/Token.java      | 5 ++++-
 2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2a8391ea/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java
index 072e1c4..72695a0 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/users/UserResourceIT.java
@@ -134,7 +134,7 @@ public class UserResourceIT extends org.apache.usergrid.rest.test.resource2point
         Entity entity = usersResource.entity(userId.toString()).activities().post(activity);
 
 
-        UUID activityId =(UUID) entity.get("uuid");
+        UUID activityId = entity.getUuid();
 
         assertNotNull( activityId );
         Map<String,Object> actor = (Map<String,Object>)entity.get("actor");
@@ -250,11 +250,11 @@ public class UserResourceIT extends org.apache.usergrid.rest.test.resource2point
 
         Collection activities = usersResource.entity(userId.toString()).activities().get();
 
-        entity = (Entity) activities.getResponse().getEntities().get(0);
+        entity =  activities.getResponse().getEntities().get(0);
 
         assertEquals( secondActivityId, entity.getUuid() );
 
-        entity = (Entity) activities.getResponse().getEntities().get(1);
+        entity =  activities.getResponse().getEntities().get(1);
 
         assertEquals( firstActivityId, entity.getUuid() );
     }
@@ -794,7 +794,7 @@ public class UserResourceIT extends org.apache.usergrid.rest.test.resource2point
             responseStatus = uie.getResponse().getStatus();
         }
 
-        assertEquals( Status.BAD_REQUEST, responseStatus );
+        assertEquals( Status.BAD_REQUEST.getStatusCode(), responseStatus );
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2a8391ea/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Token.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Token.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Token.java
index fdadc7c..97e5a9c 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Token.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Token.java
@@ -17,6 +17,9 @@
 package org.apache.usergrid.rest.test.resource2point0.model;
 
 
+import java.util.LinkedHashMap;
+import java.util.Map;
+
 /**
  * Token model that contains the operations that can be done on a token.
  */
@@ -63,7 +66,7 @@ public class Token extends Entity{
     }
 
     public User getUser() {
-        return user;
+        return user != null ? user : new User((LinkedHashMap)get("user"));
     }
 }
 


Mime
View raw message