protected void validationMessage(Runnable task, String expectedMessage) throws IOException { try { task.run(); fail("The call should have failed with a validation exception."); } catch (ClientValidationException ex) { JsonNode error = mapper.readTree(ex.getMessage()); assertEquals( expectedMessage, error.path("message").asText() ); } }
return supplier.get(); } else if (statusCode == HttpStatus.SC_BAD_REQUEST) { throw new ClientValidationException(getMessage(response)); } else if (statusCode == HttpStatus.SC_UNAUTHORIZED) { throw new ClientCannotLoginException(request);
return supplier.get(); } else if (statusCode == HttpStatus.SC_BAD_REQUEST) { throw new ClientValidationException(getMessage(response)); } else if (statusCode == HttpStatus.SC_UNAUTHORIZED) { throw new ClientCannotLoginException(request);