nastra commented on code in PR #9849:
URL: https://github.com/apache/iceberg/pull/9849#discussion_r1511226028


##########
core/src/test/java/org/apache/iceberg/TestMetadataTableScansWithPartitionEvolution.java:
##########
@@ -193,38 +190,36 @@ public void testPositionDeletesPartitionSpecRemoval() {
     PositionDeletesScanTask posDeleteTask = (PositionDeletesScanTask) task;
 
     int filePartition = posDeleteTask.file().partition().get(0, Integer.class);
-    Assert.assertEquals("Expected correct partition on task", 1, 
filePartition);
+    assertThat(filePartition).as("Expected correct partition on 
task").isEqualTo(1);
 
     // Constant partition struct is common struct that includes even deleted 
partition column
     int taskConstantPartition =
         ((StructLike)
                 constantsMap(posDeleteTask, 
partitionType).get(MetadataColumns.PARTITION_COLUMN_ID))
             .get(1, Integer.class);
-    Assert.assertEquals("Expected correct partition on constant column", 1, 
taskConstantPartition);
-
-    Assert.assertEquals(
-        "Expected correct partition field id on task's spec",
-        table.ops().current().spec().partitionType().fields().get(0).fieldId(),
-        posDeleteTask.spec().fields().get(0).fieldId());
-
-    Assert.assertEquals(
-        "Expected correct partition spec id on task",
-        table.ops().current().spec().specId(),
-        posDeleteTask.file().specId());
-    Assert.assertEquals(
-        "Expected correct partition spec id on constant column",
-        table.ops().current().spec().specId(),
-        constantsMap(posDeleteTask, 
partitionType).get(MetadataColumns.SPEC_ID.fieldId()));
-
-    Assert.assertEquals(
-        "Expected correct delete file on task", deleteFile.path(), 
posDeleteTask.file().path());
-    Assert.assertEquals(
-        "Expected correct delete file on constant column",
-        deleteFile.path(),
-        constantsMap(posDeleteTask, 
partitionType).get(MetadataColumns.FILE_PATH.fieldId()));
+    assertThat(taskConstantPartition)
+        .as("Expected correct partition on constant column")
+        .isEqualTo(1);
+
+    assertThat(posDeleteTask.spec().fields().get(0).fieldId())
+        .as("Expected correct partition field id on task's spec")
+        
.isEqualTo(table.ops().current().spec().partitionType().fields().get(0).fieldId());
+
+    assertThat(posDeleteTask.file().specId())
+        .as("Expected correct partition spec id on task")
+        .isEqualTo(table.ops().current().spec().specId());
+    assertThat(constantsMap(posDeleteTask, 
partitionType).get(MetadataColumns.SPEC_ID.fieldId()))

Review Comment:
   this should use .containsEntry()



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