X-Git-Url: https://juplo.de/gitweb/?p=facebook-errors;a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fde%2Fjuplo%2Ffacebook%2Ferrors%2FGraphApiErrorHandlerTest.java;fp=src%2Ftest%2Fjava%2Fde%2Fjuplo%2Ffacebook%2Ferrors%2FGraphApiErrorHandlerTest.java;h=c1719560dea9d31f65a94208d2d806e8c2b57cb2;hp=c9a53cd232fac8588a2f644deadd5722273f7c10;hb=e3b130e04e4e89a08e203185ba9ae7e6c1f350d8;hpb=0f38e3b679211b322d69fb96c717f92eca037c36 diff --git a/src/test/java/de/juplo/facebook/errors/GraphApiErrorHandlerTest.java b/src/test/java/de/juplo/facebook/errors/GraphApiErrorHandlerTest.java index c9a53cd..c171956 100644 --- a/src/test/java/de/juplo/facebook/errors/GraphApiErrorHandlerTest.java +++ b/src/test/java/de/juplo/facebook/errors/GraphApiErrorHandlerTest.java @@ -276,6 +276,34 @@ public class GraphApiErrorHandlerTest } } + @Test + public void testError200() + { + log.info("testError200"); + + requestFactory.setBody("{\n" + + " \"error\": {\n" + + " \"message\": \"(#200) The user hasn't authorized the application to perform this action\",\n" + + " \"type\": \"OAuthException\",\n" + + " \"code\": 200\n" + + " }\n" + + "}"); + + try + { + clientTemplate.getForObject("ANY", SOME.class); + fail("The expected exception was not thrown"); + } + catch(ApplicationNotAuthorizedByUserException e) + { + log.debug("{}", e.toString()); + assertEquals(new Integer(200), e.getCode()); + assertEquals("(#200) The user hasn't authorized the application to perform this action", e.getMessage()); + assertEquals(Type.OAuthException, e.getType()); + assertNull(e.getTraceId()); + } + } + @Test public void testError613() {