nastra commented on code in PR #9862: URL: https://github.com/apache/iceberg/pull/9862#discussion_r1514068452
########## flink/v1.18/flink/src/test/java/org/apache/iceberg/flink/source/TestStreamingReaderOperator.java: ########## @@ -34,59 +37,45 @@ import org.apache.iceberg.FileFormat; import org.apache.iceberg.PartitionSpec; import org.apache.iceberg.Schema; -import org.apache.iceberg.TableTestBase; +import org.apache.iceberg.TestBase; import org.apache.iceberg.data.GenericAppenderHelper; import org.apache.iceberg.data.RandomGenericData; import org.apache.iceberg.data.Record; import org.apache.iceberg.flink.TestHelpers; import org.apache.iceberg.flink.TestTableLoader; -import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList; import org.apache.iceberg.relocated.com.google.common.collect.Iterables; import org.apache.iceberg.relocated.com.google.common.collect.Lists; import org.apache.iceberg.types.Types; import org.apache.iceberg.util.SnapshotUtil; import org.apache.iceberg.util.ThreadPools; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestTemplate; -@RunWith(Parameterized.class) -public class TestStreamingReaderOperator extends TableTestBase { +public class TestStreamingReaderOperator extends TestBase { private static final Schema SCHEMA = new Schema( Types.NestedField.required(1, "id", Types.IntegerType.get()), Types.NestedField.required(2, "data", Types.StringType.get())); private static final FileFormat DEFAULT_FORMAT = FileFormat.PARQUET; - @Parameterized.Parameters(name = "FormatVersion={0}") - public static Iterable<Object[]> parameters() { - return ImmutableList.of(new Object[] {1}, new Object[] {2}); - } - - public TestStreamingReaderOperator(int formatVersion) { - super(formatVersion); - } - - @Before + @BeforeEach @Override public void setupTable() throws IOException { - this.tableDir = temp.newFolder(); + this.tableDir = Files.createTempDirectory(temp, "junit").toFile(); this.metadataDir = new File(tableDir, "metadata"); - Assert.assertTrue(tableDir.delete()); + assertThat(tableDir.delete()).isTrue(); // Construct the iceberg table. table = create(SCHEMA, PartitionSpec.unpartitioned()); } - @Test + @TestTemplate public void testProcessAllRecords() throws Exception { List<List<Record>> expectedRecords = generateRecordsAndCommitTxn(10); List<FlinkInputSplit> splits = generateSplits(); - Assert.assertEquals("Should have 10 splits", 10, splits.size()); + assertThat(10).as("Should have 10 splits").isEqualTo(splits.size()); Review Comment: the actual/expected is the wrong way here. This should be `assertThat(splits).hasSize(10)`. -- 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