use of org.camunda.bpm.engine.identity.Tenant in project camunda-bpm-platform by camunda.
the class TenantResourceImpl method updateTenant.
public void updateTenant(TenantDto tenantDto) {
ensureNotReadOnly();
Tenant tenant = findTenantObject();
if (tenant == null) {
throw new InvalidRequestException(Status.NOT_FOUND, "Tenant with id " + resourceId + " does not exist");
}
tenantDto.update(tenant);
identityService.saveTenant(tenant);
}
use of org.camunda.bpm.engine.identity.Tenant in project camunda-bpm-platform by camunda.
the class MockProvider method createMockTenant.
public static Tenant createMockTenant() {
Tenant mockTenant = mock(Tenant.class);
when(mockTenant.getId()).thenReturn(EXAMPLE_TENANT_ID);
when(mockTenant.getName()).thenReturn(EXAMPLE_TENANT_NAME);
return mockTenant;
}
use of org.camunda.bpm.engine.identity.Tenant 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.Tenant in project camunda-bpm-platform by camunda.
the class AuthenticationFilterPathMatchingTest method setup.
@Before
public void setup() throws ServletException {
currentEngine = getProcessEngine(engineName);
authorizationServiceMock = mock(AuthorizationServiceImpl.class);
identityServiceMock = mock(IdentityServiceImpl.class);
repositoryServiceMock = mock(RepositoryService.class);
when(currentEngine.getAuthorizationService()).thenReturn(authorizationServiceMock);
when(currentEngine.getIdentityService()).thenReturn(identityServiceMock);
// for authentication
userMock = MockProvider.createMockUser();
List<Group> groupMocks = MockProvider.createMockGroups();
groupIds = setupGroupQueryMock(groupMocks);
List<Tenant> tenantMocks = Collections.singletonList(MockProvider.createMockTenant());
tenantIds = setupTenantQueryMock(tenantMocks);
GroupQuery mockGroupQuery = mock(GroupQuery.class);
when(identityServiceMock.createGroupQuery()).thenReturn(mockGroupQuery);
when(mockGroupQuery.groupMember(anyString())).thenReturn(mockGroupQuery);
when(mockGroupQuery.list()).thenReturn(groupMocks);
setupFilter();
}
use of org.camunda.bpm.engine.identity.Tenant 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