@Test
public void testJsonConfigParser() {

    String json = "[" +
            " { 'header': 'xxx'    , 'value': '111'                                }," + // set always
            " { 'header': 'yyy'    , 'value': '222'                                }," + // set always
            " { 'header': 'yyy'    , 'value': '333'           , 'mode': 'complete' }," + // not set as already there
            " { 'header': 'zzz'    , 'value': '444'           , 'mode': 'override' }," + // not set as not (yet) there
            " { 'header': 'oli'    , 'value': '{xxx}-{yyy}'                        }," + // use variable replacement
            " { 'header': 'xxx'    , 'value': null                                 }," + // remove
            " { 'header': 'preSuff', 'value': 'pre-{yyy}-suff'                     }," + // test constant prefix and suffix
            " { 'header': 'aaa'    , 'value': 'yes'                                }," +
            " { 'header': 'aaa'    , 'value': ''                                   } " + // test that value = empty string also deletes the header
            "]";
    json = json.replace('\'', '"');
    JsonArray config = new JsonArray(json);
    HeaderFunction chain = HeaderFunctions.parseFromJson(config);
    MultiMap headers = new CaseInsensitiveHeaders();
    final EvalScope evalScope = chain.apply(headers);
    Assert.assertFalse(headers.contains("xxx")); // explicit removed
    Assert.assertFalse(headers.contains("zzz")); // never added
    Assert.assertEquals("222"         , headers.get("yyy"    ));
    Assert.assertEquals("111-222"     , headers.get("oli"    ));
    Assert.assertEquals("pre-222-suff", headers.get("preSuff"));
    Assert.assertNull("no eval error occured", evalScope.getErrorMessage());
    Assert.assertFalse(headers.contains("aaa"));
}