String header = response.getResponseHeaders().getFirst(Validation.VALIDATION_HEADER);
Assert.assertNotNull(header);
Assert.assertTrue(Boolean.valueOf(header));
String entity = response.getEntity(String.class);
System.out.println("entity: " + entity);
ResteasyViolationException e = new ResteasyViolationException(entity);
countViolations(e, 3, 1, 1, 1, 0, 0);
ResteasyConstraintViolation violation = e.getFieldViolations().iterator().next();
System.out.println("violation: " + violation);
Assert.assertEquals("size must be between 2 and 4", violation.getMessage());
Assert.assertEquals("a", violation.getValue());
violation = e.getPropertyViolations().iterator().next();
System.out.println("violation: " + violation);
Assert.assertEquals("size must be between 3 and 5", violation.getMessage());
Assert.assertEquals("z", violation.getValue());
violation = e.getClassViolations().iterator().next();
System.out.println("violation: " + violation);
Assert.assertEquals("Concatenation of s and t must have length > 5", violation.getMessage());
System.out.println("violation value: " + violation.getValue());
Assert.assertTrue(violation.getValue().startsWith("org.jboss.resteasy.validation.TestResourceWithAllViolationTypes@"));
}