X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fde%2Fjuplo%2Ffacebook%2Ferrors%2FGraphApiExceptionTest.java;h=a164d89c4c77330ddc94172df8dddf8ba1f29433;hb=6711d13c296f9375f3e264cf8a1301346ce06237;hp=f2591d1d5093ec92245a6d0a27ac1f9bb96f91c5;hpb=29d960306f0bea890cc1f02a4d66943d76013708;p=facebook-errors diff --git a/src/test/java/de/juplo/facebook/errors/GraphApiExceptionTest.java b/src/test/java/de/juplo/facebook/errors/GraphApiExceptionTest.java index f2591d1..a164d89 100644 --- a/src/test/java/de/juplo/facebook/errors/GraphApiExceptionTest.java +++ b/src/test/java/de/juplo/facebook/errors/GraphApiExceptionTest.java @@ -30,8 +30,6 @@ public class GraphApiExceptionTest @Test public void testError1() { - LOG.info("testError1"); - String str = "{\n" + " \"error\":\n" + @@ -51,9 +49,6 @@ public class GraphApiExceptionTest @Test public void testError2() { - LOG.info("testError2"); - - String str = "{\n" + " \"error\":\n" + @@ -76,9 +71,6 @@ public class GraphApiExceptionTest @Test public void testError4() { - LOG.info("testError4"); - - String str = "{\n" + " \"error\": {\n" + @@ -102,9 +94,6 @@ public class GraphApiExceptionTest @Test public void testError12() { - LOG.info("testError12"); - - String str = "{\n" + " \"error\":\n" + @@ -128,9 +117,6 @@ public class GraphApiExceptionTest @Test public void testError21() { - LOG.info("testError21"); - - String str = "{\n" + " \"error\":\n" + @@ -153,9 +139,6 @@ public class GraphApiExceptionTest @Test public void testError100() { - LOG.info("testError100"); - - String str = "{\n" + " \"error\":\n" + @@ -179,8 +162,6 @@ public class GraphApiExceptionTest @Test public void testError102() { - LOG.info("testError102"); - String str ="{\"error\":{\"message\":\"A user access token is required to request this resource.\",\"type\":\"OAuthException\",\"code\":102,\"fbtrace_id\":\"DhdMyf23Ki7\"}}"; byte[] message = str.getBytes(); GraphApiException e = GraphApiException.create (status, headers, message); @@ -193,8 +174,6 @@ public class GraphApiExceptionTest @Test public void testError104() { - LOG.info("testError104"); - String str ="{\"error\":{\"message\":\"An access token is required to request this resource.\",\"type\":\"OAuthException\",\"code\":104,\"fbtrace_id\":\"E2Jjkj5++LL\"}}"; byte[] message = str.getBytes(); GraphApiException e = GraphApiException.create (status, headers, message); @@ -219,8 +198,6 @@ public class GraphApiExceptionTest @Test public void testError200() { - LOG.info("testError200"); - String str ="{\n" + " \"error\": {\n" + " \"message\": \"(#200) The user hasn't authorized the application to perform this action\",\n" + @@ -238,9 +215,6 @@ public class GraphApiExceptionTest @Test public void testError613() { - LOG.info("testError613"); - - String str = "{\n" + " \"error\":\n" + @@ -263,8 +237,6 @@ public class GraphApiExceptionTest @Test public void testError2200() { - LOG.info("testError2200"); - String str ="{\"error\":{\"message\":\"(#2200) callback verification failed: \",\"type\":\"OAuthException\",\"code\":2200,\"fbtrace_id\":\"ESLjoZKvPXg\"}}"; byte[] message = str.getBytes(); GraphApiException e = GraphApiException.create (status, headers, message); @@ -274,11 +246,19 @@ public class GraphApiExceptionTest } @Test - public void testUnmappedError() + public void testError2500() { - LOG.info("testUnmappedError"); + String str ="{\"error\":{\"message\":\"An active access token must be used to query information about the current user.\",\"type\":\"OAuthException\",\"code\":2500,\"fbtrace_id\":\"AUmMHJlVYvTbQrBT11Dk104\"}}"; + byte[] message = str.getBytes(); + GraphApiException e = GraphApiException.create (status, headers, message); + assertTrue(e.getClass().equals(ActiveAccessTokenMissingException.class)); + LOG.debug("{}", e.toString()); + } + @Test + public void testUnmappedError() + { String str = "{\n" + " \"error\":\n" + @@ -307,8 +287,6 @@ public class GraphApiExceptionTest @Test public void testUnmappedErrors() { - LOG.info("testUnmappedErrors"); - String str; byte[] message; GraphApiException e; @@ -419,8 +397,6 @@ public class GraphApiExceptionTest @Test public void testInvlalidErrors() { - LOG.info("testInvalidErrors"); - String str; byte[] message; GraphApiException e;