File tree Expand file tree Collapse file tree 3 files changed +7
-13
lines changed Expand file tree Collapse file tree 3 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ require('../src/bootstrap')
6
6
7
7
const prepare = require ( 'mocha-prepare' )
8
8
const nock = require ( 'nock' )
9
- const testData = require ( './testData' )
10
9
11
10
prepare ( function ( done ) {
12
11
let directProjectId
@@ -16,9 +15,6 @@ prepare(function (done) {
16
15
if ( path . includes ( '/projects' ) ) {
17
16
return '/_projects'
18
17
}
19
- if ( path . includes ( '/token' ) ) { // match auth0 url
20
- return '/_m2mAuth'
21
- }
22
18
return path
23
19
} )
24
20
. get ( '/_projects' )
@@ -32,11 +28,6 @@ prepare(function (done) {
32
28
. reply ( 200 , ( uri , requestBody ) => {
33
29
directProjectId = requestBody . directProjectId
34
30
} )
35
- . post ( '/_m2mAuth' )
36
- . reply ( 200 , {
37
- access_token : testData . token . m2m ,
38
- expiry : 8400
39
- } )
40
31
. get ( '/health' )
41
32
. reply ( 200 , { checksRun : 1 } )
42
33
done ( )
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ const { initDB } = require('../scripts/init-db')
13
13
const { insertData } = require ( '../scripts/test-data' )
14
14
const { getInformixConnection, getKafkaOptions } = require ( '../src/common/helper' )
15
15
const projectService = require ( '../src/services/ProjectService' )
16
+ const sinon = require ( 'sinon' )
17
+ const helper = require ( '../src/common/helper' )
16
18
17
19
describe ( 'Topcoder - Legacy Project Processor E2E Test' , ( ) => {
18
20
let app
@@ -90,6 +92,8 @@ describe('Topcoder - Legacy Project Processor E2E Test', () => {
90
92
}
91
93
92
94
before ( async ( ) => {
95
+ sinon . stub ( helper , 'getM2MToken' ) . value ( ( ) => Promise . resolve ( 'dummy-token' ) )
96
+
93
97
// inject logger with log collector
94
98
logger . info = ( message ) => {
95
99
infoLogs . push ( message )
@@ -140,6 +144,8 @@ describe('Topcoder - Legacy Project Processor E2E Test', () => {
140
144
}
141
145
142
146
await connection . closeAsync ( )
147
+
148
+ sinon . reset ( )
143
149
} )
144
150
145
151
beforeEach ( ( ) => {
Original file line number Diff line number Diff line change @@ -241,8 +241,5 @@ const testTopics = {
241
241
}
242
242
243
243
module . exports = {
244
- testTopics,
245
- token : {
246
- m2m : 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Ik5VSkZORGd4UlRVME5EWTBOVVkzTlRkR05qTXlRamxETmpOQk5UYzVRVUV3UlRFeU56TTJRUSJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoibWFFMm1hQlN2OWZSVkhqU2xDMzFMRlpTcTZWaGhacUNAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNTc1MjMyNTMyLCJleHAiOjE1NzUzMTg5MzIsImF6cCI6Im1hRTJtYUJTdjlmUlZIalNsQzMxTEZaU3E2VmhoWnFDIiwic2NvcGUiOiJyZWFkOmNoYWxsZW5nZXMgd3JpdGU6Y2hhbGxlbmdlcyByZWFkOmdyb3VwcyB1cGRhdGU6c3VibWlzc2lvbiByZWFkOnN1Ym1pc3Npb24gZGVsZXRlOnN1Ym1pc3Npb24gY3JlYXRlOnN1Ym1pc3Npb24gYWxsOnN1Ym1pc3Npb24gdXBkYXRlOnJldmlld190eXBlIHJlYWQ6cmV2aWV3X3R5cGUgZGVsZXRlOnJldmlld190eXBlIGFsbDpyZXZpZXdfdHlwZSB1cGRhdGU6cmV2aWV3X3N1bW1hdGlvbiByZWFkOnJldmlld19zdW1tYXRpb24gZGVsZXRlOnJldmlld19zdW1tYXRpb24gY3JlYXRlOnJldmlld19zdW1tYXRpb24gYWxsOnJldmlld19zdW1tYXRpb24gdXBkYXRlOnJldmlldyByZWFkOnJldmlldyBkZWxldGU6cmV2aWV3IGNyZWF0ZTpyZXZpZXcgYWxsOnJldmlldyByZWFkOmJ1c190b3BpY3Mgd3JpdGU6YnVzX2FwaSByZWFkOnVzZXJfcHJvZmlsZXMiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.YAunJfjPGZ0UM0an8UI0ISDiE31eWi9LOWUXFT8P_xftn2V0BkOlGpcm6zlMEMS4eR0LAInZS7WY6bfQW7z3Csl7untnrp2EwRh9gQWndcJejf6XizfhEvCwhbAVeS-95sS2vuxsG9WSsAXp6pcrBayzRFPMa5kUzolB1sExeUypkdGI5jR4gDF-NC7B1zHAsseHVyL3SknlDnzSbt0S6rAOX6BEXzaYERgmX5AtIdN4cZ9cwAikQkEj27ZhmYRR4gMaAZLK6sAC9Do7Rbux4yLQwVToAE2S2PQ7ehGHlHveVlCkRx1VGLIBAmsZp9He-t_uWSxU9n7ILDVhMsomTw'
247
- }
244
+ testTopics
248
245
}
You can’t perform that action at this time.
0 commit comments