### Question:
CheckAggregateDefinitionValidator implements ConstraintValidator<CheckAggregateDefinition, ClientQueryAggregatedField>,
        ValidationErrorDescriptorBuilder { @Override public ErrorDescriptor build(ConstraintViolation violation) { return createDescriptorFrom(violation.getMessageTemplate(), violation.getPropertyPath().toString()); }  @Override void initialize(CheckAggregateDefinition constraintAnnotation); @Override boolean isValid(ClientQueryAggregatedField value, ConstraintValidatorContext context); @Override ErrorDescriptor build(ConstraintViolation violation);  }### Answer:
@Test public void build_success() { Path path = mock(Path.class); when(path.toString()).thenReturn("path1"); ConstraintViolation violation = mock(ConstraintViolation.class); when(violation.getPropertyPath()).thenReturn(path); when(violation.getMessageTemplate()).thenReturn(QUERY_AGGREGATE_DEFINITION_ERROR); ErrorDescriptor errorDescriptor = validator.build(violation); assertEquals(createDescriptorFrom(violation.getMessageTemplate(), violation.getPropertyPath().toString()), errorDescriptor); }