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

[1/2] incubator-usergrid git commit: rename getcollectionsresource

Repository: incubator-usergrid
Updated Branches:
  refs/heads/UG-rest-test-framework-overhaul e276e4faa -> 9084e3653


rename getcollectionsresource


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

Branch: refs/heads/UG-rest-test-framework-overhaul
Commit: 7a0277775bc1bb5d86def273b1c92b04ab43bcb9
Parents: 0860910
Author: Shawn Feldman <sf...@apache.org>
Authored: Tue Dec 16 16:06:04 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Tue Dec 16 16:06:04 2014 -0700

----------------------------------------------------------------------
 .../endpoints/AbstractCollectionResource.java         | 14 ++++++++------
 .../endpoints/ApplicationsResource.java               |  2 +-
 .../resource2point0/endpoints/CollectionResource.java |  2 +-
 .../test/resource2point0/endpoints/UsersResource.java |  2 +-
 .../rest/test/resource2point0/model/Entity.java       | 10 +++++-----
 5 files changed, 16 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7a027777/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/AbstractCollectionResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/AbstractCollectionResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/AbstractCollectionResource.java
index b0eae47..8d59fe6 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/AbstractCollectionResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/AbstractCollectionResource.java
@@ -31,13 +31,13 @@ import javax.ws.rs.core.MediaType;
 /**
  * Classy class class.
  */
-public abstract class AbstractCollectionResource<T,K> extends NamedResource {
+public abstract class AbstractCollectionResource<T,Subresource> extends NamedResource {
     public AbstractCollectionResource(String name, ClientContext context, UrlResource parent) {
         super(name, context, parent);
     }
 
-    public K getCollectionResource(final String identifier){
-        return instantiateK(identifier, context, this);
+    public Subresource getSubresource(final String identifier){
+        return instantiateSubresource(identifier, context, this);
     }
 
     /**
@@ -64,7 +64,8 @@ public abstract class AbstractCollectionResource<T,K> extends NamedResource {
      * @return
      */
     public T post(final T entity){
-        return instantiateT(getResource(true).post(ApiResponse.class, entity));
+        return instantiateT(getResource(true).type( MediaType.APPLICATION_JSON_TYPE ).accept(MediaType.APPLICATION_JSON)
+                .post(ApiResponse.class, entity));
     }
 
     /**
@@ -73,11 +74,12 @@ public abstract class AbstractCollectionResource<T,K> extends NamedResource {
      * @return
      */
     public T put(final T entity){
-        return instantiateT(getResource(true).put(ApiResponse.class, entity));
+        return instantiateT(getResource(true).type( MediaType.APPLICATION_JSON_TYPE ).accept(MediaType.APPLICATION_JSON)
+                .put(ApiResponse.class, entity));
     }
 
     protected abstract T instantiateT(ApiResponse response);
 
-    protected abstract K instantiateK(String identifier, ClientContext context, UrlResource parent);
+    protected abstract Subresource instantiateSubresource(String identifier, ClientContext context, UrlResource parent);
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7a027777/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/ApplicationsResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/ApplicationsResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/ApplicationsResource.java
index 6fa722e..7119b55 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/ApplicationsResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/ApplicationsResource.java
@@ -43,7 +43,7 @@ public class ApplicationsResource extends AbstractCollectionResource<Application
     }
 
     @Override
-    protected CollectionResource instantiateK(String identifier, ClientContext context, UrlResource parent) {
+    protected CollectionResource instantiateSubresource(String identifier, ClientContext context, UrlResource parent) {
         return new CollectionResource(identifier,context,parent);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7a027777/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/CollectionResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/CollectionResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/CollectionResource.java
index 695d677..e330172 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/CollectionResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/CollectionResource.java
@@ -51,7 +51,7 @@ public  class CollectionResource extends AbstractCollectionResource<Entity,Entit
     }
 
     @Override
-    protected EntityResource instantiateK(String identifier, ClientContext context, UrlResource parent) {
+    protected EntityResource instantiateSubresource(String identifier, ClientContext context, UrlResource parent) {
         return new EntityResource( identifier, context, this );
 
     }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7a027777/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/UsersResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/UsersResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/UsersResource.java
index 4eb39b9..74de6dc 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/UsersResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/UsersResource.java
@@ -43,7 +43,7 @@ public class UsersResource extends AbstractCollectionResource<User,UserResource>
     }
 
     @Override
-    protected UserResource instantiateK(String name, ClientContext context, UrlResource parent) {
+    protected UserResource instantiateSubresource(String name, ClientContext context, UrlResource parent) {
         return new UserResource(name,context,parent);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7a027777/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Entity.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Entity.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Entity.java
index f7e04f8..8d99eb4 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Entity.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Entity.java
@@ -49,7 +49,7 @@ public class Entity implements Serializable, Map<String,Object> {
 
     protected Map<String, Object> dynamic_properties = new TreeMap<String, Object>( String.CASE_INSENSITIVE_ORDER );
 
-    private CollectionResource targetResource;
+    private CollectionResource collectionResource;
 
     public Entity(){}
 
@@ -65,8 +65,8 @@ public class Entity implements Serializable, Map<String,Object> {
      * Performs deep copy on entity passed in and save over what we currently have
      */
     public void save(){
-        targetResource.put(this);
-        Entity entity = targetResource.getCollectionResource(this.getName()).get();
+        collectionResource.put(this);
+        Entity entity = collectionResource.getSubresource(this.getName()).get();
         this.dynamic_properties.putAll(entity.getDynamicProperties());
     }
 
@@ -252,8 +252,8 @@ public class Entity implements Serializable, Map<String,Object> {
         return "Entity(" + getProperties() + ")";
     }
 
-    public CollectionResource getTargetResource(){return targetResource;}
-    public void setTargetResource(CollectionResource targetResource){this.targetResource = targetResource;}
+    public CollectionResource getCollectionResource(){return collectionResource;}
+    public void setCollectionResource(CollectionResource collectionResource){this.collectionResource = collectionResource;}
 
     @JsonAnySetter
     public void setDynamicProperty( String key, Object value ) {


[2/2] incubator-usergrid git commit: merge; rat

Posted by sf...@apache.org.
merge; rat


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

Branch: refs/heads/UG-rest-test-framework-overhaul
Commit: 9084e3653d8ce5d225eb1145b95ecbcbdff81a8c
Parents: 7a02777 e276e4f
Author: Shawn Feldman <sf...@apache.org>
Authored: Tue Dec 16 16:15:58 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Tue Dec 16 16:15:58 2014 -0700

----------------------------------------------------------------------
 .../collection/groups/GroupResourceIT.java      | 81 +++++++-------------
 .../test/resource2point0/AbstractRestIT.java    |  3 +
 .../endpoints/AbstractCollectionResource.java   |  1 +
 .../endpoints/ApplicationsResource.java         | 11 ++-
 .../endpoints/EntityResource.java               |  5 +-
 .../endpoints/GroupResource.java                | 35 +++++++++
 .../endpoints/GroupsResource.java               | 45 +++++++++++
 .../resource2point0/endpoints/RoleResource.java | 35 +++++++++
 .../endpoints/RolesResource.java                | 69 +++++++++++++++++
 .../resource2point0/endpoints/UserResource.java |  1 -
 .../endpoints/UsersResource.java                |  1 -
 .../rest/test/resource2point0/model/Group.java  | 53 +++++++++++++
 .../rest/test/resource2point0/model/Role.java   | 44 +++++++++++
 13 files changed, 322 insertions(+), 62 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9084e365/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/AbstractCollectionResource.java
----------------------------------------------------------------------
diff --cc stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/AbstractCollectionResource.java
index 8d59fe6,5953cb5..101e676
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/AbstractCollectionResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/AbstractCollectionResource.java
@@@ -74,8 -73,7 +74,9 @@@ public abstract class AbstractCollectio
       * @return
       */
      public T put(final T entity){
 -        return instantiateT(getResource(true).type( MediaType.APPLICATION_JSON_TYPE ).accept( MediaType.APPLICATION_JSON ).put(ApiResponse.class, entity));
 +        return instantiateT(getResource(true).type( MediaType.APPLICATION_JSON_TYPE ).accept(MediaType.APPLICATION_JSON)
 +                .put(ApiResponse.class, entity));
++
      }
  
      protected abstract T instantiateT(ApiResponse response);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9084e365/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/ApplicationsResource.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9084e365/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/GroupResource.java
----------------------------------------------------------------------
diff --cc stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/GroupResource.java
index 0000000,95d1d33..33bfb99
mode 000000,100644..100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/GroupResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/GroupResource.java
@@@ -1,0 -1,19 +1,35 @@@
++/*
++ * Licensed to the Apache Software Foundation (ASF) under one or more
++ * contributor license agreements.  See the NOTICE file distributed with
++ * this work for additional information regarding copyright ownership.
++ * The ASF licenses this file to You under the Apache License, Version 2.0
++ * (the "License"); you may not use this file except in compliance with
++ * the License.  You may obtain a copy of the License at
++ *
++ *      http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
+ package org.apache.usergrid.rest.test.resource2point0.endpoints;
+ 
+ import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
+ import org.apache.usergrid.rest.test.resource2point0.model.Group;
+ import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
+ 
+ /**
+  * Created by rockerston on 12/16/14.
+  */
+ public class GroupResource extends AbstractEntityResource<Group>  {
+     public GroupResource(String name, ClientContext context, UrlResource parent) {
+         super(name, context, parent);
+     }
+ 
+     @Override
+     protected Group instantiateT(ApiResponse response) {
+         return new Group(response);
+     }
+ }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9084e365/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/GroupsResource.java
----------------------------------------------------------------------
diff --cc stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/GroupsResource.java
index 0000000,5be68e1..fced873
mode 000000,100644..100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/GroupsResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/GroupsResource.java
@@@ -1,0 -1,29 +1,45 @@@
++/*
++ * Licensed to the Apache Software Foundation (ASF) under one or more
++ * contributor license agreements.  See the NOTICE file distributed with
++ * this work for additional information regarding copyright ownership.
++ * The ASF licenses this file to You under the Apache License, Version 2.0
++ * (the "License"); you may not use this file except in compliance with
++ * the License.  You may obtain a copy of the License at
++ *
++ *      http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
+ package org.apache.usergrid.rest.test.resource2point0.endpoints;
+ 
+ import org.apache.usergrid.rest.test.resource2point0.model.*;
+ import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
+ import org.apache.usergrid.rest.test.resource2point0.model.Group;
+ 
+ import javax.ws.rs.core.MediaType;
+ 
+ /**
+  * Created by rockerston on 12/16/14.
+  */
+ public class GroupsResource extends AbstractCollectionResource<Group,GroupResource> {
+ 
+     public GroupsResource( ClientContext context, UrlResource parent) {
+         super("groups", context, parent);
+     }
+ 
+     @Override
+     protected Group instantiateT(ApiResponse response) {
+         return new Group(response);
+     }
+ 
+     @Override
 -    protected GroupResource instantiateK(String name, ClientContext context, UrlResource parent) {
++    protected GroupResource instantiateSubresource(String name, ClientContext context, UrlResource parent) {
+         return new GroupResource(name,context,parent);
+     }
+ 
+ 
+ }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9084e365/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/RoleResource.java
----------------------------------------------------------------------
diff --cc stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/RoleResource.java
index 0000000,b488da8..9cb6b76
mode 000000,100644..100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/RoleResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/RoleResource.java
@@@ -1,0 -1,19 +1,35 @@@
++/*
++ * Licensed to the Apache Software Foundation (ASF) under one or more
++ * contributor license agreements.  See the NOTICE file distributed with
++ * this work for additional information regarding copyright ownership.
++ * The ASF licenses this file to You under the Apache License, Version 2.0
++ * (the "License"); you may not use this file except in compliance with
++ * the License.  You may obtain a copy of the License at
++ *
++ *      http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
+ package org.apache.usergrid.rest.test.resource2point0.endpoints;
+ 
+ import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
+ import org.apache.usergrid.rest.test.resource2point0.model.Role;
+ import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
+ 
+ /**
+  * Created by rockerston on 12/16/14.
+  */
+ public class RoleResource  extends AbstractEntityResource<Role>  {
+     public RoleResource(String name, ClientContext context, UrlResource parent) {
+         super(name, context, parent);
+     }
+ 
+     @Override
+     protected Role instantiateT(ApiResponse response) {
+         return new Role(response);
+     }
+ }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9084e365/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/RolesResource.java
----------------------------------------------------------------------
diff --cc stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/RolesResource.java
index 0000000,963f936..a6ae324
mode 000000,100644..100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/RolesResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/RolesResource.java
@@@ -1,0 -1,53 +1,69 @@@
++/*
++ * Licensed to the Apache Software Foundation (ASF) under one or more
++ * contributor license agreements.  See the NOTICE file distributed with
++ * this work for additional information regarding copyright ownership.
++ * The ASF licenses this file to You under the Apache License, Version 2.0
++ * (the "License"); you may not use this file except in compliance with
++ * the License.  You may obtain a copy of the License at
++ *
++ *      http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
+ package org.apache.usergrid.rest.test.resource2point0.endpoints;
+ 
+ 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.Application;
+ import org.apache.usergrid.rest.test.resource2point0.model.Group;
+ import org.apache.usergrid.rest.test.resource2point0.model.Role;
+ import org.apache.usergrid.rest.test.resource2point0.state.ClientContext;
+ 
+ import javax.ws.rs.core.MediaType;
+ 
+ /**
+  * Created by rockerston on 12/16/14.
+  */
+ public class RolesResource extends NamedResource{
+ 
+     public RolesResource(ClientContext context, UrlResource parent) {
+         super("roles", context, parent);
+     }
+ 
+ 
+     public Role post(Role role){
+         ApiResponse response =getResource(true).type( MediaType.APPLICATION_JSON_TYPE ).accept( MediaType.APPLICATION_JSON )
+                 .post( ApiResponse.class, role );
+ 
+         return new Role(response);
+ 
+     }
+ 
+     public Application put(Application application){
+         ApiResponse response =getResource(true).type( MediaType.APPLICATION_JSON_TYPE ).accept( MediaType.APPLICATION_JSON )
+                 .put(ApiResponse.class, application );
+ 
+         return new Application(response);
+ 
+     }
+ 
+ 
+     public ApiResponse get(){
+         ApiResponse response =getResource(true).type( MediaType.APPLICATION_JSON_TYPE ).accept( MediaType.APPLICATION_JSON )
+                 .get(ApiResponse.class);
+ 
+         return response;
+ 
+     }
+ 
+     public void delete(Application application){
+         ApiResponse response =getResource(true).type( MediaType.APPLICATION_JSON_TYPE ).accept( MediaType.APPLICATION_JSON )
+                 .delete(ApiResponse.class );
+     }
+ 
+ }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9084e365/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/endpoints/UsersResource.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9084e365/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Group.java
----------------------------------------------------------------------
diff --cc stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Group.java
index 0000000,bea3c12..dc26cf1
mode 000000,100644..100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Group.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Group.java
@@@ -1,0 -1,37 +1,53 @@@
++/*
++ * Licensed to the Apache Software Foundation (ASF) under one or more
++ * contributor license agreements.  See the NOTICE file distributed with
++ * this work for additional information regarding copyright ownership.
++ * The ASF licenses this file to You under the Apache License, Version 2.0
++ * (the "License"); you may not use this file except in compliance with
++ * the License.  You may obtain a copy of the License at
++ *
++ *      http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
+ package org.apache.usergrid.rest.test.resource2point0.model;
+ 
+ import java.util.List;
+ import java.util.Map;
+ 
+ /**
+  * Created by rockerston on 12/16/14.
+  */
+ public class Group extends Entity{
+ 
+     public Group(){}
+ 
+     public Group(String name, String path) {
+ 
+         this.put("name", name);
+         this.put("path", path);
+     }
+ 
+     public Group (ApiResponse<Entity> response){
+         if(response.getEntities() !=null &&  response.getEntities().size()>=1){
+             List<Entity> entities =  response.getEntities();
+             Map<String,Object> entity = entities.get(0);
+             this.putAll(entity);
+         }
+     }
+ 
+     public String getName(){
+         return (String) this.get("name");
+     }
+ 
+     public String getPath(){
+         return (String) this.get("path");
+     }
+ 
+ 
+ 
+ }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9084e365/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Role.java
----------------------------------------------------------------------
diff --cc stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Role.java
index 0000000,d318d72..7fa4d43
mode 000000,100644..100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Role.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource2point0/model/Role.java
@@@ -1,0 -1,28 +1,44 @@@
++/*
++ * Licensed to the Apache Software Foundation (ASF) under one or more
++ * contributor license agreements.  See the NOTICE file distributed with
++ * this work for additional information regarding copyright ownership.
++ * The ASF licenses this file to You under the Apache License, Version 2.0
++ * (the "License"); you may not use this file except in compliance with
++ * the License.  You may obtain a copy of the License at
++ *
++ *      http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
+ package org.apache.usergrid.rest.test.resource2point0.model;
+ 
+ /**
+  * Created by rockerston on 12/16/14.
+  */
+ public class Role extends Entity{
+ 
+     public Role(){}
+ 
+     public Role(String name, String path) {
+ 
+         this.put("name", name);
+         this.put("path", path);
+     }
+ 
+     public Role (ApiResponse response){
+         setResponse( response,"owner" );
+     }
+ 
+     public String getName(){
+         return (String) this.get("name");
+     }
+ 
+     public String getPath(){
+         return (String) this.get("path");
+     }
+ 
+ }