### Question:
SmsConsoleServiceNameFilter { public void filter(Set<String> services) throws SSOException, SMSException { filterByAuthServices(services); filterByKnownServices(services); filterByDisplayableAttribute(services); } @Inject  SmsConsoleServiceNameFilter(@Named("frRest") Debug debug, SmsConsoleServiceConfig smsConsoleServiceConfig,
                                       @Named("hiddenServices") Set<String> alwaysRemovedServices,
                                       @Named("serviceSupportedSchemaTypes") Set<SchemaType> alwaysSupportedSchemaTypes,
                                       @Named("authenticationServices") Set<String> authenticationServices,
                                       ServiceSchemaManagerFactory serviceSchemaManagerFactory); void filter(Set<String> services); Map<String, String> mapNameToDisplayName(Set<String> names); Map<String, String> mapNameToDisplayName(Set<String> names, java.util.Locale locale);  }### Answer:
@Test public void testFilterRemovesAuthenticationServices() throws SMSException, SSOException, AMConfigurationException { authenticationServices.add("service3"); authenticationServices.add("service4"); authenticationServices.add("service5"); given(mockServiceSchemaManager.getPropertiesViewBeanURL()).willReturn(null); testNameFilter = new SmsConsoleServiceNameFilter(mockDebug, mockServiceConfig, removeServices, supportedSchemaTypes, authenticationServices, mockServiceSchemaManagerFactory); testNameFilter.filter(servicesToFilter); assertThat(servicesToFilter).contains("service1", "service2"); }
@Test public void testFilterRemovesRemoveServices() throws SMSException, SSOException, AMConfigurationException { removeServices.add("service1"); removeServices.add("service2"); removeServices.add("service3"); given(mockServiceSchemaManager.getPropertiesViewBeanURL()).willReturn(null); testNameFilter = new SmsConsoleServiceNameFilter(mockDebug, mockServiceConfig, removeServices, supportedSchemaTypes, authenticationServices, mockServiceSchemaManagerFactory); testNameFilter.filter(servicesToFilter); assertThat(servicesToFilter).contains("service4", "service5"); }
@Test public void testFilterRemovesUndisplayableServices() throws SMSException, SSOException, AMConfigurationException { given(mockServiceSchemaManager.getPropertiesViewBeanURL()).willReturn(null); given(mockAttributeSchema.getI18NKey()).willReturn(null); testNameFilter = new SmsConsoleServiceNameFilter(mockDebug, mockServiceConfig, removeServices, supportedSchemaTypes, authenticationServices, mockServiceSchemaManagerFactory); testNameFilter.filter(servicesToFilter); assertThat(servicesToFilter).isEmpty(); }