Skip to content

Instantly share code, notes, and snippets.

@tkobayas
Created September 26, 2024 06:36
Show Gist options
  • Save tkobayas/66876018739590fa37da6c66170d4502 to your computer and use it in GitHub Desktop.
Save tkobayas/66876018739590fa37da6c66170d4502 to your computer and use it in GitHub Desktop.
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