use of org.camunda.bpm.engine.identity.TenantQuery in project camunda-bpm-platform by camunda.
the class TenantQueryTest method queryByNonExistingId.
@Test
public void queryByNonExistingId() {
TenantQuery query = identityService.createTenantQuery().tenantId("nonExisting");
assertThat(query.count(), is(0L));
}
use of org.camunda.bpm.engine.identity.TenantQuery in project camunda-bpm-platform by camunda.
the class TenantQueryTest method queryByIdIn.
@Test
public void queryByIdIn() {
TenantQuery query = identityService.createTenantQuery();
assertThat(query.tenantIdIn("non", "existing").count(), is(0L));
assertThat(query.tenantIdIn(TENANT_ONE, TENANT_TWO).count(), is(2L));
}
use of org.camunda.bpm.engine.identity.TenantQuery in project camunda-bpm-platform by camunda.
the class TenantQueryTest method queryByUser.
@Test
public void queryByUser() {
TenantQuery query = identityService.createTenantQuery();
assertThat(query.userMember("nonExisting").count(), is(0L));
assertThat(query.userMember(USER).count(), is(1L));
assertThat(query.userMember(USER).tenantId(TENANT_ONE).count(), is(1L));
}
use of org.camunda.bpm.engine.identity.TenantQuery in project camunda-bpm-platform by camunda.
the class IdentityServiceTenantTest method deleteTenantGroupMembership.
@Test
public void deleteTenantGroupMembership() {
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.deleteTenantGroupMembership("nonExisting", GROUP_ONE);
assertThat(query.count(), is(1L));
identityService.deleteTenantGroupMembership(TENANT_ONE, "nonExisting");
assertThat(query.count(), is(1L));
identityService.deleteTenantGroupMembership(TENANT_ONE, 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 deleteTenantUserMembership.
@Test
public void deleteTenantUserMembership() {
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.deleteTenantUserMembership("nonExisting", USER_ONE);
assertThat(query.count(), is(1L));
identityService.deleteTenantUserMembership(TENANT_ONE, "nonExisting");
assertThat(query.count(), is(1L));
identityService.deleteTenantUserMembership(TENANT_ONE, USER_ONE);
assertThat(query.count(), is(0L));
}
Aggregations