use of com.google.cloud.spanner.Options.TransactionOption in project java-spanner by googleapis.
the class DatabaseClientImplTest method testTransactionManager_usesOptions.
@Test
public void testTransactionManager_usesOptions() {
SessionPool pool = mock(SessionPool.class);
PooledSessionFuture session = mock(PooledSessionFuture.class);
when(pool.getSession()).thenReturn(session);
TransactionOption option = mock(TransactionOption.class);
DatabaseClientImpl client = new DatabaseClientImpl(pool);
client.transactionManager(option);
verify(session).transactionManager(option);
}
use of com.google.cloud.spanner.Options.TransactionOption in project java-spanner by googleapis.
the class DatabaseClientImplTest method testReadWriteTransaction_usesOptions.
@Test
public void testReadWriteTransaction_usesOptions() {
SessionPool pool = mock(SessionPool.class);
PooledSessionFuture session = mock(PooledSessionFuture.class);
when(pool.getSession()).thenReturn(session);
TransactionOption option = mock(TransactionOption.class);
DatabaseClientImpl client = new DatabaseClientImpl(pool);
client.readWriteTransaction(option);
verify(session).readWriteTransaction(option);
}
use of com.google.cloud.spanner.Options.TransactionOption in project java-spanner by googleapis.
the class DatabaseClientImplTest method testRunAsync_usesOptions.
@Test
public void testRunAsync_usesOptions() {
SessionPool pool = mock(SessionPool.class);
PooledSessionFuture session = mock(PooledSessionFuture.class);
when(pool.getSession()).thenReturn(session);
TransactionOption option = mock(TransactionOption.class);
DatabaseClientImpl client = new DatabaseClientImpl(pool);
client.runAsync(option);
verify(session).runAsync(option);
}
use of com.google.cloud.spanner.Options.TransactionOption in project java-spanner by googleapis.
the class DatabaseClientImplTest method testTransactionManagerAsync_usesOptions.
@Test
public void testTransactionManagerAsync_usesOptions() {
SessionPool pool = mock(SessionPool.class);
PooledSessionFuture session = mock(PooledSessionFuture.class);
when(pool.getSession()).thenReturn(session);
TransactionOption option = mock(TransactionOption.class);
DatabaseClientImpl client = new DatabaseClientImpl(pool);
client.transactionManagerAsync(option);
verify(session).transactionManagerAsync(option);
}
Aggregations