DifferentialExperimentFactory implements ExperimentFactory<DifferentialExperiment> { @Override public DifferentialExperiment create(ExperimentDTO experimentDTO, ExperimentDesign experimentDesign, IdfParserOutput idfParserOutput) { String experimentAccession = experimentDTO.getExperimentAccession(); final ExperimentConfiguration experimentConfiguration = configurationTrader.getExperimentConfiguration(experimentAccession); return new DifferentialExperiment( experimentAccession, experimentDTO.getLastUpdate(), experimentConfiguration.getContrastAndAnnotationPairs(), idfParserOutput.getTitle(), speciesFactory.create(experimentDTO.getSpecies()), experimentDTO.getPubmedIds(), experimentDTO.getDois(), experimentDesign); } DifferentialExperimentFactory(ConfigurationTrader configurationTrader, SpeciesFactory speciesFactory); @Override DifferentialExperiment create(ExperimentDTO experimentDTO,
                                         ExperimentDesign experimentDesign,
                                         IdfParserOutput idfParserOutput);  }
@Test void idfTitleOverridesDatabaseTitle() { String experimentAccession = RandomDataTestUtils.generateRandomExperimentAccession(); when(configurationTraderMock.getExperimentConfiguration(experimentAccession)) .thenReturn(configurationMock); when(configurationTraderMock.getBaselineFactorsConfiguration(experimentAccession)) .thenReturn(baselineConfigurationMock); when(experimentDtoMock.getExperimentAccession()).thenReturn(experimentAccession); when(idfParserOutputMock.getTitle()).thenReturn("IDF " + experimentAccession); when(baselineConfigurationMock.getExperimentDisplayName()).thenReturn("DTO " + experimentAccession); assertThat(subject.create(experimentDtoMock, new ExperimentDesign(), idfParserOutputMock)) .hasFieldOrPropertyWithValue("description", "IDF " + experimentAccession); }