mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-6389] Remove duplicated identity user service mock (#7373)
* [AAE-6389] removed duplicate services and refactored existing * [AAE-6389] improved and moved mocks to proper files * [AAE-6389] fixed circular dependency
This commit is contained in:
171
lib/core/mock/oauth2.service.mock.ts
Normal file
171
lib/core/mock/oauth2.service.mock.ts
Normal file
@@ -0,0 +1,171 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { mockGroups, mockIdentityGroups, roleMappingMock } from './identity-group.mock';
|
||||
import { mockAssignedRoles, mockAvailableRoles, mockEffectiveRoles, mockIdentityUsers } from './identity-user.mock';
|
||||
|
||||
export const queryUsersMockApi: any = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: () => {
|
||||
return Promise.resolve(mockIdentityUsers);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const createUserMockApi: any = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: () => {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const updateUserMockApi: any = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: () => {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const deleteUserMockApi: any = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: () => {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const getInvolvedGroupsMockApi: any = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: () => {
|
||||
return Promise.resolve(mockGroups);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const joinGroupMockApi: any = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: () => {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const leaveGroupMockApi: any = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: () => {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const getAvailableRolesMockApi: any = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: () => {
|
||||
return Promise.resolve(mockAvailableRoles);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const getAssignedRolesMockApi: any = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: () => {
|
||||
return Promise.resolve(mockAssignedRoles);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const getEffectiveRolesMockApi: any = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: () => {
|
||||
return Promise.resolve(mockEffectiveRoles);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const assignRolesMockApi: any = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: () => {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const removeRolesMockApi: any = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: () => {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const roleMappingApi: any = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: () => {
|
||||
return Promise.resolve(roleMappingMock);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const noRoleMappingApi: any = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: () => {
|
||||
return Promise.resolve([]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const groupsMockApi: any = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: () => {
|
||||
return Promise.resolve(mockIdentityGroups);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const createGroupMappingApi: any = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: () => {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const updateGroupMappingApi: any = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: () => {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const deleteGroupMappingApi: any = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: () => {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const applicationDetailsMockApi: any = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: () => {
|
||||
return Promise.resolve([{id: 'mock-app-id', name: 'mock-app-name'}]);
|
||||
}
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user