DataServiceMetaStoreUtil { @Deprecated( ) public void sync( TransMeta transMeta, Function<? super Exception, ?> exceptionHandler ) { DataServiceReferenceSynchronizer syncronizer = new DataServiceReferenceSynchronizer( getContext() ); syncronizer.sync( transMeta, ( e ) -> exceptionHandler.apply( e ) ); } protected  DataServiceMetaStoreUtil( DataServiceContext context, Cache<Integer, String> cache ); protected  DataServiceMetaStoreUtil( DataServiceMetaStoreUtil metaStoreUtil ); static DataServiceMetaStoreUtil create( DataServiceContext context ); DataServiceMeta getDataService( String serviceName, Repository repository, IMetaStore metaStore ); DataServiceMeta getDataService( String serviceName, TransMeta serviceTrans ); Iterable<DataServiceMeta> getDataServices( final Repository repository, IMetaStore metaStore,
                                                    final Function<Exception, Void> exceptionHandler ); Iterable<DataServiceMeta> getDataServices( TransMeta transMeta ); List<String> getDataServiceNames( TransMeta transMeta ); List<String> getDataServiceNames( IMetaStore metaStore ); DataServiceMeta getDataServiceByStepName( TransMeta transMeta, String stepName ); DataServiceMeta checkDefined( DataServiceMeta dataServiceMeta ); DataServiceMeta checkConflict( DataServiceMeta dataServiceMeta, String ignored ); void save( DataServiceMeta dataService ); void removeDataService( DataServiceMeta dataService ); void deleteDataServiceElementAndCleanCache( DataServiceMeta dataService, TransMeta transMeta ); @Deprecated( ) void sync( TransMeta transMeta, Function<? super Exception, ?> exceptionHandler ); ImmutableMap<String, ServiceTrans> getServiceTransMap( TransMeta transMeta ); void clearReferences( TransMeta transMeta ); LogChannelInterface getLogChannel(); List<PushDownFactory> getPushDownFactories(); Function<Exception, Void> logErrors( final String message ); DataServiceContext getContext(); Cache<Integer, String> getStepCache();  }
@Test public void testSync() throws Exception { assertThat( metaStoreUtil.getDataServiceNames( metaStore ), empty() ); metaStoreUtil.save( dataService ); metaStoreUtil.sync( transMeta, exceptionHandler ); assertThat( metaStoreUtil.getDataServiceNames( metaStore ), contains( DATA_SERVICE_NAME ) ); assertThat( metaStoreUtil.getDataServices( repository, metaStore, exceptionHandler ), contains( validDataService() ) ); assertThat( metaStoreUtil.getDataService( DATA_SERVICE_NAME, repository, metaStore ), validDataService() ); metaStoreUtil.removeDataService( dataService ); metaStoreUtil.sync( transMeta, exceptionHandler ); assertThat( metaStoreUtil.getDataServiceNames( metaStore ), emptyIterable() ); assertThat( metaStoreUtil.getDataServices( repository, metaStore, exceptionHandler ), emptyIterable() ); verify( exceptionHandler, never() ).apply( any( Exception.class ) ); }