public void testPayload() {
Set<ConstraintViolation<Address>> violations;
Address address = new Address(null, null);
violations = validator.validate(address);
assertEquals(2, violations.size());
ConstraintViolation vio;
vio = TestUtils.getViolation(violations, "zipCode");
assertNotNull(vio);
assertEquals(1, vio.getConstraintDescriptor().getPayload().size());
assertTrue(
vio.getConstraintDescriptor().getPayload().contains(Severity.Info.class));
vio = TestUtils.getViolation(violations, "city");
assertNotNull(vio);
assertEquals(1, vio.getConstraintDescriptor().getPayload().size());
assertTrue(
vio.getConstraintDescriptor().getPayload().contains(Severity.Error.class));
}