tomtongue commented on code in PR #9760:
URL: https://github.com/apache/iceberg/pull/9760#discussion_r1498938153


##########
spark/v3.5/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestCallStatementParser.java:
##########
@@ -188,25 +184,26 @@ private void checkArg(
 
     if (expectedName != null) {
       NamedArgument arg = checkCast(call.args().apply(index), 
NamedArgument.class);
-      Assert.assertEquals(expectedName, arg.name());
+      assertThat(arg.name()).isEqualTo(expectedName);
     } else {
       CallArgument arg = call.args().apply(index);
       checkCast(arg, PositionalArgument.class);
     }
 
     Expression expectedExpr = toSparkLiteral(expectedValue, expectedType);
     Expression actualExpr = call.args().apply(index).expr();
-    Assert.assertEquals("Arg types must match", expectedExpr.dataType(), 
actualExpr.dataType());
-    Assert.assertEquals("Arg must match", expectedExpr, actualExpr);
+    assertThat(actualExpr.dataType()).as("Arg types must 
match").isEqualTo(expectedExpr.dataType());
+    assertThat(actualExpr).as("Arg must match").isEqualTo(expectedExpr);
   }
 
   private Literal toSparkLiteral(Object value, DataType dataType) {
     return Literal$.MODULE$.create(value, dataType);
   }
 
   private <T> T checkCast(Object value, Class<T> expectedClass) {
-    Assert.assertTrue(
-        "Expected instance of " + expectedClass.getName(), 
expectedClass.isInstance(value));
+    assertThat(expectedClass.isInstance(value))

Review Comment:
   I tried this previously, but the tests related to this method failed with 
the following error:
   
   ```
   // Example
   java.lang.AssertionError: 
   Expecting actual:
     org.apache.spark.sql.catalyst.plans.logical.PositionalArgument
   to be an instance of:
     org.apache.spark.sql.catalyst.plans.logical.PositionalArgument
   but was instance of:
     java.lang.Class
   ```
   
   This seems to work when using the current code like 
`expectedClass.isInstance(value)`
   



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

Reply via email to