PredixEventProcessor implements AuditEventProcessor { @Override public boolean process(final AuditEvent auditEvent) { if (null == this.auditClient || isExclusion(auditEvent)) { return false; } AuditEventV2 predixEvent = this.eventMapper.map(auditEvent); try { this.auditClient.audit(predixEvent); } catch (Exception e) { LOGGER.warn("Audit failed on process with event:" + predixEvent.toString(), e); return false; } return true; }  @Override boolean process(final AuditEvent auditEvent);  }
@Test public void testPredixEventProcess() throws AuditException, EventHubClientException { AuditEvent mockAuditEvent = Mockito.mock(AuditEvent.class); Mockito.doReturn("http: AuditEventV2 mockPredixEvent = Mockito.mock(AuditEventV2.class); Mockito.when(this.mockedMapper.map(anyObject())).thenReturn(mockPredixEvent); Assert.assertTrue(this.eventProcessor.process(mockAuditEvent)); Mockito.verify(this.mockedClient).audit(mockPredixEvent); }