reswqa commented on code in PR #19560:
URL: https://github.com/apache/flink/pull/19560#discussion_r858287296


##########
flink-kubernetes/src/test/java/org/apache/flink/kubernetes/kubeclient/resources/KubernetesLeaderElectorITCase.java:
##########
@@ -19,36 +19,33 @@
 package org.apache.flink.kubernetes.kubeclient.resources;
 
 import org.apache.flink.configuration.Configuration;
-import org.apache.flink.kubernetes.KubernetesResource;
+import org.apache.flink.kubernetes.KubernetesExtension;
 import 
org.apache.flink.kubernetes.configuration.KubernetesLeaderElectionConfiguration;
 import org.apache.flink.kubernetes.kubeclient.FlinkKubeClient;
 import org.apache.flink.kubernetes.kubeclient.FlinkKubeClientFactory;
-import org.apache.flink.util.TestLogger;
 
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 import java.util.UUID;
 
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.not;
+import static org.assertj.core.api.Assertions.assertThat;
 
 /**
  * IT Tests for the {@link KubernetesLeaderElector}. Start multiple leader 
contenders currently, one
  * should elect successfully. And if current leader dies, a new one could take 
over.
  */
-public class KubernetesLeaderElectorITCase extends TestLogger {
-
-    @ClassRule public static KubernetesResource kubernetesResource = new 
KubernetesResource();
+public class KubernetesLeaderElectorITCase {
+    @RegisterExtension
+    private static final KubernetesExtension kubernetesExtension = new 
KubernetesExtension();

Review Comment:
   What is the reason why the fields modified by @RegisterExtension cannot be 
private, will this affect the injection of Extension or is it just our specific 
requirement.



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