### Question:
CheckInMemoryDataSourceTypeValidator implements ConstraintValidator<CheckInMemoryDataSourceType, ClientReferenceable>,
        ValidationErrorDescriptorBuilder { @Override public ErrorDescriptor build(ConstraintViolation violation) { String dataSourceName = getClientResourceName(violation.getInvalidValue().getClass()); return QUERY_IN_MEMORY_DATASOURCE_TYPE_NOT_SUPPORTED.createDescriptor(violation.getPropertyPath().toString(), dataSourceName); }  @Override void initialize(CheckInMemoryDataSourceType constraintAnnotation); @Override boolean isValid(ClientReferenceable value, ConstraintValidatorContext context); @Override ErrorDescriptor build(ConstraintViolation violation);  }### Answer:
@Test public void build_nonSupportedDatasource_correctErrorCode() { ConstraintViolation violation = mock(ConstraintViolation.class); Path propertyPath = mock(Path.class); when(violation.getInvalidValue()).thenReturn(new ClientSemanticLayerDataSource()); when(violation.getPropertyPath()).thenReturn(propertyPath); String propertyPathStr = "datasource"; when(propertyPath.toString()).thenReturn(propertyPathStr); ErrorDescriptor errorDescriptor = checkInMemoryDataSourceTypeValidator.build(violation); assertEquals(QUERY_IN_MEMORY_DATASOURCE_TYPE_NOT_SUPPORTED. createDescriptor(propertyPathStr, SEMANTIC_LAYER_DATA_SOURCE_CLIENT_TYPE), errorDescriptor); }