// there exists a timer job to suspend the process definition delayed
Job timerToSuspendProcessDefinition = managementService.createJobQuery().timers().singleResult();
assertNotNull(timerToSuspendProcessDefinition);
// the job definitions should be still active
JobDefinitionQuery jobDefinitionQuery = managementService.createJobDefinitionQuery();
assertEquals(0, jobDefinitionQuery.suspended().count());
assertEquals(5, jobDefinitionQuery.active().count());
// ...and the corresponding jobs should be still active
JobQuery jobQuery = managementService.createJobQuery();
assertEquals(0, jobQuery.suspended().count());
assertEquals(6, jobQuery.active().count());
// when
// execute job
managementService.executeJob(timerToSuspendProcessDefinition.getId());
// then
// the job definitions should be suspended...
assertEquals(0, jobDefinitionQuery.active().count());
assertEquals(5, jobDefinitionQuery.suspended().count());
// ...and the corresponding jobs should be suspended too
assertEquals(0, jobQuery.active().count());
assertEquals(5, jobQuery.suspended().count());