@@ -0,0 +1,1801 @@
+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.mockito.Mock;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0A%0Aimport static org.hamcrest.CoreMatchers.is;%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.mockito.Matchers.any;%0Aimport static org.mockito.Mockito.when;%0A/**%0A * @author Tony Wardell%0A * Date: 10/11/2016%0A * Time: 16:23%0A * Created with IntelliJ IDEA.%0A */%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class ReferenceDBXRefEntityValidationTest %7B%0A%0A    ReferenceDBXRefEntityValidation refValidator;%0A%0A    @Mock%0A    DBXRefEntityValidation mockValidator;%0A%0A    @Mock%0A    ConstraintValidatorContext mockContext;%0A%0A    @Before%0A    public void setup()%7B%0A        refValidator = new ReferenceDBXRefEntityValidation();%0A        refValidator.dbxRefEntityValidation = mockValidator;%0A        when(mockValidator.isValid(any(), any())).thenReturn(true);%0A    %7D%0A%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%0A    public void validationFailsIfArgumentListContainsNull()%7B%0A        assertThat(refValidator.isValid(new String%5B%5D%7Bnull%7D, mockContext), is(false));%0A    %7D%0A%0A%7D%0A

Test validation of references.