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


##########
core/src/test/java/org/apache/iceberg/TestSnapshotJson.java:
##########
@@ -149,29 +182,34 @@ public void testJsonConversionWithV1Manifests() {
             timestampMillis);
 
     String json = SnapshotParser.toJson(expected, true);
-    Assertions.assertThat(json).isEqualTo(expectedJson);
+    assertThat(json).isEqualTo(expectedJson);
     Snapshot snapshot = SnapshotParser.fromJson(json);
-    Assertions.assertThat(snapshot).isEqualTo(expected);
-
-    Assert.assertEquals("Sequence number should default to 0 for v1", 0, 
snapshot.sequenceNumber());
-    Assert.assertEquals("Snapshot ID should match", expected.snapshotId(), 
snapshot.snapshotId());
-    Assert.assertEquals(
-        "Timestamp should match", expected.timestampMillis(), 
snapshot.timestampMillis());
-    Assert.assertEquals("Parent ID should match", expected.parentId(), 
snapshot.parentId());
-    Assert.assertEquals(
-        "Manifest list should match",
-        expected.manifestListLocation(),
-        snapshot.manifestListLocation());
-    Assert.assertEquals(
-        "Files should match", expected.allManifests(ops.io()), 
snapshot.allManifests(ops.io()));
-    Assert.assertEquals("Operation should match", expected.operation(), 
snapshot.operation());
-    Assert.assertEquals("Summary should match", expected.summary(), 
snapshot.summary());
-    Assert.assertEquals("Schema ID should match", expected.schemaId(), 
snapshot.schemaId());
+    assertThat(snapshot).isEqualTo(expected);
+
+    assertThat(snapshot.sequenceNumber()).isEqualTo(0);
+    assertThat(snapshot.snapshotId()).isEqualTo(expected.snapshotId());
+    
assertThat(snapshot.timestampMillis()).isEqualTo(expected.timestampMillis());
+    assertThat(snapshot.parentId()).isEqualTo(expected.parentId());
+    
assertThat(snapshot.manifestListLocation()).isEqualTo(expected.manifestListLocation());
+
+    assertThat(snapshot.allManifests(ops.io())).hasSize(2);
+
+    for (int i = 0; i < snapshot.allManifests(ops.io()).size(); i++) {
+      ManifestFile actualManifestFile = snapshot.allManifests(ops.io()).get(i);
+      ManifestFile expectedManifestFile = 
expected.allManifests(ops.io()).get(i);
+
+      
assertThat(actualManifestFile.content()).isEqualTo(expectedManifestFile.content());
+      
assertThat(actualManifestFile.path()).isEqualTo(expectedManifestFile.path());
+    }
+
+    assertThat(snapshot.operation()).isEqualTo(expected.operation());
+    assertThat(snapshot.summary()).isEqualTo(expected.summary());
+    assertThat(snapshot.schemaId()).isEqualTo(expected.schemaId());
   }
 
   private String createManifestListWithManifestFiles(long snapshotId, Long 
parentSnapshotId)
       throws IOException {
-    File manifestList = temp.newFile("manifests" + UUID.randomUUID());
+    File manifestList = java.nio.file.Files.createTempDirectory(temp, 
"junit").toFile();

Review Comment:
   this should create a new temp file instead of a temp directory



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