igalshilman commented on a change in pull request #307:
URL: https://github.com/apache/flink-statefun/pull/307#discussion_r823516954



##########
File path: 
statefun-flink/statefun-flink-core/src/test/java/org/apache/flink/statefun/flink/core/StatefulFunctionsConfigValidatorTest.java
##########
@@ -0,0 +1,39 @@
+package org.apache.flink.statefun.flink.core;

Review comment:
       missing licence header.

##########
File path: 
statefun-flink/statefun-flink-core/src/test/java/org/apache/flink/statefun/flink/core/StatefulFunctionsConfigValidatorTest.java
##########
@@ -0,0 +1,39 @@
+package org.apache.flink.statefun.flink.core;
+
+import static org.apache.flink.statefun.flink.core.TestUtils.shouldFail;
+import static org.hamcrest.Matchers.startsWith;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import org.apache.flink.api.java.utils.ParameterTool;
+import org.junit.Test;
+
+public class StatefulFunctionsConfigValidatorTest {
+
+  @Test
+  public void validatingWithoutEmbeddedModeShouldFail() {
+    Map<String, String> map = new HashMap<>();
+
+    Optional<Throwable> maybeThrowable =
+        shouldFail(
+            () ->
+                StatefulFunctionsConfigValidator.validate(
+                    ParameterTool.fromMap(map).getConfiguration()));
+
+    assertTrue(maybeThrowable.isPresent());
+    assertThat(
+        maybeThrowable.get().getMessage(),
+        startsWith("Invalid configuration: 
classloader.parent-first-patterns.additional"));

Review comment:
       I understand the intention with this test, but from my personal 
experience tests that assert on an exception message text are fragile.
   I think that a simple unit test with an `@Test(expect = ...)` should be 
enough.




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

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


Reply via email to