map.put("foo bar", "456");
exchange.getIn().setBody(map);
SimplePredicateParser parser = new SimplePredicateParser("${body[foo]} == 123", true);
Predicate pre = parser.parsePredicate();
assertTrue("Should match", pre.matches(exchange));
parser = new SimplePredicateParser("${body['foo bar']} == 456", true);
pre = parser.parsePredicate();
assertTrue("Should match", pre.matches(exchange));
// the predicate has whitespace in the function
parser = new SimplePredicateParser("${body[foo bar]} == 456", true);
pre = parser.parsePredicate();
assertTrue("Should match", pre.matches(exchange));
}