[AAE-30882] - migrating from superagent to axios

This commit is contained in:
VitoAlbano
2025-08-13 18:21:15 +01:00
committed by Vito Albano
parent 6fa531e11f
commit e400bc1068
7 changed files with 204 additions and 243 deletions

View File

@@ -17,8 +17,9 @@
import assert from 'assert';
import { ProcessAuth } from '../src';
import { SuperagentHttpClient } from '../src/superagentHttpClient';
import { BpmAuthMock } from './mockObjects';
import { AxiosHttpClient } from '../src/axiosHttpClient';
describe('Bpm Auth test', () => {
const hostBpm = 'https://127.0.0.1:9999';
@@ -256,16 +257,16 @@ describe('Bpm Auth test', () => {
let setCsrfTokenCalled = false;
beforeEach(() => {
originalMethod = SuperagentHttpClient.prototype.setCsrfToken;
originalMethod = AxiosHttpClient.prototype.setCsrfToken;
setCsrfTokenCalled = false;
SuperagentHttpClient.prototype.setCsrfToken = () => {
AxiosHttpClient.prototype.setCsrfToken = () => {
setCsrfTokenCalled = true;
};
});
afterEach(() => {
SuperagentHttpClient.prototype.setCsrfToken = originalMethod;
AxiosHttpClient.prototype.setCsrfToken = originalMethod;
setCsrfTokenCalled = false;
});