### Question:
CheckExpressionTypeValidator implements ConstraintValidator<CheckExpressionType, ClientExpressionContainer>, ValidationErrorDescriptorBuilder { @Override public ErrorDescriptor build(ConstraintViolation violation) { String type = ((ClientExpressionContainer) violation.getInvalidValue()).getObject().getClass().getSimpleName(); return createDescriptorFrom(violation.getMessageTemplate(), type); }  @Override void initialize(CheckExpressionType constraintAnnotation); @Override boolean isValid(ClientExpressionContainer value, ConstraintValidatorContext context); @Override ErrorDescriptor build(ConstraintViolation violation);  }### Answer:
@Test public void build_violation_success() { ConstraintViolation violation = mock(ConstraintViolation.class); when(violation.getInvalidValue()).thenReturn(new ClientExpressionContainer().setObject(new ClientNumber())); when(violation.getMessageTemplate()).thenReturn(QUERY_WHERE_EXPRESSION_TYPE_NOT_SUPPORTED.toString()); ErrorDescriptor errorDescriptor = checkExpressionTypeValidator.build(violation); assertEquals(QUERY_WHERE_EXPRESSION_TYPE_NOT_SUPPORTED.createDescriptor("ClientNumber"), errorDescriptor); }