use of org.neo4j.kernel.impl.locking.StatementLocks in project neo4j by neo4j.
the class StatementLocksFactorySelectorTest method loadSimpleStatementLocksFactoryWhenNoServices.
@Test
public void loadSimpleStatementLocksFactoryWhenNoServices() {
Locks locks = mock(Locks.class);
Locks.Client locksClient = mock(Client.class);
when(locks.newClient()).thenReturn(locksClient);
StatementLocksFactorySelector loader = newLoader(locks);
StatementLocksFactory factory = loader.select();
StatementLocks statementLocks = factory.newInstance();
assertThat(factory, instanceOf(SimpleStatementLocksFactory.class));
assertThat(statementLocks, instanceOf(SimpleStatementLocks.class));
assertSame(locksClient, statementLocks.optimistic());
assertSame(locksClient, statementLocks.pessimistic());
}
Aggregations