@Test
  public void testLockHeartbeat() throws TException {
    doReturn(acquiredLockResponse).when(spyClient).lock(any());
    doAnswer(AdditionalAnswers.answersWithDelay(2000, InvocationOnMock::callRealMethod))
        .when(spyClient)
        .getTable(any(), any());
    doNothing().when(spyClient).heartbeat(eq(0L), eq(dummyLockId));

    spyOps.doCommit(metadataV2, metadataV1);

    verify(spyClient, atLeastOnce()).heartbeat(eq(0L), eq(dummyLockId));
  }
Wraps an ArgumentCaptor to provide data based on the request
iceberg/iceberg-catalog/src/test/java/org/apache/iceberg/hive/TestHiveCommitLocks.java