package uk.ac.ebi.quickgo.annotation.service.converter;

import uk.ac.ebi.quickgo.annotation.common.document.AnnotationDocument;
import uk.ac.ebi.quickgo.annotation.model.Annotation;

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.mockito.Mockito.when;

/**
 * @author Tony Wardell
 * Date: 29/04/2016
 * Time: 17:39
 * Created with IntelliJ IDEA.
 */
@RunWith(MockitoJUnitRunner.class)
public class AnnotationDocConverterImplTest {

    private static final String UNI_PROT = "UniProt";
    @Mock
    private AnnotationDocument annotationDocument;

    @Before
    public void setup(){
        when(annotationDocument.assignedBy).thenReturn(UNI_PROT);
    }

    @Test
    @Ignore //Doesn't use methods.
    public void convertSuccessfully(){
        AnnotationDocConverter docConverter = new AnnotationDocConverterImpl();
        Annotation model = docConverter.convert(annotationDocument);
        assertThat(model.assignedBy, equalTo(UNI_PROT));
    }
}

@@ -46,24 +46,97 @@
 converter;%0A%0A
+import uk.ac.ebi.quickgo.annotation.common.document.AnnotationDocMocker;%0A
 import uk.ac
@@ -760,274 +760,13 @@
     
-private static final String UNI_PROT = %22UniProt%22;%0A    @Mock%0A    private AnnotationDocument annotationDocument;%0A%0A    @Before%0A    public void setup()%7B%0A        when(annotationDocument.assignedBy).thenReturn(UNI_PROT);%0A    %7D%0A%0A    @Test%0A    @Ignore //Doesn't use methods.
+@Test
 %0A   
@@ -929,17 +929,19 @@
 convert(
-a
+  A
 nnotatio
@@ -944,21 +944,52 @@
 ationDoc
-ument
+Mocker.createAnnotationDoc(%22A0A000%22)
 );%0A     
@@ -1032,16 +1032,18 @@
 lTo(
-UNI_PROT
+%22InterPro%22
 ));%0A

Replace mock with use of AnnotationDocMocker.