You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by gr...@apache.org on 2014/10/15 02:21:22 UTC

[2/2] git commit: Added a fix for some of the test cases complaining about using JsonNode and an older version of jackson.

Added a fix for some of the test cases complaining about using JsonNode and an older version of jackson.


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

Branch: refs/heads/two-dot-o-import
Commit: 52dbfe43a52d11b56fe2fa31e17d01d5f51aa77e
Parents: 0132d1a
Author: grey <gr...@apigee.com>
Authored: Tue Oct 14 17:20:54 2014 -0700
Committer: grey <gr...@apigee.com>
Committed: Tue Oct 14 17:20:54 2014 -0700

----------------------------------------------------------------------
 .../usergrid/rest/management/ImportResourceIT.java  | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/52dbfe43/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 cf2ff0d..cba3057 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
@@ -20,7 +20,7 @@ package org.apache.usergrid.rest.management;
 import com.sun.jersey.api.client.ClientResponse;
 import com.sun.jersey.api.client.UniformInterfaceException;
 import org.apache.usergrid.rest.AbstractRestIT;
-import org.codehaus.jackson.JsonNode;
+import com.fasterxml.jackson.databind.JsonNode;
 import org.junit.Test;
 
 import javax.ws.rs.core.MediaType;
@@ -88,9 +88,9 @@ public class ImportResourceIT extends AbstractRestIT {
         HashMap<String, Object> payload = payloadBuilder();
 
         try {
-            node = resource().path( "/management/orgs/test-organization/apps/test-app/import" )
+            node = mapper.readTree(resource().path( "/management/orgs/test-organization/apps/test-app/import" )
                     .queryParam( "access_token", superAdminToken() ).accept( MediaType.APPLICATION_JSON )
-                    .type( MediaType.APPLICATION_JSON_TYPE ).post( JsonNode.class, payload );
+                    .type( MediaType.APPLICATION_JSON_TYPE ).post( String.class, payload ));
         }
         catch ( UniformInterfaceException uie ) {
             responseStatus = uie.getResponse().getClientResponseStatus();
@@ -136,16 +136,16 @@ public class ImportResourceIT extends AbstractRestIT {
         uuid = uuid.replaceAll( "\"", "" );
 
         try {
-            node = resource().path( "/management/orgs/test-organization/import/" + uuid )
+            node = mapper.readTree(resource().path( "/management/orgs/test-organization/import/" + uuid )
                     .queryParam( "access_token", superAdminToken() ).accept( MediaType.APPLICATION_JSON )
-                    .type( MediaType.APPLICATION_JSON_TYPE ).get( JsonNode.class );
+                    .type( MediaType.APPLICATION_JSON_TYPE ).get( String.class ));
         }
         catch ( UniformInterfaceException uie ) {
             responseStatus = uie.getResponse().getClientResponseStatus();
         }
 
         assertEquals( ClientResponse.Status.OK, responseStatus );
-        assertEquals( "SCHEDULED", node.get( "state" ).getTextValue() );//TODO: do tests for other states in service tier
+        assertEquals( "SCHEDULED", node.get( "state" ).textValue() );//TODO: do tests for other states in service tier
 
     }
 
@@ -172,7 +172,7 @@ public class ImportResourceIT extends AbstractRestIT {
         }
 
         assertEquals( ClientResponse.Status.OK, responseStatus );
-        assertEquals( "SCHEDULED", node.get( "state" ).getTextValue() );//TODO: do tests for other states in service tier
+        assertEquals( "SCHEDULED", node.get( "state" ).textValue() );//TODO: do tests for other states in service tier
     }
 
     @Test
@@ -198,7 +198,7 @@ public class ImportResourceIT extends AbstractRestIT {
         }
 
         assertEquals( ClientResponse.Status.OK, responseStatus );
-        assertEquals( "SCHEDULED", node.get( "state" ).getTextValue() );//TODO: do tests for other states in service tier
+        assertEquals( "SCHEDULED", node.get( "state" ).textValue() );//TODO: do tests for other states in service tier
     }
 
    //do an unauthorized test for both post and get