Testing Camunda Service task in a BPMN

Hello,

I have a single service task placed at different parts of a BPMN executing same Java Class, however I would be setting a different value to a process variable at this User Task. The value of the process variable would come to me a via an external api, the same api call would claim and change the process variable, my service task has to call another external api.
When i am trying to write unit test cases for the same, i am not able to set Processvariables value, and hence getting an error at gateway. I am trying to change the process variable value using

DelegateExpressions.registerJavaDelegateMock(ServiceTask.class).onExecutionSetVariable("status","Approved");
  DelegateExpressions.registerJavaDelegateMock(ServiceTask.class).onExecutionSetVariable("status","Approved");
    ProcessInstance processInstance = startProcessInstance();
    assertThat(processInstance).isActive();
    assertThat(processInstance).isWaitingAtExactly("UserTask1");
    assertThat(task()).hasName("Claim Application/ User Request");
    complete(task());
DelegateExpressions.registerJavaDelegateMock(ServiceTask.class).onExecutionSetVariable("status","Approved");
    assertThat(processInstance).isWaitingAtExactly("Activity_1q0fftb");
    assertThat(task()).hasName("User Application");

    complete(task());
    assertThat(processInstance).isEnded();

here is the BPMN:

TestCase.bpmn (6.5 KB)
Please note both my service task point to the same class.