use of io.crnk.core.queryspec.FilterSpec in project crnk-framework by crnk-project.
the class ProcessInstanceRepositoryTest method checkLEStartTime.
@Test
public void checkLEStartTime() {
QuerySpec querySpec = new QuerySpec(ScheduleApprovalProcessInstance.class);
querySpec.addFilter(new FilterSpec(Arrays.asList("startTime"), FilterOperator.LT, OffsetDateTime.now().plusHours(1)));
Assert.assertEquals(1, processRepository.findAll(querySpec).size());
querySpec = new QuerySpec(ScheduleApprovalProcessInstance.class);
querySpec.addFilter(new FilterSpec(Arrays.asList("startTime"), FilterOperator.LT, OffsetDateTime.now().minusHours(1)));
Assert.assertEquals(0, processRepository.findAll(querySpec).size());
}
use of io.crnk.core.queryspec.FilterSpec in project crnk-framework by crnk-project.
the class ProcessInstanceRepositoryTest method checkGTStartTime.
@Test
public void checkGTStartTime() {
QuerySpec querySpec = new QuerySpec(ScheduleApprovalProcessInstance.class);
querySpec.addFilter(new FilterSpec(Arrays.asList("startTime"), FilterOperator.GT, OffsetDateTime.now().minusHours(1)));
Assert.assertEquals(1, processRepository.findAll(querySpec).size());
querySpec = new QuerySpec(ScheduleApprovalProcessInstance.class);
querySpec.addFilter(new FilterSpec(Arrays.asList("startTime"), FilterOperator.GT, OffsetDateTime.now().plusHours(1)));
Assert.assertEquals(0, processRepository.findAll(querySpec).size());
}
use of io.crnk.core.queryspec.FilterSpec in project crnk-framework by crnk-project.
the class TaskResourceRepositoryTest method checkGTDueDate.
@Test
public void checkGTDueDate() {
QuerySpec querySpec = new QuerySpec(ApproveTask.class);
querySpec.addFilter(new FilterSpec(Arrays.asList("dueDate"), FilterOperator.GT, OffsetDateTime.now().minusHours(1)));
Assert.assertEquals(1, taskRepository.findAll(querySpec).size());
querySpec = new QuerySpec(TaskResource.class);
querySpec.addFilter(new FilterSpec(Arrays.asList("dueDate"), FilterOperator.GT, OffsetDateTime.now().plusHours(1)));
Assert.assertEquals(0, taskRepository.findAll(querySpec).size());
}
use of io.crnk.core.queryspec.FilterSpec in project crnk-framework by crnk-project.
the class TaskResourceRepositoryTest method checkLEDueDate.
@Test
public void checkLEDueDate() {
QuerySpec querySpec = new QuerySpec(ApproveTask.class);
querySpec.addFilter(new FilterSpec(Arrays.asList("dueDate"), FilterOperator.LT, OffsetDateTime.now().plusHours(1)));
Assert.assertEquals(1, taskRepository.findAll(querySpec).size());
querySpec = new QuerySpec(TaskResource.class);
querySpec.addFilter(new FilterSpec(Arrays.asList("dueDate"), FilterOperator.LT, OffsetDateTime.now().minusHours(1)));
Assert.assertEquals(0, taskRepository.findAll(querySpec).size());
}
use of io.crnk.core.queryspec.FilterSpec in project crnk-framework by crnk-project.
the class TaskResourceRepositoryTest method checkGTPriority.
@Test
public void checkGTPriority() {
QuerySpec querySpec = new QuerySpec(ApproveTask.class);
querySpec.addFilter(new FilterSpec(Arrays.asList("priority"), FilterOperator.GE, task.getPriority() - 1));
Assert.assertEquals(1, taskRepository.findAll(querySpec).size());
querySpec = new QuerySpec(TaskResource.class);
querySpec.addFilter(new FilterSpec(Arrays.asList("priority"), FilterOperator.GE, task.getPriority() + 1));
Assert.assertEquals(0, taskRepository.findAll(querySpec).size());
}
Aggregations