rakesh-das08 commented on code in PR #7730:
URL: https://github.com/apache/iceberg/pull/7730#discussion_r1211889035


##########
api/src/test/java/org/apache/iceberg/expressions/TestPredicateBinding.java:
##########
@@ -160,87 +158,81 @@ public void testLongToIntegerConversion() {
     StructType struct = StructType.of(required(17, "i", 
Types.IntegerType.get()));
 
     UnboundPredicate<Long> lt = new UnboundPredicate<>(LT, ref("i"), (long) 
Integer.MAX_VALUE + 1L);
-    Assert.assertEquals(
-        "Less than above max should be alwaysTrue", Expressions.alwaysTrue(), 
lt.bind(struct));
+    assertThat(lt.bind(struct))
+        .as("Less than above max should be alwaysTrue")
+        .isEqualTo(Expressions.alwaysTrue());
 
     UnboundPredicate<Long> lteq =
         new UnboundPredicate<>(LT_EQ, ref("i"), (long) Integer.MAX_VALUE + 1L);
-    Assert.assertEquals(
-        "Less than or equal above max should be alwaysTrue",
-        Expressions.alwaysTrue(),
-        lteq.bind(struct));
+    assertThat(lteq.bind(struct))
+        .as("Less than or equal above max should be alwaysTrue")
+        .isEqualTo(Expressions.alwaysTrue());
 
     UnboundPredicate<Long> gt = new UnboundPredicate<>(GT, ref("i"), (long) 
Integer.MIN_VALUE - 1L);
-    Assert.assertEquals(
-        "Greater than below min should be alwaysTrue", 
Expressions.alwaysTrue(), gt.bind(struct));
+    assertThat(gt.bind(struct))
+        .as("Greater than below min should be alwaysTrue")
+        .isEqualTo(Expressions.alwaysTrue());
 
     UnboundPredicate<Long> gteq =
         new UnboundPredicate<>(GT_EQ, ref("i"), (long) Integer.MIN_VALUE - 1L);
-    Assert.assertEquals(
-        "Greater than or equal below min should be alwaysTrue",
-        Expressions.alwaysTrue(),
-        gteq.bind(struct));
+    assertThat(gteq.bind(struct))
+        .as("Greater than or equal below min should be alwaysTrue")
+        .isEqualTo(Expressions.alwaysTrue());
 
     UnboundPredicate<Long> gtMax =
         new UnboundPredicate<>(GT, ref("i"), (long) Integer.MAX_VALUE + 1L);
-    Assert.assertEquals(
-        "Greater than above max should be alwaysFalse",
-        Expressions.alwaysFalse(),
-        gtMax.bind(struct));
+    assertThat(gtMax.bind(struct))
+        .as("Greater than above max should be alwaysFalse")
+        .isEqualTo(Expressions.alwaysFalse());
 
     UnboundPredicate<Long> gteqMax =
         new UnboundPredicate<>(GT_EQ, ref("i"), (long) Integer.MAX_VALUE + 1L);
-    Assert.assertEquals(
-        "Greater than or equal above max should be alwaysFalse",
-        Expressions.alwaysFalse(),
-        gteqMax.bind(struct));
+    assertThat(gteqMax.bind(struct))
+        .as("Greater than or equal above max should be alwaysFalse")
+        .isEqualTo(Expressions.alwaysFalse());
 
     UnboundPredicate<Long> ltMin =
         new UnboundPredicate<>(LT, ref("i"), (long) Integer.MIN_VALUE - 1L);
-    Assert.assertEquals(
-        "Less than below min should be alwaysFalse", 
Expressions.alwaysFalse(), ltMin.bind(struct));
+    assertThat(ltMin.bind(struct))
+        .as("Less than below min should be alwaysFalse")
+        .isEqualTo(Expressions.alwaysFalse());
 
     UnboundPredicate<Long> lteqMin =
         new UnboundPredicate<>(LT_EQ, ref("i"), (long) Integer.MIN_VALUE - 1L);
-    Assert.assertEquals(
-        "Less than or equal below min should be alwaysFalse",
-        Expressions.alwaysFalse(),
-        lteqMin.bind(struct));
+    assertThat(lteqMin.bind(struct))
+        .as("Less than or equal below min should be alwaysFalse")
+        .isEqualTo(Expressions.alwaysFalse());
 
     Expression ltExpr =
         new UnboundPredicate<>(LT, ref("i"), (long) 
Integer.MAX_VALUE).bind(struct, true);
     BoundPredicate<Integer> ltMax = assertAndUnwrap(ltExpr);
-    Assert.assertTrue("Should be a literal predicate", 
ltMax.isLiteralPredicate());
-    Assert.assertEquals(
-        "Should translate bound to Integer",
-        (Integer) Integer.MAX_VALUE,
-        ltMax.asLiteralPredicate().literal().value());
+    assertThat(ltMax.isLiteralPredicate()).isTrue();
+    assertThat(ltMax.asLiteralPredicate().literal().value())
+        .as("Should translate bound to Integer")
+        .isEqualTo((Integer) Integer.MAX_VALUE);

Review Comment:
   sry for this back and forth. found the places where redundant typecasts were 
there.



-- 
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]

Reply via email to