Search in sources :

Example 21 with JobQuery

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

the class MultiTenancyJobQueryTest method testQueryByTenantIds.

public void testQueryByTenantIds() {
    JobQuery query = managementService.createJobQuery().tenantIdIn(TENANT_ONE, TENANT_TWO);
    assertThat(query.count(), is(2L));
}
Also used : JobQuery(org.camunda.bpm.engine.runtime.JobQuery)

Example 22 with JobQuery

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

the class MultiTenancyJobQueryTest method testQueryByNonExistingTenantId.

public void testQueryByNonExistingTenantId() {
    JobQuery query = managementService.createJobQuery().tenantIdIn("nonExisting");
    assertThat(query.count(), is(0L));
}
Also used : JobQuery(org.camunda.bpm.engine.runtime.JobQuery)

Example 23 with JobQuery

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

the class MultiTenancyJobQueryTest method testQueryDisabledTenantCheck.

public void testQueryDisabledTenantCheck() {
    processEngineConfiguration.setTenantCheckEnabled(false);
    identityService.setAuthentication("user", null, null);
    JobQuery query = managementService.createJobQuery();
    assertThat(query.count(), is(3L));
}
Also used : JobQuery(org.camunda.bpm.engine.runtime.JobQuery)

Example 24 with JobQuery

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

the class MultiTenancyJobQueryTest method testQueryNoTenantIdSet.

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

Example 25 with JobQuery

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

the class MultiTenancyJobQueryTest method testQueryAuthenticatedTenant.

public void testQueryAuthenticatedTenant() {
    identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
    JobQuery query = managementService.createJobQuery();
    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).includeJobsWithoutTenantId().count(), is(2L));
}
Also used : JobQuery(org.camunda.bpm.engine.runtime.JobQuery)

Aggregations

JobQuery (org.camunda.bpm.engine.runtime.JobQuery)255 Deployment (org.camunda.bpm.engine.test.Deployment)143 Job (org.camunda.bpm.engine.runtime.Job)115 HashMap (java.util.HashMap)105 JobDefinitionQuery (org.camunda.bpm.engine.management.JobDefinitionQuery)88 JobDefinition (org.camunda.bpm.engine.management.JobDefinition)73 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)55 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)41 Test (org.junit.Test)32 Date (java.util.Date)30 TaskQuery (org.camunda.bpm.engine.task.TaskQuery)23 ProcessInstanceQuery (org.camunda.bpm.engine.runtime.ProcessInstanceQuery)17 ExecutionQuery (org.camunda.bpm.engine.runtime.ExecutionQuery)14 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)9 Task (org.camunda.bpm.engine.task.Task)8 Batch (org.camunda.bpm.engine.batch.Batch)5 AbstractAsyncOperationsTest (org.camunda.bpm.engine.test.api.AbstractAsyncOperationsTest)5 ActivitySequenceCounterMap (org.camunda.bpm.engine.test.standalone.entity.ExecutionOrderListener.ActivitySequenceCounterMap)5 Matchers.anyString (org.mockito.Matchers.anyString)5 BadUserRequestException (org.camunda.bpm.engine.BadUserRequestException)3