use of org.camunda.bpm.engine.repository.DecisionDefinitionQuery in project camunda-bpm-platform by camunda.
the class DecisionDefinitionQueryTest method queryByNameLike.
@Test
public void queryByNameLike() {
DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery();
query.decisionDefinitionNameLike("%w%");
verifyQueryResults(query, 1);
query.decisionDefinitionNameLike("%z\\_");
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.repository.DecisionDefinitionQuery in project camunda-bpm-platform by camunda.
the class DecisionDefinitionRestServiceQueryTest method createMockDecisionDefinitionQuery.
private DecisionDefinitionQuery createMockDecisionDefinitionQuery(List<DecisionDefinition> mockedDefinitions) {
DecisionDefinitionQuery sampleDefinitionsQuery = mock(DecisionDefinitionQuery.class);
when(sampleDefinitionsQuery.list()).thenReturn(mockedDefinitions);
when(sampleDefinitionsQuery.count()).thenReturn((long) mockedDefinitions.size());
when(processEngine.getRepositoryService().createDecisionDefinitionQuery()).thenReturn(sampleDefinitionsQuery);
return sampleDefinitionsQuery;
}
use of org.camunda.bpm.engine.repository.DecisionDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionDefinitionQueryTest method testQueryNoTenantIdSet.
public void testQueryNoTenantIdSet() {
DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery();
assertThat(query.count(), is(3L));
}
use of org.camunda.bpm.engine.repository.DecisionDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionDefinitionQueryTest method testQueryNoAuthenticatedTenants.
public void testQueryNoAuthenticatedTenants() {
identityService.setAuthentication("user", null, null);
DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery();
assertThat(query.count(), is(1L));
}
use of org.camunda.bpm.engine.repository.DecisionDefinitionQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionDefinitionQueryTest method testQueryByTenantId.
public void testQueryByTenantId() {
DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery().tenantIdIn(TENANT_ONE);
assertThat(query.count(), is(1L));
query = repositoryService.createDecisionDefinitionQuery().tenantIdIn(TENANT_TWO);
assertThat(query.count(), is(1L));
}
Aggregations