use of io.crnk.test.mock.models.Schedule in project crnk-framework by crnk-project.
the class ApprovalIntTest method createSchedule.
private Schedule createSchedule() {
Schedule schedule = newSchedule("someName", 13L);
schedule = scheduleRepo.create(schedule);
ResourceList<Schedule> schedules = scheduleRepo.findAll(new QuerySpec(Schedule.class));
Assert.assertEquals(1, schedules.size());
return schedule;
}
use of io.crnk.test.mock.models.Schedule in project crnk-framework by crnk-project.
the class ApprovalIntTest method newSchedule.
private Schedule newSchedule(String name, long id) {
Schedule schedule = new Schedule();
schedule.setId(id);
schedule.setName(name);
return schedule;
}
use of io.crnk.test.mock.models.Schedule in project crnk-framework by crnk-project.
the class ApprovalIntTest method verifyScheduleUpdated.
private void verifyScheduleUpdated() {
ResourceList<Schedule> schedules = scheduleRepo.findAll(new QuerySpec(Schedule.class));
Assert.assertEquals(1, schedules.size());
Schedule currentSchedule = schedules.get(0);
Assert.assertEquals("updatedName", currentSchedule.getName());
}
use of io.crnk.test.mock.models.Schedule in project crnk-framework by crnk-project.
the class ApprovalIntTest method updateToTriggerApproval.
private void updateToTriggerApproval(Schedule schedule) {
schedule.setName("updatedName");
Schedule currentPerson = scheduleRepo.save(schedule);
Assert.assertEquals("someName", currentPerson.getName());
}
use of io.crnk.test.mock.models.Schedule in project crnk-framework by crnk-project.
the class ApprovalIntTest method checkApprovalWorkflow.
@Test
public void checkApprovalWorkflow() {
Schedule schedule = createSchedule();
updateToTriggerApproval(schedule);
ApproveTask task = verifyApprovalStarted(schedule);
approve(task);
verifyApprovalCompleted(schedule);
verifyScheduleUpdated();
}
Aggregations