@Test void testResolveBooleanExpressions() { List<String> expressions = Arrays.asList("a", "b"); when(jsMagmaScriptEvaluator.eval(expressions, entity)).thenReturn(Arrays.asList(TRUE, FALSE)); assertEquals( asList(true, false), expressionValidator.resolveBooleanExpressions(expressions, entity)); }
List<Boolean> resolveBooleanExpressions(List<String> expressions, Entity entity) { if (expressions.isEmpty()) { return Collections.emptyList(); } return jsMagmaScriptEvaluator.eval(expressions, entity).stream() .map(this::convertToBoolean) .collect(toList()); }
ExpressionValidator { List<Boolean> resolveBooleanExpressions(List<String> expressions, Entity entity) { if (expressions.isEmpty()) { return Collections.emptyList(); } return jsMagmaScriptEvaluator.eval(expressions, entity).stream() .map(this::convertToBoolean) .collect(toList()); } }
ExpressionValidator { List<Boolean> resolveBooleanExpressions(List<String> expressions, Entity entity) { if (expressions.isEmpty()) { return Collections.emptyList(); } return jsMagmaScriptEvaluator.eval(expressions, entity).stream() .map(this::convertToBoolean) .collect(toList()); } ExpressionValidator(JsMagmaScriptEvaluator jsMagmaScriptEvaluator); }
ExpressionValidator { List<Boolean> resolveBooleanExpressions(List<String> expressions, Entity entity) { if (expressions.isEmpty()) { return Collections.emptyList(); } return jsMagmaScriptEvaluator.eval(expressions, entity).stream() .map(this::convertToBoolean) .collect(toList()); } ExpressionValidator(JsMagmaScriptEvaluator jsMagmaScriptEvaluator);  }
ExpressionValidator { List<Boolean> resolveBooleanExpressions(List<String> expressions, Entity entity) { if (expressions.isEmpty()) { return Collections.emptyList(); } return jsMagmaScriptEvaluator.eval(expressions, entity).stream() .map(this::convertToBoolean) .collect(toList()); } ExpressionValidator(JsMagmaScriptEvaluator jsMagmaScriptEvaluator);   }