+ @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());
+ }
+ }
+