@Test
  public void testPassThroughThriftExceptions() throws TException {
    doReturn(waitLockResponse).when(spyClient).lock(any());
    doReturn(waitLockResponse).doThrow(new TException("Test Thrift Exception"))
        .when(spyClient).checkLock(eq(dummyLockId));

    assertThatThrownBy(() -> spyOps.doCommit(metadataV2, metadataV1))
        .isInstanceOf(RuntimeException.class)
        .hasMessage(
            "org.apache.iceberg.hive.LockException: Metastore operation failed for hivedb.tbl");
  }
Wraps an ArgumentCaptor to provide data based on the request
iceberg/iceberg-catalog/src/test/java/org/apache/iceberg/hive/TestHiveCommitLocks.java