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


##########
aliyun/src/test/java/org/apache/iceberg/aliyun/TestAliyunClientFactories.java:
##########
@@ -22,43 +22,45 @@
 import java.util.Map;
 import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
 import org.apache.iceberg.relocated.com.google.common.collect.Maps;
-import org.junit.Assert;
-import org.junit.Test;
+import org.assertj.core.api.Assertions;
+import org.junit.jupiter.api.Test;
 
 public class TestAliyunClientFactories {
 
   @Test
   public void testLoadDefault() {
-    Assert.assertEquals(
-        "Default client should be singleton",
-        AliyunClientFactories.defaultFactory(),
-        AliyunClientFactories.defaultFactory());
+

Review Comment:
   unnecessary newline. please also check all other places where unnecessary 
newlines have been added



##########
aliyun/src/test/java/org/apache/iceberg/aliyun/oss/mock/TestLocalAliyunOSS.java:
##########
@@ -31,23 +31,23 @@
 import java.util.Random;
 import java.util.UUID;
 import org.apache.iceberg.aliyun.TestUtility;
-import org.apache.iceberg.aliyun.oss.AliyunOSSTestRule;
+import org.apache.iceberg.aliyun.oss.AliyunOSSExtension;
 import org.apache.iceberg.relocated.com.google.common.io.ByteStreams;
 import org.assertj.core.api.Assertions;
+import org.assertj.core.api.Assumptions;
 import org.assertj.core.api.InstanceOfAssertFactories;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Assume;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class TestLocalAliyunOSS {
 
-  @ClassRule public static final AliyunOSSTestRule OSS_TEST_RULE = 
TestUtility.initialize();
+  @RegisterExtension
+  public static final AliyunOSSExtension OSS_TEST_EXTENSION = 
TestUtility.initialize();

Review Comment:
   this can be private now



##########
aliyun/src/test/java/org/apache/iceberg/aliyun/oss/AliyunOSSExtension.java:
##########
@@ -39,18 +39,13 @@ default String testBucketName() {
   }
 
   @Override
-  default Statement apply(Statement base, Description description) {
-    return new Statement() {
-      @Override
-      public void evaluate() throws Throwable {
-        start();
-        try {
-          base.evaluate();
-        } finally {
-          stop();
-        }
-      }
-    };
+  default void afterAll(ExtensionContext context) throws Exception {
+    stop();
+  }
+
+  @Override
+  default void beforeAll(ExtensionContext context) throws Exception {

Review Comment:
   ah sorry, I missed that this is an interface



##########
aliyun/src/test/java/org/apache/iceberg/aliyun/oss/AliyunOSSTestBase.java:
##########
@@ -21,25 +21,26 @@
 import com.aliyun.oss.OSS;
 import org.apache.iceberg.aliyun.TestUtility;
 import org.apache.iceberg.util.SerializableSupplier;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.ClassRule;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 public abstract class AliyunOSSTestBase {
-  @ClassRule public static final AliyunOSSTestRule OSS_TEST_RULE = 
TestUtility.initialize();
+  @RegisterExtension
+  public static final AliyunOSSExtension OSS_TEST_EXTENSION = 
TestUtility.initialize();

Review Comment:
   this can be private now



##########
aliyun/src/test/java/org/apache/iceberg/aliyun/TestAliyunClientFactories.java:
##########
@@ -22,43 +22,45 @@
 import java.util.Map;
 import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
 import org.apache.iceberg.relocated.com.google.common.collect.Maps;
-import org.junit.Assert;
-import org.junit.Test;
+import org.assertj.core.api.Assertions;
+import org.junit.jupiter.api.Test;
 
 public class TestAliyunClientFactories {
 
   @Test
   public void testLoadDefault() {
-    Assert.assertEquals(
-        "Default client should be singleton",
-        AliyunClientFactories.defaultFactory(),
-        AliyunClientFactories.defaultFactory());
+

Review Comment:
   unnecessary newline



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