addWorkflow("TaskDemoWorkflow");
assertThat(taskboxService.getOpenTasks().size(), is(0));
authenticateAsAdmin();
ProcessBag processBag = new ProcessBag();
processBag.addProperty("test", "test");
Map<String, Object> parameterMap = new HashMap<String, Object>();
parameterMap.put("processBag", processBag);
assertThat(taskboxService.getOpenTasks().size(), is(0));
workflowService.startFlowWithParameters("TaskDemoWorkflow", parameterMap);
assertNotNull(processBag.getProcessId());
assertThat(taskboxService.getOpenTasks().size(), is(1));
Task task = taskboxService.getOpenTasks().get(0);
assertEquals(task.getProcessId(), processBag.getProcessId());
assertEquals(task.getProperty("test"), "test");
assertEquals(task.getTaskType(), "demo");
assertNotNull(task.getTaskId());
taskboxService.finishTask(task);
assertTrue(taskboxService.getOpenTasks().size() == 0);