@Before
  public void init() {
    runtimeManager = createRuntimeManager(OBJECT_VARIABLE_PROCESS_FILE);
    engine = getRuntimeEngine();
    ksession = engine.getKieSession();
    taskService = engine.getTaskService();

    queryResource = new QueryResourceImpl();

    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()));
    processRequestBean.setJPAService(new RemoteServicesQueryJPAService(getEmf()));

    queryTaskHelper = new InternalTaskQueryHelper(queryResource);
    queryProcInstHelper = new InternalProcInstQueryHelper(queryResource);

    runObjectVarProcess(ksession);
  }
 private AuditLogService getAuditLogService() {
   return processRequestBean.getAuditLogService();
 }
 protected <T> T doRestTaskOperationWithDeploymentId(String deploymentId, TaskCommand<T> cmd) {
   return processRequestBean.doRestTaskOperation(null, deploymentId, null, null, cmd);
 }
 protected <T> T doRestTaskOperationWithTaskId(Long taskId, TaskCommand<T> cmd) {
   return processRequestBean.doRestTaskOperation(taskId, null, null, null, cmd);
 }
 // TODO: shouldn't this also take a process runtime id for per-process runtimes?
 public <T> T doRestTaskOperation(TaskCommand<T> cmd) {
   return processRequestBean.doRestTaskOperation(null, null, null, null, cmd);
 }
 public RemoteServicesQueryJPAService getJPAService() {
   return processRequestBean.getJPAService();
 }
 public AuditLogService getAuditLogService() {
   return processRequestBean.getAuditLogService();
 }