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/10/18 09:52:44 UTC

[GitHub] [flink] zentol commented on a diff in pull request #21088: [FLINK-29582][state-processor] Relax 1+ operator requirement

zentol commented on code in PR #21088:
URL: https://github.com/apache/flink/pull/21088#discussion_r997984157


##########
flink-libraries/flink-state-processing-api/src/test/java/org/apache/flink/state/api/SavepointWriterTest.java:
##########
@@ -22,43 +22,25 @@
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.configuration.ExecutionOptions;
 import org.apache.flink.configuration.StateBackendOptions;
-import org.apache.flink.state.api.functions.KeyedStateBootstrapFunction;
 import org.apache.flink.state.api.utils.CustomStateBackendFactory;
-import org.apache.flink.streaming.api.datastream.DataStream;
 import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
 /** Tests for the savepoint writer. */
-public class SavepointWriterTest {
+class SavepointWriterTest {
 
-    @Test(expected = CustomStateBackendFactory.ExpectedException.class)
-    public void testCustomStateBackend() throws Exception {
+    @Test
+    void testCustomStateBackend() {
         StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
         Configuration configuration = new Configuration();
         configuration.set(
                 StateBackendOptions.STATE_BACKEND,
                 CustomStateBackendFactory.class.getCanonicalName());
         configuration.set(ExecutionOptions.RUNTIME_MODE, RuntimeExecutionMode.BATCH);
-        env.configure(configuration);

Review Comment:
   This is an excellent example for why `@Test(expected = ...)` is such a flawed approach. You just don't know where the exception is actually thrown.



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