WIP: 2200: An active access token must be used
[facebook-errors] / src / test / java / de / juplo / facebook / errors / GraphApiExceptionTest.java
index f2591d1..a164d89 100644 (file)
@@ -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;