Skip to content

Commit

Permalink
More test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
filiphr committed Nov 29, 2023
1 parent 08c1dce commit 0b3e7b2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,8 @@ public void testDeleteCaseTaskShouldNotBePossible() {

assertThatThrownBy(() -> processEngineTaskService.deleteTask(caseTasks.get(0).getId()))
.isExactlyInstanceOf(FlowableException.class)
.hasMessageContaining("The task cannot be deleted")
.hasMessageContaining("The Task[")
.hasMessageContaining("cannot be deleted")
.hasMessageContaining("running case");

cmmnTaskService.complete(caseTasks.get(0).getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ public void testSimpleCombined() {

assertThatThrownBy(() -> processEngineManagementService.createExternalWorkerCompletionBuilder(cmmnAcquiredJob.getId(), "cmmnWorker").complete())
.isExactlyInstanceOf(FlowableException.class)
.hasMessage("External worker job with id " + cmmnAcquiredJob.getId()
+ " is not bpmn scoped. This command can only handle bpmn scoped external worker jobs");
.hasMessageContaining("ExternalWorkerJobEntity[id=" + cmmnAcquiredJob.getId())
.hasMessageContaining("is not bpmn scoped. This command can only handle bpmn scoped external worker jobs");

assertThatThrownBy(
() -> processEngineManagementService.createExternalWorkerCompletionBuilder(cmmnAcquiredJob.getId(), "cmmnWorker").bpmnError("errorCode"))
.isExactlyInstanceOf(FlowableException.class)
.hasMessage("External worker job with id " + cmmnAcquiredJob.getId()
+ " is not bpmn scoped. This command can only handle bpmn scoped external worker jobs");
.hasMessageContaining("ExternalWorkerJobEntity[id=" + cmmnAcquiredJob.getId())
.hasMessageContaining("is not bpmn scoped. This command can only handle bpmn scoped external worker jobs");

cmmnManagementService.createCmmnExternalWorkerTransitionBuilder(cmmnAcquiredJob.getId(), "cmmnWorker").complete();

Expand All @@ -91,13 +91,13 @@ public void testSimpleCombined() {

assertThatThrownBy(() -> cmmnManagementService.createCmmnExternalWorkerTransitionBuilder(bpmnAcquiredJob.getId(), "bpmnWorker").complete())
.isExactlyInstanceOf(FlowableException.class)
.hasMessage("External worker job with id " + bpmnAcquiredJob.getId()
+ " is not cmmn scoped. This command can only handle cmmn scoped external worker jobs");
.hasMessageContaining("ExternalWorkerJobEntity[id=" + bpmnAcquiredJob.getId())
.hasMessageContaining("is not cmmn scoped. This command can only handle cmmn scoped external worker jobs");

assertThatThrownBy(() -> cmmnManagementService.createCmmnExternalWorkerTransitionBuilder(bpmnAcquiredJob.getId(), "bpmnWorker").terminate())
.isExactlyInstanceOf(FlowableException.class)
.hasMessage("External worker job with id " + bpmnAcquiredJob.getId()
+ " is not cmmn scoped. This command can only handle cmmn scoped external worker jobs");
.hasMessageContaining("ExternalWorkerJobEntity[id=" + bpmnAcquiredJob.getId())
.hasMessageContaining("is not cmmn scoped. This command can only handle cmmn scoped external worker jobs");

processEngineManagementService.createExternalWorkerCompletionBuilder(bpmnAcquiredJob.getId(), "bpmnWorker").complete();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,8 @@ public void testDeleteProcessTaskShouldNotBePossible() {

assertThatThrownBy(() -> cmmnTaskService.deleteTask(task.getId()))
.isExactlyInstanceOf(FlowableException.class)
.hasMessageContaining("The task cannot be deleted")
.hasMessageContaining("The Task[")
.hasMessageContaining("cannot be deleted")
.hasMessageContaining("running process");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ public final Void execute(CommandContext commandContext) {
ExternalWorkerJobEntity externalWorkerJob = resolveJob(commandContext);

if (!ScopeTypes.CMMN.equals(externalWorkerJob.getScopeType())) {
throw new FlowableException(
"External worker job with id " + externalJobId + " is not cmmn scoped. This command can only handle cmmn scoped external worker jobs");
throw new FlowableException(externalWorkerJob + " is not cmmn scoped. This command can only handle cmmn scoped external worker jobs");
}

runJobLogic(externalWorkerJob, commandContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ protected AbstractExternalWorkerJobCmd(String externalJobId, String workerId, Jo
public final Void execute(CommandContext commandContext) {
ExternalWorkerJobEntity externalWorkerJob = resolveJob(commandContext);
if (externalWorkerJob.getProcessInstanceId() == null) {
throw new FlowableException(
"External worker job with id " + externalWorkerJob + " is not bpmn scoped. This command can only handle bpmn scoped external worker jobs");
throw new FlowableException(externalWorkerJob + " is not bpmn scoped. This command can only handle bpmn scoped external worker jobs");
}

runJobLogic(externalWorkerJob, commandContext);
Expand Down

0 comments on commit 0b3e7b2

Please sign in to comment.