Search in sources :

Example 11 with AuditLog

use of com.enonic.xp.audit.AuditLog in project xp by enonic.

the class AuditLogServiceImplTest method log_with_only_type.

@Test
public void log_with_only_type() {
    AuditLog log = auditLogService.log(LogAuditLogParams.create().type("test").build());
    assertLog(log);
}
Also used : AuditLog(com.enonic.xp.audit.AuditLog) Test(org.junit.jupiter.api.Test)

Example 12 with AuditLog

use of com.enonic.xp.audit.AuditLog in project xp by enonic.

the class AuditLogServiceImplDisabledTest method log_when_disabled.

@Test
public void log_when_disabled() {
    AuditLog log = auditLogService.log(LogAuditLogParams.create().type("test").build());
    assertNull(log);
}
Also used : AuditLog(com.enonic.xp.audit.AuditLog) Test(org.junit.jupiter.api.Test)

Example 13 with AuditLog

use of com.enonic.xp.audit.AuditLog in project xp by enonic.

the class FindAuditLogHandlerTest method mockCreateLog.

public void mockCreateLog() {
    AuditLog mocklog = auditLogBuilder(LogAuditLogParams.create().type("testlog").build()).source("testbundle").build();
    Mockito.when(this.auditLogService.find(Mockito.any(FindAuditLogParams.class))).thenReturn(FindAuditLogResult.create().hits(AuditLogs.from(mocklog)).total(2L).build());
}
Also used : FindAuditLogParams(com.enonic.xp.audit.FindAuditLogParams) AuditLog(com.enonic.xp.audit.AuditLog)

Example 14 with AuditLog

use of com.enonic.xp.audit.AuditLog in project xp by enonic.

the class GetAuditLogHandlerTest method mockCreateLog.

public void mockCreateLog() {
    AuditLog mocklog = auditLogBuilder(LogAuditLogParams.create().type("testlog").build()).source("testbundle").build();
    Mockito.when(this.auditLogService.get(Mockito.any(AuditLogId.class))).thenReturn(mocklog);
}
Also used : AuditLogId(com.enonic.xp.audit.AuditLogId) AuditLog(com.enonic.xp.audit.AuditLog)

Aggregations

AuditLog (com.enonic.xp.audit.AuditLog)14 Test (org.junit.jupiter.api.Test)10 FindAuditLogResult (com.enonic.xp.audit.FindAuditLogResult)6 LogAuditLogParams (com.enonic.xp.audit.LogAuditLogParams)3 AuditLogId (com.enonic.xp.audit.AuditLogId)2 FindAuditLogParams (com.enonic.xp.audit.FindAuditLogParams)1 Context (com.enonic.xp.context.Context)1 AuditLogContext (com.enonic.xp.core.impl.audit.AuditLogContext)1 PropertyTree (com.enonic.xp.data.PropertyTree)1 FindNodesByQueryResult (com.enonic.xp.node.FindNodesByQueryResult)1 NodeQuery (com.enonic.xp.node.NodeQuery)1