DataServiceResolverDelegate implements DataServiceResolver { @Override public List<String> getDataServiceNames( String dataServiceName ) { List<String> dataServiceNames = new ArrayList<>(); for ( DataServiceResolver resolver : resolvers ) { dataServiceNames.addAll( resolver.getDataServiceNames( dataServiceName ) ); } return dataServiceNames; } DataServiceResolverDelegate();  DataServiceResolverDelegate( List<DataServiceResolver> resolvers ); void addResolver( DataServiceResolver resolver ); void removeResolver( DataServiceResolver resolver ); @Override List<DataServiceMeta> getDataServices( Function<Exception, Void> logger ); @Override List<DataServiceMeta> getDataServices( String dataServiceName, Function<Exception, Void> logger ); @Override DataServiceMeta getDataService( String dataServiceName ); @Override List<String> getDataServiceNames( String dataServiceName ); @Override DataServiceExecutor.Builder createBuilder( SQL sql ); @Override List<String> getDataServiceNames();  }
@Test public void testGetDataServiceNamesNoResolvers() { DataServiceResolverDelegate nullDataServiceResolverDelegate = new DataServiceResolverDelegate(); List<String> names = nullDataServiceResolverDelegate.getDataServiceNames(); assertEquals( names, Collections.emptyList() ); }
@Test public void testGetDataServiceNamesWName() { List<String> lDataServiceNames = dataServiceResolverDelegate.getDataServiceNames( DATA_SERVICE_NAME ); assertTrue( lDataServiceNames.contains( DATA_SERVICE_NAME ) ); verify( resolver ).getDataServiceNames( DATA_SERVICE_NAME ); }
@Test public void testGetDataServiceNames() { List<String> lDataServiceNames = dataServiceResolverDelegate.getDataServiceNames(); assertTrue( lDataServiceNames.contains( DATA_SERVICE_NAME ) ); verify( resolver ).getDataServiceNames(); }