ExperimentPageService { URI experimentDownloadLink(Experiment experiment, String accessKey, ExperimentPageRequestPreferences requestPreferences) { return callbackLinkWithRequestPreferences( ExperimentDownloadController.DOWNLOAD_URL_TEMPLATE .replace("{experimentAccession}", experiment.getAccession()) .replace("{experimentType}", experiment.getType().getParent().name().toUpperCase()), experiment.getType(), accessKey, requestPreferences); }  static Optional<String> getTheOnlyId(List<? extends Profile> profiles);  }
@Test public void unitsMatterForExperimentDownloadLink() { RnaSeqBaselineRequestPreferences rnaSeqBaselineRequestPreferences = new RnaSeqBaselineRequestPreferences(); rnaSeqBaselineRequestPreferences.setUnit(ExpressionUnit.Absolute.Rna.TPM); assertThat( new ExperimentPageService() .experimentDownloadLink(experiment, "", rnaSeqBaselineRequestPreferences).toString(), containsString("unit=TPM")); rnaSeqBaselineRequestPreferences.setUnit(ExpressionUnit.Absolute.Rna.FPKM); assertThat( new ExperimentPageService() .experimentDownloadLink(experiment, "", rnaSeqBaselineRequestPreferences).toString(), containsString("unit=FPKM")); }
@Test public void selectedIdsMatterForExperimentDownloadLink() { preferences.setSelectedColumnIds(ImmutableSet.of()); String url1 = new ExperimentPageService().experimentDownloadLink(experiment, "", preferences).toString(); preferences.setSelectedColumnIds(ImmutableSet.of("g1")); String url2 = new ExperimentPageService().experimentDownloadLink(experiment, "", preferences).toString(); preferences.setSelectedColumnIds(ImmutableSet.of("g1", "g2")); String url3 = new ExperimentPageService().experimentDownloadLink(experiment, "", preferences).toString(); assertThat(url1, is(not(equalTo(url2)))); assertThat(url1, is(not(equalTo(url3)))); assertThat(url2, is(not(equalTo(url3)))); }