package uk.ac.ebi.quickgo.index.annotation.coterms;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
import org.springframework.core.io.Resource;

import static org.mockito.Mockito.mock;

/**
 * @author Tony Wardell
 * Date: 07/02/2017
 * Time: 11:00
 * Created with IntelliJ IDEA.
 */
@RunWith(MockitoJUnitRunner.class)
public class CoTermConfigTest {

    Resource manualPath;
    Resource allPath;

    @Before
    public void setup(){
        manualPath = mock(Resource.class);
        allPath = mock(Resource.class);
    }

    @Test(expected = NullPointerException.class)
    public void manualAndAllOutputPathsWhenDifferentWillNotCauseAIllegalStateException(){
        CoTermsConfig coTermsConfig = new CoTermsConfig();
        coTermsConfig.manualCoTermsPath = manualPath;
        coTermsConfig.allCoTermsPath = allPath;
        coTermsConfig.coTermAllSummarizationStep();
        coTermsConfig.coTermManualSummarizationStep();
    }

    @Test(expected = IllegalStateException.class)
    public void cannotHaveBothManualAndAllOutputPathsTheSameForCoTermsWhenCallingCoTermAllSummarizationStep(){
        CoTermsConfig coTermsConfig = new CoTermsConfig();
        coTermsConfig.manualCoTermsPath = manualPath;
        coTermsConfig.allCoTermsPath = manualPath;
        coTermsConfig.coTermAllSummarizationStep();
    }

    @Test(expected = IllegalStateException.class)
    public void cannotHaveBothManualAndAllOutputPathsTheSameForCoTermsCoTermManualSummarizationStep(){
        CoTermsConfig coTermsConfig = new CoTermsConfig();
        coTermsConfig.manualCoTermsPath = manualPath;
        coTermsConfig.allCoTermsPath = manualPath;
        coTermsConfig.coTermManualSummarizationStep();
    }

}

@@ -359,16 +359,18 @@
 EA.%0A */%0A
+//
 @RunWith
@@ -437,139 +437,45 @@
     
-Resource manualPath;%0A    Resource allPath;%0A%0A    @Before%0A    public void setup()%7B%0A        manualPath = mock(Resource.class)
+String manualPath = %22foo%22
 ;%0A    
- 
-  
+String
  all
@@ -485,35 +485,14 @@
 h = 
-mock(Resource.class);%0A    %7D
+%22bar%22;
 %0A%0A  

Make the @value for output paths Strings.