PredixEventProcessor implements AuditEventProcessor { boolean isExclusion(final AuditEvent auditEvent) { URI requestUri; try { requestUri = new URI(auditEvent.getRequestUri()); } catch (URISyntaxException e) { throw new IllegalStateException("Request has malformed URI", e); } for (String exclusion : EXCLUSIONS) { if (requestUri.normalize().getPath().startsWith(exclusion)) { return true; } } return false; }  @Override boolean process(final AuditEvent auditEvent);  }
@Test public void testControllerExclusions() { AuditEvent auditEvent = Mockito.mock(AuditEvent.class); Mockito.doReturn("http: Assert.assertTrue(this.eventProcessor.isExclusion(auditEvent)); }
@Test public void testIncludedApis() { AuditEvent mockAuditEvent = Mockito.mock(AuditEvent.class); Mockito.doReturn("http: Assert.assertFalse(this.eventProcessor.isExclusion(mockAuditEvent)); }