X-Git-Url: http://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fde%2Fjuplo%2Ffacebook%2Ferrors%2FGraphApiErrorResponseErrorHandlerIntegrationTest.java;h=81bcfe63510ac9d6cab4b228285f2462089c8168;hb=33497214e49058c63ce4746d3b4d3272d1f7f3ce;hp=254b51b6d9b37280179196d097b0575b0ecf6f32;hpb=32dfa9c65c5a1697038bde61f7907baf3027add2;p=facebook-errors diff --git a/src/test/java/de/juplo/facebook/errors/GraphApiErrorResponseErrorHandlerIntegrationTest.java b/src/test/java/de/juplo/facebook/errors/GraphApiErrorResponseErrorHandlerIntegrationTest.java index 254b51b..81bcfe6 100644 --- a/src/test/java/de/juplo/facebook/errors/GraphApiErrorResponseErrorHandlerIntegrationTest.java +++ b/src/test/java/de/juplo/facebook/errors/GraphApiErrorResponseErrorHandlerIntegrationTest.java @@ -37,7 +37,8 @@ public class GraphApiErrorResponseErrorHandlerIntegrationTest 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) { @@ -48,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) { @@ -59,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) { @@ -70,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) @@ -86,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) @@ -115,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) @@ -142,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) @@ -175,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) @@ -202,9 +205,4 @@ public class GraphApiErrorResponseErrorHandlerIntegrationTest new GraphApiErrorResponseErrorHandler(clientTemplate.getErrorHandler()) ); } - - - static class SOME - { - } }