@Test public void testEmptySearchFiltersAfterConvertWithConfigurationWithNullSearchFilters() throws Exception { populateDiscoveryConfigurationWithEmptyList(); when(discoveryConfiguration.getSearchFilters()).thenReturn(null); searchConfigurationRest = discoverConfigurationConverter.convert(discoveryConfiguration, Projection.DEFAULT); assertEquals(0, searchConfigurationRest.getFilters().size()); }
@Override public SearchConfigurationRest convert(DiscoveryConfiguration configuration, Projection projection) { SearchConfigurationRest searchConfigurationRest = new SearchConfigurationRest(); searchConfigurationRest.setProjection(projection); if (configuration != null) { addSearchFilters(searchConfigurationRest, configuration.getSearchFilters(), configuration.getSidebarFacets()); addSortOptions(searchConfigurationRest, configuration.getSearchSortConfiguration()); setDefaultSortOption(configuration, searchConfigurationRest); } return searchConfigurationRest; }
DiscoverConfigurationConverter implements DSpaceConverter<DiscoveryConfiguration, SearchConfigurationRest> { @Override public SearchConfigurationRest convert(DiscoveryConfiguration configuration, Projection projection) { SearchConfigurationRest searchConfigurationRest = new SearchConfigurationRest(); searchConfigurationRest.setProjection(projection); if (configuration != null) { addSearchFilters(searchConfigurationRest, configuration.getSearchFilters(), configuration.getSidebarFacets()); addSortOptions(searchConfigurationRest, configuration.getSearchSortConfiguration()); setDefaultSortOption(configuration, searchConfigurationRest); } return searchConfigurationRest; } }
DiscoverConfigurationConverter implements DSpaceConverter<DiscoveryConfiguration, SearchConfigurationRest> { @Override public SearchConfigurationRest convert(DiscoveryConfiguration configuration, Projection projection) { SearchConfigurationRest searchConfigurationRest = new SearchConfigurationRest(); searchConfigurationRest.setProjection(projection); if (configuration != null) { addSearchFilters(searchConfigurationRest, configuration.getSearchFilters(), configuration.getSidebarFacets()); addSortOptions(searchConfigurationRest, configuration.getSearchSortConfiguration()); setDefaultSortOption(configuration, searchConfigurationRest); } return searchConfigurationRest; }  }
DiscoverConfigurationConverter implements DSpaceConverter<DiscoveryConfiguration, SearchConfigurationRest> { @Override public SearchConfigurationRest convert(DiscoveryConfiguration configuration, Projection projection) { SearchConfigurationRest searchConfigurationRest = new SearchConfigurationRest(); searchConfigurationRest.setProjection(projection); if (configuration != null) { addSearchFilters(searchConfigurationRest, configuration.getSearchFilters(), configuration.getSidebarFacets()); addSortOptions(searchConfigurationRest, configuration.getSearchSortConfiguration()); setDefaultSortOption(configuration, searchConfigurationRest); } return searchConfigurationRest; }  @Override SearchConfigurationRest convert(DiscoveryConfiguration configuration, Projection projection); @Override Class<DiscoveryConfiguration> getModelClass(); void addSearchFilters(SearchConfigurationRest searchConfigurationRest,
                                 List<DiscoverySearchFilter> searchFilterList,
                                 List<DiscoverySearchFilterFacet> facetList); }
DiscoverConfigurationConverter implements DSpaceConverter<DiscoveryConfiguration, SearchConfigurationRest> { @Override public SearchConfigurationRest convert(DiscoveryConfiguration configuration, Projection projection) { SearchConfigurationRest searchConfigurationRest = new SearchConfigurationRest(); searchConfigurationRest.setProjection(projection); if (configuration != null) { addSearchFilters(searchConfigurationRest, configuration.getSearchFilters(), configuration.getSidebarFacets()); addSortOptions(searchConfigurationRest, configuration.getSearchSortConfiguration()); setDefaultSortOption(configuration, searchConfigurationRest); } return searchConfigurationRest; }  @Override SearchConfigurationRest convert(DiscoveryConfiguration configuration, Projection projection); @Override Class<DiscoveryConfiguration> getModelClass(); void addSearchFilters(SearchConfigurationRest searchConfigurationRest,
                                 List<DiscoverySearchFilter> searchFilterList,
                                 List<DiscoverySearchFilterFacet> facetList);  }