pvary commented on code in PR #10016: URL: https://github.com/apache/iceberg/pull/10016#discussion_r1536177091
########## hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveCommits.java: ########## @@ -397,6 +399,36 @@ public void testLockExceptionUnknownSuccessCommit() throws TException, Interrupt .isTrue(); } + @Test + public void testChangeLockWithAlterTable() throws Exception { + Table table = catalog.loadTable(TABLE_IDENTIFIER); + HiveTableOperations ops = (HiveTableOperations) ((HasTableOperations) table).operations(); + TableMetadata base = ops.current(); + final HiveLock initialLock = ops.lockObject(base); + + AtomicReference<HiveLock> lockRef = new AtomicReference<>(); + HiveTableOperations spyOps = spy(ops); + doAnswer( + i -> { + lockRef.set(ops.lockObject(i.getArgument(0))); + return lockRef.get(); + }) + .when(spyOps) + .lockObject(any()); Review Comment: Can we avoid `any` if possible? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org