TsnePlotSettingsService { List<Integer> getAvailablePerplexities(String experimentAccession) { return tSnePlotDao.fetchPerplexities(experimentAccession); } TsnePlotSettingsService(DataFileHub dataFileHub,
                                   IdfParser idfParser,
                                   TSnePlotDao tSnePlotDao,
                                   MarkerGenesDao markerGenesDao); Optional<Integer> getExpectedClusters(String experimentAccession);  }
@Test @DisplayName("Valid perplexities in database") void validPerplexities() { List<Integer> expectedPerplexities = Arrays.asList(1, 5, 25, 20, 10, 5); when(tSnePlotDaoMock.fetchPerplexities(EXPERIMENT_ACCESSION)).thenReturn(expectedPerplexities); assertThat(subject.getAvailablePerplexities(EXPERIMENT_ACCESSION)) .hasSameSizeAs(expectedPerplexities) .containsExactlyElementsOf(expectedPerplexities); }
@Test @DisplayName("No perplexities in database") void noPerplexities() { when(tSnePlotDaoMock.fetchPerplexities(EXPERIMENT_ACCESSION)).thenReturn(Collections.emptyList()); assertThat(subject.getAvailablePerplexities(EXPERIMENT_ACCESSION)).isEmpty(); }