DataServiceFactory extends DataServiceMetaStoreUtil { public DataServiceMeta getDataService( String serviceName ) throws MetaStoreException { return getDataService( serviceName, getRepository(), getMetaStore() ); } protected  DataServiceFactory( DataServiceContext context ); abstract Repository getRepository(); IMetaStore getMetaStore(); DataServiceMeta getDataService( String serviceName ); Iterable<DataServiceMeta> getDataServices( Function<Exception, Void> exceptionHandler ); List<String> getDataServiceNames(); DataServiceExecutor.Builder createBuilder( SQL sql );  }
@Test public void testGetDataService() throws Exception { assertThat( factory.getDataServiceNames(), empty() ); metaStoreUtil.save( dataService ); metaStoreUtil.sync( transMeta, exceptionHandler ); assertThat( factory.getDataServiceNames(), contains( DATA_SERVICE_NAME ) ); assertThat( factory.getDataService( DATA_SERVICE_NAME ), validDataService() ); assertThat( factory.getDataServices( exceptionHandler ), contains( validDataService() ) ); verify( exceptionHandler, never() ).apply( any( Exception.class ) ); }