@Test
  public void testPassThroughThriftExceptionsForHiveVersion_1()
      throws TException, InterruptedException {
    try (MockedStatic<HiveVersion> ignore = mockStatic(HiveVersion.class)) {
      // default order is 0, meets the requirements of this test
      HiveVersion version = mock(HiveVersion.class);
      when(HiveVersion.current()).thenReturn(version);

      doReturn(emptyLocks).when(spyClient).showLocks(any());
      doThrow(new TException("Failed to connect to HMS"))
          .doReturn(waitLockResponse)
          .when(spyClient)
          .lock(any());
      doReturn(waitLockResponse)
          .doReturn(acquiredLockResponse)
          .when(spyClient)
          .checkLock(eq(dummyLockId));
      doNothing().when(spyClient).heartbeat(eq(0L), eq(dummyLockId));

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