AuditFilter implements Filter { boolean isOperationExcludedFromAudit(String requestHttpMethod, String requestOperation, Configuration config) { try { return AtlasRepositoryConfiguration.isExcludedFromAudit(config, requestHttpMethod, requestOperation); } catch (AtlasException e) { return false; } }  @Override void init(FilterConfig filterConfig); @Override void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain); static void audit(String who, String fromAddress, String whatRequest, String fromHost, String whatURL, String whatAddrs,
            String whenISO9601); static void recordMetrics(); @Override void destroy();  }
@Test public void testVerifyExcludedOperations() { AtlasRepositoryConfiguration.resetExcludedOperations(); when(configuration.getStringArray(AtlasRepositoryConfiguration.AUDIT_EXCLUDED_OPERATIONS)).thenReturn(new String[]{"GET:Version", "GET:Ping"}); AuditFilter auditFilter = new AuditFilter(); assertTrue(auditFilter.isOperationExcludedFromAudit("GET", "Version", configuration)); assertTrue(auditFilter.isOperationExcludedFromAudit("get", "Version", configuration)); assertTrue(auditFilter.isOperationExcludedFromAudit("GET", "Ping", configuration)); assertFalse(auditFilter.isOperationExcludedFromAudit("GET", "Types", configuration)); }
@Test public void testVerifyNotExcludedOperations() { AtlasRepositoryConfiguration.resetExcludedOperations(); when(configuration.getStringArray(AtlasRepositoryConfiguration.AUDIT_EXCLUDED_OPERATIONS)).thenReturn(new String[]{"Version", "Ping"}); AuditFilter auditFilter = new AuditFilter(); assertFalse(auditFilter.isOperationExcludedFromAudit("GET", "Version", configuration)); assertFalse(auditFilter.isOperationExcludedFromAudit("GET", "Ping", configuration)); assertFalse(auditFilter.isOperationExcludedFromAudit("GET", "Types", configuration)); }
@Test public void testNullConfig() { AtlasRepositoryConfiguration.resetExcludedOperations(); AuditFilter auditFilter = new AuditFilter(); assertFalse(auditFilter.isOperationExcludedFromAudit("GET", "Version", null)); }