@Test
void shouldBeginTxAfterBeginTxFailureOnBookmark()
{

    RuntimeException error = new RuntimeException( "Hi" );
    Connection connection1 = connectionMock( BoltProtocolV4.INSTANCE );
    setupFailingBegin( connection1, error );
    Connection connection2 = connectionMock( BoltProtocolV4.INSTANCE );
    when( connectionProvider.acquireConnection( any( ConnectionContext.class ) ) )
            .thenReturn( completedFuture( connection1 ) ).thenReturn( completedFuture( connection2 ) );
    Bookmark bookmark = InternalBookmark.parse( "neo4j:bookmark:v1:tx42" );
    NetworkSession session = newSession( connectionProvider, bookmark );
    Exception e = assertThrows( Exception.class, () -> beginTransaction( session ) );
    assertEquals( error, e );
    beginTransaction( session );
    verify( connectionProvider, times( 2 ) ).acquireConnection( any( ConnectionContext.class ) );
    verifyBeginTx( connection1, bookmark );
    verifyBeginTx( connection2, bookmark );
}