public virtual void testQueryByTenantId() { HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().tenantIdIn(TENANT_ONE); assertThat(query.count(), @is(1L)); query = historyService.createHistoricCaseInstanceQuery().tenantIdIn(TENANT_TWO); assertThat(query.count(), @is(1L)); }
public virtual void testQueryByInvalidSubCaseInstanceId() { HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery(); query.subCaseInstanceId("invalid"); assertEquals(0, query.count()); assertEquals(0, query.list().size()); query.caseInstanceId(null); assertEquals(0, query.count()); assertEquals(0, query.list().size()); }
public virtual CountResultDto queryHistoricCaseInstancesCount(HistoricCaseInstanceQueryDto queryDto) { HistoricCaseInstanceQuery query = queryDto.toQuery(processEngine); long count = query.count(); return(new CountResultDto(count)); }
public virtual void testQueryNoAuthenticatedTenants() { identityService.setAuthentication("user", null, null); HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery(); assertThat(query.count(), @is(1L)); }
public virtual void testQueryDisabledTenantCheck() { processEngineConfiguration.TenantCheckEnabled = false; identityService.setAuthentication("user", null, null); HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery(); assertThat(query.count(), @is(3L)); }
public virtual void testQueryAuthenticatedTenants() { identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO)); HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery(); 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)); }
public virtual void testDistinctQueryByCaseActivityIds() { // given createCaseInstanceByKey("twoTaskCase"); // when HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().caseActivityIdIn("PI_HumanTask_1", "PI_HumanTask_2"); // then assertEquals(1, query.list().size()); assertEquals(1, query.count()); }
public virtual void testQueryBySuperCaseInstanceId() { string superCaseInstanceId = caseService.createCaseInstanceByKey("oneCaseTaskCase").Id; HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().superCaseInstanceId(superCaseInstanceId); assertEquals(1, query.list().size()); assertEquals(1, query.count()); HistoricCaseInstance caseInstance = query.singleResult(); assertEquals(superCaseInstanceId, caseInstance.SuperCaseInstanceId); assertNull(caseInstance.SuperProcessInstanceId); }
public virtual void testQueryBySuperProcessInstanceId() { string superProcessInstanceId = runtimeService.startProcessInstanceByKey("subProcessQueryTest").Id; HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().superProcessInstanceId(superProcessInstanceId); assertEquals(1, query.list().size()); assertEquals(1, query.count()); HistoricCaseInstance subCaseInstance = query.singleResult(); assertNotNull(subCaseInstance); assertEquals(superProcessInstanceId, subCaseInstance.SuperProcessInstanceId); assertNull(subCaseInstance.SuperCaseInstanceId); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void deleteHistoricCaseInstanceWithAuthenticatedTenant() public virtual void deleteHistoricCaseInstanceWithAuthenticatedTenant() { testRule.deployForTenant(TENANT_ONE, CMMN_PROCESS_WITH_MANUAL_ACTIVATION); string caseInstanceId = createAndCloseCaseInstance(null); identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE)); historyService.deleteHistoricCaseInstance(caseInstanceId); identityService.clearAuthentication(); HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery(); assertThat(query.count(), @is(0L)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void deleteHistoricCaseInstanceWithDisabledTenantCheck() public virtual void deleteHistoricCaseInstanceWithDisabledTenantCheck() { testRule.deployForTenant(TENANT_ONE, CMMN_PROCESS_WITH_MANUAL_ACTIVATION); testRule.deployForTenant(TENANT_TWO, CMMN_PROCESS_WITH_MANUAL_ACTIVATION); string caseInstanceIdOne = createAndCloseCaseInstance(TENANT_ONE); string caseInstanceIdTwo = createAndCloseCaseInstance(TENANT_TWO); identityService.setAuthentication("user", null, null); processEngineConfiguration.TenantCheckEnabled = false; historyService.deleteHistoricCaseInstance(caseInstanceIdOne); historyService.deleteHistoricCaseInstance(caseInstanceIdTwo); HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery(); assertThat(query.count(), @is(0L)); }
public virtual void testQueryByNonExistingTenantId() { HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().tenantIdIn("nonExisting"); assertThat(query.count(), @is(0L)); }
public virtual void testQueryByInstancesWithoutTenantId() { HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().withoutTenantId(); assertThat(query.count(), @is(1L)); }
public virtual void testQueryNoTenantIdSet() { HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery(); assertThat(query.count(), @is(3L)); }
protected internal virtual void assertCount(long count, HistoricCaseInstanceQuery historicQuery) { assertEquals(count, historicQuery.count()); }
public virtual void testQueryByNonExistingCaseActivityId() { HistoricCaseInstanceQuery query = historyService.createHistoricCaseInstanceQuery().caseActivityIdIn("nonExisting"); assertEquals(0, query.count()); }