Search in sources :

Example 11 with EventSubscriptionQuery

use of org.camunda.bpm.engine.runtime.EventSubscriptionQuery in project camunda-bpm-platform by camunda.

the class MultiTenancyEventSubscriptionQueryTest method testQueryNoAuthenticatedTenants.

public void testQueryNoAuthenticatedTenants() {
    identityService.setAuthentication("user", null, null);
    EventSubscriptionQuery query = runtimeService.createEventSubscriptionQuery();
    assertThat(query.count(), is(1L));
}
Also used : EventSubscriptionQuery(org.camunda.bpm.engine.runtime.EventSubscriptionQuery)

Example 12 with EventSubscriptionQuery

use of org.camunda.bpm.engine.runtime.EventSubscriptionQuery in project camunda-bpm-platform by camunda.

the class MultiTenancyEventSubscriptionQueryTest method testQueryByTenantId.

public void testQueryByTenantId() {
    EventSubscriptionQuery query = runtimeService.createEventSubscriptionQuery().tenantIdIn(TENANT_ONE);
    assertThat(query.count(), is(1L));
    query = runtimeService.createEventSubscriptionQuery().tenantIdIn(TENANT_TWO);
    assertThat(query.count(), is(1L));
}
Also used : EventSubscriptionQuery(org.camunda.bpm.engine.runtime.EventSubscriptionQuery)

Example 13 with EventSubscriptionQuery

use of org.camunda.bpm.engine.runtime.EventSubscriptionQuery in project camunda-bpm-platform by camunda.

the class MultiTenancyEventSubscriptionQueryTest method testQueryByTenantIdsIncludeSubscriptionsWithoutTenantId.

public void testQueryByTenantIdsIncludeSubscriptionsWithoutTenantId() {
    EventSubscriptionQuery query = runtimeService.createEventSubscriptionQuery().tenantIdIn(TENANT_ONE).includeEventSubscriptionsWithoutTenantId();
    assertThat(query.count(), is(2L));
    query = runtimeService.createEventSubscriptionQuery().tenantIdIn(TENANT_TWO).includeEventSubscriptionsWithoutTenantId();
    assertThat(query.count(), is(2L));
    query = runtimeService.createEventSubscriptionQuery().tenantIdIn(TENANT_ONE, TENANT_TWO).includeEventSubscriptionsWithoutTenantId();
    assertThat(query.count(), is(3L));
}
Also used : EventSubscriptionQuery(org.camunda.bpm.engine.runtime.EventSubscriptionQuery)

Example 14 with EventSubscriptionQuery

use of org.camunda.bpm.engine.runtime.EventSubscriptionQuery in project camunda-bpm-platform by camunda.

the class MultiTenancyEventSubscriptionQueryTest method testQueryNoTenantIdSet.

public void testQueryNoTenantIdSet() {
    EventSubscriptionQuery query = runtimeService.createEventSubscriptionQuery();
    assertThat(query.count(), is(3L));
}
Also used : EventSubscriptionQuery(org.camunda.bpm.engine.runtime.EventSubscriptionQuery)

Example 15 with EventSubscriptionQuery

use of org.camunda.bpm.engine.runtime.EventSubscriptionQuery in project camunda-bpm-platform by camunda.

the class MultiTenancyEventSubscriptionQueryTest method testQueryAuthenticatedTenants.

public void testQueryAuthenticatedTenants() {
    identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO));
    EventSubscriptionQuery query = runtimeService.createEventSubscriptionQuery();
    assertThat(query.count(), is(3L));
    assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
    assertThat(query.tenantIdIn(TENANT_TWO).count(), is(1L));
}
Also used : EventSubscriptionQuery(org.camunda.bpm.engine.runtime.EventSubscriptionQuery)

Aggregations

EventSubscriptionQuery (org.camunda.bpm.engine.runtime.EventSubscriptionQuery)32 EventSubscription (org.camunda.bpm.engine.runtime.EventSubscription)13 Task (org.camunda.bpm.engine.task.Task)8 Deployment (org.camunda.bpm.engine.test.Deployment)8 TaskQuery (org.camunda.bpm.engine.task.TaskQuery)7 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)5 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)3 HistoricProcessInstance (org.camunda.bpm.engine.history.HistoricProcessInstance)2 JobQuery (org.camunda.bpm.engine.runtime.JobQuery)2 Date (java.util.Date)1 HistoricActivityInstanceQuery (org.camunda.bpm.engine.history.HistoricActivityInstanceQuery)1 InvalidRequestException (org.camunda.bpm.engine.rest.exception.InvalidRequestException)1 Execution (org.camunda.bpm.engine.runtime.Execution)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1 Test (org.junit.Test)1 Matchers.anyString (org.mockito.Matchers.anyString)1