Search in sources :

Example 1 with AuditEventRepository

use of org.springframework.boot.actuate.audit.AuditEventRepository in project spring-boot by spring-projects.

the class AuditListenerTests method testStoredEvents.

@Test
public void testStoredEvents() {
    AuditEventRepository repository = mock(AuditEventRepository.class);
    AuditEvent event = new AuditEvent("principal", "type", Collections.<String, Object>emptyMap());
    AuditListener listener = new AuditListener(repository);
    listener.onApplicationEvent(new AuditApplicationEvent(event));
    verify(repository).add(event);
}
Also used : AuditEvent(org.springframework.boot.actuate.audit.AuditEvent) AuditEventRepository(org.springframework.boot.actuate.audit.AuditEventRepository) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 AuditEvent (org.springframework.boot.actuate.audit.AuditEvent)1 AuditEventRepository (org.springframework.boot.actuate.audit.AuditEventRepository)1