From: Kai Moritz Date: Thu, 21 Nov 2019 21:26:21 +0000 (+0100) Subject: WIP: Clearified intend... X-Git-Tag: wip-webclient~3 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=21fa4f6d3219587879e1404a0473aeaf223cdce7;p=facebook-errors WIP: Clearified intend... --- diff --git a/src/test/java/de/juplo/facebook/errors/GraphApiErrorResponseErrorHandlerIntegrationTest.java b/src/test/java/de/juplo/facebook/errors/GraphApiErrorResponseErrorHandlerIntegrationTest.java index 28b6f4f..752a13f 100644 --- a/src/test/java/de/juplo/facebook/errors/GraphApiErrorResponseErrorHandlerIntegrationTest.java +++ b/src/test/java/de/juplo/facebook/errors/GraphApiErrorResponseErrorHandlerIntegrationTest.java @@ -105,28 +105,6 @@ public class GraphApiErrorResponseErrorHandlerIntegrationTest } - server - .enqueue(new MockResponse() - .setResponseCode(HttpStatus.BAD_REQUEST.value()) - .setHeader("Content-Type", "text/plain") - .setBody("Hallo Welt!")); - - 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); - } - - server .enqueue(new MockResponse() .setResponseCode(HttpStatus.INTERNAL_SERVER_ERROR.value()) @@ -237,15 +215,16 @@ public class GraphApiErrorResponseErrorHandlerIntegrationTest try { clientTemplate.getForObject(uri, String.class); - fail("The expected exception was not thrown"); + fail("The parent handler should have raised an exception!"); } catch(HttpClientErrorException e) { - LOG.debug("{}", e.toString()); + LOG.debug("Expexted error: {}", e.toString()); } catch(Exception e) { - fail("A wrong exception was thrown: " + e.toString()); + LOG.debug("{}", e.toString()); + fail("Unexpected error: " + e); } @@ -258,15 +237,16 @@ public class GraphApiErrorResponseErrorHandlerIntegrationTest try { clientTemplate.getForObject(uri, String.class); - fail("The expected exception was not thrown"); + fail("The parent handler should have raised an exception!"); } catch(HttpClientErrorException e) { - LOG.debug("{}", e.toString()); + LOG.debug("Expexted error: {}", e.toString()); } catch(Exception e) { - fail("A wrong exception was thrown: " + e.toString()); + LOG.debug("{}", e.toString()); + fail("Unexpected error: " + e); } } }