nastra commented on code in PR #7866: URL: https://github.com/apache/iceberg/pull/7866#discussion_r1236659187
########## flink/v1.15/flink/src/test/java/org/apache/iceberg/flink/TestFlinkAnonymousTable.java: ########## @@ -52,12 +53,11 @@ public void testWriteAnonymousTable() throws IOException { .option("warehouse", warehouseDir.getAbsolutePath()) .build(); - Exception exception = - Assert.assertThrows( - ValidationException.class, () -> table.insertInto(descriptor).execute()); - Assert.assertNotEquals( - "This ObjectIdentifier instance refers to an anonymous object, " - + "hence it cannot be converted to ObjectPath and cannot be serialized.", - exception.getCause().getMessage()); + Assertions.assertThatThrownBy(() -> table.insertInto(descriptor).execute()) + .isInstanceOf(ValidationException.class) + .hasCause( Review Comment: for cause validation you can do `.isInstanceOf(ValidationException.class).cause().isInstanceOf(TableException.class).hasMessage(..)` -- 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