use of io.crnk.activiti.example.model.ScheduleApprovalProcessInstance in project crnk-framework by crnk-project.
the class ProcessInstanceRepositoryTest method patchBusinessKey.
@Test
public void patchBusinessKey() {
ScheduleApprovalProcessInstance processInstance = postProcess(null, null, null);
processInstance.setBusinessKey("newKey");
ScheduleApprovalProcessInstance savedProcessInstance = processRepository.save(processInstance);
Assert.assertEquals("newKey", savedProcessInstance.getBusinessKey());
Assert.assertNotSame(processInstance, savedProcessInstance);
}
use of io.crnk.activiti.example.model.ScheduleApprovalProcessInstance in project crnk-framework by crnk-project.
the class ProcessInstanceRepositoryTest method checkSetDefaultsOnCreate.
@Test
public void checkSetDefaultsOnCreate() {
ScheduleApprovalProcessInstance resource = new ScheduleApprovalProcessInstance();
// will be set by default
resource.setProcessDefinitionKey(null);
ScheduleApprovalProcessInstance savedResource = processRepository.create(resource);
Assert.assertEquals("scheduleChange", savedResource.getProcessDefinitionKey());
}
use of io.crnk.activiti.example.model.ScheduleApprovalProcessInstance in project crnk-framework by crnk-project.
the class ProcessInstanceRepositoryTest method checkDelete.
@Test
public void checkDelete() {
ScheduleApprovalProcessInstance processInstance = postProcess(null, null, null);
processRepository.delete(processInstance.getId());
try {
processRepository.findOne(processInstance.getId(), new QuerySpec(ScheduleApprovalProcessInstance.class));
Assert.fail();
} catch (ResourceNotFoundException e) {
// ok
}
}
use of io.crnk.activiti.example.model.ScheduleApprovalProcessInstance in project crnk-framework by crnk-project.
the class ProcessInstanceRepositoryTest method checkResourceMapping.
@Test
public void checkResourceMapping() {
QuerySpec querySpec = new QuerySpec(ScheduleApprovalProcessInstance.class);
ScheduleApprovalProcessInstance resource = processRepository.findOne(processInstance.getId(), querySpec);
assertEqualsNotNull(processInstance.getId(), resource.getId());
assertEqualsNotNull(processInstance.getName(), resource.getName());
assertEqualsNotNull(processInstance.isEnded(), resource.isEnded());
assertEqualsNotNull(processInstance.isSuspended(), resource.isSuspended());
assertEqualsNotNull(processInstance.getBusinessKey(), resource.getBusinessKey());
assertEqualsNotNull(processInstance.getProcessDefinitionKey(), resource.getProcessDefinitionKey());
Map<String, Object> variables = processInstance.getProcessVariables();
assertEqualsNotNull(variables.get("newValues.name"), resource.getNewValues().getName());
assertEqualsNotNull(variables.get("resourceId"), resource.getResourceId());
assertEqualsNotNull(variables.get("resourceType"), resource.getResourceType());
}
use of io.crnk.activiti.example.model.ScheduleApprovalProcessInstance in project crnk-framework by crnk-project.
the class ProcessInstanceRepositoryTest method patchName.
@Test
public void patchName() {
ScheduleApprovalProcessInstance processInstance = postProcess(null, null, null);
processInstance.setName("newName");
ScheduleApprovalProcessInstance savedProcessInstance = processRepository.save(processInstance);
Assert.assertEquals("newName", savedProcessInstance.getName());
Assert.assertNotSame(processInstance, savedProcessInstance);
}
Aggregations