@Test public void ownAuthorizationAuditListener() throws Exception { registerAndRefresh(CustomAuthorizationAuditListenerConfiguration.class, AuditAutoConfiguration.class); assertThat(this.context.getBean(AbstractAuthorizationAuditListener.class)) .isInstanceOf(TestAuthorizationAuditListener.class); }
@Bean @ConditionalOnClass(name = "org.springframework.security.access.event.AbstractAuthorizationEvent") @ConditionalOnMissingBean(AbstractAuthorizationAuditListener.class) public AuthorizationAuditListener authorizationAuditListener() throws Exception { return new AuthorizationAuditListener(); }