}
}
+ @Test
+ public void testError613()
+ {
+ log.info("testError613");
+
+
+ requestFactory.setBody(
+ "{\n" +
+ " \"error\":\n" +
+ " {\n" +
+ " \"message\": \"(#613) Calls to stream have exceeded the rate of 600 calls per 600 seconds.\",\n" +
+ " \"type\": \"OAuthException\",\n" +
+ " \"code\": 613\n" +
+ " }\n" +
+ "}");
+
+ try
+ {
+ clientTemplate.getForObject("ANY", SOME.class);
+ fail("The expected exception was not thrown");
+ }
+ catch(RateExceededException e)
+ {
+ log.debug("{}", e.toString());
+ assertEquals("invalid_request", e.getOAuth2ErrorCode());
+ assertEquals(613, e.getCode());
+ assertEquals("(#613) Calls to stream have exceeded the rate of 600 calls per 600 seconds.", e.getMessage());
+ assertEquals("OAuthException", e.getType());
+ }
+ }
+
@Test
public void testUnmappedError()
{