RussellSpitzer commented on code in PR #11947:
URL: https://github.com/apache/iceberg/pull/11947#discussion_r1915587999


##########
core/src/test/java/org/apache/iceberg/TestTableMetadata.java:
##########
@@ -357,43 +383,48 @@ public void testInvalidMainBranch() throws IOException {
 
     assertThatThrownBy(
             () ->
-                new TableMetadata(
-                    null,
-                    2,
-                    UUID.randomUUID().toString(),
-                    TEST_LOCATION,
-                    SEQ_NO,
-                    System.currentTimeMillis(),
-                    3,
-                    7,
-                    ImmutableList.of(TEST_SCHEMA, schema),
-                    5,
-                    ImmutableList.of(SPEC_5),
-                    SPEC_5.lastAssignedFieldId(),
-                    3,
-                    ImmutableList.of(SORT_ORDER_3),
-                    ImmutableMap.of("property", "value"),
-                    currentSnapshotId,
-                    Arrays.asList(previousSnapshot, currentSnapshot),
-                    null,
-                    snapshotLog,
-                    ImmutableList.of(),
-                    refs,
-                    ImmutableList.of(),
-                    ImmutableList.of(),
-                    ImmutableList.of()))
+                MetadataTestUtils.buildTestTableMetadata(formatVersion)
+                    .setFormatVersion(formatVersion)
+                    .setLocation(TEST_LOCATION)
+                    .setLastSequenceNumber(SEQ_NO)
+                    .setLastColumnId(3)
+                    .setCurrentSchemaId(7)
+                    .setSchemas(ImmutableList.of(TEST_SCHEMA, schema))
+                    .setDefaultSpecId(5)
+                    .setSpecs(ImmutableList.of(SPEC_5))
+                    .setLastAssignedPartitionId(SPEC_5.lastAssignedFieldId())
+                    .setDefaultSortOrderId(3)
+                    .setSortOrders(ImmutableList.of(SORT_ORDER_3))
+                    .setProperties(ImmutableMap.of("property", "value"))
+                    .setCurrentSnapshotId(currentSnapshotId)
+                    .setSnapshots(Arrays.asList(previousSnapshot, 
currentSnapshot))
+                    .setSnapshotLog(snapshotLog)
+                    .setRefs(refs)
+                    .build())
         .isInstanceOf(IllegalArgumentException.class)
         .hasMessageStartingWith("Current snapshot ID does not match main 
branch");
   }
 
-  @Test
-  public void testMainWithoutCurrent() throws IOException {
+  @ParameterizedTest
+  @MethodSource("formatVersionsProvider")
+  public void testMainWithoutCurrent(int formatVersion) throws IOException {
+    assumeThat(formatVersion).isGreaterThanOrEqualTo(2);

Review Comment:
   Branch support constant here again



##########
core/src/test/java/org/apache/iceberg/TestTableMetadata.java:
##########
@@ -850,37 +888,30 @@ public void testAddPreviousMetadataRemoveMultiple() 
throws IOException {
         .isEqualTo(previousMetadataLog.subList(0, 4));
   }
 
-  @Test
-  public void testV2UUIDValidation() {
+  @ParameterizedTest
+  @MethodSource("formatVersionsProvider")
+  public void testV2UUIDValidation(int formatVersion) {
+    assumeThat(formatVersion).isGreaterThanOrEqualTo(2);

Review Comment:
   I think maybe this needs a constant too? 



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