use of org.camunda.bpm.engine.management.JobDefinition in project camunda-bpm-platform by camunda.
the class MultiTenancyJobCmdsTenantCheckTest method testSetOverridingJobPriorityWithCascadeAndNoAuthenticatedTenant.
@Test
public void testSetOverridingJobPriorityWithCascadeAndNoAuthenticatedTenant() {
JobDefinition jobDefinition = managementService.createJobDefinitionQuery().list().get(0);
identityService.setAuthentication("aUserId", null);
// then
thrown.expect(ProcessEngineException.class);
thrown.expectMessage("Cannot update the process definition '" + jobDefinition.getProcessDefinitionId() + "' because it belongs to no authenticated tenant.");
managementService.setOverridingJobPriorityForJobDefinition(jobDefinition.getId(), 1701, true);
}
use of org.camunda.bpm.engine.management.JobDefinition in project camunda-bpm-platform by camunda.
the class MultiTenancyJobCmdsTenantCheckTest method testSetOverridingJobPriorityWithCascadeAndAuthenticatedTenant.
// setOverridingJobPriority with cascade
@Test
public void testSetOverridingJobPriorityWithCascadeAndAuthenticatedTenant() {
JobDefinition jobDefinition = managementService.createJobDefinitionQuery().list().get(0);
identityService.setAuthentication("aUserId", null, Arrays.asList(TENANT_ONE));
managementService.setOverridingJobPriorityForJobDefinition(jobDefinition.getId(), 1701, true);
// then
assertThat(managementService.createJobDefinitionQuery().jobDefinitionId(jobDefinition.getId()).singleResult().getOverridingJobPriority(), is(1701L));
}
use of org.camunda.bpm.engine.management.JobDefinition in project camunda-bpm-platform by camunda.
the class MultiTenancyJobCmdsTenantCheckTest method testSetOverridingJobPriorityWithAuthenticatedTenant.
// setOverridingJobPriorityForJobDefinition without cascade
@Test
public void testSetOverridingJobPriorityWithAuthenticatedTenant() {
JobDefinition jobDefinition = managementService.createJobDefinitionQuery().list().get(0);
identityService.setAuthentication("aUserId", null, Arrays.asList(TENANT_ONE));
managementService.setOverridingJobPriorityForJobDefinition(jobDefinition.getId(), 1701);
// then
assertThat(managementService.createJobDefinitionQuery().jobDefinitionId(jobDefinition.getId()).singleResult().getOverridingJobPriority(), is(1701L));
}
use of org.camunda.bpm.engine.management.JobDefinition in project camunda-bpm-platform by camunda.
the class MultiTenancyJobCmdsTenantCheckTest method testSetOverridingJobPriorityWithDisabledTenantCheck.
@Test
public void testSetOverridingJobPriorityWithDisabledTenantCheck() {
JobDefinition jobDefinition = managementService.createJobDefinitionQuery().list().get(0);
identityService.setAuthentication("aUserId", null);
engineRule.getProcessEngineConfiguration().setTenantCheckEnabled(false);
managementService.setOverridingJobPriorityForJobDefinition(jobDefinition.getId(), 1701);
// then
assertThat(managementService.createJobDefinitionQuery().jobDefinitionId(jobDefinition.getId()).singleResult().getOverridingJobPriority(), is(1701L));
}
use of org.camunda.bpm.engine.management.JobDefinition in project camunda-bpm-platform by camunda.
the class BatchMigrationTest method testSeedJobCreation.
@Test
public void testSeedJobCreation() {
// when
Batch batch = helper.migrateProcessInstancesAsync(10);
// then there exists a seed job definition with the batch id as configuration
JobDefinition seedJobDefinition = helper.getSeedJobDefinition(batch);
assertNotNull(seedJobDefinition);
assertEquals(batch.getId(), seedJobDefinition.getJobConfiguration());
assertEquals(BatchSeedJobHandler.TYPE, seedJobDefinition.getJobType());
// and there exists a migration job definition
JobDefinition migrationJobDefinition = helper.getExecutionJobDefinition(batch);
assertNotNull(migrationJobDefinition);
assertEquals(Batch.TYPE_PROCESS_INSTANCE_MIGRATION, migrationJobDefinition.getJobType());
// and a seed job with no relation to a process or execution etc.
Job seedJob = helper.getSeedJob(batch);
assertNotNull(seedJob);
assertEquals(seedJobDefinition.getId(), seedJob.getJobDefinitionId());
assertNull(seedJob.getDuedate());
assertNull(seedJob.getDeploymentId());
assertNull(seedJob.getProcessDefinitionId());
assertNull(seedJob.getProcessDefinitionKey());
assertNull(seedJob.getProcessInstanceId());
assertNull(seedJob.getExecutionId());
// but no migration jobs where created
List<Job> migrationJobs = helper.getExecutionJobs(batch);
assertEquals(0, migrationJobs.size());
}
Aggregations