Пример #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testCreateBothJobDefinitionWithParseListenerAndAsynBothInXml()
        public virtual void testCreateBothJobDefinitionWithParseListenerAndAsynBothInXml()
        {
            //given the asyncBefore AND asyncAfter is set in the xml
            string            modelFileName = "jobAsyncBothCreationWithinParseListener.bpmn20.xml";
            Stream            @in           = typeof(JobDefinitionCreationWithParseListenerTest).getResourceAsStream(modelFileName);
            DeploymentBuilder builder       = engineRule.RepositoryService.createDeployment().addInputStream(modelFileName, @in);

            //when the asyncBefore and asyncAfter is set to true in the parse listener
            Deployment deployment = builder.deploy();

            engineRule.manageDeployment(deployment);

            //then there exists two job definitions
            JobDefinitionQuery    query       = engineRule.ManagementService.createJobDefinitionQuery();
            IList <JobDefinition> definitions = query.orderByJobConfiguration().asc().list();

            assertEquals(definitions.Count, 2);

            //asyncAfter
            JobDefinition asyncAfterAfter = definitions[0];

            assertEquals(asyncAfterAfter.ProcessDefinitionKey, "oneTaskProcess");
            assertEquals(asyncAfterAfter.ActivityId, "servicetask1");
            assertEquals(asyncAfterAfter.JobConfiguration, MessageJobDeclaration.ASYNC_AFTER);

            //asyncBefore
            JobDefinition asyncAfterBefore = definitions[1];

            assertEquals(asyncAfterBefore.ProcessDefinitionKey, "oneTaskProcess");
            assertEquals(asyncAfterBefore.ActivityId, "servicetask1");
            assertEquals(asyncAfterBefore.JobConfiguration, MessageJobDeclaration.ASYNC_BEFORE);
        }
Пример #2
0
        public virtual IList <JobDefinitionDto> queryJobDefinitions(JobDefinitionQueryDto queryDto, int?firstResult, int?maxResults)
        {
            queryDto.ObjectMapper = ObjectMapper;
            JobDefinitionQuery query = queryDto.toQuery(ProcessEngine);

            IList <JobDefinition> matchingJobDefinitions;

            if (firstResult != null || maxResults != null)
            {
                matchingJobDefinitions = executePaginatedQuery(query, firstResult, maxResults);
            }
            else
            {
                matchingJobDefinitions = query.list();
            }

            IList <JobDefinitionDto> jobDefinitionResults = new List <JobDefinitionDto>();

            foreach (JobDefinition jobDefinition in matchingJobDefinitions)
            {
                JobDefinitionDto result = JobDefinitionDto.fromJobDefinition(jobDefinition);
                jobDefinitionResults.Add(result);
            }

            return(jobDefinitionResults);
        }
Пример #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testIncludeJobDefinitionsWithoutTenantIdPostParameter()
        public virtual void testIncludeJobDefinitionsWithoutTenantIdPostParameter()
        {
            IList <JobDefinition> jobDefinitions = Arrays.asList(MockProvider.mockJobDefinition().tenantId(null).build(), MockProvider.mockJobDefinition().tenantId(MockProvider.EXAMPLE_TENANT_ID).build());

            mockedQuery = setUpMockDefinitionQuery(jobDefinitions);

            IDictionary <string, object> queryParameters = new Dictionary <string, object>();

            queryParameters["tenantIdIn"] = new string[] { MockProvider.EXAMPLE_TENANT_ID };
            queryParameters["includeJobDefinitionsWithoutTenantId"] = true;

            Response response = given().contentType(POST_JSON_CONTENT_TYPE).body(queryParameters).expect().statusCode(Status.OK.StatusCode).when().post(JOB_DEFINITION_QUERY_URL);

            verify(mockedQuery).tenantIdIn(MockProvider.EXAMPLE_TENANT_ID);
            verify(mockedQuery).includeJobDefinitionsWithoutTenantId();
            verify(mockedQuery).list();

            string         content     = response.asString();
            IList <string> definitions = from(content).getList("");

            assertThat(definitions).hasSize(2);

            string returnedTenantId1 = from(content).getString("[0].tenantId");
            string returnedTenantId2 = from(content).getString("[1].tenantId");

            assertThat(returnedTenantId1).isEqualTo(null);
            assertThat(returnedTenantId2).isEqualTo(MockProvider.EXAMPLE_TENANT_ID);
        }
Пример #4
0
        public virtual void testQueryNoAuthenticatedTenants()
        {
            identityService.setAuthentication("user", null, null);

            JobDefinitionQuery query = managementService.createJobDefinitionQuery();

            assertThat(query.count(), @is(1L));
        }
Пример #5
0
        public virtual void testQueryDisabledTenantCheck()
        {
            processEngineConfiguration.TenantCheckEnabled = false;
            identityService.setAuthentication("user", null, null);

            JobDefinitionQuery query = managementService.createJobDefinitionQuery();

            assertThat(query.count(), @is(3L));
        }
Пример #6
0
        private JobDefinitionQuery setUpMockDefinitionQuery(IList <JobDefinition> mockedJobDefinitions)
        {
            JobDefinitionQuery query = mock(typeof(JobDefinitionQuery));

            when(query.list()).thenReturn(mockedJobDefinitions);
            when(query.count()).thenReturn((long)mockedJobDefinitions.Count);
            when(processEngine.ManagementService.createJobDefinitionQuery()).thenReturn(query);

            return(query);
        }
Пример #7
0
        public virtual void testQueryByTenantId()
        {
            JobDefinitionQuery query = managementService.createJobDefinitionQuery().tenantIdIn(TENANT_ONE);

            assertThat(query.count(), @is(1L));

            query = managementService.createJobDefinitionQuery().tenantIdIn(TENANT_TWO);

            assertThat(query.count(), @is(1L));
        }
Пример #8
0
        public virtual void testMultipleProcessDeployment()
        {
            JobDefinitionQuery    query          = managementService.createJobDefinitionQuery();
            IList <JobDefinition> jobDefinitions = query.list();

            assertEquals(3, jobDefinitions.Count);

            assertEquals(1, query.processDefinitionKey("testProcess").list().size());
            assertEquals(2, query.processDefinitionKey("anotherTestProcess").list().size());
        }
Пример #9
0
        public virtual void testQueryAuthenticatedTenants()
        {
            identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO));

            JobDefinitionQuery query = managementService.createJobDefinitionQuery();

            assertThat(query.count(), @is(3L));
            assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L));
            assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(1L));
            assertThat(query.withoutTenantId().count(), @is(1L));
        }
Пример #10
0
        private void createJobDefinitionMock()
        {
            IList <JobDefinition> jobDefinitions    = new List <JobDefinition>();
            JobDefinition         mockJobDefinition = MockProvider.createMockJobDefinition();

            jobDefinitions.Add(mockJobDefinition);

            JobDefinitionQuery mockJobDefinitionQuery = mock(typeof(JobDefinitionQuery));

            when(mockJobDefinitionQuery.list()).thenReturn(jobDefinitions);
            when(mockManagementService.createJobDefinitionQuery()).thenReturn(mockJobDefinitionQuery);
        }
Пример #11
0
 private IList <JobDefinition> executePaginatedQuery(JobDefinitionQuery query, int?firstResult, int?maxResults)
 {
     if (firstResult == null)
     {
         firstResult = 0;
     }
     if (maxResults == null)
     {
         maxResults = int.MaxValue;
     }
     return(query.listPage(firstResult, maxResults));
 }
Пример #12
0
        public virtual CountResultDto queryJobDefinitionsCount(JobDefinitionQueryDto queryDto)
        {
            queryDto.ObjectMapper = ObjectMapper;
            JobDefinitionQuery query = queryDto.toQuery(ProcessEngine);

            long           count  = query.count();
            CountResultDto result = new CountResultDto();

            result.Count = count;

            return(result);
        }
Пример #13
0
//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));
        }
Пример #14
0
        public virtual void testQueryByTenantIdsIncludeDefinitionsWithoutTenantId()
        {
            JobDefinitionQuery query = managementService.createJobDefinitionQuery().tenantIdIn(TENANT_ONE).includeJobDefinitionsWithoutTenantId();

            assertThat(query.count(), @is(2L));

            query = managementService.createJobDefinitionQuery().tenantIdIn(TENANT_TWO).includeJobDefinitionsWithoutTenantId();

            assertThat(query.count(), @is(2L));

            query = managementService.createJobDefinitionQuery().tenantIdIn(TENANT_ONE, TENANT_TWO).includeJobDefinitionsWithoutTenantId();

            assertThat(query.count(), @is(3L));
        }
Пример #15
0
//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));
        }
Пример #16
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testDeleteJobDefinitionWithParseListenerAndAsyncInXml()
        public virtual void testDeleteJobDefinitionWithParseListenerAndAsyncInXml()
        {
            //given the asyncBefore is set in the xml
            string            modelFileName = "jobAsyncBeforeCreationWithinParseListener.bpmn20.xml";
            Stream            @in           = typeof(JobDefinitionCreationWithParseListenerTest).getResourceAsStream(modelFileName);
            DeploymentBuilder builder       = engineRule.RepositoryService.createDeployment().addInputStream(modelFileName, @in);
            //when the asyncBefore is set to false in the parse listener
            Deployment deployment = builder.deploy();

            engineRule.manageDeployment(deployment);
            //then there exists no job definition
            JobDefinitionQuery query = engineRule.ManagementService.createJobDefinitionQuery();

            assertNull(query.singleResult());
        }
Пример #17
0
//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));
        }
Пример #18
0
//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));
        }
Пример #19
0
//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));
        }
Пример #20
0
//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));
        }
Пример #21
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testCreateJobDefinitionWithParseListenerAndAsyncInXml()
        public virtual void testCreateJobDefinitionWithParseListenerAndAsyncInXml()
        {
            //given the asyncBefore is set in the xml
            string            modelFileName = "jobAsyncBeforeCreationWithinParseListener.bpmn20.xml";
            Stream            @in           = typeof(JobDefinitionCreationWithParseListenerTest).getResourceAsStream(modelFileName);
            DeploymentBuilder builder       = engineRule.RepositoryService.createDeployment().addInputStream(modelFileName, @in);

            //when the asyncBefore is set in the parse listener
            Deployment deployment = builder.deploy();

            engineRule.manageDeployment(deployment);

            //then there exists only one job definition
            JobDefinitionQuery query  = engineRule.ManagementService.createJobDefinitionQuery();
            JobDefinition      jobDef = query.singleResult();

            assertNotNull(jobDef);
            assertEquals(jobDef.ProcessDefinitionKey, "oneTaskProcess");
            assertEquals(jobDef.ActivityId, "servicetask1");
        }
Пример #22
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testTenantIdListParameter()
        public virtual void testTenantIdListParameter()
        {
            mockedQuery = setUpMockDefinitionQuery(createMockJobDefinitionsTwoTenants());

            Response response = given().queryParam("tenantIdIn", MockProvider.EXAMPLE_TENANT_ID_LIST).then().expect().statusCode(Status.OK.StatusCode).when().get(JOB_DEFINITION_QUERY_URL);

            verify(mockedQuery).tenantIdIn(MockProvider.EXAMPLE_TENANT_ID, MockProvider.ANOTHER_EXAMPLE_TENANT_ID);
            verify(mockedQuery).list();

            string         content = response.asString();
            IList <string> jobs    = from(content).getList("");

            assertThat(jobs).hasSize(2);

            string returnedTenantId1 = from(content).getString("[0].tenantId");
            string returnedTenantId2 = from(content).getString("[1].tenantId");

            assertThat(returnedTenantId1).isEqualTo(MockProvider.EXAMPLE_TENANT_ID);
            assertThat(returnedTenantId2).isEqualTo(MockProvider.ANOTHER_EXAMPLE_TENANT_ID);
        }
Пример #23
0
//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));
        }
Пример #24
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testDeleteNonExistingAndCreateNewJobDefinitionWithParseListener()
        public virtual void testDeleteNonExistingAndCreateNewJobDefinitionWithParseListener()
        {
            //given
            string            modelFileName = "jobCreationWithinParseListener.bpmn20.xml";
            Stream            @in           = typeof(JobDefinitionCreationWithParseListenerTest).getResourceAsStream(modelFileName);
            DeploymentBuilder builder       = engineRule.RepositoryService.createDeployment().addInputStream(modelFileName, @in);

            //when the asyncBefore is set to false and the asyncAfter to true in the parse listener
            Deployment deployment = builder.deploy();

            engineRule.manageDeployment(deployment);

            //then there exists one job definition
            JobDefinitionQuery query  = engineRule.ManagementService.createJobDefinitionQuery();
            JobDefinition      jobDef = query.singleResult();

            assertNotNull(jobDef);
            assertEquals(jobDef.ProcessDefinitionKey, "oneTaskProcess");
            assertEquals(jobDef.ActivityId, "servicetask1");
            assertEquals(jobDef.JobConfiguration, MessageJobDeclaration.ASYNC_AFTER);
        }
Пример #25
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testIncludeJobDefinitionsWithoutTenantIdParameter()
        public virtual void testIncludeJobDefinitionsWithoutTenantIdParameter()
        {
            IList <JobDefinition> jobDefinitions = Arrays.asList(MockProvider.mockJobDefinition().tenantId(null).build(), MockProvider.mockJobDefinition().tenantId(MockProvider.EXAMPLE_TENANT_ID).build());

            mockedQuery = setUpMockDefinitionQuery(jobDefinitions);

            Response response = given().queryParam("tenantIdIn", MockProvider.EXAMPLE_TENANT_ID).queryParam("includeJobDefinitionsWithoutTenantId", true).then().expect().statusCode(Status.OK.StatusCode).when().get(JOB_DEFINITION_QUERY_URL);

            verify(mockedQuery).tenantIdIn(MockProvider.EXAMPLE_TENANT_ID);
            verify(mockedQuery).includeJobDefinitionsWithoutTenantId();
            verify(mockedQuery).list();

            string         content     = response.asString();
            IList <string> definitions = from(content).getList("");

            assertThat(definitions).hasSize(2);

            string returnedTenantId1 = from(content).getString("[0].tenantId");
            string returnedTenantId2 = from(content).getString("[1].tenantId");

            assertThat(returnedTenantId1).isEqualTo(null);
            assertThat(returnedTenantId2).isEqualTo(MockProvider.EXAMPLE_TENANT_ID);
        }
Пример #26
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Deployment public void testMultipleTimerBoundaryEvents()
        public virtual void testMultipleTimerBoundaryEvents()
        {
            // given
            ProcessDefinition  processDefinition  = repositoryService.createProcessDefinitionQuery().singleResult();
            JobDefinitionQuery jobDefinitionQuery = managementService.createJobDefinitionQuery().processDefinitionKey("testProcess");

            // then assert
            assertEquals(2, jobDefinitionQuery.count());

            JobDefinition jobDefinition = jobDefinitionQuery.activityIdIn("theBoundaryEvent1").singleResult();

            assertNotNull(jobDefinition);
            assertEquals(TimerExecuteNestedActivityJobHandler.TYPE, jobDefinition.JobType);
            assertEquals("theBoundaryEvent1", jobDefinition.ActivityId);
            assertEquals("DATE: 2036-11-14T11:12:22", jobDefinition.JobConfiguration);
            assertEquals(processDefinition.Id, jobDefinition.ProcessDefinitionId);

            jobDefinition = jobDefinitionQuery.activityIdIn("theBoundaryEvent2").singleResult();
            assertNotNull(jobDefinition);
            assertEquals(TimerExecuteNestedActivityJobHandler.TYPE, jobDefinition.JobType);
            assertEquals("theBoundaryEvent2", jobDefinition.ActivityId);
            assertEquals("DURATION: PT5M", jobDefinition.JobConfiguration);
            assertEquals(processDefinition.Id, jobDefinition.ProcessDefinitionId);
        }
Пример #27
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Deployment public void testEventBasedGateway()
        public virtual void testEventBasedGateway()
        {
            // given
            ProcessDefinition  processDefinition  = repositoryService.createProcessDefinitionQuery().singleResult();
            JobDefinitionQuery jobDefinitionQuery = managementService.createJobDefinitionQuery().processDefinitionKey("testProcess");

            // then assert
            assertEquals(2, jobDefinitionQuery.count());

            JobDefinition jobDefinition = jobDefinitionQuery.activityIdIn("timer1").singleResult();

            assertNotNull(jobDefinition);
            assertEquals(TimerCatchIntermediateEventJobHandler.TYPE, jobDefinition.JobType);
            assertEquals("timer1", jobDefinition.ActivityId);
            assertEquals("DURATION: PT5M", jobDefinition.JobConfiguration);
            assertEquals(processDefinition.Id, jobDefinition.ProcessDefinitionId);

            jobDefinition = jobDefinitionQuery.activityIdIn("timer2").singleResult();
            assertNotNull(jobDefinition);
            assertEquals(TimerCatchIntermediateEventJobHandler.TYPE, jobDefinition.JobType);
            assertEquals("timer2", jobDefinition.ActivityId);
            assertEquals("DURATION: PT10M", jobDefinition.JobConfiguration);
            assertEquals(processDefinition.Id, jobDefinition.ProcessDefinitionId);
        }
Пример #28
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testTenantIdListPostParameter()
        public virtual void testTenantIdListPostParameter()
        {
            mockedQuery = setUpMockDefinitionQuery(createMockJobDefinitionsTwoTenants());

            IDictionary <string, object> queryParameters = new Dictionary <string, object>();

            queryParameters["tenantIdIn"] = MockProvider.EXAMPLE_TENANT_ID_LIST.Split(",", true);

            Response response = given().contentType(POST_JSON_CONTENT_TYPE).body(queryParameters).expect().statusCode(Status.OK.StatusCode).when().post(JOB_DEFINITION_QUERY_URL);

            verify(mockedQuery).tenantIdIn(MockProvider.EXAMPLE_TENANT_ID, MockProvider.ANOTHER_EXAMPLE_TENANT_ID);
            verify(mockedQuery).list();

            string         content = response.asString();
            IList <string> jobs    = from(content).getList("");

            assertThat(jobs).hasSize(2);

            string returnedTenantId1 = from(content).getString("[0].tenantId");
            string returnedTenantId2 = from(content).getString("[1].tenantId");

            assertThat(returnedTenantId1).isEqualTo(MockProvider.EXAMPLE_TENANT_ID);
            assertThat(returnedTenantId2).isEqualTo(MockProvider.ANOTHER_EXAMPLE_TENANT_ID);
        }
Пример #29
0
        public virtual void testQueryByNonExistingTenantId()
        {
            JobDefinitionQuery query = managementService.createJobDefinitionQuery().tenantIdIn("nonExisting");

            assertThat(query.count(), @is(0L));
        }
Пример #30
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setUpRuntimeData()
        public virtual void setUpRuntimeData()
        {
            mockedQuery = setUpMockDefinitionQuery(MockProvider.createMockJobDefinitions());
        }