@Test
public void testValueDecoratorWithEscape() throws IOException, InterruptedException {

  String value = "value-%{nanos}-%{body}";
  ValueDecorator dec = new ValueDecorator(new ConsoleEventSink(), "attr", value, true);
  dec.open();
  Event e = new EventImpl("bodyString".getBytes(), 1234567L, Event.Priority.INFO, 87654321L, "host");
  dec.append(e);
  Assert.assertNotNull("Attribute wasn't added", e.get("attr"));
  Assert.assertEquals("Attribute value is incorrect", "value-87654321-bodyString", new String(e.get("attr")));
  dec.close();
}