use of org.camunda.bpm.engine.identity.TenantQuery in project camunda-bpm-platform by camunda.
the class TenantRestServiceInteractionTest method setUpMockQuery.
protected TenantQuery setUpMockQuery(Tenant tenant) {
TenantQuery query = mock(TenantQuery.class);
when(query.tenantId(anyString())).thenReturn(query);
when(query.singleResult()).thenReturn(tenant);
when(identityServiceMock.createTenantQuery()).thenReturn(query);
return query;
}
use of org.camunda.bpm.engine.identity.TenantQuery in project camunda-bpm-platform by camunda.
the class TenantRestServiceImpl method queryTenants.
public List<TenantDto> queryTenants(UriInfo uriInfo, Integer firstResult, Integer maxResults) {
TenantQueryDto queryDto = new TenantQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
TenantQuery query = queryDto.toQuery(getProcessEngine());
List<Tenant> tenants;
if (firstResult != null || maxResults != null) {
tenants = executePaginatedQuery(query, firstResult, maxResults);
} else {
tenants = query.list();
}
return TenantDto.fromTenantList(tenants);
}
use of org.camunda.bpm.engine.identity.TenantQuery in project camunda-bpm-platform by camunda.
the class TenantRestServiceImpl method getTenantCount.
public CountResultDto getTenantCount(UriInfo uriInfo) {
TenantQueryDto queryDto = new TenantQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
TenantQuery query = queryDto.toQuery(getProcessEngine());
long count = query.count();
return new CountResultDto(count);
}
use of org.camunda.bpm.engine.identity.TenantQuery in project camunda-bpm-platform by camunda.
the class AbstractAuthenticationFilterTest method setupTenantQueryMock.
protected List<String> setupTenantQueryMock(List<Tenant> tenants) {
TenantQuery mockTenantQuery = mock(TenantQuery.class);
when(identityServiceMock.createTenantQuery()).thenReturn(mockTenantQuery);
when(mockTenantQuery.userMember(anyString())).thenReturn(mockTenantQuery);
when(mockTenantQuery.includingGroupsOfUser(anyBoolean())).thenReturn(mockTenantQuery);
when(mockTenantQuery.list()).thenReturn(tenants);
List<String> tenantIds = new ArrayList<String>();
for (Tenant tenant : tenants) {
tenantIds.add(tenant.getId());
}
return tenantIds;
}
use of org.camunda.bpm.engine.identity.TenantQuery in project camunda-bpm-platform by camunda.
the class FetchAndLockRestServiceInteractionTest method setupTenantQueryMock.
private List<String> setupTenantQueryMock(List<Tenant> tenants) {
TenantQuery mockTenantQuery = mock(TenantQuery.class);
when(identityServiceMock.createTenantQuery()).thenReturn(mockTenantQuery);
when(mockTenantQuery.userMember(anyString())).thenReturn(mockTenantQuery);
when(mockTenantQuery.includingGroupsOfUser(anyBoolean())).thenReturn(mockTenantQuery);
when(mockTenantQuery.list()).thenReturn(tenants);
List<String> tenantIds = new ArrayList<String>();
for (Tenant tenant : tenants) {
tenantIds.add(tenant.getId());
}
return tenantIds;
}
Aggregations