nastra commented on code in PR #9417:
URL: https://github.com/apache/iceberg/pull/9417#discussion_r1442867841
##########
spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/TestFunctionCatalog.java:
##########
@@ -27,107 +30,106 @@
import org.apache.spark.sql.connector.catalog.FunctionCatalog;
import org.apache.spark.sql.connector.catalog.Identifier;
import org.apache.spark.sql.connector.catalog.functions.UnboundFunction;
-import org.assertj.core.api.Assertions;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.TestTemplate;
-public class TestFunctionCatalog extends SparkTestBaseWithCatalog {
+public class TestFunctionCatalog extends TestBaseWithCatalog {
private static final String[] EMPTY_NAMESPACE = new String[] {};
private static final String[] SYSTEM_NAMESPACE = new String[] {"system"};
private static final String[] DEFAULT_NAMESPACE = new String[] {"default"};
private static final String[] DB_NAMESPACE = new String[] {"db"};
- private final FunctionCatalog asFunctionCatalog;
+ private FunctionCatalog asFunctionCatalog;
- public TestFunctionCatalog() {
+ @BeforeEach
+ public void before() {
+ super.before();
this.asFunctionCatalog = castToFunctionCatalog(catalogName);
+ createDefaultNamespace();
}
- @Before
public void createDefaultNamespace() {
sql("CREATE NAMESPACE IF NOT EXISTS %s", catalogName + ".default");
}
- @After
+ @AfterEach
public void dropDefaultNamespace() {
sql("DROP NAMESPACE IF EXISTS %s", catalogName + ".default");
}
- @Test
+ @TestTemplate
public void testListFunctionsViaCatalog() throws NoSuchNamespaceException {
- Assertions.assertThat(asFunctionCatalog.listFunctions(EMPTY_NAMESPACE))
Review Comment:
these changes are adding lots of noise. Using static imports in new test
files is preferrable, but we typically don't want to add too much changes to
new PRs by adding static imports. It's ok to keep these now, but just a
reminder for any future PRs
--
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]