package uk.ac.ebi.atlas.search.analyticsindex.baseline;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.springframework.web.client.RestTemplate;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

@RunWith(MockitoJUnitRunner.class)
public class BaselineAnalyticsSearchDaoTest {

    private static final String SOLR_BASE_URL = "http://TEST";
    private static final String JSON_FACET = "{}";

    @Mock
    private RestTemplate restTemplate;

    private final BaselineAnalyticsSearchDao subject = new BaselineAnalyticsSearchDao(restTemplate, SOLR_BASE_URL, JSON_FACET);

    @Test
    public void buildQueryParameters() {
        assertThat(subject.buildQueryParameters("identifierSearch:ENSG00000126549", 0.5, 0), is("query?q=identifierSearch:ENSG00000126549&rows=0&omitHeader=true&fq=expressionLevel:%5B0.5%20TO%20*%5D"));
    }

}
@@ -909,42 +909,173 @@
 &fq=
-expressionLevel:%255B0.5%2520TO%2520*%255D
+(experimentType:rnaseq_mrna_baseline%2520AND%2520expressionLevel:%255B0.5%2520TO%2520*%255D)%2520OR%2520(experimentType:proteomics_baseline%2520AND%2520expressionLevel:%255B0%2520TO%2520*%255D)
 %22));

Fix unit test after adding separate baseline/proteomics filtering