HeaderFunctions { public static Consumer<EvalScope> setAlways(String headerName, String expression) { final Function<EvalScope, String> exprEval = newExpressionEvaluator(expression); return (scope) -> { String value = exprEval.apply(scope); scope.headers.set(headerName, value); }; }  static HeaderFunction parseFromJson(JsonArray config); @Deprecated static HeaderFunction parseStaticHeadersFromJson(JsonObject staticHeaders); static Consumer<EvalScope> remove(String headerName); static Consumer<EvalScope> setAlways(String headerName, String expression); static Consumer<EvalScope> setIfAbsent(String headerName, String expression); static Consumer<EvalScope> setIfPresent(String headerName, String expression); static final HeaderFunction DO_NOTHING; }
@Test public void testUnresolvableHeaderName() { Consumer<EvalScope> c = setAlways("gugus","{no-exist}"); MultiMap headers = new CaseInsensitiveHeaders(); EvalScope evalScope = new EvalScope(headers); c.accept(evalScope); Assert.assertNotNull("eval error message present", evalScope.getErrorMessage()); }