You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/05/02 18:28:25 UTC

[GitHub] [flink] snuyanzin commented on a diff in pull request #19625: [FLINK-27470][state][tests] Migrate test to JUnit5

snuyanzin commented on code in PR #19625:
URL: https://github.com/apache/flink/pull/19625#discussion_r863076876


##########
flink-state-backends/flink-statebackend-heap-spillable/src/test/java/org/apache/flink/runtime/state/heap/OnHeapLevelIndexHeaderTest.java:
##########
@@ -20,65 +20,64 @@
 
 package org.apache.flink.runtime.state.heap;
 
-import org.apache.flink.util.TestLogger;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.util.concurrent.ThreadLocalRandom;
 
 import static org.apache.flink.runtime.state.heap.SkipListUtils.DEFAULT_LEVEL;
 import static org.apache.flink.runtime.state.heap.SkipListUtils.MAX_LEVEL;
 import static org.apache.flink.runtime.state.heap.SkipListUtils.NIL_NODE;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
 /** Tests for {@link OnHeapLevelIndexHeader}. */
-public class OnHeapLevelIndexHeaderTest extends TestLogger {
+public class OnHeapLevelIndexHeaderTest {

Review Comment:
   Probably it could be package private



##########
flink-state-backends/flink-statebackend-heap-spillable/src/test/java/org/apache/flink/runtime/state/heap/OnHeapLevelIndexHeaderTest.java:
##########
@@ -20,65 +20,64 @@
 
 package org.apache.flink.runtime.state.heap;
 
-import org.apache.flink.util.TestLogger;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.util.concurrent.ThreadLocalRandom;
 
 import static org.apache.flink.runtime.state.heap.SkipListUtils.DEFAULT_LEVEL;
 import static org.apache.flink.runtime.state.heap.SkipListUtils.MAX_LEVEL;
 import static org.apache.flink.runtime.state.heap.SkipListUtils.NIL_NODE;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
 /** Tests for {@link OnHeapLevelIndexHeader}. */
-public class OnHeapLevelIndexHeaderTest extends TestLogger {
+public class OnHeapLevelIndexHeaderTest {
     private static final ThreadLocalRandom random = ThreadLocalRandom.current();
 
     private OnHeapLevelIndexHeader heapHeadIndex;
 
-    @Before
+    @BeforeEach
     public void setUp() {

Review Comment:
   Probably it could be package private



##########
flink-state-backends/flink-statebackend-heap-spillable/src/test/java/org/apache/flink/runtime/state/heap/CopyOnWriteSkipListStateMapComplexOpTest.java:
##########
@@ -102,7 +96,7 @@ public String filterOrTransform(@Nullable String value) {
     private CopyOnWriteSkipListStateMap<Integer, Long, String> stateMapWithStates;
     private Map<Long, Map<Integer, String>> referenceStates;
 
-    @Before
+    @BeforeEach
     public void setUp() {

Review Comment:
   It seems package-private should be ok here



-- 
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-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org