nastra commented on code in PR #10657:
URL: https://github.com/apache/iceberg/pull/10657#discussion_r1668380274
##########
flink/v1.17/flink/src/test/java/org/apache/iceberg/flink/source/TestFlinkMergingMetrics.java:
##########
@@ -18,51 +18,46 @@
*/
package org.apache.iceberg.flink.source;
+import java.io.File;
import java.io.IOException;
import java.util.List;
import org.apache.flink.table.data.RowData;
import org.apache.flink.table.types.logical.RowType;
-import org.apache.iceberg.FileFormat;
import org.apache.iceberg.PartitionSpec;
+import org.apache.iceberg.Table;
import org.apache.iceberg.TestMergingMetrics;
import org.apache.iceberg.data.Record;
import org.apache.iceberg.flink.FlinkSchemaUtil;
-import org.apache.iceberg.flink.HadoopTableResource;
+import org.apache.iceberg.flink.HadoopCatalogExtension;
import org.apache.iceberg.flink.RowDataConverter;
+import org.apache.iceberg.flink.TestFixtures;
import org.apache.iceberg.flink.sink.FlinkAppenderFactory;
import org.apache.iceberg.io.FileAppender;
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
-import org.junit.ClassRule;
-import org.junit.Rule;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.extension.RegisterExtension;
public class TestFlinkMergingMetrics extends TestMergingMetrics<RowData> {
- @ClassRule public static final TemporaryFolder TEMP_FOLDER = new
TemporaryFolder();
-
- @Rule
- public final HadoopTableResource tableResource =
- new HadoopTableResource(TEMP_FOLDER, "test_db", "test_table", SCHEMA);
-
- public TestFlinkMergingMetrics(FileFormat fileFormat) {
- super(fileFormat);
- }
+ @RegisterExtension
+ private static final HadoopCatalogExtension catalogExtension =
+ new HadoopCatalogExtension(TestFixtures.DATABASE, TestFixtures.TABLE);
@Override
protected FileAppender<RowData> writeAndGetAppender(List<Record> records)
throws IOException {
+ Table table =
catalogExtension.catalog().createTable(TestFixtures.TABLE_IDENTIFIER, SCHEMA);
Review Comment:
should this be using `"test_db", "test_table" (similar to the previous rule)?
--
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]