pibizza commented on code in PR #6085:
URL:
https://github.com/apache/incubator-kie-drools/pull/6085#discussion_r1762769446
##########
kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/runtime/functions/MatchesFunctionTest.java:
##########
@@ -19,116 +19,146 @@
package org.kie.dmn.feel.runtime.functions;
import org.junit.jupiter.api.Test;
-import org.mockito.MockedStatic;
-import java.security.InvalidParameterException;
-import java.util.regex.PatternSyntaxException;
-
-import static
org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType;
-import static
org.assertj.core.api.AssertionsForClassTypes.assertThatNoException;
-import static org.mockito.Mockito.*;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
+import org.kie.dmn.feel.runtime.events.InvalidParametersEvent;
class MatchesFunctionTest {
- @Test
- void invokeNull() {
-
assertThatExceptionOfType(InvalidParameterException.class).isThrownBy(() ->
MatchesFunction.matchFunctionWithFlags(null, null, null));
-
assertThatExceptionOfType(InvalidParameterException.class).isThrownBy(() ->
MatchesFunction.matchFunctionWithFlags(null, "test", null));
-
assertThatExceptionOfType(InvalidParameterException.class).isThrownBy(() ->
MatchesFunction.matchFunctionWithFlags("test", null, null));
+ private static final MatchesFunction matchesFunction =
MatchesFunction.INSTANCE;
+
+ @ParameterizedTest
+ @MethodSource("invokeNullTestData")
+ void invokeNullTest(String input, String pattern, Class<?>
expectedErrorEventClass) {
Review Comment:
@yesamer Yes, that makes sense. Feel free to keep the code as it is in that
case.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]