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/03/21 11:06:14 UTC

[GitHub] [flink] RocMarshal commented on a change in pull request #18978: [FLINK-25549][flink-dstl] [JUnit5 Migration] Module: flink-dstl

RocMarshal commented on a change in pull request #18978:
URL: https://github.com/apache/flink/pull/18978#discussion_r830985473



##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/state/changelog/inmemory/StateChangelogStorageTest.java
##########
@@ -44,31 +45,43 @@
 import static java.util.function.Function.identity;
 import static java.util.stream.Collectors.toMap;
 import static java.util.stream.StreamSupport.stream;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
 /** {@link InMemoryStateChangelogStorage} test. */
 public class StateChangelogStorageTest<T extends ChangelogStateHandle> {
 
     private final Random random = new Random();
 
-    @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder();
+    @TempDir public File temporaryFolder;
 
-    @Test(expected = IllegalStateException.class)
-    public void testNoAppendAfterClose() throws IOException {
-        StateChangelogWriter<?> writer =
-                getFactory().createWriter(new OperatorID().toString(), KeyGroupRange.of(0, 0));
-        writer.close();
-        writer.append(0, new byte[0]);
+    public static Stream<Boolean> parameters() {
+        return Stream.of(true);
     }
 
-    @Test
-    public void testWriteAndRead() throws Exception {
+    @MethodSource("parameters")
+    @ParameterizedTest
+    public void testNoAppendAfterClose(boolean compression) throws IOException {
+        assertThatThrownBy(
+                        () -> {
+                            StateChangelogWriter<?> writer =
+                                    getFactory(compression, temporaryFolder)
+                                            .createWriter(
+                                                    new OperatorID().toString(),
+                                                    KeyGroupRange.of(0, 0));
+                            writer.close();
+                            writer.append(0, new byte[0]);
+                        })
+                .isInstanceOf(IllegalStateException.class);
+    }
+
+    @MethodSource("parameters")
+    @ParameterizedTest

Review comment:
       Okay.




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