public JobDefinition build() { JobDefinition mockJobDefinition = mock(JobDefinition.class); when(mockJobDefinition.getId()).thenReturn(id); when(mockJobDefinition.getActivityId()).thenReturn(activityId); when(mockJobDefinition.getJobConfiguration()).thenReturn(jobConfiguration); when(mockJobDefinition.getOverridingJobPriority()).thenReturn(jobPriority); when(mockJobDefinition.getJobType()).thenReturn(jobType); when(mockJobDefinition.getProcessDefinitionId()).thenReturn(processDefinitionId); when(mockJobDefinition.getProcessDefinitionKey()).thenReturn(processDefinitionKey); when(mockJobDefinition.isSuspended()).thenReturn(suspended); when(mockJobDefinition.getTenantId()).thenReturn(tenantId); return mockJobDefinition; }
public void testQuerySortingAsc() { // exclude job definitions without tenant id because of database-specific ordering List<JobDefinition> jobDefinitions = managementService.createJobDefinitionQuery() .tenantIdIn(TENANT_ONE, TENANT_TWO) .orderByTenantId() .asc() .list(); assertThat(jobDefinitions.size(), is(2)); assertThat(jobDefinitions.get(0).getTenantId(), is(TENANT_ONE)); assertThat(jobDefinitions.get(1).getTenantId(), is(TENANT_TWO)); }
public void testQuerySortingDesc() { // exclude job definitions without tenant id because of database-specific ordering List<JobDefinition> jobDefinitions = managementService.createJobDefinitionQuery() .tenantIdIn(TENANT_ONE, TENANT_TWO) .orderByTenantId() .desc() .list(); assertThat(jobDefinitions.size(), is(2)); assertThat(jobDefinitions.get(0).getTenantId(), is(TENANT_TWO)); assertThat(jobDefinitions.get(1).getTenantId(), is(TENANT_ONE)); }
@Test public void testBatchJobDefinitionsTenantId() { // given Batch batch = batchHelper.migrateProcessInstanceAsync(tenant1Definition, tenant1Definition); // then JobDefinition migrationJobDefinition = batchHelper.getExecutionJobDefinition(batch); Assert.assertEquals(TENANT_ONE, migrationJobDefinition.getTenantId()); JobDefinition monitorJobDefinition = batchHelper.getMonitorJobDefinition(batch); Assert.assertEquals(TENANT_ONE, monitorJobDefinition.getTenantId()); JobDefinition seedJobDefinition = batchHelper.getSeedJobDefinition(batch); Assert.assertEquals(TENANT_ONE, seedJobDefinition.getTenantId()); }
public static JobDefinitionDto fromJobDefinition(JobDefinition definition) { JobDefinitionDto dto = new JobDefinitionDto(); dto.id = definition.getId(); dto.processDefinitionId = definition.getProcessDefinitionId(); dto.processDefinitionKey = definition.getProcessDefinitionKey(); dto.jobType = definition.getJobType(); dto.jobConfiguration = definition.getJobConfiguration(); dto.activityId = definition.getActivityId(); dto.suspended = definition.isSuspended(); dto.overridingJobPriority = definition.getOverridingJobPriority(); dto.tenantId = definition.getTenantId(); return dto; }
public static JobDefinitionDto fromJobDefinition(JobDefinition definition) { JobDefinitionDto dto = new JobDefinitionDto(); dto.id = definition.getId(); dto.processDefinitionId = definition.getProcessDefinitionId(); dto.processDefinitionKey = definition.getProcessDefinitionKey(); dto.jobType = definition.getJobType(); dto.jobConfiguration = definition.getJobConfiguration(); dto.activityId = definition.getActivityId(); dto.suspended = definition.isSuspended(); dto.overridingJobPriority = definition.getOverridingJobPriority(); dto.tenantId = definition.getTenantId(); return dto; }
public void testPropagateTenantIdToStartTimerJobDefinition() { deploymentForTenant(TENANT_ID, Bpmn.createExecutableProcess(PROCESS_DEFINITION_KEY) .startEvent() .timerWithDuration("PT1M") .endEvent() .done()); // the job definition is created on deployment JobDefinition jobDefinition = managementService.createJobDefinitionQuery().singleResult(); assertThat(jobDefinition, is(notNullValue())); // inherit the tenant id from process definition assertThat(jobDefinition.getTenantId(), is(TENANT_ID)); }
public void testQuerySortingAsc() { // exclude job definitions without tenant id because of database-specific ordering List<JobDefinition> jobDefinitions = managementService.createJobDefinitionQuery() .tenantIdIn(TENANT_ONE, TENANT_TWO) .orderByTenantId() .asc() .list(); assertThat(jobDefinitions.size(), is(2)); assertThat(jobDefinitions.get(0).getTenantId(), is(TENANT_ONE)); assertThat(jobDefinitions.get(1).getTenantId(), is(TENANT_TWO)); }
public void testQuerySortingDesc() { // exclude job definitions without tenant id because of database-specific ordering List<JobDefinition> jobDefinitions = managementService.createJobDefinitionQuery() .tenantIdIn(TENANT_ONE, TENANT_TWO) .orderByTenantId() .desc() .list(); assertThat(jobDefinitions.size(), is(2)); assertThat(jobDefinitions.get(0).getTenantId(), is(TENANT_TWO)); assertThat(jobDefinitions.get(1).getTenantId(), is(TENANT_ONE)); }
@Test public void testBatchJobDefinitionsTenantId() { // given Batch batch = batchHelper.migrateProcessInstanceAsync(tenant1Definition, tenant1Definition); // then JobDefinition migrationJobDefinition = batchHelper.getExecutionJobDefinition(batch); Assert.assertEquals(TENANT_ONE, migrationJobDefinition.getTenantId()); JobDefinition monitorJobDefinition = batchHelper.getMonitorJobDefinition(batch); Assert.assertEquals(TENANT_ONE, monitorJobDefinition.getTenantId()); JobDefinition seedJobDefinition = batchHelper.getSeedJobDefinition(batch); Assert.assertEquals(TENANT_ONE, seedJobDefinition.getTenantId()); }
public static JobDefinitionDto fromJobDefinition(JobDefinition definition) { JobDefinitionDto dto = new JobDefinitionDto(); dto.id = definition.getId(); dto.processDefinitionId = definition.getProcessDefinitionId(); dto.processDefinitionKey = definition.getProcessDefinitionKey(); dto.jobType = definition.getJobType(); dto.jobConfiguration = definition.getJobConfiguration(); dto.activityId = definition.getActivityId(); dto.suspended = definition.isSuspended(); dto.overridingJobPriority = definition.getOverridingJobPriority(); dto.tenantId = definition.getTenantId(); return dto; }
public void testPropagateTenantIdToStartTimerJobDefinition() { deploymentForTenant(TENANT_ID, Bpmn.createExecutableProcess(PROCESS_DEFINITION_KEY) .startEvent() .timerWithDuration("PT1M") .endEvent() .done()); // the job definition is created on deployment JobDefinition jobDefinition = managementService.createJobDefinitionQuery().singleResult(); assertThat(jobDefinition, is(notNullValue())); // inherit the tenant id from process definition assertThat(jobDefinition.getTenantId(), is(TENANT_ID)); }