//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void suspendProcessDefinitionIncludingJobDefinitionsForAllTenants() public virtual void suspendProcessDefinitionIncludingJobDefinitionsForAllTenants() { // given activated jobs JobDefinitionQuery query = engineRule.ManagementService.createJobDefinitionQuery(); assertThat(query.active().count(), @is(3L)); assertThat(query.suspended().count(), @is(0L)); engineRule.RepositoryService.updateProcessDefinitionSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).suspend(); assertThat(query.active().count(), @is(0L)); assertThat(query.suspended().count(), @is(3L)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void suspendJobDefinitionForNonTenant() public virtual void suspendJobDefinitionForNonTenant() { // given activated job definitions JobDefinitionQuery query = engineRule.ManagementService.createJobDefinitionQuery(); assertThat(query.active().count(), @is(3L)); assertThat(query.suspended().count(), @is(0L)); engineRule.ManagementService.updateJobDefinitionSuspensionState().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 activateProcessDefinitionIncludingJobDefinitionsForTenant() public virtual void activateProcessDefinitionIncludingJobDefinitionsForTenant() { // given suspended jobs engineRule.RepositoryService.updateProcessDefinitionSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).suspend(); JobDefinitionQuery query = engineRule.ManagementService.createJobDefinitionQuery(); assertThat(query.active().count(), @is(0L)); assertThat(query.suspended().count(), @is(3L)); engineRule.RepositoryService.updateProcessDefinitionSuspensionState().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 suspendJobDefinitionDisabledTenantCheck() public virtual void suspendJobDefinitionDisabledTenantCheck() { // given activated job definitions JobDefinitionQuery query = engineRule.ManagementService.createJobDefinitionQuery(); assertThat(query.active().count(), @is(3L)); assertThat(query.suspended().count(), @is(0L)); engineRule.ProcessEngineConfiguration.TenantCheckEnabled = false; engineRule.IdentityService.setAuthentication("user", null, null); engineRule.ManagementService.updateJobDefinitionSuspensionState().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).includeJobDefinitionsWithoutTenantId().count(), @is(3L)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void suspendJobDefinitionNoAuthenticatedTenants() public virtual void suspendJobDefinitionNoAuthenticatedTenants() { // given activated job definitions JobDefinitionQuery query = engineRule.ManagementService.createJobDefinitionQuery(); assertThat(query.active().count(), @is(3L)); assertThat(query.suspended().count(), @is(0L)); engineRule.IdentityService.setAuthentication("user", null, null); engineRule.ManagementService.updateJobDefinitionSuspensionState().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 suspendAndActivateJobDefinitionsForAllTenants() public virtual void suspendAndActivateJobDefinitionsForAllTenants() { // given activated job definitions JobDefinitionQuery query = engineRule.ManagementService.createJobDefinitionQuery(); assertThat(query.active().count(), @is(3L)); assertThat(query.suspended().count(), @is(0L)); // first suspend engineRule.ManagementService.updateJobDefinitionSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).suspend(); assertThat(query.active().count(), @is(0L)); assertThat(query.suspended().count(), @is(3L)); // then activate engineRule.ManagementService.updateJobDefinitionSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).activate(); assertThat(query.active().count(), @is(3L)); assertThat(query.suspended().count(), @is(0L)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void delayedSuspendJobDefinitionsForAllTenants() public virtual void delayedSuspendJobDefinitionsForAllTenants() { // given activated job definitions engineRule.ManagementService.updateJobDefinitionSuspensionState().byProcessDefinitionKey(PROCESS_DEFINITION_KEY).executionDate(tomorrow()).suspend(); JobDefinitionQuery query = engineRule.ManagementService.createJobDefinitionQuery(); assertThat(query.active().count(), @is(3L)); assertThat(query.suspended().count(), @is(0L)); // when execute the job to suspend the job definitions Job job = engineRule.ManagementService.createJobQuery().timers().singleResult(); assertThat(job, @is(notNullValue())); engineRule.ManagementService.executeJob(job.Id); assertThat(query.active().count(), @is(0L)); assertThat(query.suspended().count(), @is(3L)); }