Response response = request.get();
String answer = response.readEntity(String.class);
log.info("status: " + response.getStatus());
log.info("entity: " + answer);
assertEquals(400, response.getStatus());
ViolationReport r = new ViolationReport(answer);
countViolations(r, 1, 1, 1, 1, 0);
ResteasyConstraintViolation cv = r.getFieldViolations().iterator().next();
Assert.assertTrue(cv.getMessage().equals("must be greater than or equal to 3"));
cv = r.getPropertyViolations().iterator().next();
Assert.assertTrue(cv.getMessage().equals("must be greater than or equal to 5"));
cv = r.getClassViolations().iterator().next();
Assert.assertTrue(cv.getMessage().indexOf("org.jboss.resteasy.ejb.validation.SumConstraint") > 0);
cv = r.getParameterViolations().iterator().next();
Assert.assertTrue(cv.getMessage().equals("must be greater than or equal to 7"));
}