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


##########
flink/v1.18/flink/src/test/java/org/apache/iceberg/flink/TestFlinkCatalogDatabase.java:
##########
@@ -29,88 +29,93 @@
 import org.apache.iceberg.catalog.TableIdentifier;
 import org.apache.iceberg.types.Types;
 import org.assertj.core.api.Assertions;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Assume;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.api.TestTemplate;
 
-public class TestFlinkCatalogDatabase extends FlinkCatalogTestBase {
+public class TestFlinkCatalogDatabase extends CatalogTestBase {
 
-  public TestFlinkCatalogDatabase(String catalogName, Namespace baseNamespace) 
{
-    super(catalogName, baseNamespace);
-  }
-
-  @After
+  @AfterEach
   @Override
   public void clean() {
     sql("DROP TABLE IF EXISTS %s.tl", flinkDatabase);
     sql("DROP DATABASE IF EXISTS %s", flinkDatabase);
     super.clean();
   }
 
-  @Test
+  @TestTemplate
   public void testCreateNamespace() {
-    Assert.assertFalse(
-        "Database should not already exist",
-        validationNamespaceCatalog.namespaceExists(icebergNamespace));
-
+    
Assertions.assertThat(validationNamespaceCatalog.namespaceExists(icebergNamespace))
+        .as("Database should not already exist")
+        .isFalse();
     sql("CREATE DATABASE %s", flinkDatabase);
 
-    Assert.assertTrue(
-        "Database should exist", 
validationNamespaceCatalog.namespaceExists(icebergNamespace));
+    
Assertions.assertThat(validationNamespaceCatalog.namespaceExists(icebergNamespace))
+        .as("Database should exist")
+        .isTrue();
 
     sql("CREATE DATABASE IF NOT EXISTS %s", flinkDatabase);
-    Assert.assertTrue(
-        "Database should still exist",
-        validationNamespaceCatalog.namespaceExists(icebergNamespace));
+
+    
Assertions.assertThat(validationNamespaceCatalog.namespaceExists(icebergNamespace))
+        .as("Database should still exist")
+        .isTrue();
 
     sql("DROP DATABASE IF EXISTS %s", flinkDatabase);
-    Assert.assertFalse(
-        "Database should be dropped", 
validationNamespaceCatalog.namespaceExists(icebergNamespace));
+
+    
Assertions.assertThat(validationNamespaceCatalog.namespaceExists(icebergNamespace))
+        .as("Database should be dropped")
+        .isFalse();
 
     sql("CREATE DATABASE IF NOT EXISTS %s", flinkDatabase);
-    Assert.assertTrue(
-        "Database should be created", 
validationNamespaceCatalog.namespaceExists(icebergNamespace));
+
+    
Assertions.assertThat(validationNamespaceCatalog.namespaceExists(icebergNamespace))
+        .as("Database should be created")
+        .isTrue();
   }
 
-  @Test
+  @TestTemplate
   public void testDropEmptyDatabase() {
-    Assert.assertFalse(
-        "Namespace should not already exist",
-        validationNamespaceCatalog.namespaceExists(icebergNamespace));
+
+    
Assertions.assertThat(validationNamespaceCatalog.namespaceExists(icebergNamespace))
+        .as("Namespace should not already exist")
+        .isFalse();
 
     sql("CREATE DATABASE %s", flinkDatabase);
 
-    Assert.assertTrue(
-        "Namespace should exist", 
validationNamespaceCatalog.namespaceExists(icebergNamespace));
+    
Assertions.assertThat(validationNamespaceCatalog.namespaceExists(icebergNamespace))
+        .as("Namespace should exist")
+        .isTrue();
 
     sql("DROP DATABASE %s", flinkDatabase);
 
-    Assert.assertFalse(
-        "Namespace should have been dropped",
-        validationNamespaceCatalog.namespaceExists(icebergNamespace));
+    
Assertions.assertThat(validationNamespaceCatalog.namespaceExists(icebergNamespace))
+        .as("Namespace should have been dropped")
+        .isFalse();
   }
 
-  @Test
+  @TestTemplate
   public void testDropNonEmptyNamespace() {
-    Assume.assumeFalse(
-        "Hadoop catalog throws IOException: Directory is not empty.", 
isHadoopCatalog);
 
-    Assert.assertFalse(
-        "Namespace should not already exist",
-        validationNamespaceCatalog.namespaceExists(icebergNamespace));
+    Assumptions.assumeFalse(

Review Comment:
   please use AssertJ `Assumtions`: `assumeThat(...).as(...).isFalse()`



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