Skip to content

Commit

Permalink
Fix failing Flowable 5 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
filiphr committed Feb 6, 2025
1 parent 1823a23 commit 89e67bf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void testAddCommentToProcessInstance() {
try {
taskService.addComment(null, processInstance.getId(), "Hello World 2");
} catch (FlowableException e) {
assertTextPresent("Cannot add a comment to a suspended execution", e.getMessage());
assertTextPresent("Cannot add a comment to a suspended ProcessInstance", e.getMessage());
}

// Delete comments again
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1415,41 +1415,43 @@ public void testDeleteTaskPartOfProcess() {
runtimeService.startProcessInstanceByKey("oneTaskProcess");
org.flowable.task.api.Task task = taskService.createTaskQuery().singleResult();
assertNotNull(task);
String taskErrorString = "Task[id=" + task.getId() + ", key=theTask, name=my task, processInstanceId=" + task.getProcessInstanceId() + ", executionId="
+ task.getExecutionId() + ", processDefinitionId=" + task.getProcessDefinitionId() + "]";

try {
taskService.deleteTask(task.getId());
} catch (FlowableException ae) {
assertEquals("The task cannot be deleted because is part of a running process", ae.getMessage());
assertEquals("The " + taskErrorString + " cannot be deleted because is part of a running process", ae.getMessage());
}

try {
taskService.deleteTask(task.getId(), true);
} catch (FlowableException ae) {
assertEquals("The task cannot be deleted because is part of a running process", ae.getMessage());
assertEquals("The " + taskErrorString + " cannot be deleted because is part of a running process", ae.getMessage());
}

try {
taskService.deleteTask(task.getId(), "test");
} catch (FlowableException ae) {
assertEquals("The task cannot be deleted because is part of a running process", ae.getMessage());
assertEquals("The " + taskErrorString + " cannot be deleted because is part of a running process", ae.getMessage());
}

try {
taskService.deleteTasks(Collections.singletonList(task.getId()));
} catch (FlowableException ae) {
assertEquals("The task cannot be deleted because is part of a running process", ae.getMessage());
assertEquals("The " + taskErrorString + " cannot be deleted because is part of a running process", ae.getMessage());
}

try {
taskService.deleteTasks(Collections.singletonList(task.getId()), true);
} catch (FlowableException ae) {
assertEquals("The task cannot be deleted because is part of a running process", ae.getMessage());
assertEquals("The " + taskErrorString + " cannot be deleted because is part of a running process", ae.getMessage());
}

try {
taskService.deleteTasks(Collections.singletonList(task.getId()), "test");
} catch (FlowableException ae) {
assertEquals("The task cannot be deleted because is part of a running process", ae.getMessage());
assertEquals("The " + taskErrorString + " cannot be deleted because is part of a running process", ae.getMessage());
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void testTableCount() {

String tablePrefix = processEngineConfiguration.getDatabaseTablePrefix();

assertEquals(Long.valueOf(13), tableCount.get(tablePrefix + "ACT_GE_PROPERTY"));
assertEquals(Long.valueOf(7), tableCount.get(tablePrefix + "ACT_GE_PROPERTY"));
assertEquals(Long.valueOf(0), tableCount.get(tablePrefix + "ACT_GE_BYTEARRAY"));
assertEquals(Long.valueOf(0), tableCount.get(tablePrefix + "ACT_RE_DEPLOYMENT"));
assertEquals(Long.valueOf(0), tableCount.get(tablePrefix + "ACT_RU_EXECUTION"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ public void testDeleteRunningHistoricProcessInstance() {
fail("Exception expected when deleting process-instance that is still running");
} catch (FlowableException ae) {
// Expected exception
assertTextPresent("Process instance is still running, cannot delete historic process instance", ae.getMessage());
assertTextPresent("Process instance is still running, cannot delete HistoricProcessInstanceEntity", ae.getMessage());
}
}

Expand Down

0 comments on commit 89e67bf

Please sign in to comment.