CustomFieldMetadataValidator implements FieldMetadataValidator<CustomFieldMetadata> { @Override public Collection<? extends DomainConfigurationProblem> validateFieldMetadata(CustomFieldMetadata fieldMetadata, Class<?> domainType, DomainConfigurationValidationContext validationContext) { if (fieldMetadata.getRenderer() == null) { return newArrayList(validationContext.rendererNotDefinedForFieldProblem(fieldMetadata.getName())); } return emptyList(); }  @Override Collection<? extends DomainConfigurationProblem> validateFieldMetadata(CustomFieldMetadata fieldMetadata, Class<?> domainType, DomainConfigurationValidationContext validationContext);  }
@Test public void customFieldWithoutRendererFailure() { assertFalse(testee.validateFieldMetadata(customFieldMetadata(NULL_RENDERER), DomainType.class, validationContext).isEmpty()); }
@Test public void validFieldWithRendererDefined() throws Exception { assertTrue(testee.validateFieldMetadata(customFieldMetadata(EasyMock.createMock(FieldValueRenderer.class)), DomainType.class, validationContext).isEmpty()); }