GeneSearchService { public Map<String, Map<String, List<String>>> getFacets(List<String> cellIds) { return geneSearchDao.getFacets( cellIds, CHARACTERISTIC_INFERRED_CELL_TYPE, CHARACTERISTIC_ORGANISM_PART, CHARACTERISTIC_SPECIES); } GeneSearchService(GeneSearchDao geneSearchDao, TsnePlotSettingsService tsnePlotSettingsService); Map<String, Map<String, List<String>>> getCellIdsInExperiments(String... geneIds); Map<String, Map<String, List<String>>> getFacets(List<String> cellIds); Map<String, Map<String, Map<Integer, List<Integer>>>> getMarkerGeneProfile(String... geneIds);  }
@Test void returnsFacets() { String experimentAccession1 = generateRandomExperimentAccession(); String experimentAccession2 = generateRandomExperimentAccession(); when(geneSearchDaoMock.getFacets(anyList(), any(SingleCellAnalyticsSchemaField.class))) .thenReturn(ImmutableMap.of( experimentAccession1, ImmutableMap.of( "inferred_cell_type", Arrays.asList("neuron", "stem cell"), "species", Collections.singletonList("homo sapiens")), experimentAccession2, ImmutableMap.of( "inferred_cell_type", Arrays.asList("immune cell", "liver cell", "stem cell"), "organism_part", Collections.singletonList("liver"), "species", Arrays.asList("homo sapiens", "mus musculus")) )); Map<String, Map<String, List<String>>> result = subject.getFacets(Arrays.asList("cell_id_1", "cell_id_2")); assertThat(result) .isNotEmpty() .containsOnlyKeys(experimentAccession1, experimentAccession2); assertThat(result.get(experimentAccession1)).containsKeys("species"); assertThat(result.get(experimentAccession2)).containsKeys("species"); }