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

  MemorySinkSource mem = new MemorySinkSource();
  // %b will be replaced with event body
  EventSink format = new FormatterDecorator<EventSink>(mem, "test %{body}");
  Event e = new EventImpl("content".getBytes());
  e.set("attr1", "value".getBytes());
  format.open();
  format.append(e);
  format.close();
  mem.open();
  Event e2 = mem.next();
  assertEquals("test content", new String(e2.getBody()));
  assertEquals("value", Attributes.readString(e2, "attr1"));
}