X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fde%2Fjuplo%2Ffacebook%2Ferrors%2FGraphApiErrorHandlerTest.java;h=c9a53cd232fac8588a2f644deadd5722273f7c10;hb=8079d646addc5206f64bfb213d018a2fa94444d3;hp=185fd2b85cda5c261be2706878b7ed18723f3568;hpb=16dada3d8c499862992c1b8472f5cef3355106f1;p=facebook-errors diff --git a/src/test/java/de/juplo/facebook/errors/GraphApiErrorHandlerTest.java b/src/test/java/de/juplo/facebook/errors/GraphApiErrorHandlerTest.java index 185fd2b..c9a53cd 100644 --- a/src/test/java/de/juplo/facebook/errors/GraphApiErrorHandlerTest.java +++ b/src/test/java/de/juplo/facebook/errors/GraphApiErrorHandlerTest.java @@ -254,6 +254,28 @@ public class GraphApiErrorHandlerTest } } + @Test + public void testError190() + { + log.info("testError190"); + + requestFactory.setBody("{\"error\":{\"message\":\"Bad signature\",\"type\":\"OAuthException\",\"code\":190,\"fbtrace_id\":\"Ay2OYQrINbXOCfQpBvoxDIw\"}}"); + + try + { + clientTemplate.getForObject("ANY", SOME.class); + fail("The expected exception was not thrown"); + } + catch(AccessTokenExpiredException e) + { + log.debug("{}", e.toString()); + assertEquals(new Integer(190), e.getCode()); + assertEquals("Bad signature", e.getMessage()); + assertEquals(Type.OAuthException, e.getType()); + assertEquals("Ay2OYQrINbXOCfQpBvoxDIw", e.getTraceId()); + } + } + @Test public void testError613() { @@ -275,7 +297,7 @@ public class GraphApiErrorHandlerTest clientTemplate.getForObject("ANY", SOME.class); fail("The expected exception was not thrown"); } - catch(CustomRequestLimitReachedException e) + catch(RateLimitExceededException e) { log.debug("{}", e.toString()); assertEquals(new Integer(613), e.getCode()); @@ -753,7 +775,7 @@ public class GraphApiErrorHandlerTest clientTemplate = new RestTemplate(); clientTemplate.setRequestFactory(requestFactory); clientTemplate.setErrorHandler( - new GraphApiErrorHandler(clientTemplate.getErrorHandler()) + new GraphApiErrorResponseErrorHandler(clientTemplate.getErrorHandler()) ); }