Exemple #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testBatchQueryByActiveBatches()
        public virtual void testBatchQueryByActiveBatches()
        {
            // given
            Batch batch1 = helper.migrateProcessInstancesAsync(1);
            Batch batch2 = helper.migrateProcessInstancesAsync(1);
            Batch batch3 = helper.migrateProcessInstancesAsync(1);

            // when
            managementService.suspendBatchById(batch1.Id);
            managementService.suspendBatchById(batch2.Id);
            managementService.activateBatchById(batch1.Id);

            // then
            BatchQuery query = managementService.createBatchQuery().active();

            Assert.assertEquals(2, query.count());
            Assert.assertEquals(2, query.list().size());

            IList <string> foundIds = new List <string>();

            foreach (Batch batch in query.list())
            {
                foundIds.Add(batch.Id);
            }
            Assert.assertThat(foundIds, hasItems(batch1.Id, batch3.Id));
        }
Exemple #2
0
        public virtual CountResultDto getBatchesCount(UriInfo uriInfo)
        {
            ProcessEngine processEngine = ProcessEngine;
            BatchQueryDto queryDto      = new BatchQueryDto(ObjectMapper, uriInfo.QueryParameters);
            BatchQuery    query         = queryDto.toQuery(processEngine);

            long count = query.count();

            return(new CountResultDto(count));
        }
Exemple #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setUpBatchQueryMock()
        public virtual void setUpBatchQueryMock()
        {
            IList <Batch> mockedBatches = MockProvider.createMockBatches();

            queryMock = mock(typeof(BatchQuery));

            when(queryMock.list()).thenReturn(mockedBatches);
            when(queryMock.count()).thenReturn((long)mockedBatches.Count);

            when(processEngine.ManagementService.createBatchQuery()).thenReturn(queryMock);
        }
Exemple #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testBatchQueryBySuspendedBatches()
        public virtual void testBatchQueryBySuspendedBatches()
        {
            // given
            Batch batch1 = helper.migrateProcessInstancesAsync(1);
            Batch batch2 = helper.migrateProcessInstancesAsync(1);

            helper.migrateProcessInstancesAsync(1);

            // when
            managementService.suspendBatchById(batch1.Id);
            managementService.suspendBatchById(batch2.Id);
            managementService.activateBatchById(batch1.Id);

            // then
            BatchQuery query = managementService.createBatchQuery().suspended();

            Assert.assertEquals(1, query.count());
            Assert.assertEquals(1, query.list().size());
            Assert.assertEquals(batch2.Id, query.singleResult().Id);
        }