### Question:
AuthenticationModuleEventAuditor extends AbstractAuthenticationEventAuditor { public void auditModuleFailure(LoginState loginState, Principal principal, AuthenticationAuditEntry auditEntryDetail) { String realm = getRealmFromState(loginState); if (eventPublisher.isAuditing(realm, AUTHENTICATION_TOPIC, AM_LOGIN_MODULE_COMPLETED)) { String principalName = principal == null ? null : principal.getName(); Map sharedState = loginState == null ? emptyMap() : loginState.getSharedState(); String authId = getUserId(principalName, realm); if ((isEmpty(principalName) || isEmpty(authId)) && sharedState.containsKey(SHARED_STATE_USERNAME)) { principalName = (String) sharedState.get(SHARED_STATE_USERNAME); authId = getUserId(principalName, realm); } auditModuleEvent(loginState, realm, principalName, authId, FAILED, auditEntryDetail); } } @Inject  AuthenticationModuleEventAuditor(AuditEventPublisher eventPublisher, AuditEventFactory eventFactory); void auditModuleSuccess(LoginState loginState, Principal principal,
            AuthenticationAuditEntry auditEntryDetail); void auditModuleFailure(LoginState loginState, Principal principal,
            AuthenticationAuditEntry auditEntryDetail);  }### Answer:
@Test public void shouldNotFailAuditModuleFailure() { auditor.auditModuleFailure(null, null, null); auditor.auditModuleFailure(emptyState, emptyPrincipal, emptyAuditEntryDetail); verify(eventPublisher, times(2)).tryPublish(anyString(), any(AuditEvent.class)); }