use of com.enonic.xp.impl.server.rest.model.CleanUpAuditLogRequestJson in project xp by enonic.
the class AuditLogResourceTest method cleanUpAuditLog.
@Test
public void cleanUpAuditLog() throws Exception {
Mockito.when(taskService.submitTask(isA(SubmitTaskParams.class))).thenReturn(TaskId.from("task-id"));
final CleanUpAuditLogRequestJson requestJson = new CleanUpAuditLogRequestJson("PT1s");
final TaskResultJson result = resource.cleanup(requestJson);
final ArgumentCaptor<SubmitTaskParams> captor = ArgumentCaptor.forClass(SubmitTaskParams.class);
Mockito.verify(taskService, Mockito.times(1)).submitTask(captor.capture());
assertEquals("task-id", result.getTaskId());
assertEquals(1, captor.getValue().getData().getTotalSize());
assertEquals("PT1s", captor.getValue().getData().getString("ageThreshold"));
}
Aggregations