### Question:
ValidEnumValueOrProfileAttributeValidator implements
        ConstraintValidator<ValidEnumValueOrProfileAttribute, String>, ValidationErrorDescriptorBuilder { @Override public ErrorDescriptor build(ConstraintViolation violation) { return new ErrorDescriptor().setErrorCode(errorCode).setMessage(violation.getPropertyPath() + " should be one of " + enumNames.toString() + " or profile attribute placeholder but is [" + violation.getInvalidValue() + "]") .addProperties( new ClientProperty().setKey("propertyPath").setValue(violation.getPropertyPath().toString()), new ClientProperty().setKey("invalidValue").setValue(violation.getInvalidValue().toString()), new ClientProperty().setKey("allowedValues").setValue(enumNames.toString()) ); }  @Override void initialize(ValidEnumValueOrProfileAttribute constraintAnnotation); @Override boolean isValid(String value, ConstraintValidatorContext context); @Override ErrorDescriptor build(ConstraintViolation violation);  }### Answer:
@Test public void build_invalidValue_errorDescriptor() { ErrorDescriptor result = validEnumValueOrProfileAttributeValidator.build(constraintViolation); assertEquals(ERROR_DESCRIPTOR, result); }