@Test
void acquiresConnectionsFromThePool()
{

    BoltServerAddress address = BoltServerAddress.LOCAL_DEFAULT;
    Connection connection1 = mock( Connection.class );
    Connection connection2 = mock( Connection.class );
    ConnectionPool pool = poolMock( address, connection1, connection2 );
    DirectConnectionProvider provider = new DirectConnectionProvider( address, pool );
    Connection acquired1 = await( provider.acquireConnection( contextWithMode( READ ) ) );
    assertThat( acquired1, instanceOf( DirectConnection.class ) );
    assertSame( connection1, ((DirectConnection) acquired1).connection() );
    Connection acquired2 = await( provider.acquireConnection( contextWithMode( WRITE ) ) );
    assertThat( acquired2, instanceOf( DirectConnection.class ) );
    assertSame( connection2, ((DirectConnection) acquired2).connection() );
}