- 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);
- }
-
-