Skip to content

Commit

Permalink
PROC-1219: Fix error message in case test fails
Browse files Browse the repository at this point in the history
Make it clear that Strings 'true' and 'false' are valid
  • Loading branch information
Robert Danci committed Apr 18, 2023
1 parent 9e504ec commit 4960d97
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -49,10 +49,10 @@ public void testEmptyRule() {

@Test
public void testLiteralRule() {
for (final String rule : new String[] { "${true}", "${TRUE}", "${ TRUE }" }) {
for (final String rule : new String[] { "${true}", "${TRUE}", "${ TRUE }", "${'TRUE'}", "${'true'}" }) {
assertTrue("rule '" + rule + "' should be true", ruleEvaluator.evaluateBooleanRule(rule, emptyMap()));
}
for (final String rule : new String[] { "${false}", "${FALSE}", "${ FALSE }" }) {
for (final String rule : new String[] { "${false}", "${FALSE}", "${ FALSE }", "${'FALSE'}", "${'false'}" }) {
assertFalse("rule '" + rule + "' should be false", ruleEvaluator.evaluateBooleanRule(rule, emptyMap()));
}
}
Expand Down Expand Up @@ -96,7 +96,7 @@ public void testStandaloneMethodCalls() {
}

for (String rule : ImmutableList.of("${!context.isValid()}", "${context.isFortyTwo('47')}")) {
assertFalse("rule '" + rule + "' should be true for " + context, ruleEvaluator.evaluateBooleanRule(rule, context));
assertFalse("rule '" + rule + "' should be false for " + context, ruleEvaluator.evaluateBooleanRule(rule, context));
}

assertThatThrownBy(() -> ruleEvaluator.evaluateBooleanRule("${context.isNotFortyTwo('42')}", context))
Expand Down

0 comments on commit 4960d97

Please sign in to comment.