package uk.ac.ebi.quickgo.annotation.validation;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
/**
 * Configuration to allow integration testing of validation.
 *
 * @author Tony Wardell
 * Date: 22/11/2016
 * Time: 09:44
 * Created with IntelliJ IDEA.
 */
@Configuration
public class MockValidationConfig {

    public static final String DB_REF_VALIDATION_SUCCEEDS= "dbXrefValidationSucceeds";

    @Bean
    public DBXRefEntityValidation dBXRefEntityValidation(){
        DBXRefEntityValidation dbxRefEntityValidation = mock(DBXRefEntityValidation.class);
        when(dbxRefEntityValidation.isValid(any(String.class))).thenReturn(true);
        return dbxRefEntityValidation;
    }

    @Bean
    public ReferenceValuesValidation validator(){
        return new ReferenceValuesValidation();
    }
}

@@ -526,25 +526,10 @@
 ing 
+I
 D
-B_REF_VALIDATION
 _SUC
@@ -537,35 +537,72 @@
 EEDS
+ 
 = %22
-dbXrefValidationSucceeds
+PMID:123456%22;%0A    public static final String ID_FAILS = %22xxx
 %22;%0A%0A
@@ -763,16 +763,17 @@
 class);%0A
+%0A
         
@@ -812,25 +812,92 @@
 lid(
-any(String.class)
+ID_SUCCEEDS)).thenReturn(true);%0A        when(dbxRefEntityValidation.isValid(ID_FAILS
 )).t
@@ -898,35 +898,36 @@
 LS)).thenReturn(
-tru
+fals
 e);%0A        retu
@@ -1007,17 +1007,26 @@
 idation 
-v
+referenceV
 alidator
@@ -1082,11 +1082,132 @@
 );%0A    %7D
+%0A%0A    @Bean%0A    public WithFromValuesValidation withFromValidator()%7B%0A        return new WithFromValuesValidation();%0A    %7D
 %0A%7D%0A

Add @Bean for WithFromValuesValidation.