Process Variables are not updated

Is there a way to update the value of a Process Variable through a unit test after a process instance has been created?

We have been trying to use the runtimeService() to do so but it doesn’t work.

The value of the variable in the Execution Listener scope stays unmodified containing the previous value.

final ProcessInstance processInstance = runtimeService().startProcessInstanceByKey(PROCESS_KEY, BUSINESS_KEY,
                Map.of("Name, "name 1"
                        , "Stage", "stage"
                ));

assertThat(processInstance).isStarted();

assertThat(processInstance).isWaitingAt(SERVICE_TASK_1);

runtimeService().setVariable(processInstance.getId(), "Name, "name 2");

execute(job(SERVICE_TASK_1));

Could someone please point us in the correct direction.