@Before
 public void init() throws Exception {
   this.factory = new EventFactory(mockPrincipalProvider);
   this.principal = TestUtil.createOwnerPrincipal();
   eventFilter = new EventFilter(new CandlepinCommonTestConfig());
   when(mockPrincipalProvider.get()).thenReturn(this.principal);
   when(mockSessionFactory.createTransactedSession()).thenReturn(mockClientSession);
   when(mockClientSession.createProducer(anyString())).thenReturn(mockClientProducer);
   when(mockClientSession.createMessage(anyBoolean())).thenReturn(mockClientMessage);
   when(mockClientMessage.getBodyBuffer()).thenReturn(HornetQBuffers.fixedBuffer(2000));
   when(mockSessionFactory.getServerLocator()).thenReturn(mockLocator);
   this.mapper = spy(new ObjectMapper());
   this.eventSinkImpl = createEventSink(mockSessionFactory);
   o = new Owner("test owner");
 }