attilakreiner commented on code in PR #10657:
URL: https://github.com/apache/iceberg/pull/10657#discussion_r1670430051


##########
data/src/test/java/org/apache/iceberg/io/TestWriterMetrics.java:
##########
@@ -227,23 +227,23 @@ public void 
testPositionDeleteMetricsCoveringMultipleDataFiles() throws IOExcept
 
     // should have NO bounds for path and position as the file covers multiple 
data paths
     Map<Integer, ByteBuffer> lowerBounds = deleteFile.lowerBounds();
-    Assert.assertEquals(2, lowerBounds.size());
-    Assert.assertEquals(
-        3, (int) Conversions.fromByteBuffer(Types.IntegerType.get(), 
lowerBounds.get(1)));
-    Assert.assertEquals(
-        3L, (long) Conversions.fromByteBuffer(Types.LongType.get(), 
lowerBounds.get(5)));
+    assertThat(lowerBounds).hasSize(2);
+    assertThat((int) Conversions.fromByteBuffer(Types.IntegerType.get(), 
lowerBounds.get(1)))
+        .isEqualTo(3);
+    assertThat((long) Conversions.fromByteBuffer(Types.LongType.get(), 
lowerBounds.get(5)))
+        .isEqualTo(3L);
 
     Map<Integer, ByteBuffer> upperBounds = deleteFile.upperBounds();
-    Assert.assertEquals(2, upperBounds.size());
-    Assert.assertEquals(
-        3, (int) Conversions.fromByteBuffer(Types.IntegerType.get(), 
upperBounds.get(1)));
-    Assert.assertEquals(
-        3L, (long) Conversions.fromByteBuffer(Types.LongType.get(), 
upperBounds.get(5)));
+    assertThat(upperBounds).hasSize(2);
+    assertThat((int) Conversions.fromByteBuffer(Types.IntegerType.get(), 
upperBounds.get(1)))
+        .isEqualTo(3);
+    assertThat((long) Conversions.fromByteBuffer(Types.LongType.get(), 
upperBounds.get(5)))
+        .isEqualTo(3L);
   }
 
-  @Test
+  @TestTemplate
   public void testMaxColumns() throws IOException {
-    File tableDir = temp.newFolder();
+    File tableDir = new File(tempDir, "table");

Review Comment:
   OK, it's fixed now in all this PR.



##########
data/src/test/java/org/apache/iceberg/io/TestWriterMetrics.java:
##########
@@ -275,29 +275,38 @@ public void testMaxColumns() throws IOException {
     // start at 1 because IDs were reassigned in the table
     int id = 1;
     for (; id <= TableProperties.METRICS_MAX_INFERRED_COLUMN_DEFAULTS_DEFAULT; 
id += 1) {
-      Assert.assertNotNull("Should have lower bound metrics", 
dataFile.lowerBounds().get(id));
-      Assert.assertNotNull("Should have upper bound metrics", 
dataFile.upperBounds().get(id));
-      Assert.assertNull(
-          "Should not have nan value metrics (not floating point)",
-          dataFile.nanValueCounts().get(id));
-      Assert.assertNotNull("Should have null value metrics", 
dataFile.nullValueCounts().get(id));
-      Assert.assertNotNull("Should have value metrics", 
dataFile.valueCounts().get(id));
+      assertThat(dataFile.lowerBounds().get(id)).as("Should have lower bound 
metrics").isNotNull();
+      assertThat(dataFile.upperBounds().get(id)).as("Should have upper bound 
metrics").isNotNull();
+      assertThat(dataFile.nanValueCounts().get(id))
+          .as("Should not have nan value metrics (not floating point)")
+          .isNull();
+      assertThat(dataFile.nullValueCounts().get(id))
+          .as("Should have null value metrics")
+          .isNotNull();
+      assertThat(dataFile.valueCounts().get(id)).as("Should have value 
metrics").isNotNull();
     }
 
     // Remaining fields should not have metrics
     for (; id <= numColumns; id += 1) {
-      Assert.assertNull("Should not have any lower bound metrics", 
dataFile.lowerBounds().get(id));
-      Assert.assertNull("Should not have any upper bound metrics", 
dataFile.upperBounds().get(id));
-      Assert.assertNull("Should not have any nan value metrics", 
dataFile.nanValueCounts().get(id));
-      Assert.assertNull(
-          "Should not have any null value metrics", 
dataFile.nullValueCounts().get(id));
-      Assert.assertNull("Should not have any value metrics", 
dataFile.valueCounts().get(id));
+      assertThat(dataFile.lowerBounds().get(id))
+          .as("Should not have any lower bound metrics")
+          .isNull();
+      assertThat(dataFile.upperBounds().get(id))
+          .as("Should not have any upper bound metrics")
+          .isNull();
+      assertThat(dataFile.nanValueCounts().get(id))
+          .as("Should not have any nan value metrics")
+          .isNull();
+      assertThat(dataFile.nullValueCounts().get(id))
+          .as("Should not have any null value metrics")
+          .isNull();
+      assertThat(dataFile.valueCounts().get(id)).as("Should not have any value 
metrics").isNull();
     }
   }
 
-  @Test
+  @TestTemplate
   public void testMaxColumnsWithDefaultOverride() throws IOException {
-    File tableDir = temp.newFolder();
+    File tableDir = new File(tempDir, "table");

Review Comment:
   fixed



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