identityServiceMock = mock(IdentityServiceImpl.class);
when(processEngine.getAuthorizationService()).thenReturn(authorizationServiceMock);
when(processEngine.getIdentityService()).thenReturn(identityServiceMock);
TaskService taskService = processEngine.getTaskService();
when(taskService.createTaskQuery()).thenReturn(new TaskQueryImpl());
variableInstanceQueryMock = mock(VariableInstanceQuery.class);
when(processEngine.getRuntimeService().createVariableInstanceQuery())
.thenReturn(variableInstanceQueryMock);
when(variableInstanceQueryMock.variableScopeIdIn((String) anyVararg()))