@Test
void shouldCommitTransaction()
{

    String bookmarkString = "neo4j:bookmark:v1:tx4242";
    Connection connection = connectionMock( protocol );
    when( connection.protocol() ).thenReturn( protocol );
    doAnswer( invocation ->
    {
        ResponseHandler commitHandler = invocation.getArgument( 1 );
        commitHandler.onSuccess( singletonMap( "bookmark", value( bookmarkString ) ) );
        return null;
    } ).when( connection ).writeAndFlush( eq( CommitMessage.COMMIT ), any() );
    CompletionStage<Bookmark> stage = protocol.commitTransaction( connection );
    verify( connection ).writeAndFlush( eq( CommitMessage.COMMIT ), any( CommitTxResponseHandler.class ) );
    assertEquals( InternalBookmark.parse( bookmarkString ), await( stage ) );
}