//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void suspendJobsForNonTenant() public virtual void suspendJobsForNonTenant() { // given activated jobs JobQuery query = engineRule.ManagementService.createJobQuery(); assertThat(query.active().count(), @is(3L)); assertThat(query.suspended().count(), @is(0L)); engineRule.ManagementService.updateJobSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).processDefinitionWithoutTenantId().suspend(); assertThat(query.active().count(), @is(2L)); assertThat(query.suspended().count(), @is(1L)); assertThat(query.suspended().withoutTenantId().count(), @is(1L)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void suspendProcessInstanceIncludingJobForNonTenant() public virtual void suspendProcessInstanceIncludingJobForNonTenant() { // given activated jobs JobQuery query = engineRule.ManagementService.createJobQuery(); assertThat(query.active().count(), @is(3L)); assertThat(query.suspended().count(), @is(0L)); engineRule.RuntimeService.updateProcessInstanceSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).processDefinitionWithoutTenantId().suspend(); assertThat(query.active().count(), @is(2L)); assertThat(query.suspended().count(), @is(1L)); assertThat(query.suspended().singleResult().TenantId, @is(nullValue())); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void activateProcessInstanceIncludingJobForTenant() public virtual void activateProcessInstanceIncludingJobForTenant() { // given suspended job engineRule.RuntimeService.updateProcessInstanceSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).suspend(); JobQuery query = engineRule.ManagementService.createJobQuery(); assertThat(query.active().count(), @is(0L)); assertThat(query.suspended().count(), @is(3L)); engineRule.RuntimeService.updateProcessInstanceSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).processDefinitionTenantId(TENANT_ONE).activate(); assertThat(query.suspended().count(), @is(2L)); assertThat(query.active().count(), @is(1L)); assertThat(query.active().tenantIdIn(TENANT_ONE).count(), @is(1L)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void suspendJobDisabledTenantCheck() public virtual void suspendJobDisabledTenantCheck() { // given activated jobs JobQuery query = engineRule.ManagementService.createJobQuery(); assertThat(query.active().count(), @is(3L)); assertThat(query.suspended().count(), @is(0L)); engineRule.ProcessEngineConfiguration.TenantCheckEnabled = false; engineRule.IdentityService.setAuthentication("user", null, null); engineRule.ManagementService.updateJobSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).suspend(); assertThat(query.active().count(), @is(0L)); assertThat(query.suspended().count(), @is(3L)); assertThat(query.suspended().tenantIdIn(TENANT_ONE, TENANT_TWO).includeJobsWithoutTenantId().count(), @is(3L)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void suspendJobNoAuthenticatedTenants() public virtual void suspendJobNoAuthenticatedTenants() { // given activated jobs JobQuery query = engineRule.ManagementService.createJobQuery(); assertThat(query.active().count(), @is(3L)); assertThat(query.suspended().count(), @is(0L)); engineRule.IdentityService.setAuthentication("user", null, null); engineRule.ManagementService.updateJobSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).suspend(); engineRule.IdentityService.clearAuthentication(); assertThat(query.active().count(), @is(2L)); assertThat(query.suspended().count(), @is(1L)); assertThat(query.suspended().withoutTenantId().count(), @is(1L)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void suspendAndActivateJobsForAllTenants() public virtual void suspendAndActivateJobsForAllTenants() { // given activated jobs JobQuery query = engineRule.ManagementService.createJobQuery(); assertThat(query.active().count(), @is(3L)); assertThat(query.suspended().count(), @is(0L)); // first suspend engineRule.ManagementService.updateJobSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).suspend(); assertThat(query.active().count(), @is(0L)); assertThat(query.suspended().count(), @is(3L)); // then activate engineRule.ManagementService.updateJobSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).activate(); assertThat(query.active().count(), @is(3L)); assertThat(query.suspended().count(), @is(0L)); }