use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class SetJobRetriesBatchAuthorizationTest method setupAndExecuteJobsQueryBasedTest.
protected void setupAndExecuteJobsQueryBasedTest() {
// given
JobQuery jobQuery = managementService.createJobQuery();
authRule.init(scenario).withUser("userId").bindResource("Process", sourceDefinition.getKey()).bindResource("processInstance1", processInstance.getId()).bindResource("processInstance2", processInstance2.getId()).start();
// when
batch = managementService.setJobRetriesAsync(jobQuery, RETRIES);
executeSeedAndBatchJobs();
}
use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class ManagementServiceAsyncOperationsTest method testSetJobsRetryAsyncWithNegativeRetries.
@Test
public void testSetJobsRetryAsyncWithNegativeRetries() throws Exception {
// given
JobQuery query = managementService.createJobQuery();
// when
thrown.expect(ProcessEngineException.class);
managementService.setJobRetriesAsync(query, -1);
}
use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class ManagementServiceAsyncOperationsTest method testSetJobsRetryAsyncWithJobQueryAndList.
@Test
public void testSetJobsRetryAsyncWithJobQueryAndList() throws Exception {
// given
List<String> extraPi = startTestProcesses(1);
JobQuery query = managementService.createJobQuery().processInstanceId(extraPi.get(0));
// when
Batch batch = managementService.setJobRetriesAsync(ids, query, RETRIES);
executeSeedJob(batch);
List<Exception> exceptions = executeBatchJobs(batch);
// then
assertThat(exceptions.size(), is(0));
assertRetries(getAllJobIds(), RETRIES);
assertHistoricBatchExists(testRule);
}
use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class ManagementServiceAsyncOperationsTest method testSetJobsRetryAsyncWithNonExistingIDAsJobQuery.
@Test
public void testSetJobsRetryAsyncWithNonExistingIDAsJobQuery() throws Exception {
// expect
thrown.expect(ProcessEngineException.class);
// given
JobQuery query = managementService.createJobQuery().jobId(ids.get(0)).jobId("aFake");
// when
managementService.setJobRetriesAsync(query, RETRIES);
}
use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class ManagementServiceAsyncOperationsTest method testSetJobsRetryAsyncWithJobQuery.
@Test
public void testSetJobsRetryAsyncWithJobQuery() throws Exception {
// given
JobQuery query = managementService.createJobQuery();
// when
Batch batch = managementService.setJobRetriesAsync(query, RETRIES);
executeSeedJob(batch);
List<Exception> exceptions = executeBatchJobs(batch);
// then
assertThat(exceptions.size(), is(0));
assertRetries(ids, RETRIES);
assertHistoricBatchExists(testRule);
}
Aggregations