Fix broken APM test.

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

Branch: refs/heads/two-dot-o-dev
Commit: 54f61dc0af54d26b86d229c33f2ede4d74fb66ee
Parents: ed053ed
Author: Dave Johnson <[email protected]>
Authored: Wed Sep 16 12:47:19 2015 -0400
Committer: Dave Johnson <[email protected]>
Committed: Wed Sep 16 12:47:19 2015 -0400

----------------------------------------------------------------------
 .../rest/applications/ApplicationResourceIT.java    | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/54f61dc0/stack/rest/src/test/java/org/apache/usergrid/rest/applications/ApplicationResourceIT.java
----------------------------------------------------------------------
diff --git 
a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/ApplicationResourceIT.java
 
b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/ApplicationResourceIT.java
index 8a94760..453fe54 100644
--- 
a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/ApplicationResourceIT.java
+++ 
b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/ApplicationResourceIT.java
@@ -36,6 +36,7 @@ import org.slf4j.LoggerFactory;
 
 import javax.ws.rs.ClientErrorException;
 import javax.ws.rs.InternalServerErrorException;
+import javax.ws.rs.NotFoundException;
 import javax.ws.rs.client.Invocation;
 import javax.ws.rs.core.Form;
 import javax.ws.rs.core.MediaType;
@@ -91,7 +92,6 @@ public class ApplicationResourceIT extends AbstractRestIT {
             .queryParam("client_id", appCredentials.getClientId())
             .queryParam("client_secret", appCredentials.getClientSecret())
             .request()
-            .accept(MediaType.APPLICATION_JSON)
             .get(ApiResponse.class);
         //assert that a valid response is returned without error
         assertNotNull(apiResponse);
@@ -741,11 +741,11 @@ public class ApplicationResourceIT extends AbstractRestIT 
{
         Form payload = new Form();
         payload.param( "grant_type", "client_credentials" );
         payload.param( "client_id", clientId );
-        payload.param("client_secret", clientSecret);
+        payload.param( "client_secret", clientSecret );
 
         //POST the form to the application token endpoint
-        Token apiResponse = this.app().token().getTarget( false).request()
-            .accept(MediaType.APPLICATION_JSON)
+        Token apiResponse = this.app().token().getTarget( false ).request()
+            .accept( MediaType.APPLICATION_JSON )
             .post( javax.ws.rs.client.Entity.form(payload), Token.class);
 
         //Assert that a valid token with a valid TTL is returned
@@ -829,7 +829,8 @@ public class ApplicationResourceIT extends AbstractRestIT {
         assertEquals(604800, ttl);
 
         //retrieve the users collection for the application using the new token
-        ApiResponse response = this.app().collection("users").getTarget(true, 
token ).request().get(ApiResponse.class);
+        ApiResponse response = this.app().collection( "users" ).getTarget( 
true, token ).request()
+            .get(ApiResponse.class);
         //assert that we did not receive an error
         assertNull(response.getError());
     }
@@ -856,7 +857,8 @@ public class ApplicationResourceIT extends AbstractRestIT {
         assertEquals(604800, ttl);
 
         //retrieve the users collection for the application using the new token
-        ApiResponse response = this.app().collection("users").getTarget( true, 
token ).request().get( ApiResponse.class);
+        ApiResponse response = this.app().collection( "users" ).getTarget( 
true, token ).request()
+            .get( ApiResponse.class);
         //assert that we did not receive an error
         assertNull(response.getError());
     }
@@ -866,7 +868,7 @@ public class ApplicationResourceIT extends AbstractRestIT {
         try {
             Collection collection = 
this.app().collection("apm/apigeeMobileConfig").get();
             fail();
-        }catch (UniformInterfaceException e){
+        } catch (NotFoundException e){
             Assert.assertEquals(404, e.getResponse().getStatus());
         }
     }

Reply via email to