raminqaf commented on code in PR #28261:
URL: https://github.com/apache/flink/pull/28261#discussion_r3350320692
##########
flink-state-backends/flink-statebackend-forst/src/test/java/org/apache/flink/state/forst/ForStIncrementalCheckpointRescalingTest.java:
##########
@@ -35,109 +35,110 @@
import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
import org.apache.flink.streaming.util.AbstractStreamOperatorTestHarness;
import org.apache.flink.streaming.util.KeyedOneInputStreamOperatorTestHarness;
+import org.apache.flink.testutils.junit.extensions.parameterized.Parameter;
+import
org.apache.flink.testutils.junit.extensions.parameterized.ParameterizedTestExtension;
+import org.apache.flink.testutils.junit.extensions.parameterized.Parameters;
import org.apache.flink.util.Collector;
-import org.apache.flink.util.TestLogger;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.TestTemplate;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.api.io.TempDir;
+import java.nio.file.Path;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import static
org.apache.flink.state.forst.ForStConfigurableOptions.USE_INGEST_DB_RESTORE_MODE;
+import static org.assertj.core.api.Assertions.assertThat;
/** Tests to guard rescaling from checkpoint. */
-@RunWith(Parameterized.class)
-public class ForStIncrementalCheckpointRescalingTest extends TestLogger {
+@ExtendWith(ParameterizedTestExtension.class)
+class ForStIncrementalCheckpointRescalingTest {
- @Rule public TemporaryFolder rootFolder = new TemporaryFolder();
+ @TempDir Path rootFolder;
- @Parameterized.Parameters(name = "useIngestDbRestoreMode: {0}")
+ @Parameters(name = "useIngestDbRestoreMode: {0}")
public static Collection<Boolean> parameters() {
return Arrays.asList(false, true);
}
Review Comment:
How about
```suggestion
@Parameters(name = "useIngestDbRestoreMode: {0}")
public static List<Boolean> parameters() {
return List.of(false, true);
}
```
##########
flink-state-backends/flink-statebackend-forst/src/test/java/org/apache/flink/state/forst/ForStInitITCase.java:
##########
@@ -21,33 +21,29 @@
import org.apache.flink.runtime.operators.testutils.ExpectedTestException;
import org.apache.flink.util.concurrent.Executors;
-import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
import java.io.File;
import java.io.IOException;
-import static org.junit.Assert.fail;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.fail;
/** Tests for {@link ForStStateBackend} on initialization. */
-public class ForStInitITCase {
-
- @Rule public final TemporaryFolder temporaryFolder = new TemporaryFolder();
+class ForStInitITCase {
/**
* This test checks that the ForSt native code loader still responds to
resetting the init flag.
*/
@Test
- public void testResetInitFlag() throws Exception {
+ void testResetInitFlag() throws Exception {
ForStStateBackend.resetForStLoadedFlag();
}
@Test
- public void testTempLibFolderDeletedOnFail() throws Exception {
+ void testTempLibFolderDeletedOnFail(@TempDir File tempFolder) throws
Exception {
Review Comment:
Exception can be dropped
```suggestion
void testTempLibFolderDeletedOnFail(@TempDir File tempFolder) {
```
##########
flink-state-backends/flink-statebackend-forst/src/test/java/org/apache/flink/state/forst/ForStIncrementalCheckpointRescalingTest.java:
##########
Review Comment:
Since you are at it, it seems that the exception here is not needed anymore
--
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]