ConfigurationTrader { public BaselineExperimentConfiguration getBaselineFactorsConfiguration(String experimentAccession) { return new BaselineExperimentConfiguration( dataFileHub.getBaselineExperimentFiles(experimentAccession).factors.get()); } @Inject  ConfigurationTrader(DataFileHub dataFileHub); BaselineExperimentConfiguration getBaselineFactorsConfiguration(String experimentAccession); ExperimentConfiguration getExperimentConfiguration(String experimentAccession); MicroarrayExperimentConfiguration getMicroarrayExperimentConfiguration(String experimentAccession);  }
@Test public void testGetBaselineFactorsConfiguration() { mockDataFileHub.addFactorsFile(experimentAccession, Lists.newArrayList( "<factors-definition>\n" + " <defaultFilterFactors />\n" + " <defaultQueryFactorType>CELL_TYPE</defaultQueryFactorType>\n" + " <menuFilterFactorTypes />\n" + " <landingPageDisplayName>Cell Types - " + "BLUEPRINT rare hematopoietic cells</landingPageDisplayName>\n" + " <speciesMapping />\n" + " <orderFactor>curated</orderFactor>\n" + " <dataProviderURL>http: " <dataProviderDescription>The BLUEPRINT Epigenome project</dataProviderDescription>\n" + " <fortLauderdale>true</fortLauderdale>\n" + " <alternativeView>E-MTAB-3819</alternativeView>\n" + "</factors-definition>")); BaselineExperimentConfiguration result = subject.getBaselineFactorsConfiguration(experimentAccession); assertThat(result.getDataProviderURL().get(0), Matchers.containsString("blueprint-epigenome.eu")); assertThat(result.disclaimer().equals("fortLauderdale"), is(true)); assertThat(result.getDefaultFilterFactors(), Matchers.empty()); assertThat(result.getDataProviderDescription().get(0), Matchers.containsString("BLUEPRINT")); assertThat(result.getExperimentDisplayName(), Matchers.containsString("BLUEPRINT rare")); assertThat(result.getSpeciesMapping().entrySet(), Matchers.empty()); assertThat(result.orderCurated(), is(true)); assertThat(result.getAlternativeViews(), Matchers.hasSize(1)); }
@Test public void dataProviderUrlAndDescriptionCanBeCommaSeparated() { mockDataFileHub.addFactorsFile(experimentAccession, Lists.newArrayList( "<factors-definition>\n" + " <defaultFilterFactors>\n" + " <filterFactor>\n" + " <type>DEVELOPMENTAL_STAGE</type>\n" + " <value>adult</value>\n" + " </filterFactor>\n" + " </defaultFilterFactors>\n" + " <defaultQueryFactorType>ORGANISM_PART</defaultQueryFactorType>\n" + " <menuFilterFactorTypes>DEVELOPMENTAL_STAGE, ORGANISM_PART</menuFilterFactorTypes>\n" + " <landingPageDisplayName>Proteomics - Tissues - Human Proteome Map</landingPageDisplayName>\n" + " <dataProviderURL>http: "http: " <dataProviderDescription>A draft map of the human proteome, " + "PRIDE Archive</dataProviderDescription>\n" + " <speciesMapping/>\n" + "</factors-definition>")); BaselineExperimentConfiguration result = subject.getBaselineFactorsConfiguration(experimentAccession); assertThat(result.getDataProviderURL().size(), is(2)); assertThat(result.getDataProviderDescription().size(), is(2)); }