From: Kai Moritz Date: Thu, 21 Nov 2019 20:21:13 +0000 (+0100) Subject: Clearified intend in GraphApiErrorResponseErrorHandlerIntegrationTest X-Git-Tag: wip-webclient~7 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=33497214e49058c63ce4746d3b4d3272d1f7f3ce;p=facebook-errors Clearified intend in GraphApiErrorResponseErrorHandlerIntegrationTest --- 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 - { - } }