From 21fa4f6d3219587879e1404a0473aeaf223cdce7 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Thu, 21 Nov 2019 22:26:21 +0100 Subject: [PATCH] WIP: Clearified intend... --- ...orResponseErrorHandlerIntegrationTest.java | 36 +++++-------------- 1 file changed, 8 insertions(+), 28 deletions(-) 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); } } } -- 2.20.1