use of com.enonic.xp.audit.FindAuditLogResult in project xp by enonic.
the class FindAuditLogHandler method doExecute.
@Override
protected Object doExecute() {
final FindAuditLogParams params = FindAuditLogParams.create().ids(ids).from(from).to(to).type(type).source(source).count(count).start(start).users(users).objectUris(objectUris).build();
final FindAuditLogResult result = auditLogService.find(params);
return new FindAuditLogResultMapper(result);
}
use of com.enonic.xp.audit.FindAuditLogResult in project xp by enonic.
the class AuditLogServiceImplTest method find.
@Test
public void find() {
FindAuditLogResult result = auditLogService.find(FindAuditLogParams.create().type(auditLogParams.getType()).build());
assertEquals(1, result.getCount());
assertEquals(1, result.getTotal());
assertLog(result.getHits().first());
}
use of com.enonic.xp.audit.FindAuditLogResult in project xp by enonic.
the class AuditLogServiceImplTest method find_no_filter.
@Test
public void find_no_filter() {
FindAuditLogResult result = auditLogService.find(FindAuditLogParams.create().build());
assertEquals(1, result.getCount());
assertEquals(1, result.getTotal());
assertLog(result.getHits().first());
}
use of com.enonic.xp.audit.FindAuditLogResult in project xp by enonic.
the class AuditLogServiceImplTest_find method find_to.
@Test
public void find_to() {
AuditLog log = logAsAdmin(LogAuditLogParams.create().type("test").time(Instant.now()).build());
FindAuditLogResult result = findAsAdmin(FindAuditLogParams.create().to(Instant.now().minus(30, ChronoUnit.DAYS)).build());
assertEquals(0L, result.getCount());
result = findAsAdmin(FindAuditLogParams.create().to(Instant.now()).build());
assertEquals(1L, result.getCount());
assertEquals(log, result.getHits().first());
}
use of com.enonic.xp.audit.FindAuditLogResult in project xp by enonic.
the class AuditLogServiceImplTest_find method find.
@Test
public void find() {
LogAuditLogParams params = LogAuditLogParams.create().type("test").build();
AuditLog log = logAsAdmin(params);
FindAuditLogResult result = findAsAdmin(FindAuditLogParams.create().ids(AuditLogIds.from(log.getId())).build());
assertEquals(1L, result.getCount());
assertEquals(log, result.getHits().first());
}
Aggregations