usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfeld...@apache.org
Subject incubator-usergrid git commit: mgmtUserFeed
Date Mon, 01 Jun 2015 14:55:04 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o-dev d8ddbcc63 -> 0d4fa2b5c


mgmtUserFeed


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

Branch: refs/heads/two-dot-o-dev
Commit: 0d4fa2b5c019c6fa8e9a6431d6213100ac445bda
Parents: d8ddbcc
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Mon Jun 1 08:55:00 2015 -0600
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Mon Jun 1 08:55:00 2015 -0600

----------------------------------------------------------------------
 .../apache/usergrid/rest/management/AdminUsersIT.java | 14 ++++----------
 .../resource2point0/endpoints/mgmt/FeedResource.java  |  5 +++--
 2 files changed, 7 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0d4fa2b5/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
index de3a6ce..f853740 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/AdminUsersIT.java
@@ -27,6 +27,7 @@ import javax.mail.Message;
 import javax.mail.MessagingException;
 import javax.mail.internet.MimeMultipart;
 
+import org.apache.usergrid.rest.test.resource2point0.model.*;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -39,11 +40,6 @@ import org.apache.usergrid.persistence.core.util.StringUtils;
 import org.apache.usergrid.persistence.index.utils.UUIDUtils;
 import org.apache.usergrid.rest.test.resource2point0.AbstractRestIT;
 import org.apache.usergrid.rest.test.resource2point0.endpoints.mgmt.ManagementResource;
-import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
-import org.apache.usergrid.rest.test.resource2point0.model.Credentials;
-import org.apache.usergrid.rest.test.resource2point0.model.Entity;
-import org.apache.usergrid.rest.test.resource2point0.model.QueryParameters;
-import org.apache.usergrid.rest.test.resource2point0.model.Token;
 
 import com.sun.jersey.api.client.ClientResponse;
 import com.sun.jersey.api.client.UniformInterfaceException;
@@ -62,9 +58,6 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import org.apache.usergrid.rest.test.resource2point0.model.Organization;
-import org.apache.usergrid.rest.test.resource2point0.model.User;
-
 
 /**
  * Contains all tests relating to Admin Users
@@ -187,12 +180,13 @@ public class AdminUsersIT extends AbstractRestIT {
     @Test
     public void mgmtUserFeed() throws Exception {
         //TODO: fix or establish what the user feed should do
-        Entity mgmtUserFeedEntity = management.users().user( clientSetup.getUsername() ).feed().get();
+        management.token().setToken( this.getAdminToken() );
+        ApiResponse mgmtUserFeedEntity = management.users().user( clientSetup.getUsername()
).feed().get();
         String correctValue= "<a href=mailto:"+clientSetup.getUsername();  //user_org.apache.usergrid.rest.management.AdminUsersIT.mgmtUserFeed4c3e53e0-acc7-11e4-b527-0b8af3c5813f@usergrid.com">user_org.apache.usergrid.rest.management.AdminUsersIT.mgmtUserFeed4c3e53e0-acc7-11e4-b527-0b8af3c5813f
(user_org.apache.usergrid.rest.management.AdminUsersIT.mgmtUserFeed4c3e53e0-acc7-11e4-b527-0b8af3c5813f@usergrid.com)</a>
created a new organization account named org_org.apache.usergrid.rest.management.AdminUsersIT.mgmtUserFeed4c3ec910-acc7-11e4-94c8-33f0d48a5559
 
         assertNotNull( mgmtUserFeedEntity );
 
-        ArrayList<Map<String,Object>> feedEntityMap = ( ArrayList ) mgmtUserFeedEntity.get(
"entities" );
+        List<Entity> feedEntityMap =  mgmtUserFeedEntity.getEntities();
         assertNotNull( feedEntityMap );
         assertNotEquals( 0,feedEntityMap.size() );
         assertNotNull( feedEntityMap.get( 0 ).get( "title" )  );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0d4fa2b5/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/FeedResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/FeedResource.java
b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/FeedResource.java
index 5b95aa5..3435afe 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/FeedResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/mgmt/FeedResource.java
@@ -26,6 +26,7 @@ import javax.ws.rs.core.MediaType;
 import org.apache.usergrid.rest.test.resource2point0.endpoints.NamedResource;
 import org.apache.usergrid.rest.test.resource2point0.endpoints.UrlResource;
 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.state.ClientContext;
 
@@ -39,9 +40,9 @@ public class FeedResource extends NamedResource {
         super ( "feed",context, parent);
     }
 
-    public Entity get() {
+    public ApiResponse get() {
         return getResource( true ).type( MediaType.APPLICATION_JSON_TYPE )
-            .accept( MediaType.APPLICATION_JSON ).get( Entity.class);
+            .accept( MediaType.APPLICATION_JSON ).get( ApiResponse.class);
 
 
     }


Mime
View raw message