1996fanrui commented on code in PR #23265:
URL: https://github.com/apache/flink/pull/23265#discussion_r1302929479


##########
flink-runtime/src/test/java/org/apache/flink/runtime/security/SecurityUtilsTest.java:
##########
@@ -31,23 +31,23 @@
 
 import org.apache.flink.shaded.guava31.com.google.common.collect.Lists;
 
-import org.junit.AfterClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Test;
 
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /** Tests for the {@link SecurityUtils}. */
 public class SecurityUtilsTest {

Review Comment:
   ```suggestion
   class SecurityUtilsTest {
   ```



##########
flink-runtime/src/test/java/org/apache/flink/runtime/security/modules/JaasModuleTest.java:
##########
@@ -21,42 +21,41 @@
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.configuration.CoreOptions;
 import org.apache.flink.runtime.security.SecurityConfiguration;
+import org.apache.flink.testutils.junit.utils.TempDirUtils;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
 import java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
 
 import static 
org.apache.flink.runtime.security.modules.JaasModule.JAVA_SECURITY_AUTH_LOGIN_CONFIG;
+import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.StringStartsWith.startsWith;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;

Review Comment:
   Using the `org.assertj.core.api.Assertions.assertThat` as well



##########
flink-runtime/src/test/java/org/apache/flink/runtime/security/SecurityUtilsTest.java:
##########
@@ -31,23 +31,23 @@
 
 import org.apache.flink.shaded.guava31.com.google.common.collect.Lists;
 
-import org.junit.AfterClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Test;
 
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;

Review Comment:
   These assert should be replaced with 
`org.assertj.core.api.Assertions.assertThat`



##########
flink-runtime/src/test/java/org/apache/flink/runtime/security/SecurityUtilsTest.java:
##########
@@ -31,23 +31,23 @@
 
 import org.apache.flink.shaded.guava31.com.google.common.collect.Lists;
 
-import org.junit.AfterClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Test;
 
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /** Tests for the {@link SecurityUtils}. */
 public class SecurityUtilsTest {
 
-    @AfterClass
-    public static void afterClass() {
+    @AfterAll
+    public static void afterAll() {

Review Comment:
   ```suggestion
       static void afterAll() {
   ```
   
   And all public of test method can be removed.



##########
flink-runtime/src/test/java/org/apache/flink/runtime/security/KerberosUtilsTest.java:
##########
@@ -18,11 +18,11 @@
 
 package org.apache.flink.runtime.security;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import javax.security.auth.login.AppConfigurationEntry;
 
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;

Review Comment:
   Should use the `org.assertj.core.api.Assertions.assertThat`



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

Reply via email to