Search in sources :

Example 21 with Schedule

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;
}
Also used : Schedule(io.crnk.test.mock.models.Schedule) QuerySpec(io.crnk.core.queryspec.QuerySpec)

Example 22 with 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;
}
Also used : Schedule(io.crnk.test.mock.models.Schedule)

Example 23 with 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());
}
Also used : Schedule(io.crnk.test.mock.models.Schedule) QuerySpec(io.crnk.core.queryspec.QuerySpec)

Example 24 with Schedule

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());
}
Also used : Schedule(io.crnk.test.mock.models.Schedule)

Example 25 with Schedule

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();
}
Also used : Schedule(io.crnk.test.mock.models.Schedule) ApproveTask(io.crnk.activiti.example.model.ApproveTask) Test(org.junit.Test) JerseyTest(org.glassfish.jersey.test.JerseyTest)

Aggregations

Schedule (io.crnk.test.mock.models.Schedule)37 Test (org.junit.Test)24 QuerySpec (io.crnk.core.queryspec.QuerySpec)21 Task (io.crnk.test.mock.models.Task)10 ScheduleRepository (io.crnk.test.mock.repository.ScheduleRepository)5 AbstractClientTest (io.crnk.client.AbstractClientTest)4 ObjectProxy (io.crnk.client.internal.proxy.ObjectProxy)4 Project (io.crnk.test.mock.models.Project)3 DocumentFilterChain (io.crnk.core.engine.filter.DocumentFilterChain)2 DocumentFilterContext (io.crnk.core.engine.filter.DocumentFilterContext)2 ActionPath (io.crnk.core.engine.internal.dispatcher.path.ActionPath)2 ScheduleList (io.crnk.test.mock.repository.ScheduleRepository.ScheduleList)2 ScheduleListLinks (io.crnk.test.mock.repository.ScheduleRepository.ScheduleListLinks)2 ScheduleListMeta (io.crnk.test.mock.repository.ScheduleRepository.ScheduleListMeta)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 ApprovalManager (io.crnk.activiti.example.approval.ApprovalManager)1 ApprovalMapper (io.crnk.activiti.example.approval.ApprovalMapper)1 ApprovalRelationshipRepository (io.crnk.activiti.example.approval.ApprovalRelationshipRepository)1 ApproveTask (io.crnk.activiti.example.model.ApproveTask)1