use of org.neo4j.kernel.impl.transaction.state.DataSourceManager.DependencyResolverSupplier in project neo4j by neo4j.
the class DependencyResolverSupplierTest method shouldReturnTheDependencyResolveFromTheRegisteredDatasource.
@Test
public void shouldReturnTheDependencyResolveFromTheRegisteredDatasource() throws Exception {
// given
DataSourceManager dataSourceManager = new DataSourceManager();
DependencyResolverSupplier supplier = new DependencyResolverSupplier(dataSourceManager);
NeoStoreDataSource neoStoreDataSource = mock(NeoStoreDataSource.class);
DependencyResolver dependencyResolver = mock(DependencyResolver.class);
when(neoStoreDataSource.getDependencyResolver()).thenReturn(dependencyResolver);
// when
dataSourceManager.register(neoStoreDataSource);
// then
assertEquals(dependencyResolver, supplier.get());
}
use of org.neo4j.kernel.impl.transaction.state.DataSourceManager.DependencyResolverSupplier in project neo4j by neo4j.
the class DependencyResolverSupplierTest method shouldReturnNullIfDataSourceHasBeenUnregistered.
@Test
public void shouldReturnNullIfDataSourceHasBeenUnregistered() throws Exception {
// given
DataSourceManager dataSourceManager = new DataSourceManager();
DependencyResolverSupplier supplier = new DependencyResolverSupplier(dataSourceManager);
NeoStoreDataSource neoStoreDataSource = mock(NeoStoreDataSource.class);
DependencyResolver dependencyResolver = mock(DependencyResolver.class);
when(neoStoreDataSource.getDependencyResolver()).thenReturn(dependencyResolver);
dataSourceManager.register(neoStoreDataSource);
// when
dataSourceManager.unregister(neoStoreDataSource);
// then
assertEquals(null, supplier.get());
}
Aggregations