use of org.camunda.bpm.engine.identity.Tenant in project camunda-bpm-platform by camunda.
the class DefaultPermissionForTenantMemberTest method createTenant.
protected Tenant createTenant(String tenantId) {
Tenant newTenant = identityService.newTenant(tenantId);
identityService.saveTenant(newTenant);
return newTenant;
}
use of org.camunda.bpm.engine.identity.Tenant in project camunda-bpm-platform by camunda.
the class IdentityServiceTenantTest method createTenantGroupMembershipAlreadyExisting.
@Test
public void createTenantGroupMembershipAlreadyExisting() {
Tenant tenant = identityService.newTenant(TENANT_ONE);
identityService.saveTenant(tenant);
Group group = identityService.newGroup(GROUP_ONE);
identityService.saveGroup(group);
identityService.createTenantGroupMembership(TENANT_ONE, GROUP_ONE);
thrown.expect(ProcessEngineException.class);
identityService.createTenantGroupMembership(TENANT_ONE, GROUP_ONE);
}
use of org.camunda.bpm.engine.identity.Tenant in project camunda-bpm-platform by camunda.
the class IdentityServiceTenantTest method createTenantMembershipUnexistingGroup.
@Test
public void createTenantMembershipUnexistingGroup() {
Tenant tenant = identityService.newTenant(TENANT_ONE);
identityService.saveTenant(tenant);
thrown.expect(ProcessEngineException.class);
thrown.expectMessage("No group found with id 'nonExisting'.");
identityService.createTenantGroupMembership(tenant.getId(), "nonExisting");
}
use of org.camunda.bpm.engine.identity.Tenant 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.Tenant in project camunda-bpm-platform by camunda.
the class IdentityServiceTenantTest method updateTenantOptimisticLockingException.
@Test
public void updateTenantOptimisticLockingException() {
// create
Tenant tenant = identityService.newTenant(TENANT_ONE);
identityService.saveTenant(tenant);
Tenant tenant1 = identityService.createTenantQuery().singleResult();
Tenant tenant2 = identityService.createTenantQuery().singleResult();
// update
tenant1.setName("name");
identityService.saveTenant(tenant1);
thrown.expect(ProcessEngineException.class);
// fail to update old revision
tenant2.setName("other name");
identityService.saveTenant(tenant2);
}
Aggregations