@@ -0,0 +1,3341 @@
+package uk.ac.ebi.atlas.search.baseline;%0A%0Aimport com.google.common.collect.ImmutableList;%0Aimport com.google.common.collect.ImmutableMap;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Mock;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0Aimport uk.ac.ebi.atlas.model.AssayGroup;%0Aimport uk.ac.ebi.atlas.model.FactorAcrossExperiments;%0Aimport uk.ac.ebi.atlas.model.experiment.ExperimentDesign;%0Aimport uk.ac.ebi.atlas.model.experiment.ExperimentDisplayDefaults;%0Aimport uk.ac.ebi.atlas.model.experiment.baseline.BaselineExperiment;%0Aimport uk.ac.ebi.atlas.model.experiment.baseline.BaselineExperimentTest;%0Aimport uk.ac.ebi.atlas.model.experiment.baseline.Factor;%0Aimport uk.ac.ebi.atlas.trader.ExperimentTrader;%0A%0Aimport java.util.Collection;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0Aimport static org.hamcrest.Matchers.is;%0Aimport static org.junit.Assert.assertThat;%0Aimport static org.mockito.Mockito.when;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class BaselineExperimentSearchResultProducerTest %7B%0A%0A    @Mock%0A    ExperimentTrader experimentTrader;%0A%0A    BaselineExperimentSearchResultProducer subject;%0A%0A    BaselineExperiment singleFactorExperiment;%0A    String factorHeader = %22type1%22;%0A    String factorType = Factor.normalize(factorHeader);%0A%0A    @Before%0A    public void setUp()%7B%0A        subject = new BaselineExperimentSearchResultProducer(experimentTrader);%0A%0A        List%3CAssayGroup%3E singleFactorExperimentAssayGroups = ImmutableList.of(new AssayGroup(%22g1%22, %22run11%22), new AssayGroup(%22g2%22, %22run21%22), new AssayGroup(%22g3%22, %22run31%22));%0A        ExperimentDesign singleFactorExperimentExperimentDesign = new ExperimentDesign();%0A        singleFactorExperimentExperimentDesign.putFactor(%22run11%22, factorHeader, %22value1%22);%0A        singleFactorExperimentExperimentDesign.putFactor(%22run21%22, factorHeader, %22value2%22);%0A        singleFactorExperimentExperimentDesign.putFactor(%22run31%22, factorHeader, %22value3%22);%0A%0A        singleFactorExperiment = BaselineExperimentTest.mockExperiment(singleFactorExperimentExperimentDesign, singleFactorExperimentAssayGroups, ExperimentDisplayDefaults.create(), %22singleFactorExperiment%22);%0A        when(experimentTrader.getPublicExperiment(%22singleFactorExperiment%22)).thenReturn(singleFactorExperiment);%0A    %7D%0A%0A    @Test%0A    public void threeDataPointsGiveThreeConditions()%7B%0A        Map%3CString, Map%3CString, Double%3E%3E dataInSolr = ImmutableMap.of(singleFactorExperiment.getAccession(), (Map%3CString, Double%3E)%0A                ImmutableMap.of(%22g1%22, 1.0, %22g2%22, 2.0, %22g3%22, 3.0));%0A        Collection%3CBaselineExperimentProfile%3E result = subject.profilesForExpressions(dataInSolr, factorType);%0A        assertThat(result.size(), is(1));%0A        assertThat(result.iterator().next().getSpecificity(), is(3));%0A    %7D%0A%0A    @Test%0A    public void twoDataPointsGiveThreeConditionsButLastOneIsEmpty()%7B%0A        Map%3CString, Map%3CString, Double%3E%3E dataInSolr = ImmutableMap.of(singleFactorExperiment.getAccession(), (Map%3CString, Double%3E)%0A                ImmutableMap.of(%22g1%22, 1.0, %22g2%22, 2.0));%0A        Collection%3CBaselineExperimentProfile%3E result = subject.profilesForExpressions(dataInSolr, factorType);%0A        assertThat(result.size(), is(1));%0A        assertThat(result.iterator().next().getSpecificity(), is(2));%0A        assertThat(result.iterator().next().getConditions().size(), is(3));%0A%0A    %7D%0A%7D

Test - the missing results from Solr get padded out with below cutoffs