//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void cannotCreateMigrationPlanBetweenDifferentTenants() public virtual void cannotCreateMigrationPlanBetweenDifferentTenants() { // given ProcessDefinition tenant1Definition = testHelper.deployForTenantAndGetDefinition(TENANT_ONE, ProcessModels.ONE_TASK_PROCESS); ProcessDefinition tenant2Definition = testHelper.deployForTenantAndGetDefinition(TENANT_TWO, ProcessModels.ONE_TASK_PROCESS); // when try { engineRule.RuntimeService.createMigrationPlan(tenant1Definition.Id, tenant2Definition.Id).mapEqualActivities().build(); Assert.fail("exception expected"); } catch (ProcessEngineException e) { // then Assert.assertThat(e.Message, CoreMatchers.containsString("Cannot migrate process instances between processes of different tenants ('tenant1' != 'tenant2')")); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void cannotMigrateInstanceWithoutTenantIdToDifferentTenant() public virtual void cannotMigrateInstanceWithoutTenantIdToDifferentTenant() { // given ProcessDefinition sourceDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS); ProcessDefinition targetDefinition = testHelper.deployForTenantAndGetDefinition(TENANT_ONE, ProcessModels.ONE_TASK_PROCESS); ProcessInstance processInstance = engineRule.RuntimeService.startProcessInstanceById(sourceDefinition.Id); MigrationPlan migrationPlan = engineRule.RuntimeService.createMigrationPlan(sourceDefinition.Id, targetDefinition.Id).mapEqualActivities().build(); // when try { engineRule.RuntimeService.newMigration(migrationPlan).processInstanceIds(Arrays.asList(processInstance.Id)).execute(); Assert.fail("exception expected"); } catch (ProcessEngineException e) { Assert.assertThat(e.Message, CoreMatchers.containsString("Cannot migrate process instance '" + processInstance.Id + "' without tenant to a process definition with a tenant ('tenant1')")); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void cannotMigrateInstanceWithoutTenantIdToDifferentTenant() public virtual void cannotMigrateInstanceWithoutTenantIdToDifferentTenant() { // given ProcessDefinition sourceDefinition = defaultTestRule.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS); ProcessDefinition targetDefinition = defaultTestRule.deployForTenantAndGetDefinition(TENANT_ONE, ProcessModels.ONE_TASK_PROCESS); ProcessInstance processInstance = defaultEngineRule.RuntimeService.startProcessInstanceById(sourceDefinition.Id); MigrationPlan migrationPlan = defaultEngineRule.RuntimeService.createMigrationPlan(sourceDefinition.Id, targetDefinition.Id).mapEqualActivities().build(); Batch batch = defaultEngineRule.RuntimeService.newMigration(migrationPlan).processInstanceIds(Arrays.asList(processInstance.Id)).executeAsync(); batchHelper.executeSeedJob(batch); // when batchHelper.executeJobs(batch); // then Job migrationJob = batchHelper.getExecutionJobs(batch)[0]; Assert.assertThat(migrationJob.ExceptionMessage, CoreMatchers.containsString("Cannot migrate process instance '" + processInstance.Id + "' without tenant to a process definition with a tenant ('tenant1')")); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void cannotMigrateInstanceBetweenDifferentTenants() public virtual void cannotMigrateInstanceBetweenDifferentTenants() { // given ProcessDefinition sharedDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS); ProcessDefinition tenantDefinition = testHelper.deployForTenantAndGetDefinition(TENANT_TWO, ProcessModels.ONE_TASK_PROCESS); ProcessInstance processInstance = startInstanceForTenant(sharedDefinition, TENANT_ONE); MigrationPlan migrationPlan = engineRule.RuntimeService.createMigrationPlan(sharedDefinition.Id, tenantDefinition.Id).mapEqualActivities().build(); // when try { engineRule.RuntimeService.newMigration(migrationPlan).processInstanceIds(Arrays.asList(processInstance.Id)).execute(); Assert.fail("exception expected"); } catch (ProcessEngineException e) { Assert.assertThat(e.Message, CoreMatchers.containsString("Cannot migrate process instance '" + processInstance.Id + "' " + "to a process definition of a different tenant ('tenant1' != 'tenant2')")); } // then Assert.assertNotNull(migrationPlan); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void ensureCorrectToString() public virtual void ensureCorrectToString() { Assert.assertThat((new MyHistoryLevel()).ToString(), CoreMatchers.@is("MyHistoryLevel(name=myName, id=4711)")); }