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


##########
data/src/test/java/org/apache/iceberg/TestSplitScan.java:
##########
@@ -32,59 +35,50 @@
 import org.apache.iceberg.io.FileAppender;
 import org.apache.iceberg.relocated.com.google.common.collect.Lists;
 import org.apache.iceberg.types.Types;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-
-@RunWith(Parameterized.class)
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.TestTemplate;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.api.io.TempDir;
+
+@ExtendWith(ParameterizedTestExtension.class)
 public class TestSplitScan {
   private static final Configuration CONF = new Configuration();
   private static final HadoopTables TABLES = new HadoopTables(CONF);
-
   private static final long SPLIT_SIZE = 16 * 1024 * 1024;
 
   private static final Schema SCHEMA =
       new Schema(
           required(1, "id", Types.IntegerType.get()), required(2, "data", 
Types.StringType.get()));
 
+  @Parameters(name = "fileFormat = {0}")
+  public static Collection<FileFormat> parameters() {
+    return Arrays.asList(FileFormat.PARQUET, FileFormat.AVRO);
+  }
+
   private Table table;
   private File tableLocation;
-
-  @Rule public TemporaryFolder temp = new TemporaryFolder();
   private List<Record> expectedRecords;
 
-  @Parameterized.Parameters(name = "format = {0}")
-  public static Object[] parameters() {
-    return new Object[] {"parquet", "avro"};
-  }
+  @Parameter private FileFormat format;
+  @TempDir private File tempDir;
 
-  private final FileFormat format;
-
-  public TestSplitScan(String format) {
-    this.format = FileFormat.fromString(format);
-  }
-
-  @Before
+  @BeforeEach
   public void before() throws IOException {
-    tableLocation = new File(temp.newFolder(), "table");
+    tableLocation = new File(tempDir, "table");
     setupTable();
   }
 
-  @Test
+  @TestTemplate
   public void test() {
-    Assert.assertEquals(
-        "There should be 4 tasks created since file size is approximately 
close to 64MB and split size 16MB",
-        4,
-        Lists.newArrayList(table.newScan().planTasks()).size());
+    List<CombinedScanTask> tasks = 
Lists.newArrayList(table.newScan().planTasks());

Review Comment:
   can be inlined



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