@Test public void testConvertWithConfigurationContainingSidebarFacetsFacetConfigurationRestContainsCorrectSidebarFacet() throws Exception { LinkedList<DiscoverySearchFilterFacet> discoverySearchFilterFacets = new LinkedList<>(); DiscoverySearchFilterFacet discoverySearchFilterFacet = new DiscoverySearchFilterFacet(); discoverySearchFilterFacet.setIndexFieldName("Testing"); discoverySearchFilterFacet.setType("test"); discoverySearchFilterFacets.add(discoverySearchFilterFacet); when(discoveryConfiguration.getSidebarFacets()).thenReturn(discoverySearchFilterFacets); facetConfigurationRest = discoverFacetConfigurationConverter .convert(configurationName, scopeObject, discoveryConfiguration); assertNotNull(facetConfigurationRest); assertTrue(!facetConfigurationRest.getSidebarFacets().isEmpty()); assertEquals(discoverySearchFilterFacet.getIndexFieldName(), facetConfigurationRest.getSidebarFacets().get(0).getName()); assertEquals(discoverySearchFilterFacet.getType(), facetConfigurationRest.getSidebarFacets().get(0).getFacetType()); }
public FacetConfigurationRest convert(final String configurationName, final String scope, DiscoveryConfiguration configuration) { FacetConfigurationRest facetConfigurationRest = new FacetConfigurationRest(); facetConfigurationRest.setConfiguration(configurationName); facetConfigurationRest.setScope(scope); if (configuration != null) { addSidebarFacets(facetConfigurationRest, configuration.getSidebarFacets()); } return facetConfigurationRest; }
DiscoverFacetConfigurationConverter { public FacetConfigurationRest convert(final String configurationName, final String scope, DiscoveryConfiguration configuration) { FacetConfigurationRest facetConfigurationRest = new FacetConfigurationRest(); facetConfigurationRest.setConfiguration(configurationName); facetConfigurationRest.setScope(scope); if (configuration != null) { addSidebarFacets(facetConfigurationRest, configuration.getSidebarFacets()); } return facetConfigurationRest; } }
DiscoverFacetConfigurationConverter { public FacetConfigurationRest convert(final String configurationName, final String scope, DiscoveryConfiguration configuration) { FacetConfigurationRest facetConfigurationRest = new FacetConfigurationRest(); facetConfigurationRest.setConfiguration(configurationName); facetConfigurationRest.setScope(scope); if (configuration != null) { addSidebarFacets(facetConfigurationRest, configuration.getSidebarFacets()); } return facetConfigurationRest; }  }
DiscoverFacetConfigurationConverter { public FacetConfigurationRest convert(final String configurationName, final String scope, DiscoveryConfiguration configuration) { FacetConfigurationRest facetConfigurationRest = new FacetConfigurationRest(); facetConfigurationRest.setConfiguration(configurationName); facetConfigurationRest.setScope(scope); if (configuration != null) { addSidebarFacets(facetConfigurationRest, configuration.getSidebarFacets()); } return facetConfigurationRest; }  FacetConfigurationRest convert(final String configurationName, final String scope,
                                          DiscoveryConfiguration configuration); }
DiscoverFacetConfigurationConverter { public FacetConfigurationRest convert(final String configurationName, final String scope, DiscoveryConfiguration configuration) { FacetConfigurationRest facetConfigurationRest = new FacetConfigurationRest(); facetConfigurationRest.setConfiguration(configurationName); facetConfigurationRest.setScope(scope); if (configuration != null) { addSidebarFacets(facetConfigurationRest, configuration.getSidebarFacets()); } return facetConfigurationRest; }  FacetConfigurationRest convert(final String configurationName, final String scope,
                                          DiscoveryConfiguration configuration);  }