//JAVA TO C# CONVERTER TODO Resources.Task: Most Java annotations will not have direct .NET equivalent attributes:
 //ORIGINAL LINE: @Parameterized.Parameters(name = "Scenario {index}") public static java.util.Collection<api.authorization.util.AuthorizationScenario[]> scenarios()
 public static ICollection <AuthorizationScenario[]> scenarios()
 {
     return(AuthorizationTestRule.AsParameters(AuthorizationScenarioWithCount.scenario().withCount(2L)
                                               .WithAuthorizations(AuthorizationSpec.Grant(Resources.Batch, "*", "userId", Permissions.Create),
                                                                   AuthorizationSpec.Grant(Resources.ProcessDefinition, "Process_1", "userId", Permissions.ReadHistory, Permissions.DeleteHistory),
                                                                   AuthorizationSpec.Grant(Resources.ProcessDefinition, "Process_2", "userId", Permissions.ReadHistory)).FailsDueToRequired(AuthorizationSpec.Grant(Resources.ProcessDefinition, "Process_2", "userId", Permissions.DeleteHistory)), AuthorizationScenarioWithCount.scenario().withCount(0L).WithAuthorizations(AuthorizationSpec.Grant(Resources.Batch, "*", "userId", Permissions.Create),
                                                                                                                                                                                                                                                                                                                                                                                AuthorizationSpec.Grant(Resources.ProcessDefinition, "Process_1", "userId", Permissions.ReadHistory, Permissions.DeleteHistory),
                                                                                                                                                                                                                                                                                                                                                                                AuthorizationSpec.Grant(Resources.ProcessDefinition, "Process_2", "userId", Permissions.ReadHistory, Permissions.DeleteHistory)).Succeeds()));
 }
        public virtual void testWithTwoInvocationsJobsListBased()
        {
            engineRule.ProcessEngineConfiguration.InvocationsPerBatchJob = 2;
            setupAndExecuteJobsListBasedTest();

            // then
            AssertScenario();

            AssertRetries(AllJobIds, Convert.ToInt32(AuthorizationScenarioWithCount.scenario().Count));
        }
 //JAVA TO C# CONVERTER TODO Resources.Task: Most Java annotations will not have direct .NET equivalent attributes:
 //ORIGINAL LINE: @Parameterized.Parameters(name = "Scenario {index}") public static java.util.Collection<api.authorization.util.AuthorizationScenario[]> scenarios()
 public static ICollection <AuthorizationScenario[]> scenarios()
 {
     return(AuthorizationTestRule.AsParameters(AuthorizationScenarioWithCount.scenario().withCount(3).WithAuthorizations(AuthorizationSpec.Grant(Resources.Batch, "*", "userId", Permissions.Create),
                                                                                                                         AuthorizationSpec.Grant(Resources.ProcessInstance, "processInstance1", "userId", Permissions.Read, Permissions.Update),
                                                                                                                         AuthorizationSpec.Grant(Resources.ProcessInstance, "processInstance2", "userId", Permissions.Read)).FailsDueToRequired(AuthorizationSpec.Grant(Resources.ProcessInstance, "processInstance2", "userId", Permissions.Update),
                                                                                                                                                                                                                                                AuthorizationSpec.Grant(Resources.ProcessDefinition, "exceptionInJobExecution", "userId", Permissions.UpdateInstance)), AuthorizationScenarioWithCount.scenario().withCount(5).WithAuthorizations(AuthorizationSpec.Grant(Resources.Batch, "*", "userId", Permissions.Create),
                                                                                                                                                                                                                                                                                                                                                                                                                                                  AuthorizationSpec.Grant(Resources.ProcessInstance, "processInstance1", "userId", Permissions.All),
                                                                                                                                                                                                                                                                                                                                                                                                                                                  AuthorizationSpec.Grant(Resources.ProcessInstance, "processInstance2", "userId", Permissions.All)).Succeeds(), AuthorizationScenarioWithCount.scenario().withCount(5).WithAuthorizations(AuthorizationSpec.Grant(Resources.Batch, "*", "userId", Permissions.Create),
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           AuthorizationSpec.Grant(Resources.ProcessDefinition, "Process", "userId", Permissions.ReadInstance, Permissions.UpdateInstance)).Succeeds()));
 }
Exemplo n.º 4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Parameterized.Parameters(name = "Scenario {index}") public static java.util.Collection<org.camunda.bpm.engine.test.api.authorization.util.AuthorizationScenario[]> scenarios()
        public static ICollection <AuthorizationScenario[]> scenarios()
        {
            return(AuthorizationTestRule.asParameters(AuthorizationScenarioWithCount.scenario().withCount(3).withAuthorizations(grant(Resources.BATCH, "*", "userId", Permissions.CREATE), grant(Resources.PROCESS_INSTANCE, "processInstance1", "userId", Permissions.READ, Permissions.UPDATE), grant(Resources.PROCESS_INSTANCE, "processInstance2", "userId", Permissions.READ)).failsDueToRequired(grant(Resources.PROCESS_INSTANCE, "processInstance2", "userId", Permissions.UPDATE), grant(Resources.PROCESS_DEFINITION, "exceptionInJobExecution", "userId", Permissions.UPDATE_INSTANCE), grant(Resources.PROCESS_INSTANCE, "processInstance2", "userId", ProcessInstancePermissions.RETRY_JOB), grant(Resources.PROCESS_DEFINITION, "exceptionInJobExecution", "userId", ProcessDefinitionPermissions.RETRY_JOB)), AuthorizationScenarioWithCount.scenario().withCount(5).withAuthorizations(grant(Resources.BATCH, "*", "userId", Permissions.CREATE), grant(Resources.PROCESS_INSTANCE, "processInstance1", "userId", Permissions.ALL), grant(Resources.PROCESS_INSTANCE, "processInstance2", "userId", Permissions.ALL)).succeeds(), AuthorizationScenarioWithCount.scenario().withCount(5).withAuthorizations(grant(Resources.BATCH, "*", "userId", Permissions.CREATE), grant(Resources.PROCESS_DEFINITION, "Process", "userId", Permissions.READ_INSTANCE, Permissions.UPDATE_INSTANCE)).succeeds(), AuthorizationScenarioWithCount.scenario().withCount(5).withAuthorizations(grant(Resources.BATCH, "*", "userId", BatchPermissions.CREATE_BATCH_SET_JOB_RETRIES), grant(Resources.PROCESS_DEFINITION, "Process", "userId", Permissions.READ_INSTANCE, Permissions.UPDATE_INSTANCE)).succeeds()));
        }
        public virtual void testWithTwoInvocationsProcessInstancesList()
        {
            engineRule.ProcessEngineConfiguration.InvocationsPerBatchJob = 2;
            setupAndExecuteHistoricProcessInstancesListTest();

            // then
            AssertScenario();

            Assert.That(historyService.CreateHistoricProcessInstanceQuery().Count(), Is.EqualTo(AuthorizationScenarioWithCount.scenario().Count));
        }
Exemplo n.º 6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Parameterized.Parameters(name = "Scenario {index}") public static java.util.Collection<org.camunda.bpm.engine.test.api.authorization.util.AuthorizationScenario[]> scenarios()
        public static ICollection <AuthorizationScenario[]> scenarios()
        {
            return(AuthorizationTestRule.asParameters(AuthorizationScenarioWithCount.scenario().withCount(2L).withAuthorizations(grant(Resources.BATCH, "*", "userId", Permissions.CREATE), grant(Resources.PROCESS_DEFINITION, "Process_1", "userId", Permissions.READ_HISTORY, Permissions.DELETE_HISTORY), grant(Resources.PROCESS_DEFINITION, "Process_2", "userId", Permissions.READ_HISTORY)).failsDueToRequired(grant(Resources.PROCESS_DEFINITION, "Process_2", "userId", Permissions.DELETE_HISTORY)), AuthorizationScenarioWithCount.scenario().withCount(0L).withAuthorizations(grant(Resources.BATCH, "*", "userId", Permissions.CREATE), grant(Resources.PROCESS_DEFINITION, "Process_1", "userId", Permissions.READ_HISTORY, Permissions.DELETE_HISTORY), grant(Resources.PROCESS_DEFINITION, "Process_2", "userId", Permissions.READ_HISTORY, Permissions.DELETE_HISTORY)), AuthorizationScenarioWithCount.scenario().withCount(0L).withAuthorizations(grant(Resources.BATCH, "*", "userId", BatchPermissions.CREATE_BATCH_DELETE_FINISHED_PROCESS_INSTANCES), grant(Resources.PROCESS_DEFINITION, "Process_1", "userId", Permissions.READ_HISTORY, Permissions.DELETE_HISTORY), grant(Resources.PROCESS_DEFINITION, "Process_2", "userId", Permissions.READ_HISTORY, Permissions.DELETE_HISTORY)).succeeds()));
        }