BPMN Unit test failing in Java

76 Views Asked by At

For the BPMN, I have written the unit test cases. It's working for the positive scenario but failing for the negative scenario. Below is the error. Please post your inputs. When it's executing the below line its giving the error. completeServiceTask(CANCEL_WORKFLOW, false);

{
client.newDeployResourceCommand()
        .addResourceFromClasspath("xyz.bpmn")
        .send()
        .join();

String Id = "ABC";

Model model= new Model();
model.setId("ABC");

ZeebeWorkflow zeebeWorkflow = new ZeebeWorkflow(Id, model);

PublishMessageResponse messageResponse = sendMessage(START_WORKFLOW,Id, zeebeWorkflow);
completeServiceTask(VALIDATION, false);
sendMessage(BOOK_WORKFLOW, Id, new BookMessagePayload("user","app"));
completeServiceTask(PROCESS_BOOKING, false);
sendMessage(CANCEL_WORKFLOW_MESSAGE, Id, new ZeebeMessagePayload());
completeServiceTask(CANCEL_WORKFLOW, false);
BpmnAssert.assertThat(messageResponse)
        .hasCreatedProcessInstance()
        .extractingProcessInstance()
        .hasPassedElementsInOrder(VALIDATION,PROCESS_BOOKING,CANCEL_WORKFLOW)
        .hasVariableWithValue("Id", "ABC")
        .hasVariableWithValue("user", "user")
        .isCompleted();
}

Below is the Error message

org.opentest4j.AssertionFailedError: Unable to activate 1 jobs, because only 0 were activated.

0

There are 0 best solutions below