package dk.statsbiblioteket.medieplatform.newspaper.editionRecords;

import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import dk.statsbiblioteket.medieplatform.autonomous.ConfigConstants;
import dk.statsbiblioteket.medieplatform.autonomous.DomsItemFactory;
import dk.statsbiblioteket.medieplatform.autonomous.Item;
import dk.statsbiblioteket.medieplatform.autonomous.SolrJConnector;

import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.List;
import java.util.Properties;

import static org.testng.Assert.*;

public class NewspaperIndexIT {

    private String summaLocation;

    @BeforeClass
    public void setUp() throws Exception {
        Properties props = new Properties();
        try {
            props.load(new FileReader(new File(System.getProperty("integration.test.newspaper.properties"))));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        summaLocation = props.getProperty(ConfigConstants.AUTONOMOUS_SBOI_URL);

    }

    @Test(groups = "externalTest")
    public void testGetNewspapers() throws Exception {
        NewspaperIndex newspaperIndex = new NewspaperIndex(new SolrJConnector(summaLocation).getSolrServer(), new DomsItemFactory());
        List<Item> newspapers = newspaperIndex.getNewspapers("berlingsketidende", "1970-01-01");
        assertTrue(newspapers.size() == 1);
    }
}
@@ -430,63 +430,19 @@
 File
-;%0Aimport java.io.FileReader;%0Aimport java.io.IOException
+InputStream
 ;%0Aim
@@ -612,16 +612,34 @@
 oreClass
+(alwaysRun = true)
 %0A    pub
@@ -686,106 +686,34 @@
     
-Properties props = new Properties();%0A        try %7B%0A            props.load(new FileReader(new File(
+String pathToProperties = 
 Syst
@@ -767,19 +767,16 @@
 erties%22)
-)))
 ;%0A      
@@ -781,86 +781,105 @@
     
-%7D catch (IOException e) %7B%0A            throw new RuntimeException(e);%0A        %7D
+Properties props = new Properties();%0A%0A%0A        props.load(new FileInputStream(pathToProperties));
 %0A   

Fix integration test to run the BeforeClass method for all groups