Increment code coverage for Application
[oam/nf-oam-adopter.git] / ves-nf-oam-adopter / ves-nf-oam-adopter-app / src / main / java / org / o / ran / oam / nf / oam / adopter / app / config / LoginAttemptsLogger.java
index e1222f5..072fbb9 100644 (file)
@@ -40,6 +40,10 @@ public class LoginAttemptsLogger {
     public void auditEventHappened(final AuditApplicationEvent auditApplicationEvent) {
         final AuditEvent auditEvent = auditApplicationEvent.getAuditEvent();
         final WebAuthenticationDetails details = (WebAuthenticationDetails) auditEvent.getData().get("details");
+        if (details == null) {
+            LOG.info("AUDIT: User: {} Event Type: {}", auditEvent.getPrincipal(), auditEvent.getType());
+            return;
+        }
         LOG.info("AUDIT: User: {} Event Type: {} Remote IP address: {}",
                 auditEvent.getPrincipal(), auditEvent.getType(), details.getRemoteAddress());
     }