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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]