package uk.ac.ebi.atlas.dao;

import uk.ac.ebi.atlas.experiments.NumberOfExperiments;
import org.hamcrest.Matchers;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import javax.inject.Inject;
import java.util.List;

import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasItem;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({"/applicationContext.xml", "/solrContext.xml", "/embeddedSolrServerContext.xml", "/oracleContext.xml"})
public class OrganismDAOIT {

    @Inject
    private OrganismDAO subject;

    @Test
    public void testGetOrganisms() throws Exception {
        List<String> organisms = subject.getOrganisms();
        assertThat(organisms, hasItem("Mus musculus"));
    }

    // check for 2 word species because differential search requires bioentity species (ie: species with 2 words only)
    @Test
    public void containsOryzaSativaShortened() throws Exception {
        List<String> organisms = subject.getOrganisms();
        assertThat(organisms, hasItem("Oryza sativa"));
    }

    @Test
    public void doesNotContainLongSpeciesNames() throws Exception {
        List<String> organisms = subject.getOrganisms();
        assertThat(organisms, not(hasItem("Oryza sativa Japonica Group")));
    }

    @Test
    public void testGetOrganismsSize() throws Exception {
        List<String> organisms = subject.getOrganisms();
        assertThat(organisms.size(), Matchers.is(NumberOfExperiments.DISTINCT_ORGANISMS));
    }

}
@@ -27,64 +27,8 @@
 o;%0A%0A
-import uk.ac.ebi.atlas.experiments.NumberOfExperiments;%0A
 impo
@@ -1575,49 +1575,22 @@
 ers.
-is(NumberOfExperiments.DISTINCT_ORGANISMS
+greaterThan(10
 ));%0A

Fix setup of a not-very-useful test