You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/10/21 15:08:28 UTC

[GitHub] [iceberg] rdblue commented on a diff in pull request #6029: Replace Assert.fail usage with AssertJ fluent testing

rdblue commented on code in PR #6029:
URL: https://github.com/apache/iceberg/pull/6029#discussion_r1001900312


##########
api/src/test/java/org/apache/iceberg/expressions/TestPredicateBinding.java:
##########
@@ -81,18 +81,12 @@ public void testMissingField() {
     StructType struct = StructType.of(required(13, "x", Types.IntegerType.get()));
 
     UnboundPredicate<Integer> unbound = new UnboundPredicate<>(LT, ref("missing"), 6);
-    try {
-      unbound.bind(struct);
-      Assert.fail("Binding a missing field should fail");
-    } catch (ValidationException e) {
-      Assert.assertTrue(
-          "Validation should complain about missing field",
-          e.getMessage().contains("Cannot find field 'missing' in struct:"));
-    }
+    Assertions.assertThatThrownBy(() -> unbound.bind(struct))

Review Comment:
   Wow, this was so old it predated adding the `assertThrows` methods!



-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org