response = request1.get();
log.info("status: " + response.getStatus());
String answer = response.getEntity(String.class);
log.info("entity: " + answer);
assertEquals(400, response.getStatus());
ResteasyViolationException e = new ResteasyViolationException(String.class.cast(answer));
System.out.println(e.toString());
countViolations(e, 4, 1, 1, 1, 1, 0);
ResteasyConstraintViolation cv = e.getFieldViolations().iterator().next();
Assert.assertTrue(cv.getMessage().equals("must be greater than or equal to 3"));
cv = e.getPropertyViolations().iterator().next();
Assert.assertTrue(cv.getMessage().equals("must be greater than or equal to 5"));
cv = e.getClassViolations().iterator().next();
Assert.assertTrue(cv.getMessage().indexOf("org.jboss.resteasy.resteasy1058.SumConstraint") > 0);
cv = e.getParameterViolations().iterator().next();
Assert.assertTrue(cv.getMessage().equals("must be greater than or equal to 7"));
response.close();
response = request2.get();
log.info("status: " + response.getStatus());
answer = response.getEntity(String.class);
log.info("entity: " + answer);
assertEquals(400, response.getStatus());
e = new ResteasyViolationException(String.class.cast(answer));
System.out.println(e.toString());
countViolations(e, 4, 1, 1, 1, 1, 0);
cv = e.getFieldViolations().iterator().next();
Assert.assertTrue(cv.getMessage().equals("must be greater than or equal to 3"));
cv = e.getPropertyViolations().iterator().next();
Assert.assertTrue(cv.getMessage().equals("must be greater than or equal to 5"));
cv = e.getClassViolations().iterator().next();
Assert.assertTrue(cv.getMessage().indexOf("org.jboss.resteasy.resteasy1058.SumConstraint") > 0);
cv = e.getParameterViolations().iterator().next();
Assert.assertTrue(cv.getMessage().equals("must be greater than or equal to 7"));
response.close();
}
}