Created
September 26, 2024 06:36
-
-
Save tkobayas/66876018739590fa37da6c66170d4502 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static final String JSON2 = | |
""" | |
{ | |
"rules": [ | |
{ | |
"Rule": { | |
"name": "r1", | |
"condition": { | |
"AllCondition": [ | |
{ | |
"EqualsExpression": { | |
"lhs": { | |
"Event": "i" | |
}, | |
"rhs": { | |
"Integer": 1 | |
} | |
} | |
} | |
] | |
}, | |
"actions": [ | |
{ | |
"Action": { | |
"action": "debug", | |
"action_args": {} | |
} | |
} | |
], | |
"enabled": true | |
} | |
} | |
] | |
} | |
"""; | |
@Test | |
public void arrayAndInteger() { | |
RulesExecutor rulesExecutor = RulesExecutorFactory.createFromJson(JSON2); | |
// mera.headers is a map, not a string | |
List<Match> matchedRules = rulesExecutor.processEvents("{ \"i\": [1] }").join(); | |
assertEquals(0, matchedRules.size()); | |
rulesExecutor.dispose(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment