- try
- {
- clientTemplate.getForObject(uri, String.class);
- fail("The parent handler should have raised an exception!");
- }
- catch(HttpClientErrorException e)
- {
- LOG.debug("Expexted error: {}", e.toString());
- }
- catch(Exception e)
- {
- LOG.debug("{}", e.toString());
- fail("Unexpected error: " + e);
- }
- }
-
- @Test
- public void testValidError()
- {
- server
- .enqueue(new MockResponse()
- .setResponseCode(HttpStatus.BAD_REQUEST.value())
- .setHeader("Content-Type", "application/json")
- .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" +
- "}"));
-
-
- Mono<String> result =