AAE-30882 Remove superagent for fetch (#11856)

* [AAE-30882] - Remove superagent for fetch

* [AAE-30882] - Fixing comments

* [AAE-30882] - fixde failing unit tests

* [AAE-30882] - fixde failing unit tests

* [AAE-30882] - fixd sonarcloud comment
This commit is contained in:
Vito Albano
2026-05-07 09:12:07 +01:00
committed by GitHub
parent 9cdacf3ebf
commit 57bf066164
54 changed files with 2127 additions and 922 deletions
@@ -15,12 +15,11 @@
* limitations under the License.
*/
import nock from 'nock';
import { BaseMock } from '../base.mock';
export class GroupsMock extends BaseMock {
get200GetGroups(): void {
nock(this.host, { encodedQueryParams: true })
this.mock()
.get('/alfresco/api/-default-/public/alfresco/versions/1/groups')
.reply(200, {
list: {
@@ -52,20 +51,20 @@ export class GroupsMock extends BaseMock {
}
getDeleteGroupSuccessfulResponse(groupName: string): void {
nock(this.host, { encodedQueryParams: true })
this.mock()
.delete('/alfresco/api/-default-/public/alfresco/versions/1/groups/' + groupName)
.query({ cascade: 'false' })
.reply(200);
}
getDeleteMemberForGroupSuccessfulResponse(groupName: string, memberName: string): void {
nock(this.host, { encodedQueryParams: true })
this.mock()
.delete('/alfresco/api/-default-/public/alfresco/versions/1/groups/' + groupName + '/members/' + memberName)
.reply(200);
}
get200CreateGroupResponse(): void {
nock(this.host, { encodedQueryParams: true })
this.mock()
.post('/alfresco/api/-default-/public/alfresco/versions/1/groups')
.reply(200, {
entry: {
@@ -77,7 +76,7 @@ export class GroupsMock extends BaseMock {
}
get200GetSingleGroup(): void {
nock(this.host, { encodedQueryParams: true })
this.mock()
.get('/alfresco/api/-default-/public/alfresco/versions/1/groups/GROUP_TEST')
.reply(200, {
entry: {
@@ -89,7 +88,7 @@ export class GroupsMock extends BaseMock {
}
get200UpdateGroupResponse(): void {
nock(this.host, { encodedQueryParams: true })
this.mock()
.put('/alfresco/api/-default-/public/alfresco/versions/1/groups/GROUP_TEST')
.reply(200, {
entry: {
@@ -101,7 +100,7 @@ export class GroupsMock extends BaseMock {
}
get200GetGroupMemberships(): void {
nock(this.host, { encodedQueryParams: true })
this.mock()
.get('/alfresco/api/-default-/public/alfresco/versions/1/groups/GROUP_TEST/members')
.reply(200, {
list: {
@@ -126,7 +125,7 @@ export class GroupsMock extends BaseMock {
}
get200AddGroupMembershipResponse(): void {
nock(this.host, { encodedQueryParams: true })
this.mock()
.post('/alfresco/api/-default-/public/alfresco/versions/1/groups/GROUP_TEST/members')
.reply(200, {
entry: {