@itentialopensource/adapter-azure_devops 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/.eslintignore +5 -0
  2. package/.eslintrc.js +18 -0
  3. package/.jshintrc +3 -0
  4. package/CHANGELOG.md +9 -0
  5. package/CODE_OF_CONDUCT.md +48 -0
  6. package/CONTRIBUTING.md +158 -0
  7. package/LICENSE +201 -0
  8. package/README.md +687 -0
  9. package/adapter.js +1606 -0
  10. package/adapterBase.js +1028 -0
  11. package/entities/.generic/action.json +109 -0
  12. package/entities/.generic/schema.json +23 -0
  13. package/entities/.system/action.json +50 -0
  14. package/entities/.system/mockdatafiles/getToken-default.json +3 -0
  15. package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
  16. package/entities/.system/schema.json +19 -0
  17. package/entities/.system/schemaTokenReq.json +53 -0
  18. package/entities/.system/schemaTokenResp.json +53 -0
  19. package/entities/Artifacts/action.json +25 -0
  20. package/entities/Artifacts/mockdatafiles/artifactsGet-default.json +5 -0
  21. package/entities/Artifacts/schema.json +41 -0
  22. package/entities/Logs/action.json +46 -0
  23. package/entities/Logs/mockdatafiles/logsGet-default.json +11 -0
  24. package/entities/Logs/mockdatafiles/logsList-default.json +119 -0
  25. package/entities/Logs/schema.json +42 -0
  26. package/entities/Pipelines/action.json +66 -0
  27. package/entities/Pipelines/mockdatafiles/pipelinesCreate-default.json +6 -0
  28. package/entities/Pipelines/mockdatafiles/pipelinesGet-default.json +6 -0
  29. package/entities/Pipelines/mockdatafiles/pipelinesList-default.json +26 -0
  30. package/entities/Pipelines/schema.json +43 -0
  31. package/entities/Preview/action.json +24 -0
  32. package/entities/Preview/mockdatafiles/previewPreview-default.json +3 -0
  33. package/entities/Preview/schema.json +30 -0
  34. package/entities/Runs/action.json +66 -0
  35. package/entities/Runs/mockdatafiles/runsGet-default.json +4 -0
  36. package/entities/Runs/mockdatafiles/runsList-default.json +18 -0
  37. package/entities/Runs/mockdatafiles/runsRunPipeline-default.json +4 -0
  38. package/entities/Runs/schema.json +32 -0
  39. package/error.json +184 -0
  40. package/package.json +85 -0
  41. package/pronghorn.json +2488 -0
  42. package/propertiesSchema.json +840 -0
  43. package/refs?service=git-upload-pack +0 -0
  44. package/report/ado.json +1382 -0
  45. package/report/creationReport.json +228 -0
  46. package/report/updateReport1639421539710.json +95 -0
  47. package/sampleProperties.json +106 -0
  48. package/test/integration/adapterTestBasicGet.js +85 -0
  49. package/test/integration/adapterTestConnectivity.js +93 -0
  50. package/test/integration/adapterTestIntegration.js +751 -0
  51. package/test/unit/adapterBaseTestUnit.js +944 -0
  52. package/test/unit/adapterTestUnit.js +2192 -0
  53. package/utils/addAuth.js +94 -0
  54. package/utils/artifactize.js +146 -0
  55. package/utils/basicGet.js +50 -0
  56. package/utils/checkMigrate.js +63 -0
  57. package/utils/entitiesToDB.js +224 -0
  58. package/utils/findPath.js +74 -0
  59. package/utils/modify.js +154 -0
  60. package/utils/packModificationScript.js +35 -0
  61. package/utils/pre-commit.sh +27 -0
  62. package/utils/removeHooks.js +20 -0
  63. package/utils/setup.js +33 -0
  64. package/utils/tbScript.js +169 -0
  65. package/utils/tbUtils.js +445 -0
  66. package/utils/testRunner.js +298 -0
  67. package/utils/troubleshootingAdapter.js +190 -0
  68. package/workflows/README.md +3 -0
@@ -0,0 +1,2192 @@
1
+ /* @copyright Itential, LLC 2019 (pre-modifications) */
2
+
3
+ // Set globals
4
+ /* global describe it log pronghornProps */
5
+ /* eslint global-require: warn */
6
+ /* eslint no-unused-vars: warn */
7
+
8
+ // include required items for testing & logging
9
+ const assert = require('assert');
10
+ const fs = require('fs-extra');
11
+ const mocha = require('mocha');
12
+ const path = require('path');
13
+ const util = require('util');
14
+ const winston = require('winston');
15
+ const execute = require('child_process').execSync;
16
+ const { expect } = require('chai');
17
+ const { use } = require('chai');
18
+ const td = require('testdouble');
19
+
20
+ const anything = td.matchers.anything();
21
+
22
+ // stub and attemptTimeout are used throughout the code so set them here
23
+ let logLevel = 'none';
24
+ const stub = true;
25
+ const isRapidFail = false;
26
+ const attemptTimeout = 600000;
27
+
28
+ // these variables can be changed to run in integrated mode so easier to set them here
29
+ // always check these in with bogus data!!!
30
+ const host = 'replace.hostorip.here';
31
+ const username = 'username';
32
+ const password = 'password';
33
+ const protocol = 'http';
34
+ const port = 80;
35
+ const sslenable = false;
36
+ const sslinvalid = false;
37
+
38
+ // these are the adapter properties. You generally should not need to alter
39
+ // any of these after they are initially set up
40
+ global.pronghornProps = {
41
+ pathProps: {
42
+ encrypted: false
43
+ },
44
+ adapterProps: {
45
+ adapters: [{
46
+ id: 'Test-azure_devops',
47
+ type: 'AzureDevops',
48
+ properties: {
49
+ host,
50
+ port,
51
+ base_path: '/',
52
+ version: '',
53
+ cache_location: 'none',
54
+ encode_pathvars: true,
55
+ save_metric: false,
56
+ stub,
57
+ protocol,
58
+ authentication: {
59
+ auth_method: 'static_token',
60
+ username,
61
+ password,
62
+ token: '',
63
+ invalid_token_error: 401,
64
+ token_timeout: -1,
65
+ token_cache: 'local',
66
+ auth_field: 'header.headers.Authorization',
67
+ auth_field_format: 'Basic {b64}Basic:{token}{/b64}',
68
+ auth_logging: false,
69
+ client_id: '',
70
+ client_secret: '',
71
+ grant_type: ''
72
+ },
73
+ healthcheck: {
74
+ type: 'none',
75
+ frequency: 60000,
76
+ query_object: {}
77
+ },
78
+ throttle: {
79
+ throttle_enabled: false,
80
+ number_pronghorns: 1,
81
+ sync_async: 'sync',
82
+ max_in_queue: 1000,
83
+ concurrent_max: 1,
84
+ expire_timeout: 0,
85
+ avg_runtime: 200,
86
+ priorities: [
87
+ {
88
+ value: 0,
89
+ percent: 100
90
+ }
91
+ ]
92
+ },
93
+ request: {
94
+ number_redirects: 0,
95
+ number_retries: 3,
96
+ limit_retry_error: [0],
97
+ failover_codes: [],
98
+ attempt_timeout: attemptTimeout,
99
+ global_request: {
100
+ payload: {},
101
+ uriOptions: {},
102
+ addlHeaders: {},
103
+ authData: {}
104
+ },
105
+ healthcheck_on_timeout: true,
106
+ return_raw: true,
107
+ archiving: false,
108
+ return_request: false
109
+ },
110
+ proxy: {
111
+ enabled: false,
112
+ host: '',
113
+ port: 1,
114
+ protocol: 'http',
115
+ username: '',
116
+ password: ''
117
+ },
118
+ ssl: {
119
+ ecdhCurve: '',
120
+ enabled: sslenable,
121
+ accept_invalid_cert: sslinvalid,
122
+ ca_file: '',
123
+ key_file: '',
124
+ cert_file: '',
125
+ secure_protocol: '',
126
+ ciphers: ''
127
+ },
128
+ mongo: {
129
+ host: '',
130
+ port: 0,
131
+ database: '',
132
+ username: '',
133
+ password: '',
134
+ replSet: '',
135
+ db_ssl: {
136
+ enabled: false,
137
+ accept_invalid_cert: false,
138
+ ca_file: '',
139
+ key_file: '',
140
+ cert_file: ''
141
+ }
142
+ }
143
+ }
144
+ }]
145
+ }
146
+ };
147
+
148
+ global.$HOME = `${__dirname}/../..`;
149
+
150
+ // set the log levels that Pronghorn uses, spam and trace are not defaulted in so without
151
+ // this you may error on log.trace calls.
152
+ const myCustomLevels = {
153
+ levels: {
154
+ spam: 6,
155
+ trace: 5,
156
+ debug: 4,
157
+ info: 3,
158
+ warn: 2,
159
+ error: 1,
160
+ none: 0
161
+ }
162
+ };
163
+
164
+ // need to see if there is a log level passed in
165
+ process.argv.forEach((val) => {
166
+ // is there a log level defined to be passed in?
167
+ if (val.indexOf('--LOG') === 0) {
168
+ // get the desired log level
169
+ const inputVal = val.split('=')[1];
170
+
171
+ // validate the log level is supported, if so set it
172
+ if (Object.hasOwnProperty.call(myCustomLevels.levels, inputVal)) {
173
+ logLevel = inputVal;
174
+ }
175
+ }
176
+ });
177
+
178
+ // need to set global logging
179
+ global.log = winston.createLogger({
180
+ level: logLevel,
181
+ levels: myCustomLevels.levels,
182
+ transports: [
183
+ new winston.transports.Console()
184
+ ]
185
+ });
186
+
187
+ /**
188
+ * Runs the error asserts for the test
189
+ */
190
+ function runErrorAsserts(data, error, code, origin, displayStr) {
191
+ assert.equal(null, data);
192
+ assert.notEqual(undefined, error);
193
+ assert.notEqual(null, error);
194
+ assert.notEqual(undefined, error.IAPerror);
195
+ assert.notEqual(null, error.IAPerror);
196
+ assert.notEqual(undefined, error.IAPerror.displayString);
197
+ assert.notEqual(null, error.IAPerror.displayString);
198
+ assert.equal(code, error.icode);
199
+ assert.equal(origin, error.IAPerror.origin);
200
+ assert.equal(displayStr, error.IAPerror.displayString);
201
+ }
202
+
203
+ // require the adapter that we are going to be using
204
+ const AzureDevops = require('../../adapter');
205
+
206
+ // delete the .DS_Store directory in entities -- otherwise this will cause errors
207
+ const dirPath = path.join(__dirname, '../../entities/.DS_Store');
208
+ if (fs.existsSync(dirPath)) {
209
+ try {
210
+ fs.removeSync(dirPath);
211
+ console.log('.DS_Store deleted');
212
+ } catch (e) {
213
+ console.log('Error when deleting .DS_Store:', e);
214
+ }
215
+ }
216
+
217
+ // begin the testing - these should be pretty well defined between the describe and the it!
218
+ describe('[unit] Azure_devops Adapter Test', () => {
219
+ describe('AzureDevops Class Tests', () => {
220
+ const a = new AzureDevops(
221
+ pronghornProps.adapterProps.adapters[0].id,
222
+ pronghornProps.adapterProps.adapters[0].properties
223
+ );
224
+
225
+ if (isRapidFail) {
226
+ const state = {};
227
+ state.passed = true;
228
+
229
+ mocha.afterEach(function x() {
230
+ state.passed = state.passed
231
+ && (this.currentTest.state === 'passed');
232
+ });
233
+ mocha.beforeEach(function x() {
234
+ if (!state.passed) {
235
+ return this.currentTest.skip();
236
+ }
237
+ return true;
238
+ });
239
+ }
240
+
241
+ describe('#class instance created', () => {
242
+ it('should be a class with properties', (done) => {
243
+ try {
244
+ assert.notEqual(null, a);
245
+ assert.notEqual(undefined, a);
246
+ const checkId = global.pronghornProps.adapterProps.adapters[0].id;
247
+ assert.equal(checkId, a.id);
248
+ assert.notEqual(null, a.allProps);
249
+ const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
250
+ assert.equal(check, a.healthcheckType);
251
+ done();
252
+ } catch (error) {
253
+ log.error(`Test Failure: ${error}`);
254
+ done(error);
255
+ }
256
+ }).timeout(attemptTimeout);
257
+ });
258
+
259
+ describe('adapterBase.js', () => {
260
+ it('should have an adapterBase.js', (done) => {
261
+ try {
262
+ fs.exists('adapterBase.js', (val) => {
263
+ assert.equal(true, val);
264
+ done();
265
+ });
266
+ } catch (error) {
267
+ log.error(`Test Failure: ${error}`);
268
+ done(error);
269
+ }
270
+ });
271
+ });
272
+
273
+ let wffunctions = [];
274
+ describe('#getWorkflowFunctions', () => {
275
+ it('should retrieve workflow functions', (done) => {
276
+ try {
277
+ wffunctions = a.getWorkflowFunctions([]);
278
+
279
+ try {
280
+ assert.notEqual(0, wffunctions.length);
281
+ done();
282
+ } catch (err) {
283
+ log.error(`Test Failure: ${err}`);
284
+ done(err);
285
+ }
286
+ } catch (error) {
287
+ log.error(`Adapter Exception: ${error}`);
288
+ done(error);
289
+ }
290
+ }).timeout(attemptTimeout);
291
+ });
292
+
293
+ describe('package.json', () => {
294
+ it('should have a package.json', (done) => {
295
+ try {
296
+ fs.exists('package.json', (val) => {
297
+ assert.equal(true, val);
298
+ done();
299
+ });
300
+ } catch (error) {
301
+ log.error(`Test Failure: ${error}`);
302
+ done(error);
303
+ }
304
+ });
305
+ it('package.json should be validated', (done) => {
306
+ try {
307
+ const packageDotJson = require('../../package.json');
308
+ const { PJV } = require('package-json-validator');
309
+ const options = {
310
+ warnings: true, // show warnings
311
+ recommendations: true // show recommendations
312
+ };
313
+ const results = PJV.validate(JSON.stringify(packageDotJson), 'npm', options);
314
+
315
+ if (results.valid === false) {
316
+ log.error('The package.json contains the following errors: ');
317
+ log.error(util.inspect(results));
318
+ assert.equal(true, results.valid);
319
+ } else {
320
+ assert.equal(true, results.valid);
321
+ }
322
+
323
+ done();
324
+ } catch (error) {
325
+ log.error(`Test Failure: ${error}`);
326
+ done(error);
327
+ }
328
+ });
329
+ it('package.json standard fields should be customized', (done) => {
330
+ try {
331
+ const packageDotJson = require('../../package.json');
332
+ assert.notEqual(-1, packageDotJson.name.indexOf('azure_devops'));
333
+ assert.notEqual(undefined, packageDotJson.version);
334
+ assert.notEqual(null, packageDotJson.version);
335
+ assert.notEqual('', packageDotJson.version);
336
+ assert.notEqual(undefined, packageDotJson.description);
337
+ assert.notEqual(null, packageDotJson.description);
338
+ assert.notEqual('', packageDotJson.description);
339
+ assert.equal('adapter.js', packageDotJson.main);
340
+ assert.notEqual(undefined, packageDotJson.wizardVersion);
341
+ assert.notEqual(null, packageDotJson.wizardVersion);
342
+ assert.notEqual('', packageDotJson.wizardVersion);
343
+ assert.notEqual(undefined, packageDotJson.engineVersion);
344
+ assert.notEqual(null, packageDotJson.engineVersion);
345
+ assert.notEqual('', packageDotJson.engineVersion);
346
+ assert.equal('http', packageDotJson.adapterType);
347
+ done();
348
+ } catch (error) {
349
+ log.error(`Test Failure: ${error}`);
350
+ done(error);
351
+ }
352
+ });
353
+ it('package.json proper scripts should be provided', (done) => {
354
+ try {
355
+ const packageDotJson = require('../../package.json');
356
+ assert.notEqual(undefined, packageDotJson.scripts);
357
+ assert.notEqual(null, packageDotJson.scripts);
358
+ assert.notEqual('', packageDotJson.scripts);
359
+ assert.equal('node utils/setup.js && npm install --package-lock-only --ignore-scripts && npx npm-force-resolutions', packageDotJson.scripts.preinstall);
360
+ assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js', packageDotJson.scripts.lint);
361
+ assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js --quiet', packageDotJson.scripts['lint:errors']);
362
+ assert.equal('mocha test/unit/adapterBaseTestUnit.js --LOG=error', packageDotJson.scripts['test:baseunit']);
363
+ assert.equal('mocha test/unit/adapterTestUnit.js --LOG=error', packageDotJson.scripts['test:unit']);
364
+ assert.equal('mocha test/integration/adapterTestIntegration.js --LOG=error', packageDotJson.scripts['test:integration']);
365
+ assert.equal('nyc --reporter html --reporter text mocha --reporter dot test/*', packageDotJson.scripts['test:cover']);
366
+ assert.equal('npm run test:baseunit && npm run test:unit && npm run test:integration', packageDotJson.scripts.test);
367
+ assert.equal('npm publish --registry=https://registry.npmjs.org --access=public', packageDotJson.scripts.deploy);
368
+ assert.equal('npm run deploy', packageDotJson.scripts.build);
369
+ done();
370
+ } catch (error) {
371
+ log.error(`Test Failure: ${error}`);
372
+ done(error);
373
+ }
374
+ });
375
+ it('package.json proper directories should be provided', (done) => {
376
+ try {
377
+ const packageDotJson = require('../../package.json');
378
+ assert.notEqual(undefined, packageDotJson.repository);
379
+ assert.notEqual(null, packageDotJson.repository);
380
+ assert.notEqual('', packageDotJson.repository);
381
+ assert.equal('git', packageDotJson.repository.type);
382
+ assert.equal('git@gitlab.com:itentialopensource/adapters/', packageDotJson.repository.url.substring(0, 43));
383
+ assert.equal('https://gitlab.com/itentialopensource/adapters/', packageDotJson.homepage.substring(0, 47));
384
+ done();
385
+ } catch (error) {
386
+ log.error(`Test Failure: ${error}`);
387
+ done(error);
388
+ }
389
+ });
390
+ it('package.json proper dependencies should be provided', (done) => {
391
+ try {
392
+ const packageDotJson = require('../../package.json');
393
+ assert.notEqual(undefined, packageDotJson.dependencies);
394
+ assert.notEqual(null, packageDotJson.dependencies);
395
+ assert.notEqual('', packageDotJson.dependencies);
396
+ assert.equal('^6.12.0', packageDotJson.dependencies.ajv);
397
+ assert.equal('^0.21.0', packageDotJson.dependencies.axios);
398
+ assert.equal('^2.20.0', packageDotJson.dependencies.commander);
399
+ assert.equal('^8.1.0', packageDotJson.dependencies['fs-extra']);
400
+ assert.equal('^9.0.1', packageDotJson.dependencies.mocha);
401
+ assert.equal('^2.0.1', packageDotJson.dependencies['mocha-param']);
402
+ assert.equal('^0.5.3', packageDotJson.dependencies['network-diagnostics']);
403
+ assert.equal('^15.1.0', packageDotJson.dependencies.nyc);
404
+ assert.equal('^1.4.10', packageDotJson.dependencies['readline-sync']);
405
+ assert.equal('^7.3.2', packageDotJson.dependencies.semver);
406
+ assert.equal('^3.3.3', packageDotJson.dependencies.winston);
407
+ done();
408
+ } catch (error) {
409
+ log.error(`Test Failure: ${error}`);
410
+ done(error);
411
+ }
412
+ });
413
+ it('package.json proper dev dependencies should be provided', (done) => {
414
+ try {
415
+ const packageDotJson = require('../../package.json');
416
+ assert.notEqual(undefined, packageDotJson.devDependencies);
417
+ assert.notEqual(null, packageDotJson.devDependencies);
418
+ assert.notEqual('', packageDotJson.devDependencies);
419
+ assert.equal('^4.3.4', packageDotJson.devDependencies.chai);
420
+ assert.equal('^7.29.0', packageDotJson.devDependencies.eslint);
421
+ assert.equal('^14.2.1', packageDotJson.devDependencies['eslint-config-airbnb-base']);
422
+ assert.equal('^2.23.4', packageDotJson.devDependencies['eslint-plugin-import']);
423
+ assert.equal('^3.0.0', packageDotJson.devDependencies['eslint-plugin-json']);
424
+ assert.equal('^0.6.3', packageDotJson.devDependencies['package-json-validator']);
425
+ assert.equal('^3.16.1', packageDotJson.devDependencies.testdouble);
426
+ done();
427
+ } catch (error) {
428
+ log.error(`Test Failure: ${error}`);
429
+ done(error);
430
+ }
431
+ });
432
+ });
433
+
434
+ describe('pronghorn.json', () => {
435
+ it('should have a pronghorn.json', (done) => {
436
+ try {
437
+ fs.exists('pronghorn.json', (val) => {
438
+ assert.equal(true, val);
439
+ done();
440
+ });
441
+ } catch (error) {
442
+ log.error(`Test Failure: ${error}`);
443
+ done(error);
444
+ }
445
+ });
446
+ it('pronghorn.json should be customized', (done) => {
447
+ try {
448
+ const pronghornDotJson = require('../../pronghorn.json');
449
+ assert.notEqual(-1, pronghornDotJson.id.indexOf('azure_devops'));
450
+ assert.equal('Adapter', pronghornDotJson.type);
451
+ assert.equal('AzureDevops', pronghornDotJson.export);
452
+ assert.equal('Azure_devops', pronghornDotJson.title);
453
+ assert.equal('adapter.js', pronghornDotJson.src);
454
+ done();
455
+ } catch (error) {
456
+ log.error(`Test Failure: ${error}`);
457
+ done(error);
458
+ }
459
+ });
460
+ it('pronghorn.json should contain generic adapter methods', (done) => {
461
+ try {
462
+ const pronghornDotJson = require('../../pronghorn.json');
463
+ assert.notEqual(undefined, pronghornDotJson.methods);
464
+ assert.notEqual(null, pronghornDotJson.methods);
465
+ assert.notEqual('', pronghornDotJson.methods);
466
+ assert.equal(true, Array.isArray(pronghornDotJson.methods));
467
+ assert.notEqual(0, pronghornDotJson.methods.length);
468
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'updateAdapterConfiguration'));
469
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'findPath'));
470
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'troubleshoot'));
471
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'runHealthcheck'));
472
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'runConnectivity'));
473
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'runBasicGet'));
474
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'suspend'));
475
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'unsuspend'));
476
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'getQueue'));
477
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequest'));
478
+ done();
479
+ } catch (error) {
480
+ log.error(`Test Failure: ${error}`);
481
+ done(error);
482
+ }
483
+ });
484
+ it('pronghorn.json should only expose workflow functions', (done) => {
485
+ try {
486
+ const pronghornDotJson = require('../../pronghorn.json');
487
+
488
+ for (let m = 0; m < pronghornDotJson.methods.length; m += 1) {
489
+ let found = false;
490
+ let paramissue = false;
491
+
492
+ for (let w = 0; w < wffunctions.length; w += 1) {
493
+ if (pronghornDotJson.methods[m].name === wffunctions[w]) {
494
+ found = true;
495
+ const methLine = execute(`grep " ${wffunctions[w]}(" adapter.js | grep "callback) {"`).toString();
496
+ let wfparams = [];
497
+
498
+ if (methLine && methLine.indexOf('(') >= 0 && methLine.indexOf(')') >= 0) {
499
+ const temp = methLine.substring(methLine.indexOf('(') + 1, methLine.lastIndexOf(')'));
500
+ wfparams = temp.split(',');
501
+
502
+ for (let t = 0; t < wfparams.length; t += 1) {
503
+ // remove default value from the parameter name
504
+ wfparams[t] = wfparams[t].substring(0, wfparams[t].search(/=/) > 0 ? wfparams[t].search(/#|\?|=/) : wfparams[t].length);
505
+ // remove spaces
506
+ wfparams[t] = wfparams[t].trim();
507
+
508
+ if (wfparams[t] === 'callback') {
509
+ wfparams.splice(t, 1);
510
+ }
511
+ }
512
+ }
513
+
514
+ // if there are inputs defined but not on the method line
515
+ if (wfparams.length === 0 && (pronghornDotJson.methods[m].input
516
+ && pronghornDotJson.methods[m].input.length > 0)) {
517
+ paramissue = true;
518
+ } else if (wfparams.length > 0 && (!pronghornDotJson.methods[m].input
519
+ || pronghornDotJson.methods[m].input.length === 0)) {
520
+ // if there are no inputs defined but there are on the method line
521
+ paramissue = true;
522
+ } else {
523
+ for (let p = 0; p < pronghornDotJson.methods[m].input.length; p += 1) {
524
+ let pfound = false;
525
+ for (let wfp = 0; wfp < wfparams.length; wfp += 1) {
526
+ if (pronghornDotJson.methods[m].input[p].name.toUpperCase() === wfparams[wfp].toUpperCase()) {
527
+ pfound = true;
528
+ }
529
+ }
530
+
531
+ if (!pfound) {
532
+ paramissue = true;
533
+ }
534
+ }
535
+ for (let wfp = 0; wfp < wfparams.length; wfp += 1) {
536
+ let pfound = false;
537
+ for (let p = 0; p < pronghornDotJson.methods[m].input.length; p += 1) {
538
+ if (pronghornDotJson.methods[m].input[p].name.toUpperCase() === wfparams[wfp].toUpperCase()) {
539
+ pfound = true;
540
+ }
541
+ }
542
+
543
+ if (!pfound) {
544
+ paramissue = true;
545
+ }
546
+ }
547
+ }
548
+
549
+ break;
550
+ }
551
+ }
552
+
553
+ if (!found) {
554
+ // this is the reason to go through both loops - log which ones are not found so
555
+ // they can be worked
556
+ log.error(`${pronghornDotJson.methods[m].name} not found in workflow functions`);
557
+ }
558
+ if (paramissue) {
559
+ // this is the reason to go through both loops - log which ones are not found so
560
+ // they can be worked
561
+ log.error(`${pronghornDotJson.methods[m].name} has a parameter mismatch`);
562
+ }
563
+ assert.equal(true, found);
564
+ assert.equal(false, paramissue);
565
+ }
566
+ done();
567
+ } catch (error) {
568
+ log.error(`Adapter Exception: ${error}`);
569
+ done(error);
570
+ }
571
+ }).timeout(attemptTimeout);
572
+ it('pronghorn.json should expose all workflow functions', (done) => {
573
+ try {
574
+ const pronghornDotJson = require('../../pronghorn.json');
575
+ for (let w = 0; w < wffunctions.length; w += 1) {
576
+ let found = false;
577
+
578
+ for (let m = 0; m < pronghornDotJson.methods.length; m += 1) {
579
+ if (pronghornDotJson.methods[m].name === wffunctions[w]) {
580
+ found = true;
581
+ break;
582
+ }
583
+ }
584
+
585
+ if (!found) {
586
+ // this is the reason to go through both loops - log which ones are not found so
587
+ // they can be worked
588
+ log.error(`${wffunctions[w]} not found in pronghorn.json`);
589
+ }
590
+ assert.equal(true, found);
591
+ }
592
+ done();
593
+ } catch (error) {
594
+ log.error(`Adapter Exception: ${error}`);
595
+ done(error);
596
+ }
597
+ });
598
+ });
599
+
600
+ describe('propertiesSchema.json', () => {
601
+ it('should have a propertiesSchema.json', (done) => {
602
+ try {
603
+ fs.exists('propertiesSchema.json', (val) => {
604
+ assert.equal(true, val);
605
+ done();
606
+ });
607
+ } catch (error) {
608
+ log.error(`Test Failure: ${error}`);
609
+ done(error);
610
+ }
611
+ });
612
+ it('propertiesSchema.json should be customized', (done) => {
613
+ try {
614
+ const propertiesDotJson = require('../../propertiesSchema.json');
615
+ assert.equal('adapter-azure_devops', propertiesDotJson.$id);
616
+ assert.equal('object', propertiesDotJson.type);
617
+ assert.equal('http://json-schema.org/draft-07/schema#', propertiesDotJson.$schema);
618
+ done();
619
+ } catch (error) {
620
+ log.error(`Test Failure: ${error}`);
621
+ done(error);
622
+ }
623
+ });
624
+ it('propertiesSchema.json should contain generic adapter properties', (done) => {
625
+ try {
626
+ const propertiesDotJson = require('../../propertiesSchema.json');
627
+ assert.notEqual(undefined, propertiesDotJson.properties);
628
+ assert.notEqual(null, propertiesDotJson.properties);
629
+ assert.notEqual('', propertiesDotJson.properties);
630
+ assert.equal('string', propertiesDotJson.properties.host.type);
631
+ assert.equal('integer', propertiesDotJson.properties.port.type);
632
+ assert.equal('boolean', propertiesDotJson.properties.stub.type);
633
+ assert.notEqual(undefined, propertiesDotJson.definitions.authentication);
634
+ assert.notEqual(null, propertiesDotJson.definitions.authentication);
635
+ assert.notEqual('', propertiesDotJson.definitions.authentication);
636
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.auth_method.type);
637
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.username.type);
638
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.password.type);
639
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.token.type);
640
+ assert.equal('integer', propertiesDotJson.definitions.authentication.properties.invalid_token_error.type);
641
+ assert.equal('integer', propertiesDotJson.definitions.authentication.properties.token_timeout.type);
642
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.token_cache.type);
643
+ assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field.type));
644
+ assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field_format.type));
645
+ assert.equal('boolean', propertiesDotJson.definitions.authentication.properties.auth_logging.type);
646
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_id.type);
647
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_secret.type);
648
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.grant_type.type);
649
+ assert.notEqual('', propertiesDotJson.definitions.ssl);
650
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.ecdhCurve.type);
651
+ assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.enabled.type);
652
+ assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.accept_invalid_cert.type);
653
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.ca_file.type);
654
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.key_file.type);
655
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.cert_file.type);
656
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.secure_protocol.type);
657
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.ciphers.type);
658
+ assert.equal('string', propertiesDotJson.properties.base_path.type);
659
+ assert.equal('string', propertiesDotJson.properties.version.type);
660
+ assert.equal('string', propertiesDotJson.properties.cache_location.type);
661
+ assert.equal('boolean', propertiesDotJson.properties.encode_pathvars.type);
662
+ assert.equal(true, Array.isArray(propertiesDotJson.properties.save_metric.type));
663
+ assert.equal('string', propertiesDotJson.properties.protocol.type);
664
+ assert.notEqual(undefined, propertiesDotJson.definitions);
665
+ assert.notEqual(null, propertiesDotJson.definitions);
666
+ assert.notEqual('', propertiesDotJson.definitions);
667
+ assert.notEqual(undefined, propertiesDotJson.definitions.healthcheck);
668
+ assert.notEqual(null, propertiesDotJson.definitions.healthcheck);
669
+ assert.notEqual('', propertiesDotJson.definitions.healthcheck);
670
+ assert.equal('string', propertiesDotJson.definitions.healthcheck.properties.type.type);
671
+ assert.equal('integer', propertiesDotJson.definitions.healthcheck.properties.frequency.type);
672
+ assert.equal('object', propertiesDotJson.definitions.healthcheck.properties.query_object.type);
673
+ assert.notEqual(undefined, propertiesDotJson.definitions.throttle);
674
+ assert.notEqual(null, propertiesDotJson.definitions.throttle);
675
+ assert.notEqual('', propertiesDotJson.definitions.throttle);
676
+ assert.equal('boolean', propertiesDotJson.definitions.throttle.properties.throttle_enabled.type);
677
+ assert.equal('integer', propertiesDotJson.definitions.throttle.properties.number_pronghorns.type);
678
+ assert.equal('string', propertiesDotJson.definitions.throttle.properties.sync_async.type);
679
+ assert.equal('integer', propertiesDotJson.definitions.throttle.properties.max_in_queue.type);
680
+ assert.equal('integer', propertiesDotJson.definitions.throttle.properties.concurrent_max.type);
681
+ assert.equal('integer', propertiesDotJson.definitions.throttle.properties.expire_timeout.type);
682
+ assert.equal('integer', propertiesDotJson.definitions.throttle.properties.avg_runtime.type);
683
+ assert.equal('array', propertiesDotJson.definitions.throttle.properties.priorities.type);
684
+ assert.notEqual(undefined, propertiesDotJson.definitions.request);
685
+ assert.notEqual(null, propertiesDotJson.definitions.request);
686
+ assert.notEqual('', propertiesDotJson.definitions.request);
687
+ assert.equal('integer', propertiesDotJson.definitions.request.properties.number_redirects.type);
688
+ assert.equal('integer', propertiesDotJson.definitions.request.properties.number_retries.type);
689
+ assert.equal(true, Array.isArray(propertiesDotJson.definitions.request.properties.limit_retry_error.type));
690
+ assert.equal('array', propertiesDotJson.definitions.request.properties.failover_codes.type);
691
+ assert.equal('integer', propertiesDotJson.definitions.request.properties.attempt_timeout.type);
692
+ assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.type);
693
+ assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.payload.type);
694
+ assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.uriOptions.type);
695
+ assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.addlHeaders.type);
696
+ assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.authData.type);
697
+ assert.equal('boolean', propertiesDotJson.definitions.request.properties.healthcheck_on_timeout.type);
698
+ assert.equal('boolean', propertiesDotJson.definitions.request.properties.return_raw.type);
699
+ assert.equal('boolean', propertiesDotJson.definitions.request.properties.archiving.type);
700
+ assert.equal('boolean', propertiesDotJson.definitions.request.properties.return_request.type);
701
+ assert.notEqual(undefined, propertiesDotJson.definitions.proxy);
702
+ assert.notEqual(null, propertiesDotJson.definitions.proxy);
703
+ assert.notEqual('', propertiesDotJson.definitions.proxy);
704
+ assert.equal('boolean', propertiesDotJson.definitions.proxy.properties.enabled.type);
705
+ assert.equal('string', propertiesDotJson.definitions.proxy.properties.host.type);
706
+ assert.equal('integer', propertiesDotJson.definitions.proxy.properties.port.type);
707
+ assert.equal('string', propertiesDotJson.definitions.proxy.properties.protocol.type);
708
+ assert.equal('string', propertiesDotJson.definitions.proxy.properties.username.type);
709
+ assert.equal('string', propertiesDotJson.definitions.proxy.properties.password.type);
710
+ assert.notEqual(undefined, propertiesDotJson.definitions.ssl);
711
+ assert.notEqual(null, propertiesDotJson.definitions.ssl);
712
+ assert.notEqual(undefined, propertiesDotJson.definitions.mongo);
713
+ assert.notEqual(null, propertiesDotJson.definitions.mongo);
714
+ assert.notEqual('', propertiesDotJson.definitions.mongo);
715
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.host.type);
716
+ assert.equal('integer', propertiesDotJson.definitions.mongo.properties.port.type);
717
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.database.type);
718
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.username.type);
719
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.password.type);
720
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.replSet.type);
721
+ assert.equal('object', propertiesDotJson.definitions.mongo.properties.db_ssl.type);
722
+ assert.equal('boolean', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.enabled.type);
723
+ assert.equal('boolean', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.accept_invalid_cert.type);
724
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.ca_file.type);
725
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.key_file.type);
726
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.cert_file.type);
727
+ done();
728
+ } catch (error) {
729
+ log.error(`Test Failure: ${error}`);
730
+ done(error);
731
+ }
732
+ });
733
+ });
734
+
735
+ describe('error.json', () => {
736
+ it('should have an error.json', (done) => {
737
+ try {
738
+ fs.exists('error.json', (val) => {
739
+ assert.equal(true, val);
740
+ done();
741
+ });
742
+ } catch (error) {
743
+ log.error(`Test Failure: ${error}`);
744
+ done(error);
745
+ }
746
+ });
747
+ it('error.json should have standard adapter errors', (done) => {
748
+ try {
749
+ const errorDotJson = require('../../error.json');
750
+ assert.notEqual(undefined, errorDotJson.errors);
751
+ assert.notEqual(null, errorDotJson.errors);
752
+ assert.notEqual('', errorDotJson.errors);
753
+ assert.equal(true, Array.isArray(errorDotJson.errors));
754
+ assert.notEqual(0, errorDotJson.errors.length);
755
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.100'));
756
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.101'));
757
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.102'));
758
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.110'));
759
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.111'));
760
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.112'));
761
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.113'));
762
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.114'));
763
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.115'));
764
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.116'));
765
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.300'));
766
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.301'));
767
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.302'));
768
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.303'));
769
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.304'));
770
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.305'));
771
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.310'));
772
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.311'));
773
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.312'));
774
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.320'));
775
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.321'));
776
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.400'));
777
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.401'));
778
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.402'));
779
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.500'));
780
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.501'));
781
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.502'));
782
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.503'));
783
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.600'));
784
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.900'));
785
+ done();
786
+ } catch (error) {
787
+ log.error(`Test Failure: ${error}`);
788
+ done(error);
789
+ }
790
+ });
791
+ });
792
+
793
+ describe('sampleProperties.json', () => {
794
+ it('should have a sampleProperties.json', (done) => {
795
+ try {
796
+ fs.exists('sampleProperties.json', (val) => {
797
+ assert.equal(true, val);
798
+ done();
799
+ });
800
+ } catch (error) {
801
+ log.error(`Test Failure: ${error}`);
802
+ done(error);
803
+ }
804
+ });
805
+ it('sampleProperties.json should contain generic adapter properties', (done) => {
806
+ try {
807
+ const sampleDotJson = require('../../sampleProperties.json');
808
+ assert.notEqual(-1, sampleDotJson.id.indexOf('azure_devops'));
809
+ assert.equal('AzureDevops', sampleDotJson.type);
810
+ assert.notEqual(undefined, sampleDotJson.properties);
811
+ assert.notEqual(null, sampleDotJson.properties);
812
+ assert.notEqual('', sampleDotJson.properties);
813
+ assert.notEqual(undefined, sampleDotJson.properties.host);
814
+ assert.notEqual(undefined, sampleDotJson.properties.port);
815
+ assert.notEqual(undefined, sampleDotJson.properties.stub);
816
+ assert.notEqual(undefined, sampleDotJson.properties.authentication);
817
+ assert.notEqual(null, sampleDotJson.properties.authentication);
818
+ assert.notEqual('', sampleDotJson.properties.authentication);
819
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_method);
820
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.username);
821
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.password);
822
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.token);
823
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.invalid_token_error);
824
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.token_timeout);
825
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.token_cache);
826
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field);
827
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field_format);
828
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_logging);
829
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.client_id);
830
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.client_secret);
831
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.grant_type);
832
+ assert.notEqual(undefined, sampleDotJson.properties.ssl);
833
+ assert.notEqual(null, sampleDotJson.properties.ssl);
834
+ assert.notEqual('', sampleDotJson.properties.ssl);
835
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.ecdhCurve);
836
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.enabled);
837
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.accept_invalid_cert);
838
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.ca_file);
839
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.key_file);
840
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.cert_file);
841
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.secure_protocol);
842
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.ciphers);
843
+
844
+ assert.notEqual(undefined, sampleDotJson.properties.base_path);
845
+ assert.notEqual(undefined, sampleDotJson.properties.version);
846
+ assert.notEqual(undefined, sampleDotJson.properties.cache_location);
847
+ assert.notEqual(undefined, sampleDotJson.properties.encode_pathvars);
848
+ assert.notEqual(undefined, sampleDotJson.properties.save_metric);
849
+ assert.notEqual(undefined, sampleDotJson.properties.protocol);
850
+ assert.notEqual(undefined, sampleDotJson.properties.stub);
851
+ assert.notEqual(undefined, sampleDotJson.properties.stub);
852
+ assert.notEqual(undefined, sampleDotJson.properties.stub);
853
+ assert.notEqual(undefined, sampleDotJson.properties.stub);
854
+ assert.notEqual(undefined, sampleDotJson.properties.healthcheck);
855
+ assert.notEqual(null, sampleDotJson.properties.healthcheck);
856
+ assert.notEqual('', sampleDotJson.properties.healthcheck);
857
+ assert.notEqual(undefined, sampleDotJson.properties.healthcheck.type);
858
+ assert.notEqual(undefined, sampleDotJson.properties.healthcheck.frequency);
859
+ assert.notEqual(undefined, sampleDotJson.properties.healthcheck.query_object);
860
+ assert.notEqual(undefined, sampleDotJson.properties.throttle);
861
+ assert.notEqual(null, sampleDotJson.properties.throttle);
862
+ assert.notEqual('', sampleDotJson.properties.throttle);
863
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.throttle_enabled);
864
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.number_pronghorns);
865
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.sync_async);
866
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.max_in_queue);
867
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.concurrent_max);
868
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.expire_timeout);
869
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.avg_runtime);
870
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.priorities);
871
+ assert.notEqual(undefined, sampleDotJson.properties.request);
872
+ assert.notEqual(null, sampleDotJson.properties.request);
873
+ assert.notEqual('', sampleDotJson.properties.request);
874
+ assert.notEqual(undefined, sampleDotJson.properties.request.number_redirects);
875
+ assert.notEqual(undefined, sampleDotJson.properties.request.number_retries);
876
+ assert.notEqual(undefined, sampleDotJson.properties.request.limit_retry_error);
877
+ assert.notEqual(undefined, sampleDotJson.properties.request.failover_codes);
878
+ assert.notEqual(undefined, sampleDotJson.properties.request.attempt_timeout);
879
+ assert.notEqual(undefined, sampleDotJson.properties.request.global_request);
880
+ assert.notEqual(undefined, sampleDotJson.properties.request.global_request.payload);
881
+ assert.notEqual(undefined, sampleDotJson.properties.request.global_request.uriOptions);
882
+ assert.notEqual(undefined, sampleDotJson.properties.request.global_request.addlHeaders);
883
+ assert.notEqual(undefined, sampleDotJson.properties.request.global_request.authData);
884
+ assert.notEqual(undefined, sampleDotJson.properties.request.healthcheck_on_timeout);
885
+ assert.notEqual(undefined, sampleDotJson.properties.request.return_raw);
886
+ assert.notEqual(undefined, sampleDotJson.properties.request.archiving);
887
+ assert.notEqual(undefined, sampleDotJson.properties.request.return_request);
888
+ assert.notEqual(undefined, sampleDotJson.properties.proxy);
889
+ assert.notEqual(null, sampleDotJson.properties.proxy);
890
+ assert.notEqual('', sampleDotJson.properties.proxy);
891
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.enabled);
892
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.host);
893
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.port);
894
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.protocol);
895
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.username);
896
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.password);
897
+ assert.notEqual(undefined, sampleDotJson.properties.mongo);
898
+ assert.notEqual(null, sampleDotJson.properties.mongo);
899
+ assert.notEqual('', sampleDotJson.properties.mongo);
900
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.host);
901
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.port);
902
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.database);
903
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.username);
904
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.password);
905
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.replSet);
906
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl);
907
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.enabled);
908
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.accept_invalid_cert);
909
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.ca_file);
910
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.key_file);
911
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.cert_file);
912
+ done();
913
+ } catch (error) {
914
+ log.error(`Test Failure: ${error}`);
915
+ done(error);
916
+ }
917
+ });
918
+ });
919
+
920
+ describe('#checkProperties', () => {
921
+ it('should have a checkProperties function', (done) => {
922
+ try {
923
+ assert.equal(true, typeof a.checkProperties === 'function');
924
+ done();
925
+ } catch (error) {
926
+ log.error(`Test Failure: ${error}`);
927
+ done(error);
928
+ }
929
+ });
930
+ it('the sample properties should be good - if failure change the log level', (done) => {
931
+ try {
932
+ const samplePropsJson = require('../../sampleProperties.json');
933
+ const clean = a.checkProperties(samplePropsJson.properties);
934
+
935
+ try {
936
+ assert.notEqual(0, Object.keys(clean));
937
+ assert.equal(undefined, clean.exception);
938
+ assert.notEqual(undefined, clean.host);
939
+ assert.notEqual(null, clean.host);
940
+ assert.notEqual('', clean.host);
941
+ done();
942
+ } catch (err) {
943
+ log.error(`Test Failure: ${err}`);
944
+ done(err);
945
+ }
946
+ } catch (error) {
947
+ log.error(`Adapter Exception: ${error}`);
948
+ done(error);
949
+ }
950
+ }).timeout(attemptTimeout);
951
+ });
952
+
953
+ describe('README.md', () => {
954
+ it('should have a README', (done) => {
955
+ try {
956
+ fs.exists('README.md', (val) => {
957
+ assert.equal(true, val);
958
+ done();
959
+ });
960
+ } catch (error) {
961
+ log.error(`Test Failure: ${error}`);
962
+ done(error);
963
+ }
964
+ });
965
+ it('README.md should be customized', (done) => {
966
+ try {
967
+ fs.readFile('README.md', 'utf8', (err, data) => {
968
+ assert.equal(-1, data.indexOf('[System]'));
969
+ assert.equal(-1, data.indexOf('[system]'));
970
+ assert.equal(-1, data.indexOf('[version]'));
971
+ assert.equal(-1, data.indexOf('[namespace]'));
972
+ done();
973
+ });
974
+ } catch (error) {
975
+ log.error(`Test Failure: ${error}`);
976
+ done(error);
977
+ }
978
+ });
979
+ });
980
+
981
+ describe('#connect', () => {
982
+ it('should have a connect function', (done) => {
983
+ try {
984
+ assert.equal(true, typeof a.connect === 'function');
985
+ done();
986
+ } catch (error) {
987
+ log.error(`Test Failure: ${error}`);
988
+ done(error);
989
+ }
990
+ });
991
+ });
992
+
993
+ describe('#healthCheck', () => {
994
+ it('should have a healthCheck function', (done) => {
995
+ try {
996
+ assert.equal(true, typeof a.healthCheck === 'function');
997
+ done();
998
+ } catch (error) {
999
+ log.error(`Test Failure: ${error}`);
1000
+ done(error);
1001
+ }
1002
+ });
1003
+ });
1004
+
1005
+ describe('#updateAdapterConfiguration', () => {
1006
+ it('should have a updateAdapterConfiguration function', (done) => {
1007
+ try {
1008
+ assert.equal(true, typeof a.updateAdapterConfiguration === 'function');
1009
+ done();
1010
+ } catch (error) {
1011
+ log.error(`Test Failure: ${error}`);
1012
+ done(error);
1013
+ }
1014
+ });
1015
+ });
1016
+
1017
+ describe('#findPath', () => {
1018
+ it('should have a findPath function', (done) => {
1019
+ try {
1020
+ assert.equal(true, typeof a.findPath === 'function');
1021
+ done();
1022
+ } catch (error) {
1023
+ log.error(`Test Failure: ${error}`);
1024
+ done(error);
1025
+ }
1026
+ });
1027
+ it('findPath should find atleast one path that matches', (done) => {
1028
+ try {
1029
+ a.findPath('{base_path}/{version}', (data, error) => {
1030
+ try {
1031
+ assert.equal(undefined, error);
1032
+ assert.notEqual(undefined, data);
1033
+ assert.notEqual(null, data);
1034
+ assert.equal(true, data.found);
1035
+ assert.notEqual(undefined, data.foundIn);
1036
+ assert.notEqual(null, data.foundIn);
1037
+ assert.notEqual(0, data.foundIn.length);
1038
+ done();
1039
+ } catch (err) {
1040
+ log.error(`Test Failure: ${err}`);
1041
+ done(err);
1042
+ }
1043
+ });
1044
+ } catch (error) {
1045
+ log.error(`Adapter Exception: ${error}`);
1046
+ done(error);
1047
+ }
1048
+ }).timeout(attemptTimeout);
1049
+ });
1050
+
1051
+ describe('#suspend', () => {
1052
+ it('should have a suspend function', (done) => {
1053
+ try {
1054
+ assert.equal(true, typeof a.suspend === 'function');
1055
+ done();
1056
+ } catch (error) {
1057
+ log.error(`Test Failure: ${error}`);
1058
+ done(error);
1059
+ }
1060
+ });
1061
+ });
1062
+
1063
+ describe('#unsuspend', () => {
1064
+ it('should have a unsuspend function', (done) => {
1065
+ try {
1066
+ assert.equal(true, typeof a.unsuspend === 'function');
1067
+ done();
1068
+ } catch (error) {
1069
+ log.error(`Test Failure: ${error}`);
1070
+ done(error);
1071
+ }
1072
+ });
1073
+ });
1074
+
1075
+ describe('#getQueue', () => {
1076
+ it('should have a getQueue function', (done) => {
1077
+ try {
1078
+ assert.equal(true, typeof a.getQueue === 'function');
1079
+ done();
1080
+ } catch (error) {
1081
+ log.error(`Test Failure: ${error}`);
1082
+ done(error);
1083
+ }
1084
+ });
1085
+ });
1086
+
1087
+ describe('#troubleshoot', () => {
1088
+ it('should have a troubleshoot function', (done) => {
1089
+ try {
1090
+ assert.equal(true, typeof a.troubleshoot === 'function');
1091
+ done();
1092
+ } catch (error) {
1093
+ log.error(`Test Failure: ${error}`);
1094
+ done(error);
1095
+ }
1096
+ });
1097
+ });
1098
+
1099
+ describe('#runHealthcheck', () => {
1100
+ it('should have a runHealthcheck function', (done) => {
1101
+ try {
1102
+ assert.equal(true, typeof a.runHealthcheck === 'function');
1103
+ done();
1104
+ } catch (error) {
1105
+ log.error(`Test Failure: ${error}`);
1106
+ done(error);
1107
+ }
1108
+ });
1109
+ });
1110
+
1111
+ describe('#runConnectivity', () => {
1112
+ it('should have a runConnectivity function', (done) => {
1113
+ try {
1114
+ assert.equal(true, typeof a.runConnectivity === 'function');
1115
+ done();
1116
+ } catch (error) {
1117
+ log.error(`Test Failure: ${error}`);
1118
+ done(error);
1119
+ }
1120
+ });
1121
+ });
1122
+
1123
+ describe('#runBasicGet', () => {
1124
+ it('should have a runBasicGet function', (done) => {
1125
+ try {
1126
+ assert.equal(true, typeof a.runBasicGet === 'function');
1127
+ done();
1128
+ } catch (error) {
1129
+ log.error(`Test Failure: ${error}`);
1130
+ done(error);
1131
+ }
1132
+ });
1133
+ });
1134
+
1135
+ describe('#checkActionFiles', () => {
1136
+ it('should have a checkActionFiles function', (done) => {
1137
+ try {
1138
+ assert.equal(true, typeof a.checkActionFiles === 'function');
1139
+ done();
1140
+ } catch (error) {
1141
+ log.error(`Test Failure: ${error}`);
1142
+ done(error);
1143
+ }
1144
+ });
1145
+ it('the action files should be good - if failure change the log level as most issues are warnings', (done) => {
1146
+ try {
1147
+ const clean = a.checkActionFiles();
1148
+
1149
+ try {
1150
+ for (let c = 0; c < clean.length; c += 1) {
1151
+ log.error(clean[c]);
1152
+ }
1153
+ assert.equal(0, clean.length);
1154
+ done();
1155
+ } catch (err) {
1156
+ log.error(`Test Failure: ${err}`);
1157
+ done(err);
1158
+ }
1159
+ } catch (error) {
1160
+ log.error(`Adapter Exception: ${error}`);
1161
+ done(error);
1162
+ }
1163
+ }).timeout(attemptTimeout);
1164
+ });
1165
+
1166
+ describe('#encryptProperty', () => {
1167
+ it('should have a encryptProperty function', (done) => {
1168
+ try {
1169
+ assert.equal(true, typeof a.encryptProperty === 'function');
1170
+ done();
1171
+ } catch (error) {
1172
+ log.error(`Test Failure: ${error}`);
1173
+ done(error);
1174
+ }
1175
+ });
1176
+ it('should get base64 encoded property', (done) => {
1177
+ try {
1178
+ a.encryptProperty('testing', 'base64', (data, error) => {
1179
+ try {
1180
+ assert.equal(undefined, error);
1181
+ assert.notEqual(undefined, data);
1182
+ assert.notEqual(null, data);
1183
+ assert.notEqual(undefined, data.response);
1184
+ assert.notEqual(null, data.response);
1185
+ assert.equal(0, data.response.indexOf('{code}'));
1186
+ done();
1187
+ } catch (err) {
1188
+ log.error(`Test Failure: ${err}`);
1189
+ done(err);
1190
+ }
1191
+ });
1192
+ } catch (error) {
1193
+ log.error(`Adapter Exception: ${error}`);
1194
+ done(error);
1195
+ }
1196
+ }).timeout(attemptTimeout);
1197
+ it('should get encrypted property', (done) => {
1198
+ try {
1199
+ a.encryptProperty('testing', 'encrypt', (data, error) => {
1200
+ try {
1201
+ assert.equal(undefined, error);
1202
+ assert.notEqual(undefined, data);
1203
+ assert.notEqual(null, data);
1204
+ assert.notEqual(undefined, data.response);
1205
+ assert.notEqual(null, data.response);
1206
+ assert.equal(0, data.response.indexOf('{crypt}'));
1207
+ done();
1208
+ } catch (err) {
1209
+ log.error(`Test Failure: ${err}`);
1210
+ done(err);
1211
+ }
1212
+ });
1213
+ } catch (error) {
1214
+ log.error(`Adapter Exception: ${error}`);
1215
+ done(error);
1216
+ }
1217
+ }).timeout(attemptTimeout);
1218
+ });
1219
+
1220
+ // describe('#hasEntity', () => {
1221
+ // it('should have a hasEntity function', (done) => {
1222
+ // try {
1223
+ // assert.equal(true, typeof a.hasEntity === 'function');
1224
+ // done();
1225
+ // } catch (error) {
1226
+ // log.error(`Test Failure: ${error}`);
1227
+ // done(error);
1228
+ // }
1229
+ // });
1230
+ // it('should find entity', (done) => {
1231
+ // try {
1232
+ // a.hasEntity('template_entity', // 'a9e9c33dc61122760072455df62663d2', (data) => {
1233
+ // try {
1234
+ // assert.equal(true, data[0]);
1235
+ // done();
1236
+ // } catch (err) {
1237
+ // log.error(`Test Failure: ${err}`);
1238
+ // done(err);
1239
+ // }
1240
+ // });
1241
+ // } catch (error) {
1242
+ // log.error(`Adapter Exception: ${error}`);
1243
+ // done(error);
1244
+ // }
1245
+ // }).timeout(attemptTimeout);
1246
+ // it('should not find entity', (done) => {
1247
+ // try {
1248
+ // a.hasEntity('template_entity', 'blah', (data) => {
1249
+ // try {
1250
+ // assert.equal(false, data[0]);
1251
+ // done();
1252
+ // } catch (err) {
1253
+ // log.error(`Test Failure: ${err}`);
1254
+ // done(err);
1255
+ // }
1256
+ // });
1257
+ // } catch (error) {
1258
+ // log.error(`Adapter Exception: ${error}`);
1259
+ // done(error);
1260
+ // }
1261
+ // }).timeout(attemptTimeout);
1262
+ // });
1263
+
1264
+ /*
1265
+ -----------------------------------------------------------------------
1266
+ -----------------------------------------------------------------------
1267
+ *** All code above this comment will be replaced during a migration ***
1268
+ ******************* DO NOT REMOVE THIS COMMENT BLOCK ******************
1269
+ -----------------------------------------------------------------------
1270
+ -----------------------------------------------------------------------
1271
+ */
1272
+
1273
+ describe('#pipelinesCreate - errors', () => {
1274
+ it('should have a pipelinesCreate function', (done) => {
1275
+ try {
1276
+ assert.equal(true, typeof a.pipelinesCreate === 'function');
1277
+ done();
1278
+ } catch (error) {
1279
+ log.error(`Test Failure: ${error}`);
1280
+ done(error);
1281
+ }
1282
+ }).timeout(attemptTimeout);
1283
+ it('should error if - missing organization', (done) => {
1284
+ try {
1285
+ a.pipelinesCreate(null, null, null, null, (data, error) => {
1286
+ try {
1287
+ const displayE = 'organization is required';
1288
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-pipelinesCreate', displayE);
1289
+ done();
1290
+ } catch (err) {
1291
+ log.error(`Test Failure: ${err}`);
1292
+ done(err);
1293
+ }
1294
+ });
1295
+ } catch (error) {
1296
+ log.error(`Adapter Exception: ${error}`);
1297
+ done(error);
1298
+ }
1299
+ }).timeout(attemptTimeout);
1300
+ it('should error if - missing body', (done) => {
1301
+ try {
1302
+ a.pipelinesCreate('fakeparam', null, null, null, (data, error) => {
1303
+ try {
1304
+ const displayE = 'body is required';
1305
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-pipelinesCreate', displayE);
1306
+ done();
1307
+ } catch (err) {
1308
+ log.error(`Test Failure: ${err}`);
1309
+ done(err);
1310
+ }
1311
+ });
1312
+ } catch (error) {
1313
+ log.error(`Adapter Exception: ${error}`);
1314
+ done(error);
1315
+ }
1316
+ }).timeout(attemptTimeout);
1317
+ it('should error if - missing project', (done) => {
1318
+ try {
1319
+ a.pipelinesCreate('fakeparam', 'fakeparam', null, null, (data, error) => {
1320
+ try {
1321
+ const displayE = 'project is required';
1322
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-pipelinesCreate', displayE);
1323
+ done();
1324
+ } catch (err) {
1325
+ log.error(`Test Failure: ${err}`);
1326
+ done(err);
1327
+ }
1328
+ });
1329
+ } catch (error) {
1330
+ log.error(`Adapter Exception: ${error}`);
1331
+ done(error);
1332
+ }
1333
+ }).timeout(attemptTimeout);
1334
+ it('should error if - missing apiVersion', (done) => {
1335
+ try {
1336
+ a.pipelinesCreate('fakeparam', 'fakeparam', 'fakeparam', null, (data, error) => {
1337
+ try {
1338
+ const displayE = 'apiVersion is required';
1339
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-pipelinesCreate', displayE);
1340
+ done();
1341
+ } catch (err) {
1342
+ log.error(`Test Failure: ${err}`);
1343
+ done(err);
1344
+ }
1345
+ });
1346
+ } catch (error) {
1347
+ log.error(`Adapter Exception: ${error}`);
1348
+ done(error);
1349
+ }
1350
+ }).timeout(attemptTimeout);
1351
+ });
1352
+
1353
+ describe('#pipelinesList - errors', () => {
1354
+ it('should have a pipelinesList function', (done) => {
1355
+ try {
1356
+ assert.equal(true, typeof a.pipelinesList === 'function');
1357
+ done();
1358
+ } catch (error) {
1359
+ log.error(`Test Failure: ${error}`);
1360
+ done(error);
1361
+ }
1362
+ }).timeout(attemptTimeout);
1363
+ it('should error if - missing organization', (done) => {
1364
+ try {
1365
+ a.pipelinesList(null, null, null, null, null, null, (data, error) => {
1366
+ try {
1367
+ const displayE = 'organization is required';
1368
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-pipelinesList', displayE);
1369
+ done();
1370
+ } catch (err) {
1371
+ log.error(`Test Failure: ${err}`);
1372
+ done(err);
1373
+ }
1374
+ });
1375
+ } catch (error) {
1376
+ log.error(`Adapter Exception: ${error}`);
1377
+ done(error);
1378
+ }
1379
+ }).timeout(attemptTimeout);
1380
+ it('should error if - missing project', (done) => {
1381
+ try {
1382
+ a.pipelinesList('fakeparam', null, null, null, null, null, (data, error) => {
1383
+ try {
1384
+ const displayE = 'project is required';
1385
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-pipelinesList', displayE);
1386
+ done();
1387
+ } catch (err) {
1388
+ log.error(`Test Failure: ${err}`);
1389
+ done(err);
1390
+ }
1391
+ });
1392
+ } catch (error) {
1393
+ log.error(`Adapter Exception: ${error}`);
1394
+ done(error);
1395
+ }
1396
+ }).timeout(attemptTimeout);
1397
+ it('should error if - missing apiVersion', (done) => {
1398
+ try {
1399
+ a.pipelinesList('fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', null, (data, error) => {
1400
+ try {
1401
+ const displayE = 'apiVersion is required';
1402
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-pipelinesList', displayE);
1403
+ done();
1404
+ } catch (err) {
1405
+ log.error(`Test Failure: ${err}`);
1406
+ done(err);
1407
+ }
1408
+ });
1409
+ } catch (error) {
1410
+ log.error(`Adapter Exception: ${error}`);
1411
+ done(error);
1412
+ }
1413
+ }).timeout(attemptTimeout);
1414
+ });
1415
+
1416
+ describe('#pipelinesGet - errors', () => {
1417
+ it('should have a pipelinesGet function', (done) => {
1418
+ try {
1419
+ assert.equal(true, typeof a.pipelinesGet === 'function');
1420
+ done();
1421
+ } catch (error) {
1422
+ log.error(`Test Failure: ${error}`);
1423
+ done(error);
1424
+ }
1425
+ }).timeout(attemptTimeout);
1426
+ it('should error if - missing organization', (done) => {
1427
+ try {
1428
+ a.pipelinesGet(null, null, null, null, null, (data, error) => {
1429
+ try {
1430
+ const displayE = 'organization is required';
1431
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-pipelinesGet', displayE);
1432
+ done();
1433
+ } catch (err) {
1434
+ log.error(`Test Failure: ${err}`);
1435
+ done(err);
1436
+ }
1437
+ });
1438
+ } catch (error) {
1439
+ log.error(`Adapter Exception: ${error}`);
1440
+ done(error);
1441
+ }
1442
+ }).timeout(attemptTimeout);
1443
+ it('should error if - missing project', (done) => {
1444
+ try {
1445
+ a.pipelinesGet('fakeparam', null, null, null, null, (data, error) => {
1446
+ try {
1447
+ const displayE = 'project is required';
1448
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-pipelinesGet', displayE);
1449
+ done();
1450
+ } catch (err) {
1451
+ log.error(`Test Failure: ${err}`);
1452
+ done(err);
1453
+ }
1454
+ });
1455
+ } catch (error) {
1456
+ log.error(`Adapter Exception: ${error}`);
1457
+ done(error);
1458
+ }
1459
+ }).timeout(attemptTimeout);
1460
+ it('should error if - missing pipelineId', (done) => {
1461
+ try {
1462
+ a.pipelinesGet('fakeparam', 'fakeparam', null, null, null, (data, error) => {
1463
+ try {
1464
+ const displayE = 'pipelineId is required';
1465
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-pipelinesGet', displayE);
1466
+ done();
1467
+ } catch (err) {
1468
+ log.error(`Test Failure: ${err}`);
1469
+ done(err);
1470
+ }
1471
+ });
1472
+ } catch (error) {
1473
+ log.error(`Adapter Exception: ${error}`);
1474
+ done(error);
1475
+ }
1476
+ }).timeout(attemptTimeout);
1477
+ it('should error if - missing apiVersion', (done) => {
1478
+ try {
1479
+ a.pipelinesGet('fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', null, (data, error) => {
1480
+ try {
1481
+ const displayE = 'apiVersion is required';
1482
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-pipelinesGet', displayE);
1483
+ done();
1484
+ } catch (err) {
1485
+ log.error(`Test Failure: ${err}`);
1486
+ done(err);
1487
+ }
1488
+ });
1489
+ } catch (error) {
1490
+ log.error(`Adapter Exception: ${error}`);
1491
+ done(error);
1492
+ }
1493
+ }).timeout(attemptTimeout);
1494
+ });
1495
+
1496
+ describe('#previewPreview - errors', () => {
1497
+ it('should have a previewPreview function', (done) => {
1498
+ try {
1499
+ assert.equal(true, typeof a.previewPreview === 'function');
1500
+ done();
1501
+ } catch (error) {
1502
+ log.error(`Test Failure: ${error}`);
1503
+ done(error);
1504
+ }
1505
+ }).timeout(attemptTimeout);
1506
+ it('should error if - missing organization', (done) => {
1507
+ try {
1508
+ a.previewPreview(null, null, null, null, null, null, (data, error) => {
1509
+ try {
1510
+ const displayE = 'organization is required';
1511
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-previewPreview', displayE);
1512
+ done();
1513
+ } catch (err) {
1514
+ log.error(`Test Failure: ${err}`);
1515
+ done(err);
1516
+ }
1517
+ });
1518
+ } catch (error) {
1519
+ log.error(`Adapter Exception: ${error}`);
1520
+ done(error);
1521
+ }
1522
+ }).timeout(attemptTimeout);
1523
+ it('should error if - missing body', (done) => {
1524
+ try {
1525
+ a.previewPreview('fakeparam', null, null, null, null, null, (data, error) => {
1526
+ try {
1527
+ const displayE = 'body is required';
1528
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-previewPreview', displayE);
1529
+ done();
1530
+ } catch (err) {
1531
+ log.error(`Test Failure: ${err}`);
1532
+ done(err);
1533
+ }
1534
+ });
1535
+ } catch (error) {
1536
+ log.error(`Adapter Exception: ${error}`);
1537
+ done(error);
1538
+ }
1539
+ }).timeout(attemptTimeout);
1540
+ it('should error if - missing project', (done) => {
1541
+ try {
1542
+ a.previewPreview('fakeparam', 'fakeparam', null, null, null, null, (data, error) => {
1543
+ try {
1544
+ const displayE = 'project is required';
1545
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-previewPreview', displayE);
1546
+ done();
1547
+ } catch (err) {
1548
+ log.error(`Test Failure: ${err}`);
1549
+ done(err);
1550
+ }
1551
+ });
1552
+ } catch (error) {
1553
+ log.error(`Adapter Exception: ${error}`);
1554
+ done(error);
1555
+ }
1556
+ }).timeout(attemptTimeout);
1557
+ it('should error if - missing pipelineId', (done) => {
1558
+ try {
1559
+ a.previewPreview('fakeparam', 'fakeparam', 'fakeparam', null, null, null, (data, error) => {
1560
+ try {
1561
+ const displayE = 'pipelineId is required';
1562
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-previewPreview', displayE);
1563
+ done();
1564
+ } catch (err) {
1565
+ log.error(`Test Failure: ${err}`);
1566
+ done(err);
1567
+ }
1568
+ });
1569
+ } catch (error) {
1570
+ log.error(`Adapter Exception: ${error}`);
1571
+ done(error);
1572
+ }
1573
+ }).timeout(attemptTimeout);
1574
+ it('should error if - missing apiVersion', (done) => {
1575
+ try {
1576
+ a.previewPreview('fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', null, (data, error) => {
1577
+ try {
1578
+ const displayE = 'apiVersion is required';
1579
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-previewPreview', displayE);
1580
+ done();
1581
+ } catch (err) {
1582
+ log.error(`Test Failure: ${err}`);
1583
+ done(err);
1584
+ }
1585
+ });
1586
+ } catch (error) {
1587
+ log.error(`Adapter Exception: ${error}`);
1588
+ done(error);
1589
+ }
1590
+ }).timeout(attemptTimeout);
1591
+ });
1592
+
1593
+ describe('#runsList - errors', () => {
1594
+ it('should have a runsList function', (done) => {
1595
+ try {
1596
+ assert.equal(true, typeof a.runsList === 'function');
1597
+ done();
1598
+ } catch (error) {
1599
+ log.error(`Test Failure: ${error}`);
1600
+ done(error);
1601
+ }
1602
+ }).timeout(attemptTimeout);
1603
+ it('should error if - missing organization', (done) => {
1604
+ try {
1605
+ a.runsList(null, null, null, null, (data, error) => {
1606
+ try {
1607
+ const displayE = 'organization is required';
1608
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-runsList', displayE);
1609
+ done();
1610
+ } catch (err) {
1611
+ log.error(`Test Failure: ${err}`);
1612
+ done(err);
1613
+ }
1614
+ });
1615
+ } catch (error) {
1616
+ log.error(`Adapter Exception: ${error}`);
1617
+ done(error);
1618
+ }
1619
+ }).timeout(attemptTimeout);
1620
+ it('should error if - missing project', (done) => {
1621
+ try {
1622
+ a.runsList('fakeparam', null, null, null, (data, error) => {
1623
+ try {
1624
+ const displayE = 'project is required';
1625
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-runsList', displayE);
1626
+ done();
1627
+ } catch (err) {
1628
+ log.error(`Test Failure: ${err}`);
1629
+ done(err);
1630
+ }
1631
+ });
1632
+ } catch (error) {
1633
+ log.error(`Adapter Exception: ${error}`);
1634
+ done(error);
1635
+ }
1636
+ }).timeout(attemptTimeout);
1637
+ it('should error if - missing pipelineId', (done) => {
1638
+ try {
1639
+ a.runsList('fakeparam', 'fakeparam', null, null, (data, error) => {
1640
+ try {
1641
+ const displayE = 'pipelineId is required';
1642
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-runsList', displayE);
1643
+ done();
1644
+ } catch (err) {
1645
+ log.error(`Test Failure: ${err}`);
1646
+ done(err);
1647
+ }
1648
+ });
1649
+ } catch (error) {
1650
+ log.error(`Adapter Exception: ${error}`);
1651
+ done(error);
1652
+ }
1653
+ }).timeout(attemptTimeout);
1654
+ it('should error if - missing apiVersion', (done) => {
1655
+ try {
1656
+ a.runsList('fakeparam', 'fakeparam', 'fakeparam', null, (data, error) => {
1657
+ try {
1658
+ const displayE = 'apiVersion is required';
1659
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-runsList', displayE);
1660
+ done();
1661
+ } catch (err) {
1662
+ log.error(`Test Failure: ${err}`);
1663
+ done(err);
1664
+ }
1665
+ });
1666
+ } catch (error) {
1667
+ log.error(`Adapter Exception: ${error}`);
1668
+ done(error);
1669
+ }
1670
+ }).timeout(attemptTimeout);
1671
+ });
1672
+
1673
+ describe('#runsRunPipeline - errors', () => {
1674
+ it('should have a runsRunPipeline function', (done) => {
1675
+ try {
1676
+ assert.equal(true, typeof a.runsRunPipeline === 'function');
1677
+ done();
1678
+ } catch (error) {
1679
+ log.error(`Test Failure: ${error}`);
1680
+ done(error);
1681
+ }
1682
+ }).timeout(attemptTimeout);
1683
+ it('should error if - missing organization', (done) => {
1684
+ try {
1685
+ a.runsRunPipeline(null, null, null, null, null, null, (data, error) => {
1686
+ try {
1687
+ const displayE = 'organization is required';
1688
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-runsRunPipeline', displayE);
1689
+ done();
1690
+ } catch (err) {
1691
+ log.error(`Test Failure: ${err}`);
1692
+ done(err);
1693
+ }
1694
+ });
1695
+ } catch (error) {
1696
+ log.error(`Adapter Exception: ${error}`);
1697
+ done(error);
1698
+ }
1699
+ }).timeout(attemptTimeout);
1700
+ it('should error if - missing body', (done) => {
1701
+ try {
1702
+ a.runsRunPipeline('fakeparam', null, null, null, null, null, (data, error) => {
1703
+ try {
1704
+ const displayE = 'body is required';
1705
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-runsRunPipeline', displayE);
1706
+ done();
1707
+ } catch (err) {
1708
+ log.error(`Test Failure: ${err}`);
1709
+ done(err);
1710
+ }
1711
+ });
1712
+ } catch (error) {
1713
+ log.error(`Adapter Exception: ${error}`);
1714
+ done(error);
1715
+ }
1716
+ }).timeout(attemptTimeout);
1717
+ it('should error if - missing project', (done) => {
1718
+ try {
1719
+ a.runsRunPipeline('fakeparam', 'fakeparam', null, null, null, null, (data, error) => {
1720
+ try {
1721
+ const displayE = 'project is required';
1722
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-runsRunPipeline', displayE);
1723
+ done();
1724
+ } catch (err) {
1725
+ log.error(`Test Failure: ${err}`);
1726
+ done(err);
1727
+ }
1728
+ });
1729
+ } catch (error) {
1730
+ log.error(`Adapter Exception: ${error}`);
1731
+ done(error);
1732
+ }
1733
+ }).timeout(attemptTimeout);
1734
+ it('should error if - missing pipelineId', (done) => {
1735
+ try {
1736
+ a.runsRunPipeline('fakeparam', 'fakeparam', 'fakeparam', null, null, null, (data, error) => {
1737
+ try {
1738
+ const displayE = 'pipelineId is required';
1739
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-runsRunPipeline', displayE);
1740
+ done();
1741
+ } catch (err) {
1742
+ log.error(`Test Failure: ${err}`);
1743
+ done(err);
1744
+ }
1745
+ });
1746
+ } catch (error) {
1747
+ log.error(`Adapter Exception: ${error}`);
1748
+ done(error);
1749
+ }
1750
+ }).timeout(attemptTimeout);
1751
+ it('should error if - missing apiVersion', (done) => {
1752
+ try {
1753
+ a.runsRunPipeline('fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', null, (data, error) => {
1754
+ try {
1755
+ const displayE = 'apiVersion is required';
1756
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-runsRunPipeline', displayE);
1757
+ done();
1758
+ } catch (err) {
1759
+ log.error(`Test Failure: ${err}`);
1760
+ done(err);
1761
+ }
1762
+ });
1763
+ } catch (error) {
1764
+ log.error(`Adapter Exception: ${error}`);
1765
+ done(error);
1766
+ }
1767
+ }).timeout(attemptTimeout);
1768
+ });
1769
+
1770
+ describe('#runsGet - errors', () => {
1771
+ it('should have a runsGet function', (done) => {
1772
+ try {
1773
+ assert.equal(true, typeof a.runsGet === 'function');
1774
+ done();
1775
+ } catch (error) {
1776
+ log.error(`Test Failure: ${error}`);
1777
+ done(error);
1778
+ }
1779
+ }).timeout(attemptTimeout);
1780
+ it('should error if - missing organization', (done) => {
1781
+ try {
1782
+ a.runsGet(null, null, null, null, null, (data, error) => {
1783
+ try {
1784
+ const displayE = 'organization is required';
1785
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-runsGet', displayE);
1786
+ done();
1787
+ } catch (err) {
1788
+ log.error(`Test Failure: ${err}`);
1789
+ done(err);
1790
+ }
1791
+ });
1792
+ } catch (error) {
1793
+ log.error(`Adapter Exception: ${error}`);
1794
+ done(error);
1795
+ }
1796
+ }).timeout(attemptTimeout);
1797
+ it('should error if - missing project', (done) => {
1798
+ try {
1799
+ a.runsGet('fakeparam', null, null, null, null, (data, error) => {
1800
+ try {
1801
+ const displayE = 'project is required';
1802
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-runsGet', displayE);
1803
+ done();
1804
+ } catch (err) {
1805
+ log.error(`Test Failure: ${err}`);
1806
+ done(err);
1807
+ }
1808
+ });
1809
+ } catch (error) {
1810
+ log.error(`Adapter Exception: ${error}`);
1811
+ done(error);
1812
+ }
1813
+ }).timeout(attemptTimeout);
1814
+ it('should error if - missing pipelineId', (done) => {
1815
+ try {
1816
+ a.runsGet('fakeparam', 'fakeparam', null, null, null, (data, error) => {
1817
+ try {
1818
+ const displayE = 'pipelineId is required';
1819
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-runsGet', displayE);
1820
+ done();
1821
+ } catch (err) {
1822
+ log.error(`Test Failure: ${err}`);
1823
+ done(err);
1824
+ }
1825
+ });
1826
+ } catch (error) {
1827
+ log.error(`Adapter Exception: ${error}`);
1828
+ done(error);
1829
+ }
1830
+ }).timeout(attemptTimeout);
1831
+ it('should error if - missing runId', (done) => {
1832
+ try {
1833
+ a.runsGet('fakeparam', 'fakeparam', 'fakeparam', null, null, (data, error) => {
1834
+ try {
1835
+ const displayE = 'runId is required';
1836
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-runsGet', displayE);
1837
+ done();
1838
+ } catch (err) {
1839
+ log.error(`Test Failure: ${err}`);
1840
+ done(err);
1841
+ }
1842
+ });
1843
+ } catch (error) {
1844
+ log.error(`Adapter Exception: ${error}`);
1845
+ done(error);
1846
+ }
1847
+ }).timeout(attemptTimeout);
1848
+ it('should error if - missing apiVersion', (done) => {
1849
+ try {
1850
+ a.runsGet('fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', null, (data, error) => {
1851
+ try {
1852
+ const displayE = 'apiVersion is required';
1853
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-runsGet', displayE);
1854
+ done();
1855
+ } catch (err) {
1856
+ log.error(`Test Failure: ${err}`);
1857
+ done(err);
1858
+ }
1859
+ });
1860
+ } catch (error) {
1861
+ log.error(`Adapter Exception: ${error}`);
1862
+ done(error);
1863
+ }
1864
+ }).timeout(attemptTimeout);
1865
+ });
1866
+
1867
+ describe('#artifactsGet - errors', () => {
1868
+ it('should have a artifactsGet function', (done) => {
1869
+ try {
1870
+ assert.equal(true, typeof a.artifactsGet === 'function');
1871
+ done();
1872
+ } catch (error) {
1873
+ log.error(`Test Failure: ${error}`);
1874
+ done(error);
1875
+ }
1876
+ }).timeout(attemptTimeout);
1877
+ it('should error if - missing organization', (done) => {
1878
+ try {
1879
+ a.artifactsGet(null, null, null, null, null, null, null, (data, error) => {
1880
+ try {
1881
+ const displayE = 'organization is required';
1882
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-artifactsGet', displayE);
1883
+ done();
1884
+ } catch (err) {
1885
+ log.error(`Test Failure: ${err}`);
1886
+ done(err);
1887
+ }
1888
+ });
1889
+ } catch (error) {
1890
+ log.error(`Adapter Exception: ${error}`);
1891
+ done(error);
1892
+ }
1893
+ }).timeout(attemptTimeout);
1894
+ it('should error if - missing project', (done) => {
1895
+ try {
1896
+ a.artifactsGet('fakeparam', null, null, null, null, null, null, (data, error) => {
1897
+ try {
1898
+ const displayE = 'project is required';
1899
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-artifactsGet', displayE);
1900
+ done();
1901
+ } catch (err) {
1902
+ log.error(`Test Failure: ${err}`);
1903
+ done(err);
1904
+ }
1905
+ });
1906
+ } catch (error) {
1907
+ log.error(`Adapter Exception: ${error}`);
1908
+ done(error);
1909
+ }
1910
+ }).timeout(attemptTimeout);
1911
+ it('should error if - missing pipelineId', (done) => {
1912
+ try {
1913
+ a.artifactsGet('fakeparam', 'fakeparam', null, null, null, null, null, (data, error) => {
1914
+ try {
1915
+ const displayE = 'pipelineId is required';
1916
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-artifactsGet', displayE);
1917
+ done();
1918
+ } catch (err) {
1919
+ log.error(`Test Failure: ${err}`);
1920
+ done(err);
1921
+ }
1922
+ });
1923
+ } catch (error) {
1924
+ log.error(`Adapter Exception: ${error}`);
1925
+ done(error);
1926
+ }
1927
+ }).timeout(attemptTimeout);
1928
+ it('should error if - missing runId', (done) => {
1929
+ try {
1930
+ a.artifactsGet('fakeparam', 'fakeparam', 'fakeparam', null, null, null, null, (data, error) => {
1931
+ try {
1932
+ const displayE = 'runId is required';
1933
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-artifactsGet', displayE);
1934
+ done();
1935
+ } catch (err) {
1936
+ log.error(`Test Failure: ${err}`);
1937
+ done(err);
1938
+ }
1939
+ });
1940
+ } catch (error) {
1941
+ log.error(`Adapter Exception: ${error}`);
1942
+ done(error);
1943
+ }
1944
+ }).timeout(attemptTimeout);
1945
+ it('should error if - missing artifactName', (done) => {
1946
+ try {
1947
+ a.artifactsGet('fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', null, null, null, (data, error) => {
1948
+ try {
1949
+ const displayE = 'artifactName is required';
1950
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-artifactsGet', displayE);
1951
+ done();
1952
+ } catch (err) {
1953
+ log.error(`Test Failure: ${err}`);
1954
+ done(err);
1955
+ }
1956
+ });
1957
+ } catch (error) {
1958
+ log.error(`Adapter Exception: ${error}`);
1959
+ done(error);
1960
+ }
1961
+ }).timeout(attemptTimeout);
1962
+ it('should error if - missing apiVersion', (done) => {
1963
+ try {
1964
+ a.artifactsGet('fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', null, (data, error) => {
1965
+ try {
1966
+ const displayE = 'apiVersion is required';
1967
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-artifactsGet', displayE);
1968
+ done();
1969
+ } catch (err) {
1970
+ log.error(`Test Failure: ${err}`);
1971
+ done(err);
1972
+ }
1973
+ });
1974
+ } catch (error) {
1975
+ log.error(`Adapter Exception: ${error}`);
1976
+ done(error);
1977
+ }
1978
+ }).timeout(attemptTimeout);
1979
+ });
1980
+
1981
+ describe('#logsList - errors', () => {
1982
+ it('should have a logsList function', (done) => {
1983
+ try {
1984
+ assert.equal(true, typeof a.logsList === 'function');
1985
+ done();
1986
+ } catch (error) {
1987
+ log.error(`Test Failure: ${error}`);
1988
+ done(error);
1989
+ }
1990
+ }).timeout(attemptTimeout);
1991
+ it('should error if - missing organization', (done) => {
1992
+ try {
1993
+ a.logsList(null, null, null, null, null, null, (data, error) => {
1994
+ try {
1995
+ const displayE = 'organization is required';
1996
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-logsList', displayE);
1997
+ done();
1998
+ } catch (err) {
1999
+ log.error(`Test Failure: ${err}`);
2000
+ done(err);
2001
+ }
2002
+ });
2003
+ } catch (error) {
2004
+ log.error(`Adapter Exception: ${error}`);
2005
+ done(error);
2006
+ }
2007
+ }).timeout(attemptTimeout);
2008
+ it('should error if - missing project', (done) => {
2009
+ try {
2010
+ a.logsList('fakeparam', null, null, null, null, null, (data, error) => {
2011
+ try {
2012
+ const displayE = 'project is required';
2013
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-logsList', displayE);
2014
+ done();
2015
+ } catch (err) {
2016
+ log.error(`Test Failure: ${err}`);
2017
+ done(err);
2018
+ }
2019
+ });
2020
+ } catch (error) {
2021
+ log.error(`Adapter Exception: ${error}`);
2022
+ done(error);
2023
+ }
2024
+ }).timeout(attemptTimeout);
2025
+ it('should error if - missing pipelineId', (done) => {
2026
+ try {
2027
+ a.logsList('fakeparam', 'fakeparam', null, null, null, null, (data, error) => {
2028
+ try {
2029
+ const displayE = 'pipelineId is required';
2030
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-logsList', displayE);
2031
+ done();
2032
+ } catch (err) {
2033
+ log.error(`Test Failure: ${err}`);
2034
+ done(err);
2035
+ }
2036
+ });
2037
+ } catch (error) {
2038
+ log.error(`Adapter Exception: ${error}`);
2039
+ done(error);
2040
+ }
2041
+ }).timeout(attemptTimeout);
2042
+ it('should error if - missing runId', (done) => {
2043
+ try {
2044
+ a.logsList('fakeparam', 'fakeparam', 'fakeparam', null, null, null, (data, error) => {
2045
+ try {
2046
+ const displayE = 'runId is required';
2047
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-logsList', displayE);
2048
+ done();
2049
+ } catch (err) {
2050
+ log.error(`Test Failure: ${err}`);
2051
+ done(err);
2052
+ }
2053
+ });
2054
+ } catch (error) {
2055
+ log.error(`Adapter Exception: ${error}`);
2056
+ done(error);
2057
+ }
2058
+ }).timeout(attemptTimeout);
2059
+ it('should error if - missing apiVersion', (done) => {
2060
+ try {
2061
+ a.logsList('fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', null, (data, error) => {
2062
+ try {
2063
+ const displayE = 'apiVersion is required';
2064
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-logsList', displayE);
2065
+ done();
2066
+ } catch (err) {
2067
+ log.error(`Test Failure: ${err}`);
2068
+ done(err);
2069
+ }
2070
+ });
2071
+ } catch (error) {
2072
+ log.error(`Adapter Exception: ${error}`);
2073
+ done(error);
2074
+ }
2075
+ }).timeout(attemptTimeout);
2076
+ });
2077
+
2078
+ describe('#logsGet - errors', () => {
2079
+ it('should have a logsGet function', (done) => {
2080
+ try {
2081
+ assert.equal(true, typeof a.logsGet === 'function');
2082
+ done();
2083
+ } catch (error) {
2084
+ log.error(`Test Failure: ${error}`);
2085
+ done(error);
2086
+ }
2087
+ }).timeout(attemptTimeout);
2088
+ it('should error if - missing organization', (done) => {
2089
+ try {
2090
+ a.logsGet(null, null, null, null, null, null, null, (data, error) => {
2091
+ try {
2092
+ const displayE = 'organization is required';
2093
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-logsGet', displayE);
2094
+ done();
2095
+ } catch (err) {
2096
+ log.error(`Test Failure: ${err}`);
2097
+ done(err);
2098
+ }
2099
+ });
2100
+ } catch (error) {
2101
+ log.error(`Adapter Exception: ${error}`);
2102
+ done(error);
2103
+ }
2104
+ }).timeout(attemptTimeout);
2105
+ it('should error if - missing project', (done) => {
2106
+ try {
2107
+ a.logsGet('fakeparam', null, null, null, null, null, null, (data, error) => {
2108
+ try {
2109
+ const displayE = 'project is required';
2110
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-logsGet', displayE);
2111
+ done();
2112
+ } catch (err) {
2113
+ log.error(`Test Failure: ${err}`);
2114
+ done(err);
2115
+ }
2116
+ });
2117
+ } catch (error) {
2118
+ log.error(`Adapter Exception: ${error}`);
2119
+ done(error);
2120
+ }
2121
+ }).timeout(attemptTimeout);
2122
+ it('should error if - missing pipelineId', (done) => {
2123
+ try {
2124
+ a.logsGet('fakeparam', 'fakeparam', null, null, null, null, null, (data, error) => {
2125
+ try {
2126
+ const displayE = 'pipelineId is required';
2127
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-logsGet', displayE);
2128
+ done();
2129
+ } catch (err) {
2130
+ log.error(`Test Failure: ${err}`);
2131
+ done(err);
2132
+ }
2133
+ });
2134
+ } catch (error) {
2135
+ log.error(`Adapter Exception: ${error}`);
2136
+ done(error);
2137
+ }
2138
+ }).timeout(attemptTimeout);
2139
+ it('should error if - missing runId', (done) => {
2140
+ try {
2141
+ a.logsGet('fakeparam', 'fakeparam', 'fakeparam', null, null, null, null, (data, error) => {
2142
+ try {
2143
+ const displayE = 'runId is required';
2144
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-logsGet', displayE);
2145
+ done();
2146
+ } catch (err) {
2147
+ log.error(`Test Failure: ${err}`);
2148
+ done(err);
2149
+ }
2150
+ });
2151
+ } catch (error) {
2152
+ log.error(`Adapter Exception: ${error}`);
2153
+ done(error);
2154
+ }
2155
+ }).timeout(attemptTimeout);
2156
+ it('should error if - missing logId', (done) => {
2157
+ try {
2158
+ a.logsGet('fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', null, null, null, (data, error) => {
2159
+ try {
2160
+ const displayE = 'logId is required';
2161
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-logsGet', displayE);
2162
+ done();
2163
+ } catch (err) {
2164
+ log.error(`Test Failure: ${err}`);
2165
+ done(err);
2166
+ }
2167
+ });
2168
+ } catch (error) {
2169
+ log.error(`Adapter Exception: ${error}`);
2170
+ done(error);
2171
+ }
2172
+ }).timeout(attemptTimeout);
2173
+ it('should error if - missing apiVersion', (done) => {
2174
+ try {
2175
+ a.logsGet('fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', null, (data, error) => {
2176
+ try {
2177
+ const displayE = 'apiVersion is required';
2178
+ runErrorAsserts(data, error, 'AD.300', 'Test-azure_devops-adapter-logsGet', displayE);
2179
+ done();
2180
+ } catch (err) {
2181
+ log.error(`Test Failure: ${err}`);
2182
+ done(err);
2183
+ }
2184
+ });
2185
+ } catch (error) {
2186
+ log.error(`Adapter Exception: ${error}`);
2187
+ done(error);
2188
+ }
2189
+ }).timeout(attemptTimeout);
2190
+ });
2191
+ });
2192
+ });