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