1. Micha Kops
  2. activiti-bpmn2-tutorial

Commits

Micha Kops  committed 9d2628c

Testing process tasks added.

  • Participants
  • Parent commits e095d2d
  • Branches master

Comments (0)

Files changed (1)

File src/test/java/it/IssueRequestProcessTest.java

View file
 import java.util.Map;
 
 import org.activiti.engine.FormService;
+import org.activiti.engine.TaskService;
 import org.activiti.engine.form.FormProperty;
 import org.activiti.engine.history.HistoricDetail;
 import org.activiti.engine.history.HistoricFormProperty;
 import org.activiti.engine.repository.ProcessDefinition;
+import org.activiti.engine.runtime.ProcessInstance;
+import org.activiti.engine.task.Task;
 import org.activiti.engine.test.ActivitiRule;
 import org.activiti.engine.test.Deployment;
 import org.junit.Rule;
 		requestFormProps.put("priority", "critical");
 
 		Date startDate = new Date();
-		formService.submitStartFormData(definition.getId(), requestFormProps);
+		ProcessInstance processInstance = formService.submitStartFormData(
+				definition.getId(), requestFormProps);
+		assertThat(processInstance, notNullValue());
 
 		List<HistoricDetail> historicFormProps = activitiRule
 				.getHistoryService().createHistoricDetailQuery()
 		assertThat(historicSummary.getPropertyValue(),
 				equalTo(DESCRIPTION_VALUE));
 		assertThat(historicSummary.getTime(), greaterThan(startDate));
+
+		TaskService taskService = activitiRule.getTaskService();
+		Task approveCriticalIssueTask = taskService.createTaskQuery()
+				.processInstanceId(processInstance.getProcessInstanceId())
+				.singleResult();
+		assertThat(approveCriticalIssueTask.getName(),
+				equalTo("Approve Critical Issue"));
 	}
 }