Clearified intend in GraphApiErrorResponseErrorHandlerIntegrationTest
[facebook-errors] / src / test / java / de / juplo / facebook / errors / GraphApiErrorResponseErrorHandlerIntegrationTest.java
index 55025e7..81bcfe6 100644 (file)
@@ -31,15 +31,14 @@ public class GraphApiErrorResponseErrorHandlerIntegrationTest
   @Test
   public void testNoError()
   {
-    LOG.info("testNoError");
-
     requestFactory.setBody("{ \"message\": \"Hello World!\" }");
 
 
     requestFactory.setStatus(HttpStatus.CONTINUE);
     try
     {
-      clientTemplate.getForObject("ANY", SOME.class);
+      String result = clientTemplate.getForObject("ANY", String.class);
+      assertEquals("{ \"message\": \"Hello World!\" }", result);
     }
     catch(Exception e)
     {
@@ -50,7 +49,8 @@ public class GraphApiErrorResponseErrorHandlerIntegrationTest
     requestFactory.setStatus(HttpStatus.OK);
     try
     {
-      clientTemplate.getForObject("ANY", SOME.class);
+      String result = clientTemplate.getForObject("ANY", String.class);
+      assertEquals("{ \"message\": \"Hello World!\" }", result);
     }
     catch(Exception e)
     {
@@ -61,7 +61,8 @@ public class GraphApiErrorResponseErrorHandlerIntegrationTest
     requestFactory.setStatus(HttpStatus.TEMPORARY_REDIRECT);
     try
     {
-      clientTemplate.getForObject("ANY", SOME.class);
+      String result = clientTemplate.getForObject("ANY", String.class);
+      assertEquals("{ \"message\": \"Hello World!\" }", result);
     }
     catch(Exception e)
     {
@@ -72,7 +73,7 @@ public class GraphApiErrorResponseErrorHandlerIntegrationTest
     requestFactory.setStatus(HttpStatus.BAD_REQUEST);
     try
     {
-      clientTemplate.getForObject("ANY", SOME.class);
+      clientTemplate.getForObject("ANY", String.class);
       fail("The parent handler should have raised an exception!");
     }
     catch(HttpClientErrorException e)
@@ -88,7 +89,7 @@ public class GraphApiErrorResponseErrorHandlerIntegrationTest
     requestFactory.setStatus(HttpStatus.INTERNAL_SERVER_ERROR);
     try
     {
-      clientTemplate.getForObject("ANY", SOME.class);
+      clientTemplate.getForObject("ANY", String.class);
       fail("The parent handler should have raised an exception!");
     }
     catch(HttpServerErrorException e)
@@ -105,9 +106,6 @@ public class GraphApiErrorResponseErrorHandlerIntegrationTest
   @Test
   public void testValidError()
   {
-    LOG.info("testValidError");
-
-
     requestFactory.setBody(
         "{\n" +
         "  \"error\":\n" +
@@ -120,7 +118,7 @@ public class GraphApiErrorResponseErrorHandlerIntegrationTest
 
     try
     {
-      clientTemplate.getForObject("ANY", SOME.class);
+      clientTemplate.getForObject("ANY", String.class);
       fail("The expected exception was not thrown");
     }
     catch(RateLimitExceededException e)
@@ -135,9 +133,6 @@ public class GraphApiErrorResponseErrorHandlerIntegrationTest
   @Test
   public void testUnmappedError()
   {
-    LOG.info("testUnmappedError");
-
-
     requestFactory.setBody(
         "{\n" +
         "  \"error\":\n" +
@@ -150,7 +145,7 @@ public class GraphApiErrorResponseErrorHandlerIntegrationTest
 
     try
     {
-      clientTemplate.getForObject("ANY", SOME.class);
+      clientTemplate.getForObject("ANY", String.class);
       fail("The expected exception was not thrown");
     }
     catch(GraphApiException e)
@@ -171,9 +166,6 @@ public class GraphApiErrorResponseErrorHandlerIntegrationTest
   @Test
   public void testInvlalidError()
   {
-    LOG.info("testInvalidError");
-
-
     requestFactory.setBody(
         "{\n" +
         "  \"error\":\n" +
@@ -186,7 +178,7 @@ public class GraphApiErrorResponseErrorHandlerIntegrationTest
 
     try
     {
-      clientTemplate.getForObject("ANY", SOME.class);
+      clientTemplate.getForObject("ANY", String.class);
       fail("The expected exception was not thrown");
     }
     catch(HttpClientErrorException e)
@@ -213,9 +205,4 @@ public class GraphApiErrorResponseErrorHandlerIntegrationTest
         new GraphApiErrorResponseErrorHandler(clientTemplate.getErrorHandler())
         );
   }
-
-
-  static class SOME
-  {
-  }
 }