usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [02/10] usergrid git commit: Switch to Jersey 2, fix all compilation errors. TODO: new MeteringFilter, new JSON-HTMP swap logic and correct use of dependency management.
Date Thu, 03 Sep 2015 20:30:28 GMT
http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java
index a754eb0..c55f953 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/ImportResourceIT.java
@@ -21,8 +21,6 @@ import com.amazonaws.SDKGlobalConfiguration;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.util.concurrent.Service;
 import com.google.inject.Module;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.UniformInterfaceException;
 import org.apache.commons.lang.RandomStringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.usergrid.ServiceITSetup;
@@ -51,6 +49,8 @@ import org.junit.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.ws.rs.client.ResponseProcessingException;
+import javax.ws.rs.core.Response;
 import java.io.File;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -211,7 +211,7 @@ public class ImportResourceIT extends AbstractRestIT {
             this.management().orgs().org( org ).app().addToPath(app)
                 .addToPath("imports").addToPath(entity.getUuid().toString()).get();
             fail("Should not be able to read import job with unauthorized token");
-        } catch (UniformInterfaceException ex) {
+        } catch (ResponseProcessingException ex) {
             errorParse(401, "unauthorized", ex);
         }
 
@@ -223,16 +223,16 @@ public class ImportResourceIT extends AbstractRestIT {
     public void importPostApplicationNullPointerProperties() throws Exception {
         String org = clientSetup.getOrganizationName();
         String app = clientSetup.getAppName();
-        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
+        Response.Status responseStatus = Response.Status.OK;
 
         Entity payload = new Entity();
 
         try {
             this.management().orgs().org( org ).app().addToPath(app).addToPath("imports").post(Entity.class,payload);
-        } catch (UniformInterfaceException uie) {
-            responseStatus = uie.getResponse().getClientResponseStatus();
+        } catch (ResponseProcessingException uie) {
+            responseStatus = Response.Status.fromStatusCode( uie.getResponse().getStatus() );
         }
-        assertEquals(ClientResponse.Status.BAD_REQUEST, responseStatus);
+        assertEquals(Response.Status.BAD_REQUEST, responseStatus);
     }
 
     @Ignore
@@ -240,7 +240,7 @@ public class ImportResourceIT extends AbstractRestIT {
     public void importPostApplicationNullPointerStorageInfo() throws Exception {
         String org = clientSetup.getOrganizationName();
         String app = clientSetup.getAppName();
-        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
+        Response.Status responseStatus = Response.Status.OK;
 
         Entity payload = payloadBuilder();
         Entity properties = (Entity) payload.get("properties");
@@ -249,10 +249,10 @@ public class ImportResourceIT extends AbstractRestIT {
 
         try {
             this.management().orgs().org( org ).app().addToPath(app).addToPath("imports").post(Entity.class,payload);
-        } catch (UniformInterfaceException uie) {
-            responseStatus = uie.getResponse().getClientResponseStatus();
+        } catch (ResponseProcessingException uie) {
+            responseStatus = Response.Status.fromStatusCode( uie.getResponse().getStatus() );
         }
-        assertEquals(ClientResponse.Status.BAD_REQUEST, responseStatus);
+        assertEquals(Response.Status.BAD_REQUEST, responseStatus);
     }
 
 
@@ -261,7 +261,7 @@ public class ImportResourceIT extends AbstractRestIT {
     public void importPostApplicationNullPointerStorageProvider() throws Exception {
         String org = clientSetup.getOrganizationName();
         String app = clientSetup.getAppName();
-        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
+        Response.Status responseStatus = Response.Status.OK;
 
         Entity payload = payloadBuilder();
         Entity properties = (Entity) payload.get("properties");
@@ -271,10 +271,10 @@ public class ImportResourceIT extends AbstractRestIT {
 
         try {
             this.management().orgs().org( org ).app().addToPath(app).addToPath("imports").post(Entity.class,payload);
-        } catch (UniformInterfaceException uie) {
-            responseStatus = uie.getResponse().getClientResponseStatus();
+        } catch (ResponseProcessingException uie) {
+            responseStatus = Response.Status.fromStatusCode( uie.getResponse().getStatus() );
         }
-        assertEquals(ClientResponse.Status.BAD_REQUEST, responseStatus);
+        assertEquals(Response.Status.BAD_REQUEST, responseStatus);
     }
 
 
@@ -283,7 +283,7 @@ public class ImportResourceIT extends AbstractRestIT {
     public void importPostApplicationNullPointerStorageVerification() throws Exception {
         String org = clientSetup.getOrganizationName();
         String app = clientSetup.getAppName();
-        ClientResponse.Status responseStatus = ClientResponse.Status.OK;
+        Response.Status responseStatus = Response.Status.OK;
 
         Entity payload = payloadBuilder();
 
@@ -294,10 +294,10 @@ public class ImportResourceIT extends AbstractRestIT {
 
         try {
             this.management().orgs().org( org ).app().addToPath(app).addToPath("imports").post(Entity.class,payload);
-        } catch (UniformInterfaceException uie) {
-            responseStatus = uie.getResponse().getClientResponseStatus();
+        } catch (ResponseProcessingException uie) {
+            responseStatus = Response.Status.fromStatusCode( uie.getResponse().getStatus() );
         }
-        assertEquals(ClientResponse.Status.BAD_REQUEST, responseStatus);
+        assertEquals(Response.Status.BAD_REQUEST, responseStatus);
 
         payload = payloadBuilder();
         properties = (Entity) payload.get("properties");
@@ -307,10 +307,10 @@ public class ImportResourceIT extends AbstractRestIT {
 
         try {
             this.management().orgs().org( org ).app().addToPath(app).addToPath("imports").post(Entity.class,payload);
-        } catch (UniformInterfaceException uie) {
-            responseStatus = uie.getResponse().getClientResponseStatus();
+        } catch (ResponseProcessingException uie) {
+            responseStatus = Response.Status.fromStatusCode( uie.getResponse().getStatus() );
         }
-        assertEquals(ClientResponse.Status.BAD_REQUEST, responseStatus);
+        assertEquals(Response.Status.BAD_REQUEST, responseStatus);
 
         payload = payloadBuilder();
         properties = (Entity) payload.get("properties");
@@ -320,10 +320,10 @@ public class ImportResourceIT extends AbstractRestIT {
 
         try {
             this.management().orgs().org( org ).app().addToPath(app).addToPath("imports").post(Entity.class,payload);
-        } catch (UniformInterfaceException uie) {
-            responseStatus = uie.getResponse().getClientResponseStatus();
+        } catch (ResponseProcessingException uie) {
+            responseStatus = Response.Status.fromStatusCode( uie.getResponse().getStatus() );
         }
-        assertEquals(ClientResponse.Status.BAD_REQUEST, responseStatus);
+        assertEquals(Response.Status.BAD_REQUEST, responseStatus);
     }
 
 //    @Test

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/management/ManagementResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/ManagementResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/management/ManagementResourceIT.java
index 1fe4974..386f3b9 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/ManagementResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/ManagementResourceIT.java
@@ -18,9 +18,6 @@ package org.apache.usergrid.rest.management;
 
 
 import com.fasterxml.jackson.databind.JsonNode;
-import com.sun.jersey.api.client.ClientResponse.Status;
-import com.sun.jersey.api.client.UniformInterfaceException;
-import com.sun.jersey.api.representation.Form;
 import net.jcip.annotations.NotThreadSafe;
 import org.apache.commons.lang.RandomStringUtils;
 import org.apache.usergrid.persistence.index.utils.UUIDUtils;
@@ -33,7 +30,10 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.ws.rs.client.ResponseProcessingException;
+import javax.ws.rs.core.Form;
 import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
 import java.io.IOException;
 import java.util.*;
 
@@ -115,26 +115,26 @@ public class ManagementResourceIT extends AbstractRestIT {
 
         // check that the test admin cannot access the new org info
 
-        Status status = null;
+        Response.Status status = null;
         String returnVal = "";
 
         try {
             returnVal = this.management().orgs().org( orgName ).get(String.class);
         }
-        catch ( UniformInterfaceException uie ) {
-            status = uie.getResponse().getClientResponseStatus();
+        catch ( ResponseProcessingException uie ) {
+            status = Response.Status.fromStatusCode( uie.getResponse().getStatus() );
         }
 
         assertNotNull( status );
-        assertEquals( Status.UNAUTHORIZED, status );
+        assertEquals( Response.Status.UNAUTHORIZED, status );
 
         // this admin should have access to test org
         status = null;
         try {
             this.management().orgs().org( this.clientSetup.getOrganizationName() ).get( String.class );
         }
-        catch ( UniformInterfaceException uie ) {
-            status = uie.getResponse().getClientResponseStatus();
+        catch ( ResponseProcessingException uie ) {
+            status = Response.Status.fromStatusCode( uie.getResponse().getStatus() );
         }
 
         assertNull( status );
@@ -145,8 +145,8 @@ public class ManagementResourceIT extends AbstractRestIT {
         try {
             this.management().orgs().org( this.clientSetup.getOrganizationName() ).get( String.class );
         }
-        catch ( UniformInterfaceException uie ) {
-            status = uie.getResponse().getClientResponseStatus();
+        catch ( ResponseProcessingException uie ) {
+            status = Response.Status.fromStatusCode( uie.getResponse().getStatus() );
         }
 
         assertNull( status );
@@ -332,15 +332,15 @@ public class ManagementResourceIT extends AbstractRestIT {
         // wait for the token to expire
         Thread.sleep(  (System.currentTimeMillis() - startTime) + ttl );
 
-        Status responseStatus = null;
+        Response.Status responseStatus = null;
         try {
             userdata = management.users().user(clientSetup.getEmail()).get();
         }
-        catch ( UniformInterfaceException uie ) {
-            responseStatus = uie.getResponse().getClientResponseStatus();
+        catch ( ResponseProcessingException uie ) {
+            responseStatus = Response.Status.fromStatusCode( uie.getResponse().getStatus() );
         }
 
-        assertEquals( Status.UNAUTHORIZED, responseStatus );
+        assertEquals( Response.Status.UNAUTHORIZED, responseStatus );
     }
 
 
@@ -423,19 +423,21 @@ public class ManagementResourceIT extends AbstractRestIT {
     public void meTokenPostForm() {
 
         Form form = new Form();
-        form.add( "grant_type", "password" );
-        form.add( "username", clientSetup.getUsername() );
-        form.add( "password", clientSetup.getPassword() );
+        form.param( "grant_type", "password" );
+        form.param( "username", clientSetup.getUsername() );
+        form.param( "password", clientSetup.getPassword() );
 
         JsonNode node = management.me().post( JsonNode.class, form );
-        logger.info("node:", node);
+        logger.info( "node:", node);
 
         String token = node.get( "access_token" ).textValue();
 
         assertNotNull( token );
 
-        node = resource().path( "/management/me" ).queryParam( "access_token", token )
-                         .accept( MediaType.APPLICATION_JSON ).get( JsonNode.class );
+        node = target().path( "/management/me" )
+            .queryParam( "access_token", token ).request()
+            .accept( MediaType.APPLICATION_JSON )
+            .get( JsonNode.class );
         logger.info("node:", node );
 
     }
@@ -449,15 +451,15 @@ public class ManagementResourceIT extends AbstractRestIT {
             .map( "password", clientSetup.getPassword() )
             .map( "ttl", "derp" );
 
-        Status responseStatus = null;
+        Response.Status responseStatus = null;
         try {
            management.token().post( JsonNode.class, payload );
         }
-        catch ( UniformInterfaceException uie ) {
-            responseStatus = uie.getResponse().getClientResponseStatus();
+        catch ( ResponseProcessingException uie ) {
+            responseStatus = Response.Status.fromStatusCode( uie.getResponse().getStatus());
         }
 
-        assertEquals( Status.BAD_REQUEST, responseStatus );
+        assertEquals( Response.Status.BAD_REQUEST, responseStatus );
     }
 
 
@@ -469,16 +471,16 @@ public class ManagementResourceIT extends AbstractRestIT {
             .map( "password", clientSetup.getPassword() )
             .map( "ttl", Long.MAX_VALUE + "" );
 
-        Status responseStatus = null;
+        Response.Status responseStatus = null;
 
         try {
             management.token().post( JsonNode.class, payload );
         }
-        catch ( UniformInterfaceException uie ) {
-            responseStatus = uie.getResponse().getClientResponseStatus();
+        catch ( ResponseProcessingException uie ) {
+            responseStatus = Response.Status.fromStatusCode( uie.getResponse().getStatus() );
         }
 
-        assertEquals( Status.BAD_REQUEST, responseStatus );
+        assertEquals( Response.Status.BAD_REQUEST, responseStatus );
     }
 
 
@@ -500,16 +502,16 @@ public class ManagementResourceIT extends AbstractRestIT {
 
         // the tokens shouldn't work
 
-        Status status = null;
+        Response.Status status = null;
 
         try {
             response = management.users().user(clientSetup.getUsername()).get();
         }
-        catch ( UniformInterfaceException uie ) {
-            status = uie.getResponse().getClientResponseStatus();
+        catch ( ResponseProcessingException uie ) {
+            status = Response.Status.fromStatusCode( uie.getResponse().getStatus() );
         }
 
-        assertEquals( Status.UNAUTHORIZED, status );
+        assertEquals( Response.Status.UNAUTHORIZED, status );
 
         Token token3 = management.token().get(clientSetup.getUsername(), clientSetup.getPassword());
 
@@ -528,11 +530,11 @@ public class ManagementResourceIT extends AbstractRestIT {
         try {
             management.users().user(clientSetup.getUsername()).get();
         }
-        catch ( UniformInterfaceException uie ) {
-            status = uie.getResponse().getClientResponseStatus();
+        catch ( ResponseProcessingException uie ) {
+            status = Response.Status.fromStatusCode( uie.getResponse().getStatus() );
         }
 
-        assertEquals( Status.UNAUTHORIZED, status );
+        assertEquals( Response.Status.UNAUTHORIZED, status );
 
     }
 
@@ -587,10 +589,10 @@ public class ManagementResourceIT extends AbstractRestIT {
 
                 fail( "Validation should have failed" );
 
-            } catch (UniformInterfaceException actual) {
+            } catch (ResponseProcessingException actual) {
                 assertEquals( 404, actual.getResponse().getStatus() );
-                String errorMsg = actual.getResponse().getEntity(
-                    JsonNode.class ).get( "error_description" ).toString();
+                String errorMsg = actual.getResponse().readEntity( JsonNode.class )
+                    .get( "error_description" ).toString();
                 logger.error( "ERROR: " + errorMsg );
                 assertTrue( errorMsg.contains( "Cannot find Admin User" ) );
             }
@@ -638,15 +640,15 @@ public class ManagementResourceIT extends AbstractRestIT {
                 ApiResponse postResponse = pathResource( "management/token" ).post( false, ApiResponse.class, loginInfo );
                 fail( "Login as Admin User must fail when validate external tokens is enabled" );
 
-            } catch (UniformInterfaceException actual) {
+            } catch (ResponseProcessingException actual) {
                 assertEquals( 400, actual.getResponse().getStatus() );
-                String errorMsg = actual.getResponse()
-                    .getEntity( JsonNode.class ).get( "error_description" ).toString();
+                String errorMsg = actual.getResponse().readEntity( JsonNode.class )
+                    .get( "error_description" ).toString();
                 logger.error( "ERROR: " + errorMsg );
                 assertTrue( errorMsg.contains( "Admin Users must login via" ) );
 
             } catch (Exception e) {
-                fail( "We expected a UniformInterfaceException" );
+                fail( "We expected a ResponseProcessingException" );
             }
 
             // login as superuser must succeed

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/management/OrganizationsIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/OrganizationsIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/management/OrganizationsIT.java
index 782c8cd..a0ebf6e 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/OrganizationsIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/OrganizationsIT.java
@@ -29,9 +29,9 @@ import org.apache.usergrid.persistence.index.utils.UUIDUtils;
 import org.apache.usergrid.rest.test.resource.AbstractRestIT;
 import org.apache.usergrid.rest.test.resource.RestClient;
 
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.UniformInterfaceException;
-import com.sun.jersey.api.representation.Form;
+import javax.ws.rs.client.ResponseProcessingException;
+import javax.ws.rs.core.Form;
+import javax.ws.rs.core.Response;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
@@ -123,7 +123,7 @@ public class OrganizationsIT extends AbstractRestIT {
             clientSetup.getRestClient().management().orgs().post( orgTestDuplicatePayload );
             fail("Should not have been able to create duplicate organization");
         }
-        catch ( UniformInterfaceException ex ) {
+        catch ( ResponseProcessingException ex ) {
             errorParse( 400,duplicateUniquePropertyExistsErrorMessage, ex );
         }
 
@@ -135,7 +135,7 @@ public class OrganizationsIT extends AbstractRestIT {
             tokenError = clientSetup.getRestClient().management().token().post(false,Token.class, tokenPayload,null );
             fail( "Should not have created user" );
         }
-        catch ( UniformInterfaceException ex ) {
+        catch ( ResponseProcessingException ex ) {
             errorParse( 400,invalidGrantErrorMessage, ex );
 
         }
@@ -179,7 +179,7 @@ public class OrganizationsIT extends AbstractRestIT {
             clientSetup.getRestClient().management().orgs().post( orgDuplicatePayload );
             fail( "Should not have created organization" );
         }
-        catch ( UniformInterfaceException ex ) {
+        catch ( ResponseProcessingException ex ) {
             errorParse( 400,duplicateUniquePropertyExistsErrorMessage,ex);
         }
 
@@ -190,7 +190,7 @@ public class OrganizationsIT extends AbstractRestIT {
             tokenError = clientSetup.getRestClient().management().token().post(false,Token.class, tokenPayload,null );
             fail( "Should not have created organization" );
         }
-        catch ( UniformInterfaceException ex ) {
+        catch ( ResponseProcessingException ex ) {
             errorParse( 400,invalidGrantErrorMessage,ex );
         }
 
@@ -222,7 +222,7 @@ public class OrganizationsIT extends AbstractRestIT {
         try{
             Organization organizationReturned = clientSetup.getRestClient().management().orgs().post(queryParameters);
             fail();
-        }catch (UniformInterfaceException e){
+        }catch (ResponseProcessingException e){
             assertEquals("ensure bad request",e.getResponse().getStatus(), 400);
         }
 
@@ -254,12 +254,12 @@ public class OrganizationsIT extends AbstractRestIT {
 
         //create the form to hold the organization
         Form form = new Form();
-        form.add( "organization", organization.getOrganization() );
-        form.add("username", organization.getUsername());
-        form.add( "grant_type", "password" );
-        form.add( "email", organization.getEmail() );
-        form.add( "name", organization.getName() );
-        form.add("password", organization.getPassword());
+        form.param( "organization", organization.getOrganization() );
+        form.param( "username", organization.getUsername() );
+        form.param( "grant_type", "password" );
+        form.param( "email", organization.getEmail() );
+        form.param( "name", organization.getName() );
+        form.param( "password", organization.getPassword() );
 
         //Post the organization and verify it worked.
         Organization organizationReturned = clientSetup.getRestClient().management().orgs().post( form );
@@ -295,8 +295,8 @@ public class OrganizationsIT extends AbstractRestIT {
             //Delete default organization
             clientSetup.getRestClient().management().orgs().org( clientSetup.getOrganizationName() ).delete();
             fail( "Delete is not implemented yet" );
-        }catch(UniformInterfaceException uie){
-            assertEquals( ClientResponse.Status.NOT_IMPLEMENTED ,uie.getResponse().getStatus());
+        }catch(ResponseProcessingException uie){
+            assertEquals( Response.Status.NOT_IMPLEMENTED ,uie.getResponse().getStatus());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/management/RegistrationIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/RegistrationIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/management/RegistrationIT.java
index abe2230..fc18292 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/RegistrationIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/RegistrationIT.java
@@ -17,8 +17,6 @@
 package org.apache.usergrid.rest.management;
 
 
-import com.sun.jersey.api.client.UniformInterfaceException;
-import com.sun.jersey.api.representation.Form;
 import org.apache.commons.lang.StringUtils;
 import org.apache.usergrid.persistence.model.util.UUIDGenerator;
 import org.apache.usergrid.rest.test.resource.AbstractRestIT;
@@ -32,6 +30,8 @@ import org.slf4j.LoggerFactory;
 
 import javax.mail.*;
 import javax.mail.internet.MimeMultipart;
+import javax.ws.rs.client.ResponseProcessingException;
+import javax.ws.rs.core.Form;
 import javax.ws.rs.core.MediaType;
 import java.io.IOException;
 import java.util.Map;
@@ -102,12 +102,14 @@ public class RegistrationIT extends AbstractRestIT {
 
             String t = this.getAdminToken().getAccessToken();
             Form form = new Form();
-            form.add("foo", "bar");
+            form.param( "foo", "bar" );
             try {
-                this.org().getResource(false).path("/users/test-admin-null@mockserver.com")
-                    .queryParam("access_token", t).accept(MediaType.APPLICATION_JSON)
-                    .type(MediaType.APPLICATION_FORM_URLENCODED).put(String.class, form);
-            } catch (UniformInterfaceException e) {
+                this.org().getTarget(false).path("/users/test-admin-null@mockserver.com")
+                    .queryParam("access_token", t)
+                    .request()
+                    .accept(MediaType.APPLICATION_JSON)
+                    .put( javax.ws.rs.client.Entity.form(form) );
+            } catch (ResponseProcessingException e) {
                 assertEquals("Should receive a 404 Not Found", 404, e.getResponse().getStatus());
             }
         } finally {
@@ -179,13 +181,9 @@ public class RegistrationIT extends AbstractRestIT {
 
             //reset token
             String token = getTokenFromMessage(msgs[0]);
-            this
-                .management()
-                .orgs()
-                .org( this.clientSetup.getOrganizationName() )
-                .users()
-                .getResource( false )
+            this.management().orgs().org( this.clientSetup.getOrganizationName() ).users().getTarget( false )
                 .queryParam( "access_token", token )
+                .request()
                 .get( String.class );
 
             //There is nothing in this test that should indicate why an admin access wouldn't be allowed.
@@ -218,10 +216,10 @@ public class RegistrationIT extends AbstractRestIT {
 
             //A form is REQUIRED to post a user to a management application
             Form userForm = new Form();
-            userForm.add( "username", adminUserEmail );
-            userForm.add( "name", adminUserEmail );
-            userForm.add( "email", adminUserEmail );
-            userForm.add( "password", "password1" );
+            userForm.param( "username", adminUserEmail );
+            userForm.param( "name", adminUserEmail );
+            userForm.param( "email", adminUserEmail );
+            userForm.param( "password", "password1" );
 
             //Disgusting data manipulation to parse the form response.
             Map adminUserPostResponse = (management().users().post( User.class, userForm ));

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/management/organizations/AdminEmailEncodingIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/organizations/AdminEmailEncodingIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/management/organizations/AdminEmailEncodingIT.java
index 1392749..c615b60 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/organizations/AdminEmailEncodingIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/organizations/AdminEmailEncodingIT.java
@@ -17,7 +17,6 @@
 package org.apache.usergrid.rest.management.organizations;
 
 
-import com.sun.jersey.api.client.UniformInterfaceException;
 import org.apache.usergrid.rest.test.resource.AbstractRestIT;
 import org.apache.usergrid.rest.test.resource.model.Application;
 import org.apache.usergrid.rest.test.resource.model.Entity;
@@ -89,9 +88,9 @@ public class AdminEmailEncodingIT extends AbstractRestIT {
      * the given string is a part of the admin email address
      *
      * @param symbol
-     * @throws UniformInterfaceException
+     * @throws Exception
      */
-    private void doTest(String symbol) throws UniformInterfaceException {
+    private void doTest(String symbol) throws Exception {
 
         String unique = UUID.randomUUID().toString();
         String org = "org_getTokenDash" + unique;

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/AbstractRestIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/AbstractRestIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/AbstractRestIT.java
index 1d9c23e..cc5807e 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/AbstractRestIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/AbstractRestIT.java
@@ -19,14 +19,6 @@ package org.apache.usergrid.rest.test.resource;
 
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.sun.jersey.api.client.UniformInterfaceException;
-import com.sun.jersey.api.client.config.ClientConfig;
-import com.sun.jersey.api.client.config.DefaultClientConfig;
-import com.sun.jersey.api.json.JSONConfiguration;
-import com.sun.jersey.test.framework.AppDescriptor;
-import com.sun.jersey.test.framework.JerseyTest;
-import com.sun.jersey.test.framework.WebAppDescriptor;
-import com.sun.jersey.test.framework.spi.container.TestContainerFactory;
 import org.apache.usergrid.rest.TomcatRuntime;
 import org.apache.usergrid.rest.test.resource.endpoints.ApplicationsResource;
 import org.apache.usergrid.rest.test.resource.endpoints.NamedResource;
@@ -35,8 +27,12 @@ import org.apache.usergrid.rest.test.resource.endpoints.mgmt.ManagementResource;
 import org.apache.usergrid.rest.test.resource.model.Entity;
 import org.apache.usergrid.rest.test.resource.model.Token;
 import org.apache.usergrid.rest.test.resource.state.ClientContext;
+import org.glassfish.jersey.client.ClientConfig;
+import org.glassfish.jersey.jackson.JacksonFeature;
+import org.glassfish.jersey.test.JerseyTest;
 import org.junit.Rule;
 
+import javax.ws.rs.client.ResponseProcessingException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URLClassLoader;
@@ -53,26 +49,24 @@ import static org.junit.Assert.assertEquals;
 //@RunWith( Arquillian.class )
 public class AbstractRestIT extends JerseyTest {
 
-    private static ClientConfig clientConfig = new DefaultClientConfig();
+    private static ClientConfig clientConfig = new ClientConfig();
 
     public static TomcatRuntime tomcatRuntime = TomcatRuntime.getInstance();
 
     @Rule
     public ClientSetup clientSetup = new ClientSetup( this.getBaseURI().toString() );
 
-    protected static final AppDescriptor descriptor;
-
-    public AbstractRestIT() {
-        super( descriptor );
-    }
+//    protected static final Application descriptor;
+//
+//    public AbstractRestIT() {
+//        super( descriptor );
+//    }
 
 
     protected ObjectMapper mapper = new ObjectMapper();
 
     static {
-        clientConfig.getFeatures().put( JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE );
-        descriptor = new WebAppDescriptor.Builder( "org.apache.usergrid.rest" )
-                .clientConfig( clientConfig ).build();
+        clientConfig.register( new JacksonFeature() );
         dumpClasspath( AbstractRestIT.class.getClassLoader() );
     }
 
@@ -107,7 +101,6 @@ public class AbstractRestIT extends JerseyTest {
         }
     }
 
-    @Override
     protected URI getBaseURI() {
         try {
             return new URI("http://localhost:" + tomcatRuntime.getPort());
@@ -116,10 +109,10 @@ public class AbstractRestIT extends JerseyTest {
         }
     }
 
-    @Override
-    protected TestContainerFactory getTestContainerFactory() {
-        return new com.sun.jersey.test.framework.spi.container.external.ExternalTestContainerFactory();
-    }
+//    @Override
+//    protected TestContainerFactory getTestContainerFactory() {
+//        return new ExternalTestContainerFactory();
+//    }
 
     ///myorg/
     protected OrganizationResource org(){
@@ -158,15 +151,15 @@ public class AbstractRestIT extends JerseyTest {
 
 
     /**
-     * Takes in the expectedStatus message and the expectedErrorMessage then compares it to the UniformInterfaceException
+     * Takes in the expectedStatus message and the expectedErrorMessage then compares it to the ResponseProcessingException
      * to make sure that we got what we expected.
      * @param expectedStatus
      * @param expectedErrorMessage
      * @param uie
      */
-    public void errorParse(int expectedStatus, String expectedErrorMessage, UniformInterfaceException uie){
+    public void errorParse(int expectedStatus, String expectedErrorMessage, ResponseProcessingException uie){
         assertEquals(expectedStatus,uie.getResponse().getStatus());
-        JsonNode errorJson = uie.getResponse().getEntity( JsonNode.class );
+        JsonNode errorJson = uie.getResponse().readEntity( JsonNode.class );
         assertEquals( expectedErrorMessage, errorJson.get( "error" ).asText() );
 
     }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/RestClient.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/RestClient.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/RestClient.java
index 30e008c..23fa6c3 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/RestClient.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/RestClient.java
@@ -17,15 +17,15 @@
 package org.apache.usergrid.rest.test.resource;
 
 import com.fasterxml.jackson.databind.JsonNode;
-import com.sun.jersey.api.client.Client;
-import com.sun.jersey.api.client.WebResource;
-import com.sun.jersey.api.client.config.ClientConfig;
-import com.sun.jersey.api.client.config.DefaultClientConfig;
-import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter;
 import org.apache.usergrid.rest.test.resource.endpoints.*;
 import org.apache.usergrid.rest.test.resource.endpoints.mgmt.ManagementResource;
 import org.apache.usergrid.rest.test.resource.state.ClientContext;
+import org.glassfish.jersey.client.ClientConfig;
+import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
 
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+import javax.ws.rs.client.WebTarget;
 import javax.ws.rs.core.MediaType;
 
 
@@ -38,9 +38,9 @@ public class RestClient implements UrlResource {
     private final String serverUrl;
     private ClientContext context;
 
-    public WebResource resource;
-    ClientConfig config = new DefaultClientConfig();
-    Client client = Client.create( config );
+    public WebTarget resource;
+    ClientConfig config = new ClientConfig();
+    Client client = ClientBuilder.newClient( config );
 
     /**
      *
@@ -49,7 +49,7 @@ public class RestClient implements UrlResource {
     public RestClient( final String serverUrl ) {
         this.serverUrl = serverUrl;
         this.context = new ClientContext();
-        resource = client.resource( serverUrl );
+        resource = client.target( serverUrl );
         resource.path( serverUrl );
     }
 
@@ -59,12 +59,12 @@ public class RestClient implements UrlResource {
      */
     @Override
     public String getPath() {
-        return resource.getURI().toString();
+        return resource.getUri().toString();
     }
 
     @Override
-    public WebResource getResource() {
-        return client.resource( serverUrl );
+    public WebTarget getTarget(){
+        return client.target( serverUrl );
     }
 
     public ClientContext getContext() {
@@ -98,11 +98,12 @@ public class RestClient implements UrlResource {
     }
     public void refreshIndex(String orgname, String appName, String appid) {
         //TODO: add error checking and logging
-        this.getResource().path( "/refreshindex" )
+        this.getTarget().path( "/refreshindex" )
                 .queryParam( "org_name", orgname )
                 .queryParam( "app_name",appName )
                 .queryParam("app_id", appid)
-            .accept( MediaType.APPLICATION_JSON ).post();
+            .request()
+            .accept( MediaType.APPLICATION_JSON ).post( javax.ws.rs.client.Entity.json(null) );
     }
 
     public NamedResource pathResource(String path){
@@ -110,13 +111,11 @@ public class RestClient implements UrlResource {
     }
 
     public void superuserSetup() {
-        //TODO: change this when we upgrade to new version of jersey
-        HTTPBasicAuthFilter httpBasicAuthFilter = new HTTPBasicAuthFilter( "superuser","superpassword" );
-        client.addFilter( httpBasicAuthFilter );
-
-        this.getResource().path( "system/superuser/setup" )
-            .accept( MediaType.APPLICATION_JSON ).type( MediaType.APPLICATION_JSON ).get( JsonNode.class );
-        client.removeFilter( httpBasicAuthFilter );
+        this.getTarget().path( "system/superuser/setup" ).request()
+            .property( HttpAuthenticationFeature.HTTP_AUTHENTICATION_BASIC_USERNAME, "superuser")
+            .property( HttpAuthenticationFeature.HTTP_AUTHENTICATION_BASIC_PASSWORD, "superpassword" )
+            .accept( MediaType.APPLICATION_JSON )
+            .get( JsonNode.class );
     }
 
     //todo:fix this method for the client.

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/TestPropertiesResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/TestPropertiesResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/TestPropertiesResource.java
index ad08d94..21aece5 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/TestPropertiesResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/TestPropertiesResource.java
@@ -17,14 +17,14 @@
 package org.apache.usergrid.rest.test.resource;
 
 
-import javax.ws.rs.core.MediaType;
-
 import org.apache.usergrid.rest.test.resource.endpoints.NamedResource;
 import org.apache.usergrid.rest.test.resource.endpoints.UrlResource;
 import org.apache.usergrid.rest.test.resource.model.ApiResponse;
 import org.apache.usergrid.rest.test.resource.model.Entity;
 import org.apache.usergrid.rest.test.resource.state.ClientContext;
 
+import javax.ws.rs.core.MediaType;
+
 
 /**
  *Adds support for changing the management properties in the rest testing framework.
@@ -36,12 +36,14 @@ public class TestPropertiesResource extends NamedResource {
 
     public ApiResponse post(Entity testProperties){
 
-        return getResource(true).type( MediaType.APPLICATION_JSON_TYPE )
-                            .accept( MediaType.APPLICATION_JSON ).post( ApiResponse.class, testProperties );
+        return getTarget( true ).request()
+            .accept( MediaType.APPLICATION_JSON )
+            .post( javax.ws.rs.client.Entity.json( testProperties), ApiResponse.class);
     }
 
     public ApiResponse get(){
-        return getResource(true).type( MediaType.APPLICATION_JSON_TYPE )
-                       .accept( MediaType.APPLICATION_JSON ).get(ApiResponse.class );
+        return getTarget(true).request()
+            .accept( MediaType.APPLICATION_JSON )
+            .get( ApiResponse.class );
     }
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/ApplicationsResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/ApplicationsResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/ApplicationsResource.java
index 78f906f..709d1ad 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/ApplicationsResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/ApplicationsResource.java
@@ -50,8 +50,8 @@ public class ApplicationsResource extends NamedResource {
      * Delete this application.
      */
     public ApiResponse delete() {
-        return getResource(true)
-            .type( MediaType.APPLICATION_JSON_TYPE )
+        return getTarget( true ).request()
+            //.type( MediaType.APPLICATION_JSON_TYPE )
             .accept( MediaType.APPLICATION_JSON )
             .delete( ApiResponse.class );
     }
@@ -65,8 +65,8 @@ public class ApplicationsResource extends NamedResource {
      * Used to get an application entity.
      */
     public ApiResponse get() {
-        return getResource(true)
-            .type(MediaType.APPLICATION_JSON_TYPE)
+        return getTarget(true).request()
+            //.type(MediaType.APPLICATION_JSON_TYPE)
             .accept( MediaType.APPLICATION_JSON )
             .get(ApiResponse.class);
     }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/CollectionEndpoint.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/CollectionEndpoint.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/CollectionEndpoint.java
index 520bab3..6873955 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/CollectionEndpoint.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/CollectionEndpoint.java
@@ -17,19 +17,20 @@
 package org.apache.usergrid.rest.test.resource.endpoints;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.sun.jersey.api.client.WebResource;
-import org.apache.usergrid.rest.test.resource.model.*;
 import org.apache.usergrid.rest.test.resource.model.Collection;
 import org.apache.usergrid.rest.test.resource.state.ClientContext;
-import org.apache.usergrid.services.ServiceParameter;
 import org.apache.usergrid.utils.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.client.WebTarget;
 import javax.ws.rs.core.MediaType;
 import java.io.IOException;
 import java.io.StringReader;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
 
 
 /**
@@ -114,20 +115,22 @@ public class CollectionEndpoint extends NamedResource {
         return get(parameters, true);
     }
 
-    public Collection get(final org.apache.usergrid.rest.test.resource.model.QueryParameters parameters, final boolean useToken){
+    public Collection get(
+        final org.apache.usergrid.rest.test.resource.model.QueryParameters parameters,
+        final boolean useToken){
 
         String acceptHeader = MediaType.APPLICATION_JSON;
         if (this.acceptHeaders.size() > 0) {
            acceptHeader = StringUtils.join(this.acceptHeaders, ',');
         }
 
-        WebResource resource  = getResource(useToken);
+        WebTarget resource  = getTarget( useToken );
         resource = addParametersToResource(resource, parameters);
 
-        logger.info("PATH is "+ resource.getURI().getRawPath()+"?"+resource.getURI().getRawQuery());
+        logger.info("PATH is "+ resource.getUri().getRawPath()+"?"+resource.getUri().getRawQuery());
         // use string type so we can log actual response from server
-        String responseString = resource.type( MediaType.APPLICATION_JSON_TYPE )
-            .accept(acceptHeader)
+        String responseString = resource.request()
+            .accept( acceptHeader )
             .get(String.class);
 
         logger.debug("Response from get: " + responseString);
@@ -135,7 +138,8 @@ public class CollectionEndpoint extends NamedResource {
         ObjectMapper mapper = new ObjectMapper();
         org.apache.usergrid.rest.test.resource.model.ApiResponse response;
         try {
-            response = mapper.readValue( new StringReader(responseString), org.apache.usergrid.rest.test.resource.model.ApiResponse.class);
+            response = mapper.readValue(
+                new StringReader(responseString), org.apache.usergrid.rest.test.resource.model.ApiResponse.class);
         } catch (IOException e) {
             throw new RuntimeException("Error parsing response", e);
         }
@@ -157,13 +161,16 @@ public class CollectionEndpoint extends NamedResource {
      * </pre>
      */
     //TODO: add queryParameters here
-    public Collection getNextPage(Collection collection, org.apache.usergrid.rest.test.resource.model.QueryParameters passedParameters ,final boolean useToken) {
+    public Collection getNextPage(Collection collection,
+             org.apache.usergrid.rest.test.resource.model.QueryParameters passedParameters ,
+             final boolean useToken) {
+
         String acceptHeader = MediaType.APPLICATION_JSON;
         if (this.acceptHeaders.size() > 0) {
             acceptHeader = StringUtils.join(this.acceptHeaders, ',');
         }
 
-        WebResource resource = getResource(useToken);
+        WebTarget resource = getTarget( useToken );
         org.apache.usergrid.rest.test.resource.model.QueryParameters queryParameters = passedParameters;
         if( queryParameters == null){
             queryParameters = new org.apache.usergrid.rest.test.resource.model.QueryParameters();
@@ -172,8 +179,10 @@ public class CollectionEndpoint extends NamedResource {
         queryParameters.setCursor(collection.getCursor());
         resource = addParametersToResource(resource, queryParameters);
 
-        org.apache.usergrid.rest.test.resource.model.ApiResponse response = resource.type( MediaType.APPLICATION_JSON_TYPE ).accept(acceptHeader)
-                .get(org.apache.usergrid.rest.test.resource.model.ApiResponse.class);
+        org.apache.usergrid.rest.test.resource.model.ApiResponse response =
+            resource.request()
+            .accept( acceptHeader )
+            .get(org.apache.usergrid.rest.test.resource.model.ApiResponse.class);
 
         return new Collection(response);
     }
@@ -206,10 +215,10 @@ public class CollectionEndpoint extends NamedResource {
             acceptHeader = StringUtils.join(this.acceptHeaders, ',');
         }
 
-        WebResource resource  = getResource(useToken);
+        WebTarget resource  = getTarget( useToken );
         resource = addParametersToResource(resource, parameters);
-        return resource.type( MediaType.APPLICATION_JSON_TYPE )
-            .accept(acceptHeader)
+        return resource.request()
+            .accept( acceptHeader )
             .delete(org.apache.usergrid.rest.test.resource.model.ApiResponse.class);
     }
 
@@ -229,10 +238,10 @@ public class CollectionEndpoint extends NamedResource {
         }
 
         // use string type so we can log actual response from server
-        String responseString = getResource(true)
-            .type( MediaType.APPLICATION_JSON_TYPE )
+        String responseString = getTarget( true )
+            .request()
             .accept(acceptHeader)
-            .post(String.class, payload);
+            .post( javax.ws.rs.client.Entity.json( payload ), String.class);
 
         logger.debug("Response from post: " + responseString);
 
@@ -256,10 +265,10 @@ public class CollectionEndpoint extends NamedResource {
         }
 
         // use string type so we can log actual response from server
-        String responseString = getResource(true)
-            .type( MediaType.APPLICATION_JSON_TYPE )
-            .accept(acceptHeader)
-            .post(String.class);
+        String responseString = getTarget( true )
+            .request()
+            .accept( acceptHeader )
+            .post( javax.ws.rs.client.Entity.json( null ), String.class);
 
         logger.debug("Response from post: " + responseString);
 
@@ -283,17 +292,18 @@ public class CollectionEndpoint extends NamedResource {
         }
 
         // use string type so we can log actual response from server
-        String responseString = getResource(true)
-            .type( MediaType.APPLICATION_JSON_TYPE )
-            .accept(acceptHeader)
-            .post(String.class, entityList );
+        String responseString = getTarget( true )
+            .request()
+            .accept( acceptHeader )
+            .post( javax.ws.rs.client.Entity.json( entityList ), String.class);
 
         logger.debug("Response from post: " + responseString);
 
         ObjectMapper mapper = new ObjectMapper();
         org.apache.usergrid.rest.test.resource.model.ApiResponse response;
         try {
-            response = mapper.readValue( new StringReader(responseString), org.apache.usergrid.rest.test.resource.model.ApiResponse.class);
+            response = mapper.readValue(
+                new StringReader(responseString), org.apache.usergrid.rest.test.resource.model.ApiResponse.class);
         } catch (IOException e) {
             throw new RuntimeException("Error parsing response", e);
         }
@@ -312,31 +322,37 @@ public class CollectionEndpoint extends NamedResource {
      * PUT /users?ql=select * where created > 0
      * </pre>
      */
-    public org.apache.usergrid.rest.test.resource.model.ApiResponse put( final org.apache.usergrid.rest.test.resource.model.QueryParameters parameters, org.apache.usergrid.rest.test.resource.model.Entity entity ){
+    public org.apache.usergrid.rest.test.resource.model.ApiResponse put(
+        final org.apache.usergrid.rest.test.resource.model.QueryParameters parameters,
+        org.apache.usergrid.rest.test.resource.model.Entity entity ){
         return put(parameters, true, entity);
     }
 
-    public org.apache.usergrid.rest.test.resource.model.ApiResponse put(final org.apache.usergrid.rest.test.resource.model.QueryParameters parameters, final boolean useToken, org.apache.usergrid.rest.test.resource.model.Entity entity) {
+    public org.apache.usergrid.rest.test.resource.model.ApiResponse put(
+        final org.apache.usergrid.rest.test.resource.model.QueryParameters parameters,
+        final boolean useToken,
+        org.apache.usergrid.rest.test.resource.model.Entity entity) {
 
         String acceptHeader = MediaType.APPLICATION_JSON;
         if (this.acceptHeaders.size() > 0) {
             acceptHeader = StringUtils.join(this.acceptHeaders, ',');
         }
 
-        WebResource resource  = getResource(useToken);
-        addParametersToResource(getResource(), parameters);
+        WebTarget resource  = getTarget( useToken );
+        addParametersToResource(getTarget(), parameters);
 
         // use string type so we can log actual response from server
-        String responseString = resource.type(MediaType.APPLICATION_JSON_TYPE)
+        String responseString = resource.request()
             .accept(acceptHeader)
-            .post(String.class, entity);
+            .post( javax.ws.rs.client.Entity.json( entity ), String.class);
 
         logger.debug("Response from put: " + responseString);
 
         ObjectMapper mapper = new ObjectMapper();
         org.apache.usergrid.rest.test.resource.model.ApiResponse response;
         try {
-            response = mapper.readValue( new StringReader(responseString), org.apache.usergrid.rest.test.resource.model.ApiResponse.class);
+            response = mapper.readValue(
+                new StringReader(responseString), org.apache.usergrid.rest.test.resource.model.ApiResponse.class);
         } catch (IOException e) {
             throw new RuntimeException("Error parsing response", e);
         }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/EntityEndpoint.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/EntityEndpoint.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/EntityEndpoint.java
index 70b2c3a..63949ec 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/EntityEndpoint.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/EntityEndpoint.java
@@ -20,14 +20,13 @@
 
 package org.apache.usergrid.rest.test.resource.endpoints;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.sun.jersey.api.client.WebResource;
 import org.apache.usergrid.rest.test.resource.model.ApiResponse;
 import org.apache.usergrid.rest.test.resource.model.Entity;
 import org.apache.usergrid.rest.test.resource.model.QueryParameters;
 import org.apache.usergrid.rest.test.resource.model.Token;
 import org.apache.usergrid.rest.test.resource.state.ClientContext;
 
+import javax.ws.rs.client.WebTarget;
 import javax.ws.rs.core.MediaType;
 
 public class EntityEndpoint extends NamedResource {
@@ -63,19 +62,21 @@ public class EntityEndpoint extends NamedResource {
     }
 
     public Entity get(final boolean useToken, final Token token){
-        WebResource resource  = getResource(useToken,token);
-        ApiResponse response = resource.type( MediaType.APPLICATION_JSON_TYPE ).accept(MediaType.APPLICATION_JSON)
-                .get(ApiResponse.class);
+        WebTarget resource  = getTarget( useToken, token );
+        ApiResponse response = resource.request()
+            .accept( MediaType.APPLICATION_JSON )
+            .get(ApiResponse.class);
 
         return new Entity(response);
     }
 
     //For testing purposes only
     public Entity get(QueryParameters parameters, final boolean useToken){
-        WebResource resource  = getResource(useToken);
+        WebTarget resource  = getTarget(useToken);
         resource = addParametersToResource(resource, parameters);
-        ApiResponse response = resource.type( MediaType.APPLICATION_JSON_TYPE ).accept(MediaType.APPLICATION_JSON)
-                                       .get(ApiResponse.class);
+        ApiResponse response = resource.request()
+            .accept( MediaType.APPLICATION_JSON )
+            .get(ApiResponse.class);
 
         return new Entity(response);
     }
@@ -96,9 +97,10 @@ public class EntityEndpoint extends NamedResource {
     }
 
     public ApiResponse delete(final boolean useToken){
-        WebResource resource  = getResource(useToken);
-        return resource.type( MediaType.APPLICATION_JSON_TYPE ).accept(MediaType.APPLICATION_JSON)
-                .delete(ApiResponse.class);
+        WebTarget resource  = getTarget( useToken );
+        return resource.request()
+            .accept( MediaType.APPLICATION_JSON )
+            .delete(ApiResponse.class);
     }
 
     /**
@@ -113,9 +115,10 @@ public class EntityEndpoint extends NamedResource {
      * PUT /users/fred {"color":"red"}
      */
     public Entity put(Entity entity){
-        ApiResponse response = getResource(true).type( MediaType.APPLICATION_JSON_TYPE ).accept(MediaType.APPLICATION_JSON)
-                .put(ApiResponse.class, entity);
-        return new Entity(response);
+        ApiResponse response = getTarget( true ).request()
+            .accept(MediaType.APPLICATION_JSON)
+            .put( javax.ws.rs.client.Entity.json(entity), ApiResponse.class );
+        return new Entity( response);
     }
 
 
@@ -134,11 +137,12 @@ public class EntityEndpoint extends NamedResource {
     }
 
     public Entity post(final boolean useToken){
-        WebResource resource  = getResource(useToken);
-        ApiResponse response = resource.type(MediaType.APPLICATION_JSON_TYPE ).accept(MediaType.APPLICATION_JSON)
-                .post(ApiResponse.class);
+        WebTarget resource  = getTarget(useToken);
+        ApiResponse response = resource.request()
+            .accept(MediaType.APPLICATION_JSON)
+            .post( javax.ws.rs.client.Entity.json(null), ApiResponse.class );
 
-        return new Entity(response);
+        return new Entity( response);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/NamedResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/NamedResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/NamedResource.java
index 2258312..336d709 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/NamedResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/NamedResource.java
@@ -17,17 +17,18 @@
 package org.apache.usergrid.rest.test.resource.endpoints;
 
 
-import com.sun.jersey.api.client.GenericType;
-import com.sun.jersey.api.client.WebResource;
-import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter;
-import com.sun.jersey.api.representation.Form;
-import com.sun.jersey.multipart.FormDataMultiPart;
 import org.apache.usergrid.rest.test.resource.model.ApiResponse;
 import org.apache.usergrid.rest.test.resource.model.Entity;
 import org.apache.usergrid.rest.test.resource.model.QueryParameters;
 import org.apache.usergrid.rest.test.resource.model.Token;
 import org.apache.usergrid.rest.test.resource.state.ClientContext;
+import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
+import org.glassfish.jersey.media.multipart.FormDataMultiPart;
 
+import javax.ws.rs.client.Invocation;
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.Form;
+import javax.ws.rs.core.GenericType;
 import javax.ws.rs.core.MediaType;
 import java.io.InputStream;
 import java.util.Iterator;
@@ -64,14 +65,14 @@ public class NamedResource implements UrlResource {
     }
 
     @Override
-    public WebResource getResource() {
-        return getResource(false);
+    public WebTarget getTarget() {
+        return getTarget( false );
     }
-    public WebResource getResource(boolean useToken) {
-        return getResource(useToken,null);
+    public WebTarget getTarget(boolean useToken) {
+        return getTarget( useToken, null );
     }
-    public WebResource getResource(boolean useToken,Token token) {
-        WebResource resource = parent.getResource().path( getPath() );
+    public WebTarget getTarget(boolean useToken,Token token) {
+        WebTarget resource = parent.getTarget().path( getPath() );
         token = token !=null ? token : this.context.getToken();
         //error checking
         if (token == null) {
@@ -80,7 +81,7 @@ public class NamedResource implements UrlResource {
         return  useToken    ? resource.queryParam("access_token",token.getAccessToken()) :  resource;
     }
 
-    protected WebResource addParametersToResource(WebResource resource, final QueryParameters parameters){
+    protected WebTarget addParametersToResource(WebTarget resource, final QueryParameters parameters){
 
         if(parameters == null){
             return resource;
@@ -178,11 +179,8 @@ public class NamedResource implements UrlResource {
     /**
      * Need to refactor all instances of tokens to either be passed in or manually set during the test.
      * There isn't any reason we would want a rest forwarding framework to set something on behave of the user.
-     * @param type
-     * @param <T>
-     * @return
+     * For edge cases like Organizations and Tokens
      */
-    //For edge cases like Organizations and Tokens
     public <T> T post(Class<T> type) {
         return post(true,type,null,null,false);
 
@@ -191,26 +189,18 @@ public class NamedResource implements UrlResource {
     /**
      * Need to refactor all instances of tokens to either be passed in or manually set during the test.
      * There isn't any reason we would want a rest forwarding framework to set something on behave of the user.
-     * @param type
-     * @param requestEntity
-     * @param <T>
-     * @return
+     * For edge cases like Organizations and Tokens.
      */
-    //For edge cases like Organizations and Tokens
     public <T> T post(Class<T> type, Entity requestEntity) {
-        return post(true,type,requestEntity,null,false);
+        return post( true, type, requestEntity, null, false);
 
     }
 
     /**
      * Need to refactor all instances of tokens to either be passed in or manually set during the test.
      * There isn't any reason we would want a rest forwarding framework to set something on behave of the user.
-     * @param type
-     * @param requestEntity
-     * @param <T>
-     * @return
+     * For edge cases like Organizations and Tokens
      */
-    //For edge cases like Organizations and Tokens
     public <T> T post(Class<T> type, Map requestEntity) {
         return post(true,type,requestEntity,null,false);
 
@@ -223,59 +213,46 @@ public class NamedResource implements UrlResource {
 
     /**
      * Used to test POST using form payloads.
-     * @param type
-     * @param requestEntity
-     * @param <T>
-     * @return
      */
-    public <T> T post(Class<T> type, Form requestEntity) {
+    public <T> T post(Class<T> type, Form form) {
         GenericType<T> gt = new GenericType<>((Class) type);
-        return getResource()
-            .accept(MediaType.APPLICATION_JSON)
-            .type(MediaType.APPLICATION_FORM_URLENCODED_TYPE)
-            .entity(requestEntity, MediaType.APPLICATION_FORM_URLENCODED_TYPE)
-            .post(gt.getRawClass());
-
+        return getTarget().request()
+            .accept( MediaType.APPLICATION_JSON )
+            .post( javax.ws.rs.client.Entity.entity( form, MediaType.APPLICATION_FORM_URLENCODED_TYPE ), gt );
     }
 
 
-    //Used for empty posts
+    // Used for empty posts
     public <T> T post( boolean useToken, Class<T> type, Map entity, final QueryParameters queryParameters) {
-        WebResource resource = getResource(useToken);
-        resource = addParametersToResource(resource, queryParameters);
-        WebResource.Builder builder = resource
-            .type(MediaType.APPLICATION_JSON_TYPE)
+        WebTarget resource = getTarget( useToken );
+        resource = addParametersToResource( resource, queryParameters );
+
+        Invocation.Builder builder = resource.request()
             .accept( MediaType.APPLICATION_JSON );
 
-        if(entity!=null){
-            builder.entity(entity);
-        }
+        // it's OK for the entity to be null
         GenericType<T> gt = new GenericType<>((Class) type);
-        return builder
-            .post(gt.getRawClass());
-
+        return builder.post( javax.ws.rs.client.Entity.json( entity ), gt );
     }
 
-    //Used for empty posts
-    public <T> T post( boolean useToken, Class<T> type, Map entity, final QueryParameters queryParameters, boolean useBasicAuthentication ) {
-        WebResource resource = getResource(useToken);
+    // Used for empty posts
+    public <T> T post( boolean useToken, Class<T> type, Map entity,
+                       final QueryParameters queryParameters, boolean useBasicAuthentication ) {
+
+        WebTarget resource = getTarget( useToken );
         resource = addParametersToResource(resource, queryParameters);
-        WebResource.Builder builder = resource
-            .type(MediaType.APPLICATION_JSON_TYPE)
+        Invocation.Builder builder = resource.request()
             .accept( MediaType.APPLICATION_JSON );
 
-        if(entity!=null){
-            builder.entity(entity);
-        }
 
-        if(useBasicAuthentication){
-            //added httpBasicauth filter to all setup calls because they all do verification this way.
-            HTTPBasicAuthFilter httpBasicAuthFilter = new HTTPBasicAuthFilter( "superuser","superpassword" );
-            resource.addFilter( httpBasicAuthFilter );
+        if ( useBasicAuthentication ) {
+            builder = builder.property( HttpAuthenticationFeature.HTTP_AUTHENTICATION_BASIC_USERNAME, "superuser")
+                             .property( HttpAuthenticationFeature.HTTP_AUTHENTICATION_BASIC_PASSWORD, "superpassword");
         }
 
+        // it's OK for the entity to be null
         GenericType<T> gt = new GenericType<>((Class) type);
-        return builder.post( gt.getRawClass() );
+        return builder.post( javax.ws.rs.client.Entity.json( entity ), gt );
 
     }
 
@@ -297,14 +274,14 @@ public class NamedResource implements UrlResource {
     }
 
     public <T> T get(Class<T> type,QueryParameters queryParameters, boolean useToken) {
-        WebResource resource = getResource(useToken);
+        WebTarget resource = getTarget( useToken );
         if(queryParameters!=null) {
             resource = addParametersToResource(resource, queryParameters);
         }
         GenericType<T> gt = new GenericType<>((Class) type);
-        return resource.type(MediaType.APPLICATION_JSON_TYPE)
+        return resource.request()
             .accept( MediaType.APPLICATION_JSON )
-            .get( gt.getRawClass() );
+            .get( gt );
 
     }
 
@@ -313,8 +290,9 @@ public class NamedResource implements UrlResource {
     }
 
     public ApiResponse post( boolean useToken, FormDataMultiPart multiPartForm ) {
-        WebResource resource = getResource( useToken );
-        return resource.type( MediaType.MULTIPART_FORM_DATA_TYPE ).post( ApiResponse.class, multiPartForm );
+        WebTarget resource = getTarget( useToken );
+        return resource.request().post(
+            javax.ws.rs.client.Entity.entity( multiPartForm, multiPartForm.getMediaType() ), ApiResponse.class );
     }
 
     public ApiResponse post( FormDataMultiPart multiPartForm ) {
@@ -322,8 +300,9 @@ public class NamedResource implements UrlResource {
     }
 
     public ApiResponse put( boolean useToken, byte[] data, MediaType type ) {
-        WebResource resource = getResource(useToken);
-        return resource.type( type ).put( ApiResponse.class, data );
+        WebTarget resource = getTarget(useToken );
+        return resource.request().put(
+            javax.ws.rs.client.Entity.entity(data, type), ApiResponse.class );
     }
 
     public ApiResponse put( byte[] data, MediaType type ) {
@@ -331,8 +310,9 @@ public class NamedResource implements UrlResource {
     }
 
     public ApiResponse put( boolean useToken, FormDataMultiPart multiPartForm ) {
-        WebResource resource = getResource(useToken);
-        return resource.type( MediaType.MULTIPART_FORM_DATA_TYPE ).put( ApiResponse.class, multiPartForm );
+        WebTarget resource = getTarget(useToken );
+        return resource.request().put(
+            javax.ws.rs.client.Entity.entity(multiPartForm, multiPartForm.getMediaType()), ApiResponse.class );
     }
 
     public ApiResponse put( FormDataMultiPart multiPartForm ) {
@@ -340,8 +320,8 @@ public class NamedResource implements UrlResource {
     }
 
     public InputStream getAssetAsStream( boolean useToken ) {
-        WebResource resource = getResource(useToken);
-        return resource.accept( MediaType.APPLICATION_OCTET_STREAM_TYPE ).get( InputStream.class );
+        WebTarget resource = getTarget(useToken );
+        return resource.request().accept( MediaType.APPLICATION_OCTET_STREAM_TYPE ).get( InputStream.class );
     }
 
     public InputStream getAssetAsStream() {
@@ -353,6 +333,6 @@ public class NamedResource implements UrlResource {
     }
 
     public ApiResponse delete( boolean useToken ) {
-        return getResource(useToken).delete( ApiResponse.class );
+        return getTarget(useToken).request().delete( ApiResponse.class );
     }
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/RootResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/RootResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/RootResource.java
index 8537251..88ec1c4 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/RootResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/RootResource.java
@@ -21,7 +21,7 @@ import org.apache.usergrid.rest.test.resource.endpoints.mgmt.ManagementResource;
 import org.apache.usergrid.rest.test.resource.model.Token;
 import org.apache.usergrid.rest.test.resource.state.ClientContext;
 
-import com.sun.jersey.api.client.WebResource;
+import javax.ws.rs.client.WebTarget;
 
 
 /**
@@ -61,7 +61,7 @@ public class RootResource implements UrlResource {
     }
 
     @Override
-    public WebResource getResource() {
+    public WebTarget getTarget() {
         //TODO: fix this to return the proper resource in the scope we expect it, might not be needed here.
         return null;
     }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/SetupResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/SetupResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/SetupResource.java
index b374cdc..75f1b6b 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/SetupResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/SetupResource.java
@@ -17,16 +17,13 @@
 package org.apache.usergrid.rest.test.resource.endpoints;
 
 
-import javax.ws.rs.core.MediaType;
-
 import org.apache.usergrid.rest.test.resource.model.Entity;
 import org.apache.usergrid.rest.test.resource.model.QueryParameters;
-import org.apache.usergrid.rest.test.resource.model.Token;
 import org.apache.usergrid.rest.test.resource.state.ClientContext;
+import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
 
-import com.sun.jersey.api.client.WebResource;
-import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter;
-
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.MediaType;
 
 /**
  * Functions as the endpoint for all resources that hit /system/ * /setup
@@ -39,14 +36,13 @@ public class SetupResource extends NamedResource {
 
     public Entity get(QueryParameters queryParameters){
 
-        WebResource resource = getResource();
+        WebTarget resource = getTarget();
         resource = addParametersToResource( resource, queryParameters );
 
-        //added httpBasicauth filter to all setup calls because they all do verification this way.
-        HTTPBasicAuthFilter httpBasicAuthFilter = new HTTPBasicAuthFilter( "superuser","superpassword" );
-        resource.addFilter( httpBasicAuthFilter );
-
-        return resource.type( MediaType.APPLICATION_JSON_TYPE ).accept( MediaType.APPLICATION_JSON )
-                                .get( Entity.class);
+        return resource.request()
+            .property( HttpAuthenticationFeature.HTTP_AUTHENTICATION_BASIC_USERNAME, "superuser")
+            .property( HttpAuthenticationFeature.HTTP_AUTHENTICATION_BASIC_PASSWORD, "superpassword" )
+            .accept( MediaType.APPLICATION_JSON )
+            .get( Entity.class );
     }
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/SystemResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/SystemResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/SystemResource.java
index 6a97dad..35ffc21 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/SystemResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/SystemResource.java
@@ -18,12 +18,11 @@
 package org.apache.usergrid.rest.test.resource.endpoints;
 
 
-import javax.ws.rs.core.MediaType;
-
 import org.apache.usergrid.rest.test.resource.model.ApiResponse;
-import org.apache.usergrid.rest.test.resource.model.Entity;
 import org.apache.usergrid.rest.test.resource.state.ClientContext;
 
+import javax.ws.rs.core.MediaType;
+
 
 /**
  * Handles making rest calls to system resources.
@@ -50,8 +49,10 @@ public class SystemResource extends NamedResource {
 
     public ApiResponse put(){
         ApiResponse
-            response = getResource(true).type( MediaType.APPLICATION_JSON_TYPE ).accept(MediaType.APPLICATION_JSON)
-                                        .put(ApiResponse.class);
+            response = getTarget(true)
+                .request()
+                .accept(MediaType.APPLICATION_JSON)
+                .put( javax.ws.rs.client.Entity.json(null), ApiResponse.class);
         return response;
     }
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/TokenResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/TokenResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/TokenResource.java
index 59ad354..2c777dd 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/TokenResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/TokenResource.java
@@ -21,11 +21,12 @@
 package org.apache.usergrid.rest.test.resource.endpoints;
 
 
-import com.sun.jersey.api.client.WebResource;
 import org.apache.usergrid.rest.test.resource.model.QueryParameters;
 import org.apache.usergrid.rest.test.resource.model.Token;
 import org.apache.usergrid.rest.test.resource.state.ClientContext;
 
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.client.WebTarget;
 import javax.ws.rs.core.MediaType;
 
 /**
@@ -43,9 +44,10 @@ public class TokenResource extends NamedResource {
      * @return
      */
     public Token post(QueryParameters params) {
-        WebResource resource = getResource(false);
+        WebTarget resource = getTarget( false );
         resource = addParametersToResource(resource, params);
-        Token token = resource.type(MediaType.APPLICATION_JSON_TYPE).accept(MediaType.APPLICATION_JSON)
+        Token token = resource.request()
+            .accept( MediaType.APPLICATION_JSON )
             .get(Token.class);
 
         this.context.setToken(token);
@@ -58,7 +60,7 @@ public class TokenResource extends NamedResource {
      * @return
      */
     public Token post() {
-        Token token = getResource().accept(MediaType.APPLICATION_JSON).post(Token.class);
+        Token token = getTarget().request().accept( MediaType.APPLICATION_JSON ).post( Entity.json(null), Token.class );
         this.context.setToken(token);
         return token;
     }
@@ -70,8 +72,9 @@ public class TokenResource extends NamedResource {
      * @return
      */
     public Token post(Token token) {
-        token = getResource(false).type(MediaType.APPLICATION_JSON_TYPE)
-            .accept(MediaType.APPLICATION_JSON).post(Token.class, token);
+        token = getTarget(false).request()
+            .accept(MediaType.APPLICATION_JSON)
+            .post( Entity.json( token ), Token.class);
         this.context.setToken(token);
         return token;
     }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/UrlResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/UrlResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/UrlResource.java
index eb16d4d..6e5ee1b 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/UrlResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/UrlResource.java
@@ -17,10 +17,7 @@
 package org.apache.usergrid.rest.test.resource.endpoints;
 
 
-import org.apache.usergrid.rest.test.resource.state.ClientContext;
-
-import com.sun.jersey.api.client.WebResource;
-
+import javax.ws.rs.client.WebTarget;
 
 /**
  * Interface that returns the path that is currently being pointed to.
@@ -38,7 +35,7 @@ public interface UrlResource {
      * Get the resource
      * @return
      */
-    public WebResource getResource();
+    public WebTarget getTarget();
 
 
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/ApplicationResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/ApplicationResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/ApplicationResource.java
index dbf653d..4b9d195 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/ApplicationResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/ApplicationResource.java
@@ -59,23 +59,29 @@ public class ApplicationResource extends NamedResource {
 
 
     public org.apache.usergrid.rest.test.resource.model.ApiResponse post(Application application) {
-        org.apache.usergrid.rest.test.resource.model.ApiResponse apiResponse =getResource(true).type(MediaType.APPLICATION_JSON_TYPE)
-            .accept(MediaType.APPLICATION_JSON).post(org.apache.usergrid.rest.test.resource.model.ApiResponse.class, application);
+        org.apache.usergrid.rest.test.resource.model.ApiResponse apiResponse = getTarget(true)
+            .request()
+            .accept( MediaType.APPLICATION_JSON )
+            .post( javax.ws.rs.client.Entity.json(application),
+                org.apache.usergrid.rest.test.resource.model.ApiResponse.class);
         return apiResponse;
     }
 
-    public org.apache.usergrid.rest.test.resource.model.Entity post(org.apache.usergrid.rest.test.resource.model.Entity payload) {
+    public org.apache.usergrid.rest.test.resource.model.Entity post(
+        org.apache.usergrid.rest.test.resource.model.Entity payload) {
 
-        String responseString = getResource(true)
-            .type( MediaType.APPLICATION_JSON_TYPE )
+        String responseString = getTarget( true )
+            .request()
             .accept(MediaType.APPLICATION_JSON)
-            .post(String.class, payload);
+            .post( javax.ws.rs.client.Entity.json(payload), String.class);
 
         logger.debug("Response from post: " + responseString);
 
         org.apache.usergrid.rest.test.resource.model.ApiResponse response;
         try {
-            response = mapper.readValue(new StringReader(responseString), org.apache.usergrid.rest.test.resource.model.ApiResponse.class);
+            response = mapper.readValue(
+                new StringReader(responseString),
+                org.apache.usergrid.rest.test.resource.model.ApiResponse.class);
         } catch (IOException e) {
             throw new RuntimeException("Error parsing response", e);
         }
@@ -86,8 +92,8 @@ public class ApplicationResource extends NamedResource {
 
     public org.apache.usergrid.rest.test.resource.model.Entity get() {
 
-        String responseString = getResource(true)
-            .type( MediaType.APPLICATION_JSON_TYPE )
+        String responseString = getTarget(true)
+            .request()
             .accept(MediaType.APPLICATION_JSON)
             .get(String.class);
 
@@ -95,7 +101,8 @@ public class ApplicationResource extends NamedResource {
 
         org.apache.usergrid.rest.test.resource.model.ApiResponse response;
         try {
-            response = mapper.readValue(new StringReader(responseString), org.apache.usergrid.rest.test.resource.model.ApiResponse.class);
+            response = mapper.readValue(
+                new StringReader(responseString), org.apache.usergrid.rest.test.resource.model.ApiResponse.class);
         } catch (IOException e) {
             throw new RuntimeException("Error parsing response", e);
         }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/ApplicationsResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/ApplicationsResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/ApplicationsResource.java
index caf93e8..bd0c824 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/ApplicationsResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/ApplicationsResource.java
@@ -45,9 +45,9 @@ public class ApplicationsResource extends NamedResource {
 
     public ManagementResponse getOrganizationApplications() throws IOException {
 
-        String responseString = this.getResource()
+        String responseString = this.getTarget()
             .queryParam( "access_token", context.getToken().getAccessToken() )
-            .type(MediaType.APPLICATION_JSON)
+            .request()
             .get(String.class);
 
         logger.info("Response: " + responseString);

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/AuthorizeResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/AuthorizeResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/AuthorizeResource.java
index 694f9c4..d93612a 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/AuthorizeResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/AuthorizeResource.java
@@ -19,7 +19,6 @@
  */
 package org.apache.usergrid.rest.test.resource.endpoints.mgmt;
 
-import com.sun.jersey.api.client.GenericType;
 import org.apache.usergrid.rest.test.resource.endpoints.NamedResource;
 import org.apache.usergrid.rest.test.resource.endpoints.UrlResource;
 import org.apache.usergrid.rest.test.resource.state.ClientContext;
@@ -39,7 +38,7 @@ public class AuthorizeResource extends NamedResource {
      * @return
      */
     public Object post(Object requestEntity) {
-        return getResource().post(Object.class, requestEntity);
+        return getTarget().request().post( javax.ws.rs.client.Entity.json(requestEntity), Object.class);
 
     }
 
@@ -51,9 +50,7 @@ public class AuthorizeResource extends NamedResource {
      * @return
      */
     public <T> T post(Class<T> type, Object requestEntity) {
-        GenericType<T> gt = new GenericType<>((Class) type);
-        return getResource().post(gt.getRawClass(), requestEntity);
-
+        return getTarget().request().post( javax.ws.rs.client.Entity.json( requestEntity ), type );
     }
 
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/ConfirmResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/ConfirmResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/ConfirmResource.java
index 0a35353..9e0c443 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/ConfirmResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/ConfirmResource.java
@@ -17,15 +17,13 @@
 package org.apache.usergrid.rest.test.resource.endpoints.mgmt;
 
 
-import javax.ws.rs.core.MediaType;
-
 import org.apache.usergrid.rest.test.resource.endpoints.NamedResource;
 import org.apache.usergrid.rest.test.resource.endpoints.UrlResource;
-import org.apache.usergrid.rest.test.resource.model.ApiResponse;
 import org.apache.usergrid.rest.test.resource.model.QueryParameters;
 import org.apache.usergrid.rest.test.resource.state.ClientContext;
 
-import com.sun.jersey.api.client.WebResource;
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.MediaType;
 
 
 /**
@@ -37,10 +35,8 @@ public class ConfirmResource extends NamedResource {
     }
 
     public void get(QueryParameters queryParameters){
-        WebResource resource = getResource();
+        WebTarget resource = getTarget();
         resource = addParametersToResource( resource, queryParameters );
-        String obj = resource.type( MediaType.TEXT_HTML_TYPE )
-                                       .accept( MediaType.TEXT_HTML).get( String.class );
-
+        String obj = resource.request().accept( MediaType.TEXT_HTML).get( String.class );
     }
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/CredentialsResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/CredentialsResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/CredentialsResource.java
index 073d6d6..31df4ba 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/CredentialsResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/CredentialsResource.java
@@ -19,7 +19,6 @@
  */
 package org.apache.usergrid.rest.test.resource.endpoints.mgmt;
 
-import com.sun.jersey.api.client.WebResource;
 import org.apache.usergrid.rest.test.resource.endpoints.NamedResource;
 import org.apache.usergrid.rest.test.resource.endpoints.UrlResource;
 import org.apache.usergrid.rest.test.resource.model.ApiResponse;
@@ -27,6 +26,7 @@ import org.apache.usergrid.rest.test.resource.model.Credentials;
 import org.apache.usergrid.rest.test.resource.model.QueryParameters;
 import org.apache.usergrid.rest.test.resource.state.ClientContext;
 
+import javax.ws.rs.client.WebTarget;
 import javax.ws.rs.core.MediaType;
 
 /**
@@ -38,9 +38,10 @@ public class CredentialsResource extends NamedResource {
     }
 
     public Credentials get(final QueryParameters parameters, final boolean useToken) {
-        WebResource resource = getResource(useToken);
+        WebTarget resource = getTarget(useToken);
         resource = addParametersToResource(resource, parameters);
-        ApiResponse response = resource.type(MediaType.APPLICATION_JSON_TYPE).accept(MediaType.APPLICATION_JSON)
+        ApiResponse response = resource.request()
+            .accept(MediaType.APPLICATION_JSON)
             .get(ApiResponse.class);
         return new Credentials(response);
     }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/0578d987/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/FeedResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/FeedResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/FeedResource.java
index 8fd873b..4895659 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/FeedResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/test/resource/endpoints/mgmt/FeedResource.java
@@ -41,8 +41,9 @@ public class FeedResource extends NamedResource {
     }
 
     public ApiResponse get() {
-        return getResource( true ).type( MediaType.APPLICATION_JSON_TYPE )
-            .accept( MediaType.APPLICATION_JSON ).get( ApiResponse.class);
+        return getTarget( true ).request()
+            .accept( MediaType.APPLICATION_JSON )
+            .get( ApiResponse.class);
 
 
     }


Mime
View raw message