X-Git-Url: https://juplo.de/gitweb/?p=facebook-errors;a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fde%2Fjuplo%2Ffacebook%2Ferrors%2FGraphApiErrorHandlerTest.java;h=185fd2b85cda5c261be2706878b7ed18723f3568;hp=65149d51496fba55f8eda2b26aa0599d76b055a0;hb=16dada3d8c499862992c1b8472f5cef3355106f1;hpb=3066c30381e1d22ca77e79beedc0dbbcbfc6ee82 diff --git a/src/test/java/de/juplo/facebook/errors/GraphApiErrorHandlerTest.java b/src/test/java/de/juplo/facebook/errors/GraphApiErrorHandlerTest.java index 65149d5..185fd2b 100644 --- a/src/test/java/de/juplo/facebook/errors/GraphApiErrorHandlerTest.java +++ b/src/test/java/de/juplo/facebook/errors/GraphApiErrorHandlerTest.java @@ -88,6 +88,37 @@ public class GraphApiErrorHandlerTest } } + @Test + public void testError4() + { + log.info("testError4"); + + + requestFactory.setBody( + "{\n" + + " \"error\": {\n" + + " \"code\": 4, \n" + + " \"fbtrace_id\": \"HZRM6BTMu+D\", \n" + + " \"is_transient\": true, \n" + + " \"message\": \"(#4) Application request limit reached\", \n" + + " \"type\": \"OAuthException\"\n" + + " }\n" + + "}\n"); + + try + { + clientTemplate.getForObject("ANY", SOME.class); + fail("The expected exception was not thrown"); + } + catch(ApplicationRequestLimitReachedException e) + { + log.debug("{}", e.toString()); + assertEquals(new Integer(4), e.getCode()); + assertEquals("(#4) Application request limit reached", e.getMessage()); + assertEquals(Type.OAuthException, e.getType()); + } + } + @Test public void testError12() { @@ -244,7 +275,7 @@ public class GraphApiErrorHandlerTest clientTemplate.getForObject("ANY", SOME.class); fail("The expected exception was not thrown"); } - catch(RateLimitExceededException e) + catch(CustomRequestLimitReachedException e) { log.debug("{}", e.toString()); assertEquals(new Integer(613), e.getCode());