@Test public void testAudit() throws AuditException { @SuppressWarnings("unchecked") Map<PredicateKey, String> predicateMap = (Map<PredicateKey, String>) mock(Map.class); doReturn(predicateMap).when(auditService).createPredicateMap(); SecurityEvent event = new UnauthorizedAccessAttemptedEvent(IP_ADDRESS, USER_NAME); listener.audit(event); verify(auditService).audit("UnauthorizedAccessAttemptedEventListener", USER_NAME, SecurityAuditVerb.ATTEMPTS_TO_ACCESS_UNAUTHORIZED_RESOURCE, "Unauthorized Page", predicateMap); }
@Override public void audit(SecurityEvent event) { UnauthorizedAccessAttemptedEvent unauthorizedAccessAttemptedEvent = (UnauthorizedAccessAttemptedEvent) event; Map<PredicateKey, String> predicateMap = auditService .createPredicateMap(); predicateMap.put(SecurityPredicateKey.IP_ADDRESS, event.getIpAddress()); try { auditService.audit("UnauthorizedAccessAttemptedEventListener", unauthorizedAccessAttemptedEvent.getUserName(), SecurityAuditVerb.ATTEMPTS_TO_ACCESS_UNAUTHORIZED_RESOURCE, "Unauthorized Page", predicateMap); } catch (AuditException e) { logger.error(e.getMessage(), e); } }
UnauthorizedAccessAttemptedEventListener extends
		SecurityEventListener { @Override public void audit(SecurityEvent event) { UnauthorizedAccessAttemptedEvent unauthorizedAccessAttemptedEvent = (UnauthorizedAccessAttemptedEvent) event; Map<PredicateKey, String> predicateMap = auditService .createPredicateMap(); predicateMap.put(SecurityPredicateKey.IP_ADDRESS, event.getIpAddress()); try { auditService.audit("UnauthorizedAccessAttemptedEventListener", unauthorizedAccessAttemptedEvent.getUserName(), SecurityAuditVerb.ATTEMPTS_TO_ACCESS_UNAUTHORIZED_RESOURCE, "Unauthorized Page", predicateMap); } catch (AuditException e) { logger.error(e.getMessage(), e); } } }
UnauthorizedAccessAttemptedEventListener extends
		SecurityEventListener { @Override public void audit(SecurityEvent event) { UnauthorizedAccessAttemptedEvent unauthorizedAccessAttemptedEvent = (UnauthorizedAccessAttemptedEvent) event; Map<PredicateKey, String> predicateMap = auditService .createPredicateMap(); predicateMap.put(SecurityPredicateKey.IP_ADDRESS, event.getIpAddress()); try { auditService.audit("UnauthorizedAccessAttemptedEventListener", unauthorizedAccessAttemptedEvent.getUserName(), SecurityAuditVerb.ATTEMPTS_TO_ACCESS_UNAUTHORIZED_RESOURCE, "Unauthorized Page", predicateMap); } catch (AuditException e) { logger.error(e.getMessage(), e); } } UnauthorizedAccessAttemptedEventListener(EventService eventService,
			AuditService auditService); }
UnauthorizedAccessAttemptedEventListener extends
		SecurityEventListener { @Override public void audit(SecurityEvent event) { UnauthorizedAccessAttemptedEvent unauthorizedAccessAttemptedEvent = (UnauthorizedAccessAttemptedEvent) event; Map<PredicateKey, String> predicateMap = auditService .createPredicateMap(); predicateMap.put(SecurityPredicateKey.IP_ADDRESS, event.getIpAddress()); try { auditService.audit("UnauthorizedAccessAttemptedEventListener", unauthorizedAccessAttemptedEvent.getUserName(), SecurityAuditVerb.ATTEMPTS_TO_ACCESS_UNAUTHORIZED_RESOURCE, "Unauthorized Page", predicateMap); } catch (AuditException e) { logger.error(e.getMessage(), e); } } UnauthorizedAccessAttemptedEventListener(EventService eventService,
			AuditService auditService); @Override boolean canHandle(Object event); @Override void handle(Object event); @Override void audit(SecurityEvent event); }
UnauthorizedAccessAttemptedEventListener extends
		SecurityEventListener { @Override public void audit(SecurityEvent event) { UnauthorizedAccessAttemptedEvent unauthorizedAccessAttemptedEvent = (UnauthorizedAccessAttemptedEvent) event; Map<PredicateKey, String> predicateMap = auditService .createPredicateMap(); predicateMap.put(SecurityPredicateKey.IP_ADDRESS, event.getIpAddress()); try { auditService.audit("UnauthorizedAccessAttemptedEventListener", unauthorizedAccessAttemptedEvent.getUserName(), SecurityAuditVerb.ATTEMPTS_TO_ACCESS_UNAUTHORIZED_RESOURCE, "Unauthorized Page", predicateMap); } catch (AuditException e) { logger.error(e.getMessage(), e); } } UnauthorizedAccessAttemptedEventListener(EventService eventService,
			AuditService auditService); @Override boolean canHandle(Object event); @Override void handle(Object event); @Override void audit(SecurityEvent event);  }