use of org.camunda.bpm.engine.identity.TenantQuery in project camunda-bpm-platform by camunda.
the class IdentityServiceTenantTest method deleteTenantMembershipsWileDeleteUser.
@Test
public void deleteTenantMembershipsWileDeleteUser() {
Tenant tenant = identityService.newTenant(TENANT_ONE);
identityService.saveTenant(tenant);
User user = identityService.newUser(USER_ONE);
identityService.saveUser(user);
identityService.createTenantUserMembership(TENANT_ONE, USER_ONE);
TenantQuery query = identityService.createTenantQuery().userMember(USER_ONE);
assertThat(query.count(), is(1L));
identityService.deleteUser(USER_ONE);
assertThat(query.count(), is(0L));
}
use of org.camunda.bpm.engine.identity.TenantQuery in project camunda-bpm-platform by camunda.
the class IdentityServiceTenantTest method deleteTenantMembershipsWhileDeleteGroup.
@Test
public void deleteTenantMembershipsWhileDeleteGroup() {
Tenant tenant = identityService.newTenant(TENANT_ONE);
identityService.saveTenant(tenant);
Group group = identityService.newGroup(GROUP_ONE);
identityService.saveGroup(group);
identityService.createTenantGroupMembership(TENANT_ONE, GROUP_ONE);
TenantQuery query = identityService.createTenantQuery().groupMember(GROUP_ONE);
assertThat(query.count(), is(1L));
identityService.deleteGroup(GROUP_ONE);
assertThat(query.count(), is(0L));
}
use of org.camunda.bpm.engine.identity.TenantQuery in project camunda-bpm-platform by camunda.
the class IdentityServiceTenantTest method deleteTenant.
@Test
public void deleteTenant() {
// create
Tenant tenant = identityService.newTenant(TENANT_ONE);
identityService.saveTenant(tenant);
TenantQuery query = identityService.createTenantQuery();
assertThat(query.count(), is(1L));
identityService.deleteTenant("nonExisting");
assertThat(query.count(), is(1L));
identityService.deleteTenant(TENANT_ONE);
assertThat(query.count(), is(0L));
}
use of org.camunda.bpm.engine.identity.TenantQuery in project camunda-bpm-platform by camunda.
the class TenantQueryTest method queryByUserIncludingGroups.
@Test
public void queryByUserIncludingGroups() {
TenantQuery query = identityService.createTenantQuery().userMember(USER);
assertThat(query.includingGroupsOfUser(false).count(), is(1L));
assertThat(query.includingGroupsOfUser(true).count(), is(2L));
}
use of org.camunda.bpm.engine.identity.TenantQuery in project camunda-bpm-platform by camunda.
the class TenantQueryTest method queryByGroup.
@Test
public void queryByGroup() {
TenantQuery query = identityService.createTenantQuery();
assertThat(query.groupMember("nonExisting").count(), is(0L));
assertThat(query.groupMember(GROUP).count(), is(1L));
assertThat(query.groupMember(GROUP).tenantId(TENANT_TWO).count(), is(1L));
}
Aggregations