Source:
public void testTimerRequiresRecoveryJobNameFlagSet() throws Exception { Properties properties= new Properties(); properties.setProperty("mary", "HR"); properties.setProperty("john", "HR"); UserGroupCallback userGroupCallback = new JBossUserGroupCallbackImpl(properties); environment = RuntimeEnvironmentBuilder.Factory.get() .newDefaultBuilder() .entityManagerFactory(emf) .addAsset(ResourceFactory.newClassPathResource("org/jbpm/test/functional/timer/HumanTaskWithBoundaryTimer.bpmn"), ResourceType.BPMN2) .schedulerService(globalScheduler) .userGroupCallback(userGroupCallback) .get(); manager = getManager(environment, true); RuntimeEngine runtime = manager.getRuntimeEngine(ProcessInstanceIdContext.get()); KieSession ksession = runtime.getKieSession(); Map<String, Object> params = new HashMap<String, Object>(); params.put("test", "john"); ProcessInstance processInstance = ksession.startProcess("PROCESS_1", params); Connection connection = null; Statement stmt = null; try { connection = ((DataSource)InitialContext.doLookup("jdbc/jbpm-ds")).getConnection(); stmt = connection.createStatement(); ResultSet resultSet = stmt.executeQuery("select REQUESTS_RECOVERY, JOB_NAME from QRTZ_JOB_DETAILS"); while(resultSet.next()) { boolean requestsRecovery = resultSet.getBoolean(1); assertEquals("Requests recovery must be set to true", true, requestsRecovery); String jobName = resultSet.getString(2); assertTrue(jobName + " does not contain ticket name", jobName.contains("Boundary Event")); } } finally { if(stmt != null) { stmt.close(); } if(connection != null) { connection.close(); } } ksession.abortProcessInstance(processInstance.getId()); manager.disposeRuntimeEngine(runtime); }

Target:
public void testTimerRequiresRecoveryJobNameFlagSet() throws Exception { Properties properties= new Properties(); properties.setProperty("mary", "HR"); properties.setProperty("john", "HR"); UserGroupCallback userGroupCallback = new JBossUserGroupCallbackImpl(properties); environment = RuntimeEnvironmentBuilder.Factory.get() .newDefaultBuilder() .entityManagerFactory(emf) .addAsset(ResourceFactory.newClassPathResource("org/jbpm/test/functional/timer/HumanTaskWithBoundaryTimer.bpmn"), ResourceType.BPMN2) .schedulerService(globalScheduler) .userGroupCallback(userGroupCallback) .get(); manager = getManager(environment, true); RuntimeEngine runtime = manager.getRuntimeEngine(ProcessInstanceIdContext.get()); KieSession ksession = runtime.getKieSession(); Map<String, Object> params = new HashMap<String, Object>(); params.put("test", "john"); ProcessInstance processInstance = ksession.startProcess("PROCESS_1", params); Connection connection = null; Statement stmt = null; try { connection = ((DataSource)InitialContext.doLookup("jdbc/jbpm-ds")).getConnection(); stmt = connection.createStatement(); ResultSet resultSet = stmt.executeQuery("select REQUESTS_RECOVERY, JOB_NAME from QRTZ_JOB_DETAILS"); while(resultSet.next()) { boolean requestsRecovery = resultSet.getBoolean(1); assertEquals("Requests recovery must be set to true", true, requestsRecovery); String jobName = resultSet.getString(2); assertTrue(jobName + " does not contain timer name", jobName.contains("Boundary Event")); } } finally { if(stmt != null) { stmt.close(); } if(connection != null) { connection.close(); } } ksession.abortProcessInstance(processInstance.getId()); manager.disposeRuntimeEngine(runtime); }