IdentityProvider mockIdProvider = mock(IdentityProvider.class);
when(mockIdProvider.getName()).thenReturn(USER_ID);
queryResource.setIdentityProvider(mockIdProvider);
ProcessRequestBean processRequestBean = new ProcessRequestBean();
UserTaskServiceImpl userTaskService = new UserTaskServiceImpl();
userTaskService.setNonProcessScopedTaskService((InternalTaskService) taskService);
processRequestBean.setUserTaskService(userTaskService);
DeploymentService mockDepService = mock(DeploymentService.class);
when(mockDepService.getRuntimeManager(anyString())).thenReturn(runtimeManager);
userTaskService.setDeploymentService(mockDepService);
queryResource.setProcessRequestBean(processRequestBean);
processRequestBean.setAuditLogService(new JPAAuditLogService(getEmf()));
queryTaskHelper = new InternalTaskQueryHelper(queryResource);
queryProcInstHelper = new InternalProcInstQueryHelper(queryResource);
}