}
}
@Test
public void testApply() throws IOException {
PrincipalProvider pp = mock(PrincipalProvider.class);
when(pp.get()).thenReturn(TestUtil.createPrincipal("admin", null, null));
EventFactory factory = new EventFactory(pp);
Consumer c = TestUtil.createConsumer();
Event e = factory.consumerCreated(c);
String value = publisher.apply(e);