@@ -0,0 +1,2033 @@
+package uk.ac.ebi.quickgo.annotation.validation;%0A%0Aimport javax.validation.ConstraintValidatorContext;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.boot.test.SpringApplicationContextLoader;%0Aimport org.springframework.test.context.ActiveProfiles;%0Aimport org.springframework.test.context.ContextConfiguration;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0A%0Aimport static org.hamcrest.CoreMatchers.is;%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.mockito.Mockito.mock;%0A%0A/**%0A * @author Tony Wardell%0A * Date: 22/11/2016%0A * Time: 09:38%0A * Created with IntelliJ IDEA.%0A */%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@ContextConfiguration(classes = MockValidationConfig.class, loader = SpringApplicationContextLoader.class)%0A@ActiveProfiles(profiles = MockValidationConfig.DB_REF_VALIDATION_SUCCEEDS)%0Apublic class ReferenceValuesValidationIT %7B%0A%0A    @Autowired%0A    ReferenceValuesValidation refValidator;%0A    private ConstraintValidatorContext mockContext;%0A%0A    @Before%0A    public void setup()%7B%0A        mockContext = mock(ConstraintValidatorContext.class);%0A    %7D%0A%0A    @Test%0A    public void validationSucceedsIfKnownDb()%7B%0A        assertThat(refValidator.isValid(new String%5B%5D%7B%22PMID:123456%22%7D, mockContext), is(true));%0A    %7D%0A%0A    @Test%0A    public void validationSucceedsIfDbNotSpecified()%7B%0A        assertThat(refValidator.isValid(new String%5B%5D%7B%22123456%22%7D, mockContext), is(true));%0A    %7D%0A%0A    @Test%0A    public void validationSucceedsIfArgumentListIsNull()%7B%0A        assertThat(refValidator.isValid(null, mockContext), is(true));%0A    %7D%0A%0A    @Test%0A    public void validationFailsIfUnknownDb()%7B%0A        assertThat(refValidator.isValid(new String%5B%5D%7B%22XXXX:123456%22%7D, mockContext), is(false));%0A    %7D%0A%0A    @Test(expected = IllegalArgumentException.class)%0A    public void validationFailsIfArgumentListContainsNull()%7B%0A       refValidator.isValid(new String%5B%5D%7Bnull%7D, mockContext);%0A    %7D%0A%7D%0A

Test for validation of Reference values for annotation filtering.