public virtual void testQueryAuthenticatedTenants() { identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO)); HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery(); 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 testQueryAuthenticatedTenant() { identityService.setAuthentication("user", null, Collections.singletonList(TENANT_ONE)); HistoricProcessInstanceQuery query = historyService.createHistoricProcessInstanceQuery(); assertThat(query.count(), @is(2L)); assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L)); assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(0L)); assertThat(query.tenantIdIn(TENANT_ONE, TENANT_TWO).count(), @is(1L)); }