@itentialopensource/adapter-algosec_appviz 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 (89) hide show
  1. package/.eslintignore +5 -0
  2. package/.eslintrc.js +18 -0
  3. package/.jshintrc +3 -0
  4. package/AUTH.md +39 -0
  5. package/BROKER.md +199 -0
  6. package/CALLS.md +170 -0
  7. package/CHANGELOG.md +9 -0
  8. package/CODE_OF_CONDUCT.md +43 -0
  9. package/CONTRIBUTING.md +172 -0
  10. package/ENHANCE.md +69 -0
  11. package/LICENSE +201 -0
  12. package/PROPERTIES.md +641 -0
  13. package/README.md +337 -0
  14. package/SUMMARY.md +9 -0
  15. package/SYSTEMINFO.md +11 -0
  16. package/TROUBLESHOOT.md +47 -0
  17. package/adapter.js +6079 -0
  18. package/adapterBase.js +1787 -0
  19. package/entities/.generic/action.json +214 -0
  20. package/entities/.generic/schema.json +28 -0
  21. package/entities/.system/action.json +50 -0
  22. package/entities/.system/mockdatafiles/getToken-default.json +3 -0
  23. package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
  24. package/entities/.system/schema.json +19 -0
  25. package/entities/.system/schemaTokenReq.json +53 -0
  26. package/entities/.system/schemaTokenResp.json +53 -0
  27. package/entities/ApplicationsApiController/action.json +580 -0
  28. package/entities/ApplicationsApiController/mockdatafiles/getActivitiesForApplicationUsingGET-default.json +9 -0
  29. package/entities/ApplicationsApiController/mockdatafiles/getAllApplicationsActivitiesUsingGET-default.json +23 -0
  30. package/entities/ApplicationsApiController/mockdatafiles/getAllApplicationsUsingGET-default.json +170 -0
  31. package/entities/ApplicationsApiController/mockdatafiles/getApplicationChangeRequestsUsingGET-default.json +94 -0
  32. package/entities/ApplicationsApiController/mockdatafiles/getApplicationContactsUsingGET-default.json +20 -0
  33. package/entities/ApplicationsApiController/mockdatafiles/getApplicationLabelsUsingGET-default.json +14 -0
  34. package/entities/ApplicationsApiController/mockdatafiles/getApplicationLabelsUsingGET1-default.json +14 -0
  35. package/entities/ApplicationsApiController/mockdatafiles/getApplicationRevisionsByAppIdUsingGET-default.json +46 -0
  36. package/entities/ApplicationsApiController/mockdatafiles/getApplicationRevisionsUsingGET-default.json +68 -0
  37. package/entities/ApplicationsApiController/mockdatafiles/getApplicationRisksUsingGET-default.json +9 -0
  38. package/entities/ApplicationsApiController/mockdatafiles/getPciApplicationsVulnerabilitiesUsingGET-default.json +26 -0
  39. package/entities/ApplicationsApiController/schema.json +68 -0
  40. package/entities/FlowsApiController/action.json +147 -0
  41. package/entities/FlowsApiController/mockdatafiles/editApplicationFlowUsingPOST-default.json +2024 -0
  42. package/entities/FlowsApiController/mockdatafiles/getApplicationFlowsUsingGET-default.json +5022 -0
  43. package/entities/FlowsApiController/mockdatafiles/getFlowRisksUsingGET-default.json +23 -0
  44. package/entities/FlowsApiController/schema.json +25 -0
  45. package/entities/NetworkObjectApiController/action.json +271 -0
  46. package/entities/NetworkObjectApiController/mockdatafiles/findNetworkObjectsApplicationsByIpUsingGET-default.json +330 -0
  47. package/entities/NetworkObjectApiController/mockdatafiles/findNetworkObjectsByIpUsingGET-default.json +491 -0
  48. package/entities/NetworkObjectApiController/mockdatafiles/getAllNetworkObjectsUsingGET-default.json +479 -0
  49. package/entities/NetworkObjectApiController/mockdatafiles/getNetworkObjectApplicationsUsingGET-default.json +277 -0
  50. package/entities/NetworkObjectApiController/mockdatafiles/getNetworkObjectsByNameUsingGET-default.json +364 -0
  51. package/entities/NetworkObjectApiController/schema.json +53 -0
  52. package/entities/NetworkServiceApiController/action.json +147 -0
  53. package/entities/NetworkServiceApiController/mockdatafiles/getAllNetworkServicesUsingGET-default.json +81 -0
  54. package/entities/NetworkServiceApiController/schema.json +47 -0
  55. package/entities/PermissionsApiController/action.json +168 -0
  56. package/entities/PermissionsApiController/schema.json +26 -0
  57. package/error.json +190 -0
  58. package/package.json +86 -0
  59. package/pronghorn.json +7756 -0
  60. package/propertiesDecorators.json +14 -0
  61. package/propertiesSchema.json +1248 -0
  62. package/refs?service=git-upload-pack +0 -0
  63. package/report/algosec-AppViz-swagger.json +4453 -0
  64. package/report/creationReport.json +485 -0
  65. package/sampleProperties.json +195 -0
  66. package/test/integration/adapterTestBasicGet.js +83 -0
  67. package/test/integration/adapterTestConnectivity.js +93 -0
  68. package/test/integration/adapterTestIntegration.js +2212 -0
  69. package/test/unit/adapterBaseTestUnit.js +949 -0
  70. package/test/unit/adapterTestUnit.js +3291 -0
  71. package/utils/adapterInfo.js +206 -0
  72. package/utils/addAuth.js +94 -0
  73. package/utils/artifactize.js +146 -0
  74. package/utils/basicGet.js +50 -0
  75. package/utils/checkMigrate.js +63 -0
  76. package/utils/entitiesToDB.js +178 -0
  77. package/utils/findPath.js +74 -0
  78. package/utils/methodDocumentor.js +225 -0
  79. package/utils/modify.js +154 -0
  80. package/utils/packModificationScript.js +35 -0
  81. package/utils/patches2bundledDeps.js +90 -0
  82. package/utils/pre-commit.sh +32 -0
  83. package/utils/removeHooks.js +20 -0
  84. package/utils/setup.js +33 -0
  85. package/utils/tbScript.js +246 -0
  86. package/utils/tbUtils.js +490 -0
  87. package/utils/testRunner.js +298 -0
  88. package/utils/troubleshootingAdapter.js +195 -0
  89. package/workflows/README.md +3 -0
@@ -0,0 +1,3291 @@
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
+ /* eslint import/no-dynamic-require:warn */
8
+
9
+ // include required items for testing & logging
10
+ const assert = require('assert');
11
+ const fs = require('fs-extra');
12
+ const mocha = require('mocha');
13
+ const path = require('path');
14
+ const util = require('util');
15
+ const winston = require('winston');
16
+ const execute = require('child_process').execSync;
17
+ const { expect } = require('chai');
18
+ const { use } = require('chai');
19
+ const td = require('testdouble');
20
+ const Ajv = require('ajv');
21
+
22
+ const ajv = new Ajv({ allErrors: true, unknownFormats: 'ignore' });
23
+ const anything = td.matchers.anything();
24
+ let logLevel = 'none';
25
+ const isRapidFail = false;
26
+
27
+ // read in the properties from the sampleProperties files
28
+ let adaptdir = __dirname;
29
+ if (adaptdir.endsWith('/test/integration')) {
30
+ adaptdir = adaptdir.substring(0, adaptdir.length - 17);
31
+ } else if (adaptdir.endsWith('/test/unit')) {
32
+ adaptdir = adaptdir.substring(0, adaptdir.length - 10);
33
+ }
34
+ const samProps = require(`${adaptdir}/sampleProperties.json`).properties;
35
+
36
+ // these variables can be changed to run in integrated mode so easier to set them here
37
+ // always check these in with bogus data!!!
38
+ samProps.stub = true;
39
+ samProps.host = 'replace.hostorip.here';
40
+ samProps.authentication.username = 'username';
41
+ samProps.authentication.password = 'password';
42
+ samProps.protocol = 'http';
43
+ samProps.port = 80;
44
+ samProps.ssl.enabled = false;
45
+ samProps.ssl.accept_invalid_cert = false;
46
+ samProps.request.attempt_timeout = 1200000;
47
+ const attemptTimeout = samProps.request.attempt_timeout;
48
+ const { stub } = samProps;
49
+
50
+ // these are the adapter properties. You generally should not need to alter
51
+ // any of these after they are initially set up
52
+ global.pronghornProps = {
53
+ pathProps: {
54
+ encrypted: false
55
+ },
56
+ adapterProps: {
57
+ adapters: [{
58
+ id: 'Test-algosec_appviz',
59
+ type: 'AlgosecAppviz',
60
+ properties: samProps
61
+ }]
62
+ }
63
+ };
64
+
65
+ global.$HOME = `${__dirname}/../..`;
66
+
67
+ // set the log levels that Pronghorn uses, spam and trace are not defaulted in so without
68
+ // this you may error on log.trace calls.
69
+ const myCustomLevels = {
70
+ levels: {
71
+ spam: 6,
72
+ trace: 5,
73
+ debug: 4,
74
+ info: 3,
75
+ warn: 2,
76
+ error: 1,
77
+ none: 0
78
+ }
79
+ };
80
+
81
+ // need to see if there is a log level passed in
82
+ process.argv.forEach((val) => {
83
+ // is there a log level defined to be passed in?
84
+ if (val.indexOf('--LOG') === 0) {
85
+ // get the desired log level
86
+ const inputVal = val.split('=')[1];
87
+
88
+ // validate the log level is supported, if so set it
89
+ if (Object.hasOwnProperty.call(myCustomLevels.levels, inputVal)) {
90
+ logLevel = inputVal;
91
+ }
92
+ }
93
+ });
94
+
95
+ // need to set global logging
96
+ global.log = winston.createLogger({
97
+ level: logLevel,
98
+ levels: myCustomLevels.levels,
99
+ transports: [
100
+ new winston.transports.Console()
101
+ ]
102
+ });
103
+
104
+ /**
105
+ * Runs the error asserts for the test
106
+ */
107
+ function runErrorAsserts(data, error, code, origin, displayStr) {
108
+ assert.equal(null, data);
109
+ assert.notEqual(undefined, error);
110
+ assert.notEqual(null, error);
111
+ assert.notEqual(undefined, error.IAPerror);
112
+ assert.notEqual(null, error.IAPerror);
113
+ assert.notEqual(undefined, error.IAPerror.displayString);
114
+ assert.notEqual(null, error.IAPerror.displayString);
115
+ assert.equal(code, error.icode);
116
+ assert.equal(origin, error.IAPerror.origin);
117
+ assert.equal(displayStr, error.IAPerror.displayString);
118
+ }
119
+
120
+ // require the adapter that we are going to be using
121
+ const AlgosecAppviz = require('../../adapter');
122
+
123
+ // delete the .DS_Store directory in entities -- otherwise this will cause errors
124
+ const dirPath = path.join(__dirname, '../../entities/.DS_Store');
125
+ if (fs.existsSync(dirPath)) {
126
+ try {
127
+ fs.removeSync(dirPath);
128
+ console.log('.DS_Store deleted');
129
+ } catch (e) {
130
+ console.log('Error when deleting .DS_Store:', e);
131
+ }
132
+ }
133
+
134
+ // begin the testing - these should be pretty well defined between the describe and the it!
135
+ describe('[unit] Algosec_appviz Adapter Test', () => {
136
+ describe('AlgosecAppviz Class Tests', () => {
137
+ const a = new AlgosecAppviz(
138
+ pronghornProps.adapterProps.adapters[0].id,
139
+ pronghornProps.adapterProps.adapters[0].properties
140
+ );
141
+
142
+ if (isRapidFail) {
143
+ const state = {};
144
+ state.passed = true;
145
+
146
+ mocha.afterEach(function x() {
147
+ state.passed = state.passed
148
+ && (this.currentTest.state === 'passed');
149
+ });
150
+ mocha.beforeEach(function x() {
151
+ if (!state.passed) {
152
+ return this.currentTest.skip();
153
+ }
154
+ return true;
155
+ });
156
+ }
157
+
158
+ describe('#class instance created', () => {
159
+ it('should be a class with properties', (done) => {
160
+ try {
161
+ assert.notEqual(null, a);
162
+ assert.notEqual(undefined, a);
163
+ const checkId = global.pronghornProps.adapterProps.adapters[0].id;
164
+ assert.equal(checkId, a.id);
165
+ assert.notEqual(null, a.allProps);
166
+ const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
167
+ assert.equal(check, a.healthcheckType);
168
+ done();
169
+ } catch (error) {
170
+ log.error(`Test Failure: ${error}`);
171
+ done(error);
172
+ }
173
+ }).timeout(attemptTimeout);
174
+ });
175
+
176
+ describe('adapterBase.js', () => {
177
+ it('should have an adapterBase.js', (done) => {
178
+ try {
179
+ fs.exists('adapterBase.js', (val) => {
180
+ assert.equal(true, val);
181
+ done();
182
+ });
183
+ } catch (error) {
184
+ log.error(`Test Failure: ${error}`);
185
+ done(error);
186
+ }
187
+ });
188
+ });
189
+
190
+ let wffunctions = [];
191
+ describe('#iapGetAdapterWorkflowFunctions', () => {
192
+ it('should retrieve workflow functions', (done) => {
193
+ try {
194
+ wffunctions = a.iapGetAdapterWorkflowFunctions([]);
195
+
196
+ try {
197
+ assert.notEqual(0, wffunctions.length);
198
+ done();
199
+ } catch (err) {
200
+ log.error(`Test Failure: ${err}`);
201
+ done(err);
202
+ }
203
+ } catch (error) {
204
+ log.error(`Adapter Exception: ${error}`);
205
+ done(error);
206
+ }
207
+ }).timeout(attemptTimeout);
208
+ });
209
+
210
+ describe('package.json', () => {
211
+ it('should have a package.json', (done) => {
212
+ try {
213
+ fs.exists('package.json', (val) => {
214
+ assert.equal(true, val);
215
+ done();
216
+ });
217
+ } catch (error) {
218
+ log.error(`Test Failure: ${error}`);
219
+ done(error);
220
+ }
221
+ });
222
+ it('package.json should be validated', (done) => {
223
+ try {
224
+ const packageDotJson = require('../../package.json');
225
+ const { PJV } = require('package-json-validator');
226
+ const options = {
227
+ warnings: true, // show warnings
228
+ recommendations: true // show recommendations
229
+ };
230
+ const results = PJV.validate(JSON.stringify(packageDotJson), 'npm', options);
231
+
232
+ if (results.valid === false) {
233
+ log.error('The package.json contains the following errors: ');
234
+ log.error(util.inspect(results));
235
+ assert.equal(true, results.valid);
236
+ } else {
237
+ assert.equal(true, results.valid);
238
+ }
239
+
240
+ done();
241
+ } catch (error) {
242
+ log.error(`Test Failure: ${error}`);
243
+ done(error);
244
+ }
245
+ });
246
+ it('package.json standard fields should be customized', (done) => {
247
+ try {
248
+ const packageDotJson = require('../../package.json');
249
+ assert.notEqual(-1, packageDotJson.name.indexOf('algosec_appviz'));
250
+ assert.notEqual(undefined, packageDotJson.version);
251
+ assert.notEqual(null, packageDotJson.version);
252
+ assert.notEqual('', packageDotJson.version);
253
+ assert.notEqual(undefined, packageDotJson.description);
254
+ assert.notEqual(null, packageDotJson.description);
255
+ assert.notEqual('', packageDotJson.description);
256
+ assert.equal('adapter.js', packageDotJson.main);
257
+ assert.notEqual(undefined, packageDotJson.wizardVersion);
258
+ assert.notEqual(null, packageDotJson.wizardVersion);
259
+ assert.notEqual('', packageDotJson.wizardVersion);
260
+ assert.notEqual(undefined, packageDotJson.engineVersion);
261
+ assert.notEqual(null, packageDotJson.engineVersion);
262
+ assert.notEqual('', packageDotJson.engineVersion);
263
+ assert.equal('http', packageDotJson.adapterType);
264
+ done();
265
+ } catch (error) {
266
+ log.error(`Test Failure: ${error}`);
267
+ done(error);
268
+ }
269
+ });
270
+ it('package.json proper scripts should be provided', (done) => {
271
+ try {
272
+ const packageDotJson = require('../../package.json');
273
+ assert.notEqual(undefined, packageDotJson.scripts);
274
+ assert.notEqual(null, packageDotJson.scripts);
275
+ assert.notEqual('', packageDotJson.scripts);
276
+ assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js', packageDotJson.scripts.lint);
277
+ assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js --quiet', packageDotJson.scripts['lint:errors']);
278
+ assert.equal('mocha test/unit/adapterBaseTestUnit.js --LOG=error', packageDotJson.scripts['test:baseunit']);
279
+ assert.equal('mocha test/unit/adapterTestUnit.js --LOG=error', packageDotJson.scripts['test:unit']);
280
+ assert.equal('mocha test/integration/adapterTestIntegration.js --LOG=error', packageDotJson.scripts['test:integration']);
281
+ assert.equal('nyc --reporter html --reporter text mocha --reporter dot test/*', packageDotJson.scripts['test:cover']);
282
+ assert.equal('npm run test:baseunit && npm run test:unit && npm run test:integration', packageDotJson.scripts.test);
283
+ done();
284
+ } catch (error) {
285
+ log.error(`Test Failure: ${error}`);
286
+ done(error);
287
+ }
288
+ });
289
+ it('package.json proper directories should be provided', (done) => {
290
+ try {
291
+ const packageDotJson = require('../../package.json');
292
+ assert.notEqual(undefined, packageDotJson.repository);
293
+ assert.notEqual(null, packageDotJson.repository);
294
+ assert.notEqual('', packageDotJson.repository);
295
+ done();
296
+ } catch (error) {
297
+ log.error(`Test Failure: ${error}`);
298
+ done(error);
299
+ }
300
+ });
301
+ it('package.json proper dependencies should be provided', (done) => {
302
+ try {
303
+ const packageDotJson = require('../../package.json');
304
+ assert.notEqual(undefined, packageDotJson.dependencies);
305
+ assert.notEqual(null, packageDotJson.dependencies);
306
+ assert.notEqual('', packageDotJson.dependencies);
307
+ assert.equal('^6.12.0', packageDotJson.dependencies.ajv);
308
+ assert.equal('^0.21.0', packageDotJson.dependencies.axios);
309
+ assert.equal('^2.20.0', packageDotJson.dependencies.commander);
310
+ assert.equal('^8.1.0', packageDotJson.dependencies['fs-extra']);
311
+ assert.equal('^9.0.1', packageDotJson.dependencies.mocha);
312
+ assert.equal('^2.0.1', packageDotJson.dependencies['mocha-param']);
313
+ assert.equal('^0.5.3', packageDotJson.dependencies['network-diagnostics']);
314
+ assert.equal('^15.1.0', packageDotJson.dependencies.nyc);
315
+ assert.equal('^1.4.10', packageDotJson.dependencies['readline-sync']);
316
+ assert.equal('^7.3.2', packageDotJson.dependencies.semver);
317
+ assert.equal('^3.3.3', packageDotJson.dependencies.winston);
318
+ done();
319
+ } catch (error) {
320
+ log.error(`Test Failure: ${error}`);
321
+ done(error);
322
+ }
323
+ });
324
+ it('package.json proper dev dependencies should be provided', (done) => {
325
+ try {
326
+ const packageDotJson = require('../../package.json');
327
+ assert.notEqual(undefined, packageDotJson.devDependencies);
328
+ assert.notEqual(null, packageDotJson.devDependencies);
329
+ assert.notEqual('', packageDotJson.devDependencies);
330
+ assert.equal('^4.3.4', packageDotJson.devDependencies.chai);
331
+ assert.equal('^7.29.0', packageDotJson.devDependencies.eslint);
332
+ assert.equal('^14.2.1', packageDotJson.devDependencies['eslint-config-airbnb-base']);
333
+ assert.equal('^2.23.4', packageDotJson.devDependencies['eslint-plugin-import']);
334
+ assert.equal('^3.0.0', packageDotJson.devDependencies['eslint-plugin-json']);
335
+ assert.equal('^0.6.3', packageDotJson.devDependencies['package-json-validator']);
336
+ assert.equal('^3.16.1', packageDotJson.devDependencies.testdouble);
337
+ done();
338
+ } catch (error) {
339
+ log.error(`Test Failure: ${error}`);
340
+ done(error);
341
+ }
342
+ });
343
+ });
344
+
345
+ describe('pronghorn.json', () => {
346
+ it('should have a pronghorn.json', (done) => {
347
+ try {
348
+ fs.exists('pronghorn.json', (val) => {
349
+ assert.equal(true, val);
350
+ done();
351
+ });
352
+ } catch (error) {
353
+ log.error(`Test Failure: ${error}`);
354
+ done(error);
355
+ }
356
+ });
357
+ it('pronghorn.json should be customized', (done) => {
358
+ try {
359
+ const pronghornDotJson = require('../../pronghorn.json');
360
+ assert.notEqual(-1, pronghornDotJson.id.indexOf('algosec_appviz'));
361
+ assert.equal('Adapter', pronghornDotJson.type);
362
+ assert.equal('AlgosecAppviz', pronghornDotJson.export);
363
+ assert.equal('Algosec_appviz', pronghornDotJson.title);
364
+ assert.equal('adapter.js', pronghornDotJson.src);
365
+ done();
366
+ } catch (error) {
367
+ log.error(`Test Failure: ${error}`);
368
+ done(error);
369
+ }
370
+ });
371
+ it('pronghorn.json should contain generic adapter methods', (done) => {
372
+ try {
373
+ const pronghornDotJson = require('../../pronghorn.json');
374
+ assert.notEqual(undefined, pronghornDotJson.methods);
375
+ assert.notEqual(null, pronghornDotJson.methods);
376
+ assert.notEqual('', pronghornDotJson.methods);
377
+ assert.equal(true, Array.isArray(pronghornDotJson.methods));
378
+ assert.notEqual(0, pronghornDotJson.methods.length);
379
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUpdateAdapterConfiguration'));
380
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapFindAdapterPath'));
381
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapTroubleshootAdapter'));
382
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterHealthcheck'));
383
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterConnectivity'));
384
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterBasicGet'));
385
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapSuspendAdapter'));
386
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUnsuspendAdapter'));
387
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapGetAdapterQueue'));
388
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequest'));
389
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequestNoBasePath'));
390
+ done();
391
+ } catch (error) {
392
+ log.error(`Test Failure: ${error}`);
393
+ done(error);
394
+ }
395
+ });
396
+ it('pronghorn.json should only expose workflow functions', (done) => {
397
+ try {
398
+ const pronghornDotJson = require('../../pronghorn.json');
399
+
400
+ for (let m = 0; m < pronghornDotJson.methods.length; m += 1) {
401
+ let found = false;
402
+ let paramissue = false;
403
+
404
+ for (let w = 0; w < wffunctions.length; w += 1) {
405
+ if (pronghornDotJson.methods[m].name === wffunctions[w]) {
406
+ found = true;
407
+ const methLine = execute(`grep " ${wffunctions[w]}(" adapter.js | grep "callback) {"`).toString();
408
+ let wfparams = [];
409
+
410
+ if (methLine && methLine.indexOf('(') >= 0 && methLine.indexOf(')') >= 0) {
411
+ const temp = methLine.substring(methLine.indexOf('(') + 1, methLine.lastIndexOf(')'));
412
+ wfparams = temp.split(',');
413
+
414
+ for (let t = 0; t < wfparams.length; t += 1) {
415
+ // remove default value from the parameter name
416
+ wfparams[t] = wfparams[t].substring(0, wfparams[t].search(/=/) > 0 ? wfparams[t].search(/#|\?|=/) : wfparams[t].length);
417
+ // remove spaces
418
+ wfparams[t] = wfparams[t].trim();
419
+
420
+ if (wfparams[t] === 'callback') {
421
+ wfparams.splice(t, 1);
422
+ }
423
+ }
424
+ }
425
+
426
+ // if there are inputs defined but not on the method line
427
+ if (wfparams.length === 0 && (pronghornDotJson.methods[m].input
428
+ && pronghornDotJson.methods[m].input.length > 0)) {
429
+ paramissue = true;
430
+ } else if (wfparams.length > 0 && (!pronghornDotJson.methods[m].input
431
+ || pronghornDotJson.methods[m].input.length === 0)) {
432
+ // if there are no inputs defined but there are on the method line
433
+ paramissue = true;
434
+ } else {
435
+ for (let p = 0; p < pronghornDotJson.methods[m].input.length; p += 1) {
436
+ let pfound = false;
437
+ for (let wfp = 0; wfp < wfparams.length; wfp += 1) {
438
+ if (pronghornDotJson.methods[m].input[p].name.toUpperCase() === wfparams[wfp].toUpperCase()) {
439
+ pfound = true;
440
+ }
441
+ }
442
+
443
+ if (!pfound) {
444
+ paramissue = true;
445
+ }
446
+ }
447
+ for (let wfp = 0; wfp < wfparams.length; wfp += 1) {
448
+ let pfound = false;
449
+ for (let p = 0; p < pronghornDotJson.methods[m].input.length; p += 1) {
450
+ if (pronghornDotJson.methods[m].input[p].name.toUpperCase() === wfparams[wfp].toUpperCase()) {
451
+ pfound = true;
452
+ }
453
+ }
454
+
455
+ if (!pfound) {
456
+ paramissue = true;
457
+ }
458
+ }
459
+ }
460
+
461
+ break;
462
+ }
463
+ }
464
+
465
+ if (!found) {
466
+ // this is the reason to go through both loops - log which ones are not found so
467
+ // they can be worked
468
+ log.error(`${pronghornDotJson.methods[m].name} not found in workflow functions`);
469
+ }
470
+ if (paramissue) {
471
+ // this is the reason to go through both loops - log which ones are not found so
472
+ // they can be worked
473
+ log.error(`${pronghornDotJson.methods[m].name} has a parameter mismatch`);
474
+ }
475
+ assert.equal(true, found);
476
+ assert.equal(false, paramissue);
477
+ }
478
+ done();
479
+ } catch (error) {
480
+ log.error(`Adapter Exception: ${error}`);
481
+ done(error);
482
+ }
483
+ }).timeout(attemptTimeout);
484
+ it('pronghorn.json should expose all workflow functions', (done) => {
485
+ try {
486
+ const pronghornDotJson = require('../../pronghorn.json');
487
+ for (let w = 0; w < wffunctions.length; w += 1) {
488
+ let found = false;
489
+
490
+ for (let m = 0; m < pronghornDotJson.methods.length; m += 1) {
491
+ if (pronghornDotJson.methods[m].name === wffunctions[w]) {
492
+ found = true;
493
+ break;
494
+ }
495
+ }
496
+
497
+ if (!found) {
498
+ // this is the reason to go through both loops - log which ones are not found so
499
+ // they can be worked
500
+ log.error(`${wffunctions[w]} not found in pronghorn.json`);
501
+ }
502
+ assert.equal(true, found);
503
+ }
504
+ done();
505
+ } catch (error) {
506
+ log.error(`Adapter Exception: ${error}`);
507
+ done(error);
508
+ }
509
+ });
510
+ it('pronghorn.json verify input/output schema objects', (done) => {
511
+ const verifySchema = (methodName, schema) => {
512
+ try {
513
+ ajv.compile(schema);
514
+ } catch (error) {
515
+ const errorMessage = `Invalid schema found in '${methodName}' method.
516
+ Schema => ${JSON.stringify(schema)}.
517
+ Details => ${error.message}`;
518
+ throw new Error(errorMessage);
519
+ }
520
+ };
521
+
522
+ try {
523
+ const pronghornDotJson = require('../../pronghorn.json');
524
+ const { methods } = pronghornDotJson;
525
+ for (let i = 0; i < methods.length; i += 1) {
526
+ for (let j = 0; j < methods[i].input.length; j += 1) {
527
+ const inputSchema = methods[i].input[j].schema;
528
+ if (inputSchema) {
529
+ verifySchema(methods[i].name, inputSchema);
530
+ }
531
+ }
532
+ const outputSchema = methods[i].output.schema;
533
+ if (outputSchema) {
534
+ verifySchema(methods[i].name, outputSchema);
535
+ }
536
+ }
537
+ done();
538
+ } catch (error) {
539
+ log.error(`Adapter Exception: ${error}`);
540
+ done(error);
541
+ }
542
+ });
543
+ });
544
+
545
+ describe('propertiesSchema.json', () => {
546
+ it('should have a propertiesSchema.json', (done) => {
547
+ try {
548
+ fs.exists('propertiesSchema.json', (val) => {
549
+ assert.equal(true, val);
550
+ done();
551
+ });
552
+ } catch (error) {
553
+ log.error(`Test Failure: ${error}`);
554
+ done(error);
555
+ }
556
+ });
557
+ it('propertiesSchema.json should be customized', (done) => {
558
+ try {
559
+ const propertiesDotJson = require('../../propertiesSchema.json');
560
+ assert.equal('adapter-algosec_appviz', propertiesDotJson.$id);
561
+ assert.equal('object', propertiesDotJson.type);
562
+ assert.equal('http://json-schema.org/draft-07/schema#', propertiesDotJson.$schema);
563
+ done();
564
+ } catch (error) {
565
+ log.error(`Test Failure: ${error}`);
566
+ done(error);
567
+ }
568
+ });
569
+ it('propertiesSchema.json should contain generic adapter properties', (done) => {
570
+ try {
571
+ const propertiesDotJson = require('../../propertiesSchema.json');
572
+ assert.notEqual(undefined, propertiesDotJson.properties);
573
+ assert.notEqual(null, propertiesDotJson.properties);
574
+ assert.notEqual('', propertiesDotJson.properties);
575
+ assert.equal('string', propertiesDotJson.properties.host.type);
576
+ assert.equal('integer', propertiesDotJson.properties.port.type);
577
+ assert.equal('boolean', propertiesDotJson.properties.stub.type);
578
+ assert.equal('string', propertiesDotJson.properties.protocol.type);
579
+ assert.notEqual(undefined, propertiesDotJson.definitions.authentication);
580
+ assert.notEqual(null, propertiesDotJson.definitions.authentication);
581
+ assert.notEqual('', propertiesDotJson.definitions.authentication);
582
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.auth_method.type);
583
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.username.type);
584
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.password.type);
585
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.token.type);
586
+ assert.equal('integer', propertiesDotJson.definitions.authentication.properties.invalid_token_error.type);
587
+ assert.equal('integer', propertiesDotJson.definitions.authentication.properties.token_timeout.type);
588
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.token_cache.type);
589
+ assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field.type));
590
+ assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field_format.type));
591
+ assert.equal('boolean', propertiesDotJson.definitions.authentication.properties.auth_logging.type);
592
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_id.type);
593
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_secret.type);
594
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.grant_type.type);
595
+ assert.notEqual(undefined, propertiesDotJson.definitions.ssl);
596
+ assert.notEqual(null, propertiesDotJson.definitions.ssl);
597
+ assert.notEqual('', propertiesDotJson.definitions.ssl);
598
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.ecdhCurve.type);
599
+ assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.enabled.type);
600
+ assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.accept_invalid_cert.type);
601
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.ca_file.type);
602
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.key_file.type);
603
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.cert_file.type);
604
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.secure_protocol.type);
605
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.ciphers.type);
606
+ assert.equal('string', propertiesDotJson.properties.base_path.type);
607
+ assert.equal('string', propertiesDotJson.properties.version.type);
608
+ assert.equal('string', propertiesDotJson.properties.cache_location.type);
609
+ assert.equal('boolean', propertiesDotJson.properties.encode_pathvars.type);
610
+ assert.equal('boolean', propertiesDotJson.properties.encode_queryvars.type);
611
+ assert.equal(true, Array.isArray(propertiesDotJson.properties.save_metric.type));
612
+ assert.notEqual(undefined, propertiesDotJson.definitions);
613
+ assert.notEqual(null, propertiesDotJson.definitions);
614
+ assert.notEqual('', propertiesDotJson.definitions);
615
+ assert.notEqual(undefined, propertiesDotJson.definitions.healthcheck);
616
+ assert.notEqual(null, propertiesDotJson.definitions.healthcheck);
617
+ assert.notEqual('', propertiesDotJson.definitions.healthcheck);
618
+ assert.equal('string', propertiesDotJson.definitions.healthcheck.properties.type.type);
619
+ assert.equal('integer', propertiesDotJson.definitions.healthcheck.properties.frequency.type);
620
+ assert.equal('object', propertiesDotJson.definitions.healthcheck.properties.query_object.type);
621
+ assert.notEqual(undefined, propertiesDotJson.definitions.throttle);
622
+ assert.notEqual(null, propertiesDotJson.definitions.throttle);
623
+ assert.notEqual('', propertiesDotJson.definitions.throttle);
624
+ assert.equal('boolean', propertiesDotJson.definitions.throttle.properties.throttle_enabled.type);
625
+ assert.equal('integer', propertiesDotJson.definitions.throttle.properties.number_pronghorns.type);
626
+ assert.equal('string', propertiesDotJson.definitions.throttle.properties.sync_async.type);
627
+ assert.equal('integer', propertiesDotJson.definitions.throttle.properties.max_in_queue.type);
628
+ assert.equal('integer', propertiesDotJson.definitions.throttle.properties.concurrent_max.type);
629
+ assert.equal('integer', propertiesDotJson.definitions.throttle.properties.expire_timeout.type);
630
+ assert.equal('integer', propertiesDotJson.definitions.throttle.properties.avg_runtime.type);
631
+ assert.equal('array', propertiesDotJson.definitions.throttle.properties.priorities.type);
632
+ assert.notEqual(undefined, propertiesDotJson.definitions.request);
633
+ assert.notEqual(null, propertiesDotJson.definitions.request);
634
+ assert.notEqual('', propertiesDotJson.definitions.request);
635
+ assert.equal('integer', propertiesDotJson.definitions.request.properties.number_redirects.type);
636
+ assert.equal('integer', propertiesDotJson.definitions.request.properties.number_retries.type);
637
+ assert.equal(true, Array.isArray(propertiesDotJson.definitions.request.properties.limit_retry_error.type));
638
+ assert.equal('array', propertiesDotJson.definitions.request.properties.failover_codes.type);
639
+ assert.equal('integer', propertiesDotJson.definitions.request.properties.attempt_timeout.type);
640
+ assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.type);
641
+ assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.payload.type);
642
+ assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.uriOptions.type);
643
+ assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.addlHeaders.type);
644
+ assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.authData.type);
645
+ assert.equal('boolean', propertiesDotJson.definitions.request.properties.healthcheck_on_timeout.type);
646
+ assert.equal('boolean', propertiesDotJson.definitions.request.properties.return_raw.type);
647
+ assert.equal('boolean', propertiesDotJson.definitions.request.properties.archiving.type);
648
+ assert.equal('boolean', propertiesDotJson.definitions.request.properties.return_request.type);
649
+ assert.notEqual(undefined, propertiesDotJson.definitions.proxy);
650
+ assert.notEqual(null, propertiesDotJson.definitions.proxy);
651
+ assert.notEqual('', propertiesDotJson.definitions.proxy);
652
+ assert.equal('boolean', propertiesDotJson.definitions.proxy.properties.enabled.type);
653
+ assert.equal('string', propertiesDotJson.definitions.proxy.properties.host.type);
654
+ assert.equal('integer', propertiesDotJson.definitions.proxy.properties.port.type);
655
+ assert.equal('string', propertiesDotJson.definitions.proxy.properties.protocol.type);
656
+ assert.equal('string', propertiesDotJson.definitions.proxy.properties.username.type);
657
+ assert.equal('string', propertiesDotJson.definitions.proxy.properties.password.type);
658
+ assert.notEqual(undefined, propertiesDotJson.definitions.mongo);
659
+ assert.notEqual(null, propertiesDotJson.definitions.mongo);
660
+ assert.notEqual('', propertiesDotJson.definitions.mongo);
661
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.host.type);
662
+ assert.equal('integer', propertiesDotJson.definitions.mongo.properties.port.type);
663
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.database.type);
664
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.username.type);
665
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.password.type);
666
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.replSet.type);
667
+ assert.equal('object', propertiesDotJson.definitions.mongo.properties.db_ssl.type);
668
+ assert.equal('boolean', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.enabled.type);
669
+ assert.equal('boolean', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.accept_invalid_cert.type);
670
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.ca_file.type);
671
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.key_file.type);
672
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.cert_file.type);
673
+ assert.notEqual('', propertiesDotJson.definitions.devicebroker);
674
+ assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevice.type);
675
+ assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevicesFiltered.type);
676
+ assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.isAlive.type);
677
+ assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getConfig.type);
678
+ assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getCount.type);
679
+ done();
680
+ } catch (error) {
681
+ log.error(`Test Failure: ${error}`);
682
+ done(error);
683
+ }
684
+ });
685
+ });
686
+
687
+ describe('error.json', () => {
688
+ it('should have an error.json', (done) => {
689
+ try {
690
+ fs.exists('error.json', (val) => {
691
+ assert.equal(true, val);
692
+ done();
693
+ });
694
+ } catch (error) {
695
+ log.error(`Test Failure: ${error}`);
696
+ done(error);
697
+ }
698
+ });
699
+ it('error.json should have standard adapter errors', (done) => {
700
+ try {
701
+ const errorDotJson = require('../../error.json');
702
+ assert.notEqual(undefined, errorDotJson.errors);
703
+ assert.notEqual(null, errorDotJson.errors);
704
+ assert.notEqual('', errorDotJson.errors);
705
+ assert.equal(true, Array.isArray(errorDotJson.errors));
706
+ assert.notEqual(0, errorDotJson.errors.length);
707
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.100'));
708
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.101'));
709
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.102'));
710
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.110'));
711
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.111'));
712
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.112'));
713
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.113'));
714
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.114'));
715
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.115'));
716
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.116'));
717
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.300'));
718
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.301'));
719
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.302'));
720
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.303'));
721
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.304'));
722
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.305'));
723
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.310'));
724
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.311'));
725
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.312'));
726
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.320'));
727
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.321'));
728
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.400'));
729
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.401'));
730
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.402'));
731
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.500'));
732
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.501'));
733
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.502'));
734
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.503'));
735
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.600'));
736
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.900'));
737
+ done();
738
+ } catch (error) {
739
+ log.error(`Test Failure: ${error}`);
740
+ done(error);
741
+ }
742
+ });
743
+ });
744
+
745
+ describe('sampleProperties.json', () => {
746
+ it('should have a sampleProperties.json', (done) => {
747
+ try {
748
+ fs.exists('sampleProperties.json', (val) => {
749
+ assert.equal(true, val);
750
+ done();
751
+ });
752
+ } catch (error) {
753
+ log.error(`Test Failure: ${error}`);
754
+ done(error);
755
+ }
756
+ });
757
+ it('sampleProperties.json should contain generic adapter properties', (done) => {
758
+ try {
759
+ const sampleDotJson = require('../../sampleProperties.json');
760
+ assert.notEqual(-1, sampleDotJson.id.indexOf('algosec_appviz'));
761
+ assert.equal('AlgosecAppviz', sampleDotJson.type);
762
+ assert.notEqual(undefined, sampleDotJson.properties);
763
+ assert.notEqual(null, sampleDotJson.properties);
764
+ assert.notEqual('', sampleDotJson.properties);
765
+ assert.notEqual(undefined, sampleDotJson.properties.host);
766
+ assert.notEqual(undefined, sampleDotJson.properties.port);
767
+ assert.notEqual(undefined, sampleDotJson.properties.stub);
768
+ assert.notEqual(undefined, sampleDotJson.properties.protocol);
769
+ assert.notEqual(undefined, sampleDotJson.properties.authentication);
770
+ assert.notEqual(null, sampleDotJson.properties.authentication);
771
+ assert.notEqual('', sampleDotJson.properties.authentication);
772
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_method);
773
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.username);
774
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.password);
775
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.token);
776
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.invalid_token_error);
777
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.token_timeout);
778
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.token_cache);
779
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field);
780
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field_format);
781
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_logging);
782
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.client_id);
783
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.client_secret);
784
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.grant_type);
785
+ assert.notEqual(undefined, sampleDotJson.properties.ssl);
786
+ assert.notEqual(null, sampleDotJson.properties.ssl);
787
+ assert.notEqual('', sampleDotJson.properties.ssl);
788
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.ecdhCurve);
789
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.enabled);
790
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.accept_invalid_cert);
791
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.ca_file);
792
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.key_file);
793
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.cert_file);
794
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.secure_protocol);
795
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.ciphers);
796
+ assert.notEqual(undefined, sampleDotJson.properties.base_path);
797
+ assert.notEqual(undefined, sampleDotJson.properties.version);
798
+ assert.notEqual(undefined, sampleDotJson.properties.cache_location);
799
+ assert.notEqual(undefined, sampleDotJson.properties.encode_pathvars);
800
+ assert.notEqual(undefined, sampleDotJson.properties.encode_queryvars);
801
+ assert.notEqual(undefined, sampleDotJson.properties.save_metric);
802
+ assert.notEqual(undefined, sampleDotJson.properties.healthcheck);
803
+ assert.notEqual(null, sampleDotJson.properties.healthcheck);
804
+ assert.notEqual('', sampleDotJson.properties.healthcheck);
805
+ assert.notEqual(undefined, sampleDotJson.properties.healthcheck.type);
806
+ assert.notEqual(undefined, sampleDotJson.properties.healthcheck.frequency);
807
+ assert.notEqual(undefined, sampleDotJson.properties.healthcheck.query_object);
808
+ assert.notEqual(undefined, sampleDotJson.properties.throttle);
809
+ assert.notEqual(null, sampleDotJson.properties.throttle);
810
+ assert.notEqual('', sampleDotJson.properties.throttle);
811
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.throttle_enabled);
812
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.number_pronghorns);
813
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.sync_async);
814
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.max_in_queue);
815
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.concurrent_max);
816
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.expire_timeout);
817
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.avg_runtime);
818
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.priorities);
819
+ assert.notEqual(undefined, sampleDotJson.properties.request);
820
+ assert.notEqual(null, sampleDotJson.properties.request);
821
+ assert.notEqual('', sampleDotJson.properties.request);
822
+ assert.notEqual(undefined, sampleDotJson.properties.request.number_redirects);
823
+ assert.notEqual(undefined, sampleDotJson.properties.request.number_retries);
824
+ assert.notEqual(undefined, sampleDotJson.properties.request.limit_retry_error);
825
+ assert.notEqual(undefined, sampleDotJson.properties.request.failover_codes);
826
+ assert.notEqual(undefined, sampleDotJson.properties.request.attempt_timeout);
827
+ assert.notEqual(undefined, sampleDotJson.properties.request.global_request);
828
+ assert.notEqual(undefined, sampleDotJson.properties.request.global_request.payload);
829
+ assert.notEqual(undefined, sampleDotJson.properties.request.global_request.uriOptions);
830
+ assert.notEqual(undefined, sampleDotJson.properties.request.global_request.addlHeaders);
831
+ assert.notEqual(undefined, sampleDotJson.properties.request.global_request.authData);
832
+ assert.notEqual(undefined, sampleDotJson.properties.request.healthcheck_on_timeout);
833
+ assert.notEqual(undefined, sampleDotJson.properties.request.return_raw);
834
+ assert.notEqual(undefined, sampleDotJson.properties.request.archiving);
835
+ assert.notEqual(undefined, sampleDotJson.properties.request.return_request);
836
+ assert.notEqual(undefined, sampleDotJson.properties.proxy);
837
+ assert.notEqual(null, sampleDotJson.properties.proxy);
838
+ assert.notEqual('', sampleDotJson.properties.proxy);
839
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.enabled);
840
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.host);
841
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.port);
842
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.protocol);
843
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.username);
844
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.password);
845
+ assert.notEqual(undefined, sampleDotJson.properties.mongo);
846
+ assert.notEqual(null, sampleDotJson.properties.mongo);
847
+ assert.notEqual('', sampleDotJson.properties.mongo);
848
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.host);
849
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.port);
850
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.database);
851
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.username);
852
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.password);
853
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.replSet);
854
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl);
855
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.enabled);
856
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.accept_invalid_cert);
857
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.ca_file);
858
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.key_file);
859
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.cert_file);
860
+ assert.notEqual(undefined, sampleDotJson.properties.devicebroker);
861
+ assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevice);
862
+ assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevicesFiltered);
863
+ assert.notEqual(undefined, sampleDotJson.properties.devicebroker.isAlive);
864
+ assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getConfig);
865
+ assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getCount);
866
+ done();
867
+ } catch (error) {
868
+ log.error(`Test Failure: ${error}`);
869
+ done(error);
870
+ }
871
+ });
872
+ });
873
+
874
+ describe('#checkProperties', () => {
875
+ it('should have a checkProperties function', (done) => {
876
+ try {
877
+ assert.equal(true, typeof a.checkProperties === 'function');
878
+ done();
879
+ } catch (error) {
880
+ log.error(`Test Failure: ${error}`);
881
+ done(error);
882
+ }
883
+ });
884
+ it('the sample properties should be good - if failure change the log level', (done) => {
885
+ try {
886
+ const samplePropsJson = require('../../sampleProperties.json');
887
+ const clean = a.checkProperties(samplePropsJson.properties);
888
+
889
+ try {
890
+ assert.notEqual(0, Object.keys(clean));
891
+ assert.equal(undefined, clean.exception);
892
+ assert.notEqual(undefined, clean.host);
893
+ assert.notEqual(null, clean.host);
894
+ assert.notEqual('', clean.host);
895
+ done();
896
+ } catch (err) {
897
+ log.error(`Test Failure: ${err}`);
898
+ done(err);
899
+ }
900
+ } catch (error) {
901
+ log.error(`Adapter Exception: ${error}`);
902
+ done(error);
903
+ }
904
+ }).timeout(attemptTimeout);
905
+ });
906
+
907
+ describe('README.md', () => {
908
+ it('should have a README', (done) => {
909
+ try {
910
+ fs.exists('README.md', (val) => {
911
+ assert.equal(true, val);
912
+ done();
913
+ });
914
+ } catch (error) {
915
+ log.error(`Test Failure: ${error}`);
916
+ done(error);
917
+ }
918
+ });
919
+ it('README.md should be customized', (done) => {
920
+ try {
921
+ fs.readFile('README.md', 'utf8', (err, data) => {
922
+ assert.equal(-1, data.indexOf('[System]'));
923
+ assert.equal(-1, data.indexOf('[system]'));
924
+ assert.equal(-1, data.indexOf('[version]'));
925
+ assert.equal(-1, data.indexOf('[namespace]'));
926
+ done();
927
+ });
928
+ } catch (error) {
929
+ log.error(`Test Failure: ${error}`);
930
+ done(error);
931
+ }
932
+ });
933
+ });
934
+
935
+ describe('#connect', () => {
936
+ it('should have a connect function', (done) => {
937
+ try {
938
+ assert.equal(true, typeof a.connect === 'function');
939
+ done();
940
+ } catch (error) {
941
+ log.error(`Test Failure: ${error}`);
942
+ done(error);
943
+ }
944
+ });
945
+ });
946
+
947
+ describe('#healthCheck', () => {
948
+ it('should have a healthCheck function', (done) => {
949
+ try {
950
+ assert.equal(true, typeof a.healthCheck === 'function');
951
+ done();
952
+ } catch (error) {
953
+ log.error(`Test Failure: ${error}`);
954
+ done(error);
955
+ }
956
+ });
957
+ });
958
+
959
+ describe('#iapUpdateAdapterConfiguration', () => {
960
+ it('should have a iapUpdateAdapterConfiguration function', (done) => {
961
+ try {
962
+ assert.equal(true, typeof a.iapUpdateAdapterConfiguration === 'function');
963
+ done();
964
+ } catch (error) {
965
+ log.error(`Test Failure: ${error}`);
966
+ done(error);
967
+ }
968
+ });
969
+ });
970
+
971
+ describe('#iapFindAdapterPath', () => {
972
+ it('should have a iapFindAdapterPath function', (done) => {
973
+ try {
974
+ assert.equal(true, typeof a.iapFindAdapterPath === 'function');
975
+ done();
976
+ } catch (error) {
977
+ log.error(`Test Failure: ${error}`);
978
+ done(error);
979
+ }
980
+ });
981
+ it('iapFindAdapterPath should find atleast one path that matches', (done) => {
982
+ try {
983
+ a.iapFindAdapterPath('{base_path}/{version}', (data, error) => {
984
+ try {
985
+ assert.equal(undefined, error);
986
+ assert.notEqual(undefined, data);
987
+ assert.notEqual(null, data);
988
+ assert.equal(true, data.found);
989
+ assert.notEqual(undefined, data.foundIn);
990
+ assert.notEqual(null, data.foundIn);
991
+ assert.notEqual(0, data.foundIn.length);
992
+ done();
993
+ } catch (err) {
994
+ log.error(`Test Failure: ${err}`);
995
+ done(err);
996
+ }
997
+ });
998
+ } catch (error) {
999
+ log.error(`Adapter Exception: ${error}`);
1000
+ done(error);
1001
+ }
1002
+ }).timeout(attemptTimeout);
1003
+ });
1004
+
1005
+ describe('#iapSuspendAdapter', () => {
1006
+ it('should have a iapSuspendAdapter function', (done) => {
1007
+ try {
1008
+ assert.equal(true, typeof a.iapSuspendAdapter === 'function');
1009
+ done();
1010
+ } catch (error) {
1011
+ log.error(`Test Failure: ${error}`);
1012
+ done(error);
1013
+ }
1014
+ });
1015
+ });
1016
+
1017
+ describe('#iapUnsuspendAdapter', () => {
1018
+ it('should have a iapUnsuspendAdapter function', (done) => {
1019
+ try {
1020
+ assert.equal(true, typeof a.iapUnsuspendAdapter === 'function');
1021
+ done();
1022
+ } catch (error) {
1023
+ log.error(`Test Failure: ${error}`);
1024
+ done(error);
1025
+ }
1026
+ });
1027
+ });
1028
+
1029
+ describe('#iapGetAdapterQueue', () => {
1030
+ it('should have a iapGetAdapterQueue function', (done) => {
1031
+ try {
1032
+ assert.equal(true, typeof a.iapGetAdapterQueue === 'function');
1033
+ done();
1034
+ } catch (error) {
1035
+ log.error(`Test Failure: ${error}`);
1036
+ done(error);
1037
+ }
1038
+ });
1039
+ });
1040
+
1041
+ describe('#iapTroubleshootAdapter', () => {
1042
+ it('should have a iapTroubleshootAdapter function', (done) => {
1043
+ try {
1044
+ assert.equal(true, typeof a.iapTroubleshootAdapter === 'function');
1045
+ done();
1046
+ } catch (error) {
1047
+ log.error(`Test Failure: ${error}`);
1048
+ done(error);
1049
+ }
1050
+ });
1051
+ });
1052
+
1053
+ describe('#iapRunAdapterHealthcheck', () => {
1054
+ it('should have a iapRunAdapterHealthcheck function', (done) => {
1055
+ try {
1056
+ assert.equal(true, typeof a.iapRunAdapterHealthcheck === 'function');
1057
+ done();
1058
+ } catch (error) {
1059
+ log.error(`Test Failure: ${error}`);
1060
+ done(error);
1061
+ }
1062
+ });
1063
+ });
1064
+
1065
+ describe('#iapRunAdapterConnectivity', () => {
1066
+ it('should have a iapRunAdapterConnectivity function', (done) => {
1067
+ try {
1068
+ assert.equal(true, typeof a.iapRunAdapterConnectivity === 'function');
1069
+ done();
1070
+ } catch (error) {
1071
+ log.error(`Test Failure: ${error}`);
1072
+ done(error);
1073
+ }
1074
+ });
1075
+ });
1076
+
1077
+ describe('#iapRunAdapterBasicGet', () => {
1078
+ it('should have a iapRunAdapterBasicGet function', (done) => {
1079
+ try {
1080
+ assert.equal(true, typeof a.iapRunAdapterBasicGet === 'function');
1081
+ done();
1082
+ } catch (error) {
1083
+ log.error(`Test Failure: ${error}`);
1084
+ done(error);
1085
+ }
1086
+ });
1087
+ });
1088
+
1089
+ describe('#iapMoveAdapterEntitiesToDB', () => {
1090
+ it('should have a iapMoveAdapterEntitiesToDB function', (done) => {
1091
+ try {
1092
+ assert.equal(true, typeof a.iapMoveAdapterEntitiesToDB === 'function');
1093
+ done();
1094
+ } catch (error) {
1095
+ log.error(`Test Failure: ${error}`);
1096
+ done(error);
1097
+ }
1098
+ });
1099
+ });
1100
+
1101
+ describe('#checkActionFiles', () => {
1102
+ it('should have a checkActionFiles function', (done) => {
1103
+ try {
1104
+ assert.equal(true, typeof a.checkActionFiles === 'function');
1105
+ done();
1106
+ } catch (error) {
1107
+ log.error(`Test Failure: ${error}`);
1108
+ done(error);
1109
+ }
1110
+ });
1111
+ it('the action files should be good - if failure change the log level as most issues are warnings', (done) => {
1112
+ try {
1113
+ const clean = a.checkActionFiles();
1114
+
1115
+ try {
1116
+ for (let c = 0; c < clean.length; c += 1) {
1117
+ log.error(clean[c]);
1118
+ }
1119
+ assert.equal(0, clean.length);
1120
+ done();
1121
+ } catch (err) {
1122
+ log.error(`Test Failure: ${err}`);
1123
+ done(err);
1124
+ }
1125
+ } catch (error) {
1126
+ log.error(`Adapter Exception: ${error}`);
1127
+ done(error);
1128
+ }
1129
+ }).timeout(attemptTimeout);
1130
+ });
1131
+
1132
+ describe('#encryptProperty', () => {
1133
+ it('should have a encryptProperty function', (done) => {
1134
+ try {
1135
+ assert.equal(true, typeof a.encryptProperty === 'function');
1136
+ done();
1137
+ } catch (error) {
1138
+ log.error(`Test Failure: ${error}`);
1139
+ done(error);
1140
+ }
1141
+ });
1142
+ it('should get base64 encoded property', (done) => {
1143
+ try {
1144
+ a.encryptProperty('testing', 'base64', (data, error) => {
1145
+ try {
1146
+ assert.equal(undefined, error);
1147
+ assert.notEqual(undefined, data);
1148
+ assert.notEqual(null, data);
1149
+ assert.notEqual(undefined, data.response);
1150
+ assert.notEqual(null, data.response);
1151
+ assert.equal(0, data.response.indexOf('{code}'));
1152
+ done();
1153
+ } catch (err) {
1154
+ log.error(`Test Failure: ${err}`);
1155
+ done(err);
1156
+ }
1157
+ });
1158
+ } catch (error) {
1159
+ log.error(`Adapter Exception: ${error}`);
1160
+ done(error);
1161
+ }
1162
+ }).timeout(attemptTimeout);
1163
+ it('should get encrypted property', (done) => {
1164
+ try {
1165
+ a.encryptProperty('testing', 'encrypt', (data, error) => {
1166
+ try {
1167
+ assert.equal(undefined, error);
1168
+ assert.notEqual(undefined, data);
1169
+ assert.notEqual(null, data);
1170
+ assert.notEqual(undefined, data.response);
1171
+ assert.notEqual(null, data.response);
1172
+ assert.equal(0, data.response.indexOf('{crypt}'));
1173
+ done();
1174
+ } catch (err) {
1175
+ log.error(`Test Failure: ${err}`);
1176
+ done(err);
1177
+ }
1178
+ });
1179
+ } catch (error) {
1180
+ log.error(`Adapter Exception: ${error}`);
1181
+ done(error);
1182
+ }
1183
+ }).timeout(attemptTimeout);
1184
+ });
1185
+
1186
+ // describe('#iapHasAdapterEntity', () => {
1187
+ // it('should have a iapHasAdapterEntity function', (done) => {
1188
+ // try {
1189
+ // assert.equal(true, typeof a.iapHasAdapterEntity === 'function');
1190
+ // done();
1191
+ // } catch (error) {
1192
+ // log.error(`Test Failure: ${error}`);
1193
+ // done(error);
1194
+ // }
1195
+ // });
1196
+ // it('should find entity', (done) => {
1197
+ // try {
1198
+ // a.iapHasAdapterEntity('template_entity', // 'a9e9c33dc61122760072455df62663d2', (data) => {
1199
+ // try {
1200
+ // assert.equal(true, data[0]);
1201
+ // done();
1202
+ // } catch (err) {
1203
+ // log.error(`Test Failure: ${err}`);
1204
+ // done(err);
1205
+ // }
1206
+ // });
1207
+ // } catch (error) {
1208
+ // log.error(`Adapter Exception: ${error}`);
1209
+ // done(error);
1210
+ // }
1211
+ // }).timeout(attemptTimeout);
1212
+ // it('should not find entity', (done) => {
1213
+ // try {
1214
+ // a.iapHasAdapterEntity('template_entity', 'blah', (data) => {
1215
+ // try {
1216
+ // assert.equal(false, data[0]);
1217
+ // done();
1218
+ // } catch (err) {
1219
+ // log.error(`Test Failure: ${err}`);
1220
+ // done(err);
1221
+ // }
1222
+ // });
1223
+ // } catch (error) {
1224
+ // log.error(`Adapter Exception: ${error}`);
1225
+ // done(error);
1226
+ // }
1227
+ // }).timeout(attemptTimeout);
1228
+ // });
1229
+
1230
+ describe('#hasEntities', () => {
1231
+ it('should have a hasEntities function', (done) => {
1232
+ try {
1233
+ assert.equal(true, typeof a.hasEntities === 'function');
1234
+ done();
1235
+ } catch (error) {
1236
+ log.error(`Test Failure: ${error}`);
1237
+ done(error);
1238
+ }
1239
+ });
1240
+ });
1241
+
1242
+ describe('#getDevice', () => {
1243
+ it('should have a getDevice function', (done) => {
1244
+ try {
1245
+ assert.equal(true, typeof a.getDevice === 'function');
1246
+ done();
1247
+ } catch (error) {
1248
+ log.error(`Test Failure: ${error}`);
1249
+ done(error);
1250
+ }
1251
+ });
1252
+ });
1253
+
1254
+ describe('#getDevicesFiltered', () => {
1255
+ it('should have a getDevicesFiltered function', (done) => {
1256
+ try {
1257
+ assert.equal(true, typeof a.getDevicesFiltered === 'function');
1258
+ done();
1259
+ } catch (error) {
1260
+ log.error(`Test Failure: ${error}`);
1261
+ done(error);
1262
+ }
1263
+ });
1264
+ });
1265
+
1266
+ describe('#isAlive', () => {
1267
+ it('should have a isAlive function', (done) => {
1268
+ try {
1269
+ assert.equal(true, typeof a.isAlive === 'function');
1270
+ done();
1271
+ } catch (error) {
1272
+ log.error(`Test Failure: ${error}`);
1273
+ done(error);
1274
+ }
1275
+ });
1276
+ });
1277
+
1278
+ describe('#getConfig', () => {
1279
+ it('should have a getConfig function', (done) => {
1280
+ try {
1281
+ assert.equal(true, typeof a.getConfig === 'function');
1282
+ done();
1283
+ } catch (error) {
1284
+ log.error(`Test Failure: ${error}`);
1285
+ done(error);
1286
+ }
1287
+ });
1288
+ });
1289
+
1290
+ describe('#iapGetDeviceCount', () => {
1291
+ it('should have a iapGetDeviceCount function', (done) => {
1292
+ try {
1293
+ assert.equal(true, typeof a.iapGetDeviceCount === 'function');
1294
+ done();
1295
+ } catch (error) {
1296
+ log.error(`Test Failure: ${error}`);
1297
+ done(error);
1298
+ }
1299
+ });
1300
+ });
1301
+
1302
+ /*
1303
+ -----------------------------------------------------------------------
1304
+ -----------------------------------------------------------------------
1305
+ *** All code above this comment will be replaced during a migration ***
1306
+ ******************* DO NOT REMOVE THIS COMMENT BLOCK ******************
1307
+ -----------------------------------------------------------------------
1308
+ -----------------------------------------------------------------------
1309
+ */
1310
+
1311
+ describe('#getAllApplicationsUsingGET - errors', () => {
1312
+ it('should have a getAllApplicationsUsingGET function', (done) => {
1313
+ try {
1314
+ assert.equal(true, typeof a.getAllApplicationsUsingGET === 'function');
1315
+ done();
1316
+ } catch (error) {
1317
+ log.error(`Test Failure: ${error}`);
1318
+ done(error);
1319
+ }
1320
+ }).timeout(attemptTimeout);
1321
+ });
1322
+
1323
+ describe('#getAllApplicationsActivitiesUsingGET - errors', () => {
1324
+ it('should have a getAllApplicationsActivitiesUsingGET function', (done) => {
1325
+ try {
1326
+ assert.equal(true, typeof a.getAllApplicationsActivitiesUsingGET === 'function');
1327
+ done();
1328
+ } catch (error) {
1329
+ log.error(`Test Failure: ${error}`);
1330
+ done(error);
1331
+ }
1332
+ }).timeout(attemptTimeout);
1333
+ });
1334
+
1335
+ describe('#getApplicationByAppIdUsingGET - errors', () => {
1336
+ it('should have a getApplicationByAppIdUsingGET function', (done) => {
1337
+ try {
1338
+ assert.equal(true, typeof a.getApplicationByAppIdUsingGET === 'function');
1339
+ done();
1340
+ } catch (error) {
1341
+ log.error(`Test Failure: ${error}`);
1342
+ done(error);
1343
+ }
1344
+ }).timeout(attemptTimeout);
1345
+ it('should error if - missing id', (done) => {
1346
+ try {
1347
+ a.getApplicationByAppIdUsingGET(null, (data, error) => {
1348
+ try {
1349
+ const displayE = 'id is required';
1350
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getApplicationByAppIdUsingGET', displayE);
1351
+ done();
1352
+ } catch (err) {
1353
+ log.error(`Test Failure: ${err}`);
1354
+ done(err);
1355
+ }
1356
+ });
1357
+ } catch (error) {
1358
+ log.error(`Adapter Exception: ${error}`);
1359
+ done(error);
1360
+ }
1361
+ }).timeout(attemptTimeout);
1362
+ });
1363
+
1364
+ describe('#getApplicationRevisionsByAppIdUsingGET - errors', () => {
1365
+ it('should have a getApplicationRevisionsByAppIdUsingGET function', (done) => {
1366
+ try {
1367
+ assert.equal(true, typeof a.getApplicationRevisionsByAppIdUsingGET === 'function');
1368
+ done();
1369
+ } catch (error) {
1370
+ log.error(`Test Failure: ${error}`);
1371
+ done(error);
1372
+ }
1373
+ }).timeout(attemptTimeout);
1374
+ it('should error if - missing id', (done) => {
1375
+ try {
1376
+ a.getApplicationRevisionsByAppIdUsingGET(null, (data, error) => {
1377
+ try {
1378
+ const displayE = 'id is required';
1379
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getApplicationRevisionsByAppIdUsingGET', displayE);
1380
+ done();
1381
+ } catch (err) {
1382
+ log.error(`Test Failure: ${err}`);
1383
+ done(err);
1384
+ }
1385
+ });
1386
+ } catch (error) {
1387
+ log.error(`Adapter Exception: ${error}`);
1388
+ done(error);
1389
+ }
1390
+ }).timeout(attemptTimeout);
1391
+ });
1392
+
1393
+ describe('#getApplicationByNameUsingGET - errors', () => {
1394
+ it('should have a getApplicationByNameUsingGET function', (done) => {
1395
+ try {
1396
+ assert.equal(true, typeof a.getApplicationByNameUsingGET === 'function');
1397
+ done();
1398
+ } catch (error) {
1399
+ log.error(`Test Failure: ${error}`);
1400
+ done(error);
1401
+ }
1402
+ }).timeout(attemptTimeout);
1403
+ });
1404
+
1405
+ describe('#newApplicationUsingPOST - errors', () => {
1406
+ it('should have a newApplicationUsingPOST function', (done) => {
1407
+ try {
1408
+ assert.equal(true, typeof a.newApplicationUsingPOST === 'function');
1409
+ done();
1410
+ } catch (error) {
1411
+ log.error(`Test Failure: ${error}`);
1412
+ done(error);
1413
+ }
1414
+ }).timeout(attemptTimeout);
1415
+ it('should error if - missing applicationRequest', (done) => {
1416
+ try {
1417
+ a.newApplicationUsingPOST(null, (data, error) => {
1418
+ try {
1419
+ const displayE = 'applicationRequest is required';
1420
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-newApplicationUsingPOST', displayE);
1421
+ done();
1422
+ } catch (err) {
1423
+ log.error(`Test Failure: ${err}`);
1424
+ done(err);
1425
+ }
1426
+ });
1427
+ } catch (error) {
1428
+ log.error(`Adapter Exception: ${error}`);
1429
+ done(error);
1430
+ }
1431
+ }).timeout(attemptTimeout);
1432
+ });
1433
+
1434
+ describe('#getPciApplicationsVulnerabilitiesUsingGET - errors', () => {
1435
+ it('should have a getPciApplicationsVulnerabilitiesUsingGET function', (done) => {
1436
+ try {
1437
+ assert.equal(true, typeof a.getPciApplicationsVulnerabilitiesUsingGET === 'function');
1438
+ done();
1439
+ } catch (error) {
1440
+ log.error(`Test Failure: ${error}`);
1441
+ done(error);
1442
+ }
1443
+ }).timeout(attemptTimeout);
1444
+ it('should error if - missing devices', (done) => {
1445
+ try {
1446
+ a.getPciApplicationsVulnerabilitiesUsingGET(null, (data, error) => {
1447
+ try {
1448
+ const displayE = 'devices is required';
1449
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getPciApplicationsVulnerabilitiesUsingGET', displayE);
1450
+ done();
1451
+ } catch (err) {
1452
+ log.error(`Test Failure: ${err}`);
1453
+ done(err);
1454
+ }
1455
+ });
1456
+ } catch (error) {
1457
+ log.error(`Adapter Exception: ${error}`);
1458
+ done(error);
1459
+ }
1460
+ }).timeout(attemptTimeout);
1461
+ });
1462
+
1463
+ describe('#getApplicationByIdUsingGET - errors', () => {
1464
+ it('should have a getApplicationByIdUsingGET function', (done) => {
1465
+ try {
1466
+ assert.equal(true, typeof a.getApplicationByIdUsingGET === 'function');
1467
+ done();
1468
+ } catch (error) {
1469
+ log.error(`Test Failure: ${error}`);
1470
+ done(error);
1471
+ }
1472
+ }).timeout(attemptTimeout);
1473
+ it('should error if - missing id', (done) => {
1474
+ try {
1475
+ a.getApplicationByIdUsingGET(null, (data, error) => {
1476
+ try {
1477
+ const displayE = 'id is required';
1478
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getApplicationByIdUsingGET', displayE);
1479
+ done();
1480
+ } catch (err) {
1481
+ log.error(`Test Failure: ${err}`);
1482
+ done(err);
1483
+ }
1484
+ });
1485
+ } catch (error) {
1486
+ log.error(`Adapter Exception: ${error}`);
1487
+ done(error);
1488
+ }
1489
+ }).timeout(attemptTimeout);
1490
+ });
1491
+
1492
+ describe('#getActivitiesForApplicationUsingGET - errors', () => {
1493
+ it('should have a getActivitiesForApplicationUsingGET function', (done) => {
1494
+ try {
1495
+ assert.equal(true, typeof a.getActivitiesForApplicationUsingGET === 'function');
1496
+ done();
1497
+ } catch (error) {
1498
+ log.error(`Test Failure: ${error}`);
1499
+ done(error);
1500
+ }
1501
+ }).timeout(attemptTimeout);
1502
+ it('should error if - missing id', (done) => {
1503
+ try {
1504
+ a.getActivitiesForApplicationUsingGET(null, (data, error) => {
1505
+ try {
1506
+ const displayE = 'id is required';
1507
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getActivitiesForApplicationUsingGET', displayE);
1508
+ done();
1509
+ } catch (err) {
1510
+ log.error(`Test Failure: ${err}`);
1511
+ done(err);
1512
+ }
1513
+ });
1514
+ } catch (error) {
1515
+ log.error(`Adapter Exception: ${error}`);
1516
+ done(error);
1517
+ }
1518
+ }).timeout(attemptTimeout);
1519
+ });
1520
+
1521
+ describe('#applyDraftUsingPOST - errors', () => {
1522
+ it('should have a applyDraftUsingPOST function', (done) => {
1523
+ try {
1524
+ assert.equal(true, typeof a.applyDraftUsingPOST === 'function');
1525
+ done();
1526
+ } catch (error) {
1527
+ log.error(`Test Failure: ${error}`);
1528
+ done(error);
1529
+ }
1530
+ }).timeout(attemptTimeout);
1531
+ it('should error if - missing id', (done) => {
1532
+ try {
1533
+ a.applyDraftUsingPOST('fakeparam', null, null, (data, error) => {
1534
+ try {
1535
+ const displayE = 'id is required';
1536
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-applyDraftUsingPOST', displayE);
1537
+ done();
1538
+ } catch (err) {
1539
+ log.error(`Test Failure: ${err}`);
1540
+ done(err);
1541
+ }
1542
+ });
1543
+ } catch (error) {
1544
+ log.error(`Adapter Exception: ${error}`);
1545
+ done(error);
1546
+ }
1547
+ }).timeout(attemptTimeout);
1548
+ });
1549
+
1550
+ describe('#getApplicationUsersAndRolesUsingGET - errors', () => {
1551
+ it('should have a getApplicationUsersAndRolesUsingGET function', (done) => {
1552
+ try {
1553
+ assert.equal(true, typeof a.getApplicationUsersAndRolesUsingGET === 'function');
1554
+ done();
1555
+ } catch (error) {
1556
+ log.error(`Test Failure: ${error}`);
1557
+ done(error);
1558
+ }
1559
+ }).timeout(attemptTimeout);
1560
+ it('should error if - missing id', (done) => {
1561
+ try {
1562
+ a.getApplicationUsersAndRolesUsingGET(null, (data, error) => {
1563
+ try {
1564
+ const displayE = 'id is required';
1565
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getApplicationUsersAndRolesUsingGET', displayE);
1566
+ done();
1567
+ } catch (err) {
1568
+ log.error(`Test Failure: ${err}`);
1569
+ done(err);
1570
+ }
1571
+ });
1572
+ } catch (error) {
1573
+ log.error(`Adapter Exception: ${error}`);
1574
+ done(error);
1575
+ }
1576
+ }).timeout(attemptTimeout);
1577
+ });
1578
+
1579
+ describe('#getApplicationChangeRequestsUsingGET - errors', () => {
1580
+ it('should have a getApplicationChangeRequestsUsingGET function', (done) => {
1581
+ try {
1582
+ assert.equal(true, typeof a.getApplicationChangeRequestsUsingGET === 'function');
1583
+ done();
1584
+ } catch (error) {
1585
+ log.error(`Test Failure: ${error}`);
1586
+ done(error);
1587
+ }
1588
+ }).timeout(attemptTimeout);
1589
+ it('should error if - missing id', (done) => {
1590
+ try {
1591
+ a.getApplicationChangeRequestsUsingGET(null, (data, error) => {
1592
+ try {
1593
+ const displayE = 'id is required';
1594
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getApplicationChangeRequestsUsingGET', displayE);
1595
+ done();
1596
+ } catch (err) {
1597
+ log.error(`Test Failure: ${err}`);
1598
+ done(err);
1599
+ }
1600
+ });
1601
+ } catch (error) {
1602
+ log.error(`Adapter Exception: ${error}`);
1603
+ done(error);
1604
+ }
1605
+ }).timeout(attemptTimeout);
1606
+ });
1607
+
1608
+ describe('#runCheckConnectivityUsingPOST - errors', () => {
1609
+ it('should have a runCheckConnectivityUsingPOST function', (done) => {
1610
+ try {
1611
+ assert.equal(true, typeof a.runCheckConnectivityUsingPOST === 'function');
1612
+ done();
1613
+ } catch (error) {
1614
+ log.error(`Test Failure: ${error}`);
1615
+ done(error);
1616
+ }
1617
+ }).timeout(attemptTimeout);
1618
+ it('should error if - missing id', (done) => {
1619
+ try {
1620
+ a.runCheckConnectivityUsingPOST(null, (data, error) => {
1621
+ try {
1622
+ const displayE = 'id is required';
1623
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-runCheckConnectivityUsingPOST', displayE);
1624
+ done();
1625
+ } catch (err) {
1626
+ log.error(`Test Failure: ${err}`);
1627
+ done(err);
1628
+ }
1629
+ });
1630
+ } catch (error) {
1631
+ log.error(`Adapter Exception: ${error}`);
1632
+ done(error);
1633
+ }
1634
+ }).timeout(attemptTimeout);
1635
+ });
1636
+
1637
+ describe('#getApplicationContactsUsingGET - errors', () => {
1638
+ it('should have a getApplicationContactsUsingGET function', (done) => {
1639
+ try {
1640
+ assert.equal(true, typeof a.getApplicationContactsUsingGET === 'function');
1641
+ done();
1642
+ } catch (error) {
1643
+ log.error(`Test Failure: ${error}`);
1644
+ done(error);
1645
+ }
1646
+ }).timeout(attemptTimeout);
1647
+ it('should error if - missing id', (done) => {
1648
+ try {
1649
+ a.getApplicationContactsUsingGET(null, (data, error) => {
1650
+ try {
1651
+ const displayE = 'id is required';
1652
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getApplicationContactsUsingGET', displayE);
1653
+ done();
1654
+ } catch (err) {
1655
+ log.error(`Test Failure: ${err}`);
1656
+ done(err);
1657
+ }
1658
+ });
1659
+ } catch (error) {
1660
+ log.error(`Adapter Exception: ${error}`);
1661
+ done(error);
1662
+ }
1663
+ }).timeout(attemptTimeout);
1664
+ });
1665
+
1666
+ describe('#editApplicationContactsUsingPOST - errors', () => {
1667
+ it('should have a editApplicationContactsUsingPOST function', (done) => {
1668
+ try {
1669
+ assert.equal(true, typeof a.editApplicationContactsUsingPOST === 'function');
1670
+ done();
1671
+ } catch (error) {
1672
+ log.error(`Test Failure: ${error}`);
1673
+ done(error);
1674
+ }
1675
+ }).timeout(attemptTimeout);
1676
+ it('should error if - missing id', (done) => {
1677
+ try {
1678
+ a.editApplicationContactsUsingPOST(null, null, (data, error) => {
1679
+ try {
1680
+ const displayE = 'id is required';
1681
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-editApplicationContactsUsingPOST', displayE);
1682
+ done();
1683
+ } catch (err) {
1684
+ log.error(`Test Failure: ${err}`);
1685
+ done(err);
1686
+ }
1687
+ });
1688
+ } catch (error) {
1689
+ log.error(`Adapter Exception: ${error}`);
1690
+ done(error);
1691
+ }
1692
+ }).timeout(attemptTimeout);
1693
+ it('should error if - missing request', (done) => {
1694
+ try {
1695
+ a.editApplicationContactsUsingPOST('fakeparam', null, (data, error) => {
1696
+ try {
1697
+ const displayE = 'request is required';
1698
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-editApplicationContactsUsingPOST', displayE);
1699
+ done();
1700
+ } catch (err) {
1701
+ log.error(`Test Failure: ${err}`);
1702
+ done(err);
1703
+ }
1704
+ });
1705
+ } catch (error) {
1706
+ log.error(`Adapter Exception: ${error}`);
1707
+ done(error);
1708
+ }
1709
+ }).timeout(attemptTimeout);
1710
+ });
1711
+
1712
+ describe('#clearAllApplicationContactsUsingDELETE - errors', () => {
1713
+ it('should have a clearAllApplicationContactsUsingDELETE function', (done) => {
1714
+ try {
1715
+ assert.equal(true, typeof a.clearAllApplicationContactsUsingDELETE === 'function');
1716
+ done();
1717
+ } catch (error) {
1718
+ log.error(`Test Failure: ${error}`);
1719
+ done(error);
1720
+ }
1721
+ }).timeout(attemptTimeout);
1722
+ it('should error if - missing id', (done) => {
1723
+ try {
1724
+ a.clearAllApplicationContactsUsingDELETE(null, (data, error) => {
1725
+ try {
1726
+ const displayE = 'id is required';
1727
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-clearAllApplicationContactsUsingDELETE', displayE);
1728
+ done();
1729
+ } catch (err) {
1730
+ log.error(`Test Failure: ${err}`);
1731
+ done(err);
1732
+ }
1733
+ });
1734
+ } catch (error) {
1735
+ log.error(`Adapter Exception: ${error}`);
1736
+ done(error);
1737
+ }
1738
+ }).timeout(attemptTimeout);
1739
+ });
1740
+
1741
+ describe('#editCustomFieldsUsingPOST - errors', () => {
1742
+ it('should have a editCustomFieldsUsingPOST function', (done) => {
1743
+ try {
1744
+ assert.equal(true, typeof a.editCustomFieldsUsingPOST === 'function');
1745
+ done();
1746
+ } catch (error) {
1747
+ log.error(`Test Failure: ${error}`);
1748
+ done(error);
1749
+ }
1750
+ }).timeout(attemptTimeout);
1751
+ it('should error if - missing id', (done) => {
1752
+ try {
1753
+ a.editCustomFieldsUsingPOST(null, null, (data, error) => {
1754
+ try {
1755
+ const displayE = 'id is required';
1756
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-editCustomFieldsUsingPOST', 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
+ it('should error if - missing request', (done) => {
1769
+ try {
1770
+ a.editCustomFieldsUsingPOST('fakeparam', null, (data, error) => {
1771
+ try {
1772
+ const displayE = 'request is required';
1773
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-editCustomFieldsUsingPOST', displayE);
1774
+ done();
1775
+ } catch (err) {
1776
+ log.error(`Test Failure: ${err}`);
1777
+ done(err);
1778
+ }
1779
+ });
1780
+ } catch (error) {
1781
+ log.error(`Adapter Exception: ${error}`);
1782
+ done(error);
1783
+ }
1784
+ }).timeout(attemptTimeout);
1785
+ });
1786
+
1787
+ describe('#clearAllApplicationCustomFieldsUsingDELETE - errors', () => {
1788
+ it('should have a clearAllApplicationCustomFieldsUsingDELETE function', (done) => {
1789
+ try {
1790
+ assert.equal(true, typeof a.clearAllApplicationCustomFieldsUsingDELETE === 'function');
1791
+ done();
1792
+ } catch (error) {
1793
+ log.error(`Test Failure: ${error}`);
1794
+ done(error);
1795
+ }
1796
+ }).timeout(attemptTimeout);
1797
+ it('should error if - missing id', (done) => {
1798
+ try {
1799
+ a.clearAllApplicationCustomFieldsUsingDELETE(null, (data, error) => {
1800
+ try {
1801
+ const displayE = 'id is required';
1802
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-clearAllApplicationCustomFieldsUsingDELETE', 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
+ });
1815
+
1816
+ describe('#decomissionApplicationUsingPOST - errors', () => {
1817
+ it('should have a decomissionApplicationUsingPOST function', (done) => {
1818
+ try {
1819
+ assert.equal(true, typeof a.decomissionApplicationUsingPOST === 'function');
1820
+ done();
1821
+ } catch (error) {
1822
+ log.error(`Test Failure: ${error}`);
1823
+ done(error);
1824
+ }
1825
+ }).timeout(attemptTimeout);
1826
+ it('should error if - missing id', (done) => {
1827
+ try {
1828
+ a.decomissionApplicationUsingPOST(null, null, (data, error) => {
1829
+ try {
1830
+ const displayE = 'id is required';
1831
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-decomissionApplicationUsingPOST', displayE);
1832
+ done();
1833
+ } catch (err) {
1834
+ log.error(`Test Failure: ${err}`);
1835
+ done(err);
1836
+ }
1837
+ });
1838
+ } catch (error) {
1839
+ log.error(`Adapter Exception: ${error}`);
1840
+ done(error);
1841
+ }
1842
+ }).timeout(attemptTimeout);
1843
+ });
1844
+
1845
+ describe('#discardRevisionUsingPOST - errors', () => {
1846
+ it('should have a discardRevisionUsingPOST function', (done) => {
1847
+ try {
1848
+ assert.equal(true, typeof a.discardRevisionUsingPOST === 'function');
1849
+ done();
1850
+ } catch (error) {
1851
+ log.error(`Test Failure: ${error}`);
1852
+ done(error);
1853
+ }
1854
+ }).timeout(attemptTimeout);
1855
+ it('should error if - missing id', (done) => {
1856
+ try {
1857
+ a.discardRevisionUsingPOST(null, (data, error) => {
1858
+ try {
1859
+ const displayE = 'id is required';
1860
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-discardRevisionUsingPOST', displayE);
1861
+ done();
1862
+ } catch (err) {
1863
+ log.error(`Test Failure: ${err}`);
1864
+ done(err);
1865
+ }
1866
+ });
1867
+ } catch (error) {
1868
+ log.error(`Adapter Exception: ${error}`);
1869
+ done(error);
1870
+ }
1871
+ }).timeout(attemptTimeout);
1872
+ });
1873
+
1874
+ describe('#getApplicationLabelsUsingGET1 - errors', () => {
1875
+ it('should have a getApplicationLabelsUsingGET1 function', (done) => {
1876
+ try {
1877
+ assert.equal(true, typeof a.getApplicationLabelsUsingGET1 === 'function');
1878
+ done();
1879
+ } catch (error) {
1880
+ log.error(`Test Failure: ${error}`);
1881
+ done(error);
1882
+ }
1883
+ }).timeout(attemptTimeout);
1884
+ it('should error if - missing id', (done) => {
1885
+ try {
1886
+ a.getApplicationLabelsUsingGET1(null, (data, error) => {
1887
+ try {
1888
+ const displayE = 'id is required';
1889
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getApplicationLabelsUsingGET1', displayE);
1890
+ done();
1891
+ } catch (err) {
1892
+ log.error(`Test Failure: ${err}`);
1893
+ done(err);
1894
+ }
1895
+ });
1896
+ } catch (error) {
1897
+ log.error(`Adapter Exception: ${error}`);
1898
+ done(error);
1899
+ }
1900
+ }).timeout(attemptTimeout);
1901
+ });
1902
+
1903
+ describe('#editApplicationLabelsUsingPOST - errors', () => {
1904
+ it('should have a editApplicationLabelsUsingPOST function', (done) => {
1905
+ try {
1906
+ assert.equal(true, typeof a.editApplicationLabelsUsingPOST === 'function');
1907
+ done();
1908
+ } catch (error) {
1909
+ log.error(`Test Failure: ${error}`);
1910
+ done(error);
1911
+ }
1912
+ }).timeout(attemptTimeout);
1913
+ it('should error if - missing id', (done) => {
1914
+ try {
1915
+ a.editApplicationLabelsUsingPOST(null, null, (data, error) => {
1916
+ try {
1917
+ const displayE = 'id is required';
1918
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-editApplicationLabelsUsingPOST', displayE);
1919
+ done();
1920
+ } catch (err) {
1921
+ log.error(`Test Failure: ${err}`);
1922
+ done(err);
1923
+ }
1924
+ });
1925
+ } catch (error) {
1926
+ log.error(`Adapter Exception: ${error}`);
1927
+ done(error);
1928
+ }
1929
+ }).timeout(attemptTimeout);
1930
+ it('should error if - missing request', (done) => {
1931
+ try {
1932
+ a.editApplicationLabelsUsingPOST('fakeparam', null, (data, error) => {
1933
+ try {
1934
+ const displayE = 'request is required';
1935
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-editApplicationLabelsUsingPOST', displayE);
1936
+ done();
1937
+ } catch (err) {
1938
+ log.error(`Test Failure: ${err}`);
1939
+ done(err);
1940
+ }
1941
+ });
1942
+ } catch (error) {
1943
+ log.error(`Adapter Exception: ${error}`);
1944
+ done(error);
1945
+ }
1946
+ }).timeout(attemptTimeout);
1947
+ });
1948
+
1949
+ describe('#removeAllApplicationLabelsUsingDELETE - errors', () => {
1950
+ it('should have a removeAllApplicationLabelsUsingDELETE function', (done) => {
1951
+ try {
1952
+ assert.equal(true, typeof a.removeAllApplicationLabelsUsingDELETE === 'function');
1953
+ done();
1954
+ } catch (error) {
1955
+ log.error(`Test Failure: ${error}`);
1956
+ done(error);
1957
+ }
1958
+ }).timeout(attemptTimeout);
1959
+ it('should error if - missing id', (done) => {
1960
+ try {
1961
+ a.removeAllApplicationLabelsUsingDELETE(null, (data, error) => {
1962
+ try {
1963
+ const displayE = 'id is required';
1964
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-removeAllApplicationLabelsUsingDELETE', displayE);
1965
+ done();
1966
+ } catch (err) {
1967
+ log.error(`Test Failure: ${err}`);
1968
+ done(err);
1969
+ }
1970
+ });
1971
+ } catch (error) {
1972
+ log.error(`Adapter Exception: ${error}`);
1973
+ done(error);
1974
+ }
1975
+ }).timeout(attemptTimeout);
1976
+ });
1977
+
1978
+ describe('#getApplicationLabelsUsingGET - errors', () => {
1979
+ it('should have a getApplicationLabelsUsingGET function', (done) => {
1980
+ try {
1981
+ assert.equal(true, typeof a.getApplicationLabelsUsingGET === 'function');
1982
+ done();
1983
+ } catch (error) {
1984
+ log.error(`Test Failure: ${error}`);
1985
+ done(error);
1986
+ }
1987
+ }).timeout(attemptTimeout);
1988
+ it('should error if - missing id', (done) => {
1989
+ try {
1990
+ a.getApplicationLabelsUsingGET(null, null, (data, error) => {
1991
+ try {
1992
+ const displayE = 'id is required';
1993
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getApplicationLabelsUsingGET', displayE);
1994
+ done();
1995
+ } catch (err) {
1996
+ log.error(`Test Failure: ${err}`);
1997
+ done(err);
1998
+ }
1999
+ });
2000
+ } catch (error) {
2001
+ log.error(`Adapter Exception: ${error}`);
2002
+ done(error);
2003
+ }
2004
+ }).timeout(attemptTimeout);
2005
+ it('should error if - missing type', (done) => {
2006
+ try {
2007
+ a.getApplicationLabelsUsingGET('fakeparam', null, (data, error) => {
2008
+ try {
2009
+ const displayE = 'type is required';
2010
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getApplicationLabelsUsingGET', displayE);
2011
+ done();
2012
+ } catch (err) {
2013
+ log.error(`Test Failure: ${err}`);
2014
+ done(err);
2015
+ }
2016
+ });
2017
+ } catch (error) {
2018
+ log.error(`Adapter Exception: ${error}`);
2019
+ done(error);
2020
+ }
2021
+ }).timeout(attemptTimeout);
2022
+ });
2023
+
2024
+ describe('#resolveApplicationUsingPOST - errors', () => {
2025
+ it('should have a resolveApplicationUsingPOST function', (done) => {
2026
+ try {
2027
+ assert.equal(true, typeof a.resolveApplicationUsingPOST === 'function');
2028
+ done();
2029
+ } catch (error) {
2030
+ log.error(`Test Failure: ${error}`);
2031
+ done(error);
2032
+ }
2033
+ }).timeout(attemptTimeout);
2034
+ it('should error if - missing id', (done) => {
2035
+ try {
2036
+ a.resolveApplicationUsingPOST(null, null, (data, error) => {
2037
+ try {
2038
+ const displayE = 'id is required';
2039
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-resolveApplicationUsingPOST', displayE);
2040
+ done();
2041
+ } catch (err) {
2042
+ log.error(`Test Failure: ${err}`);
2043
+ done(err);
2044
+ }
2045
+ });
2046
+ } catch (error) {
2047
+ log.error(`Adapter Exception: ${error}`);
2048
+ done(error);
2049
+ }
2050
+ }).timeout(attemptTimeout);
2051
+ });
2052
+
2053
+ describe('#getApplicationRevisionsUsingGET - errors', () => {
2054
+ it('should have a getApplicationRevisionsUsingGET function', (done) => {
2055
+ try {
2056
+ assert.equal(true, typeof a.getApplicationRevisionsUsingGET === 'function');
2057
+ done();
2058
+ } catch (error) {
2059
+ log.error(`Test Failure: ${error}`);
2060
+ done(error);
2061
+ }
2062
+ }).timeout(attemptTimeout);
2063
+ it('should error if - missing id', (done) => {
2064
+ try {
2065
+ a.getApplicationRevisionsUsingGET(null, (data, error) => {
2066
+ try {
2067
+ const displayE = 'id is required';
2068
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getApplicationRevisionsUsingGET', displayE);
2069
+ done();
2070
+ } catch (err) {
2071
+ log.error(`Test Failure: ${err}`);
2072
+ done(err);
2073
+ }
2074
+ });
2075
+ } catch (error) {
2076
+ log.error(`Adapter Exception: ${error}`);
2077
+ done(error);
2078
+ }
2079
+ }).timeout(attemptTimeout);
2080
+ });
2081
+
2082
+ describe('#getApplicationRisksUsingGET - errors', () => {
2083
+ it('should have a getApplicationRisksUsingGET function', (done) => {
2084
+ try {
2085
+ assert.equal(true, typeof a.getApplicationRisksUsingGET === 'function');
2086
+ done();
2087
+ } catch (error) {
2088
+ log.error(`Test Failure: ${error}`);
2089
+ done(error);
2090
+ }
2091
+ }).timeout(attemptTimeout);
2092
+ it('should error if - missing id', (done) => {
2093
+ try {
2094
+ a.getApplicationRisksUsingGET(null, (data, error) => {
2095
+ try {
2096
+ const displayE = 'id is required';
2097
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getApplicationRisksUsingGET', displayE);
2098
+ done();
2099
+ } catch (err) {
2100
+ log.error(`Test Failure: ${err}`);
2101
+ done(err);
2102
+ }
2103
+ });
2104
+ } catch (error) {
2105
+ log.error(`Adapter Exception: ${error}`);
2106
+ done(error);
2107
+ }
2108
+ }).timeout(attemptTimeout);
2109
+ });
2110
+
2111
+ describe('#getApplicationVulnerabilitiesUsingGET - errors', () => {
2112
+ it('should have a getApplicationVulnerabilitiesUsingGET function', (done) => {
2113
+ try {
2114
+ assert.equal(true, typeof a.getApplicationVulnerabilitiesUsingGET === 'function');
2115
+ done();
2116
+ } catch (error) {
2117
+ log.error(`Test Failure: ${error}`);
2118
+ done(error);
2119
+ }
2120
+ }).timeout(attemptTimeout);
2121
+ it('should error if - missing id', (done) => {
2122
+ try {
2123
+ a.getApplicationVulnerabilitiesUsingGET(null, (data, error) => {
2124
+ try {
2125
+ const displayE = 'id is required';
2126
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getApplicationVulnerabilitiesUsingGET', displayE);
2127
+ done();
2128
+ } catch (err) {
2129
+ log.error(`Test Failure: ${err}`);
2130
+ done(err);
2131
+ }
2132
+ });
2133
+ } catch (error) {
2134
+ log.error(`Adapter Exception: ${error}`);
2135
+ done(error);
2136
+ }
2137
+ }).timeout(attemptTimeout);
2138
+ });
2139
+
2140
+ describe('#getApplicationFlowsUsingGET - errors', () => {
2141
+ it('should have a getApplicationFlowsUsingGET function', (done) => {
2142
+ try {
2143
+ assert.equal(true, typeof a.getApplicationFlowsUsingGET === 'function');
2144
+ done();
2145
+ } catch (error) {
2146
+ log.error(`Test Failure: ${error}`);
2147
+ done(error);
2148
+ }
2149
+ }).timeout(attemptTimeout);
2150
+ it('should error if - missing id', (done) => {
2151
+ try {
2152
+ a.getApplicationFlowsUsingGET(null, null, (data, error) => {
2153
+ try {
2154
+ const displayE = 'id is required';
2155
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getApplicationFlowsUsingGET', displayE);
2156
+ done();
2157
+ } catch (err) {
2158
+ log.error(`Test Failure: ${err}`);
2159
+ done(err);
2160
+ }
2161
+ });
2162
+ } catch (error) {
2163
+ log.error(`Adapter Exception: ${error}`);
2164
+ done(error);
2165
+ }
2166
+ }).timeout(attemptTimeout);
2167
+ });
2168
+
2169
+ describe('#editApplicationFlowUsingPOST - errors', () => {
2170
+ it('should have a editApplicationFlowUsingPOST function', (done) => {
2171
+ try {
2172
+ assert.equal(true, typeof a.editApplicationFlowUsingPOST === 'function');
2173
+ done();
2174
+ } catch (error) {
2175
+ log.error(`Test Failure: ${error}`);
2176
+ done(error);
2177
+ }
2178
+ }).timeout(attemptTimeout);
2179
+ it('should error if - missing editFlowRequests', (done) => {
2180
+ try {
2181
+ a.editApplicationFlowUsingPOST(null, null, (data, error) => {
2182
+ try {
2183
+ const displayE = 'editFlowRequests is required';
2184
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-editApplicationFlowUsingPOST', displayE);
2185
+ done();
2186
+ } catch (err) {
2187
+ log.error(`Test Failure: ${err}`);
2188
+ done(err);
2189
+ }
2190
+ });
2191
+ } catch (error) {
2192
+ log.error(`Adapter Exception: ${error}`);
2193
+ done(error);
2194
+ }
2195
+ }).timeout(attemptTimeout);
2196
+ it('should error if - missing id', (done) => {
2197
+ try {
2198
+ a.editApplicationFlowUsingPOST('fakeparam', null, (data, error) => {
2199
+ try {
2200
+ const displayE = 'id is required';
2201
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-editApplicationFlowUsingPOST', displayE);
2202
+ done();
2203
+ } catch (err) {
2204
+ log.error(`Test Failure: ${err}`);
2205
+ done(err);
2206
+ }
2207
+ });
2208
+ } catch (error) {
2209
+ log.error(`Adapter Exception: ${error}`);
2210
+ done(error);
2211
+ }
2212
+ }).timeout(attemptTimeout);
2213
+ });
2214
+
2215
+ describe('#createApplicationFlowUsingPOST - errors', () => {
2216
+ it('should have a createApplicationFlowUsingPOST function', (done) => {
2217
+ try {
2218
+ assert.equal(true, typeof a.createApplicationFlowUsingPOST === 'function');
2219
+ done();
2220
+ } catch (error) {
2221
+ log.error(`Test Failure: ${error}`);
2222
+ done(error);
2223
+ }
2224
+ }).timeout(attemptTimeout);
2225
+ it('should error if - missing flowRequests', (done) => {
2226
+ try {
2227
+ a.createApplicationFlowUsingPOST(null, null, (data, error) => {
2228
+ try {
2229
+ const displayE = 'flowRequests is required';
2230
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-createApplicationFlowUsingPOST', displayE);
2231
+ done();
2232
+ } catch (err) {
2233
+ log.error(`Test Failure: ${err}`);
2234
+ done(err);
2235
+ }
2236
+ });
2237
+ } catch (error) {
2238
+ log.error(`Adapter Exception: ${error}`);
2239
+ done(error);
2240
+ }
2241
+ }).timeout(attemptTimeout);
2242
+ it('should error if - missing id', (done) => {
2243
+ try {
2244
+ a.createApplicationFlowUsingPOST('fakeparam', null, (data, error) => {
2245
+ try {
2246
+ const displayE = 'id is required';
2247
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-createApplicationFlowUsingPOST', displayE);
2248
+ done();
2249
+ } catch (err) {
2250
+ log.error(`Test Failure: ${err}`);
2251
+ done(err);
2252
+ }
2253
+ });
2254
+ } catch (error) {
2255
+ log.error(`Adapter Exception: ${error}`);
2256
+ done(error);
2257
+ }
2258
+ }).timeout(attemptTimeout);
2259
+ });
2260
+
2261
+ describe('#getFlowUsingGET - errors', () => {
2262
+ it('should have a getFlowUsingGET function', (done) => {
2263
+ try {
2264
+ assert.equal(true, typeof a.getFlowUsingGET === 'function');
2265
+ done();
2266
+ } catch (error) {
2267
+ log.error(`Test Failure: ${error}`);
2268
+ done(error);
2269
+ }
2270
+ }).timeout(attemptTimeout);
2271
+ it('should error if - missing flowId', (done) => {
2272
+ try {
2273
+ a.getFlowUsingGET(null, null, (data, error) => {
2274
+ try {
2275
+ const displayE = 'flowId is required';
2276
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getFlowUsingGET', displayE);
2277
+ done();
2278
+ } catch (err) {
2279
+ log.error(`Test Failure: ${err}`);
2280
+ done(err);
2281
+ }
2282
+ });
2283
+ } catch (error) {
2284
+ log.error(`Adapter Exception: ${error}`);
2285
+ done(error);
2286
+ }
2287
+ }).timeout(attemptTimeout);
2288
+ it('should error if - missing id', (done) => {
2289
+ try {
2290
+ a.getFlowUsingGET('fakeparam', null, (data, error) => {
2291
+ try {
2292
+ const displayE = 'id is required';
2293
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getFlowUsingGET', displayE);
2294
+ done();
2295
+ } catch (err) {
2296
+ log.error(`Test Failure: ${err}`);
2297
+ done(err);
2298
+ }
2299
+ });
2300
+ } catch (error) {
2301
+ log.error(`Adapter Exception: ${error}`);
2302
+ done(error);
2303
+ }
2304
+ }).timeout(attemptTimeout);
2305
+ });
2306
+
2307
+ describe('#deleteFlowByIdUsingDELETE - errors', () => {
2308
+ it('should have a deleteFlowByIdUsingDELETE function', (done) => {
2309
+ try {
2310
+ assert.equal(true, typeof a.deleteFlowByIdUsingDELETE === 'function');
2311
+ done();
2312
+ } catch (error) {
2313
+ log.error(`Test Failure: ${error}`);
2314
+ done(error);
2315
+ }
2316
+ }).timeout(attemptTimeout);
2317
+ it('should error if - missing flowId', (done) => {
2318
+ try {
2319
+ a.deleteFlowByIdUsingDELETE(null, null, (data, error) => {
2320
+ try {
2321
+ const displayE = 'flowId is required';
2322
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-deleteFlowByIdUsingDELETE', displayE);
2323
+ done();
2324
+ } catch (err) {
2325
+ log.error(`Test Failure: ${err}`);
2326
+ done(err);
2327
+ }
2328
+ });
2329
+ } catch (error) {
2330
+ log.error(`Adapter Exception: ${error}`);
2331
+ done(error);
2332
+ }
2333
+ }).timeout(attemptTimeout);
2334
+ it('should error if - missing id', (done) => {
2335
+ try {
2336
+ a.deleteFlowByIdUsingDELETE('fakeparam', null, (data, error) => {
2337
+ try {
2338
+ const displayE = 'id is required';
2339
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-deleteFlowByIdUsingDELETE', displayE);
2340
+ done();
2341
+ } catch (err) {
2342
+ log.error(`Test Failure: ${err}`);
2343
+ done(err);
2344
+ }
2345
+ });
2346
+ } catch (error) {
2347
+ log.error(`Adapter Exception: ${error}`);
2348
+ done(error);
2349
+ }
2350
+ }).timeout(attemptTimeout);
2351
+ });
2352
+
2353
+ describe('#runConnectivityOnFlowUsingPOST - errors', () => {
2354
+ it('should have a runConnectivityOnFlowUsingPOST function', (done) => {
2355
+ try {
2356
+ assert.equal(true, typeof a.runConnectivityOnFlowUsingPOST === 'function');
2357
+ done();
2358
+ } catch (error) {
2359
+ log.error(`Test Failure: ${error}`);
2360
+ done(error);
2361
+ }
2362
+ }).timeout(attemptTimeout);
2363
+ it('should error if - missing flowId', (done) => {
2364
+ try {
2365
+ a.runConnectivityOnFlowUsingPOST(null, null, (data, error) => {
2366
+ try {
2367
+ const displayE = 'flowId is required';
2368
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-runConnectivityOnFlowUsingPOST', displayE);
2369
+ done();
2370
+ } catch (err) {
2371
+ log.error(`Test Failure: ${err}`);
2372
+ done(err);
2373
+ }
2374
+ });
2375
+ } catch (error) {
2376
+ log.error(`Adapter Exception: ${error}`);
2377
+ done(error);
2378
+ }
2379
+ }).timeout(attemptTimeout);
2380
+ it('should error if - missing id', (done) => {
2381
+ try {
2382
+ a.runConnectivityOnFlowUsingPOST('fakeparam', null, (data, error) => {
2383
+ try {
2384
+ const displayE = 'id is required';
2385
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-runConnectivityOnFlowUsingPOST', displayE);
2386
+ done();
2387
+ } catch (err) {
2388
+ log.error(`Test Failure: ${err}`);
2389
+ done(err);
2390
+ }
2391
+ });
2392
+ } catch (error) {
2393
+ log.error(`Adapter Exception: ${error}`);
2394
+ done(error);
2395
+ }
2396
+ }).timeout(attemptTimeout);
2397
+ });
2398
+
2399
+ describe('#getFlowRisksUsingGET - errors', () => {
2400
+ it('should have a getFlowRisksUsingGET function', (done) => {
2401
+ try {
2402
+ assert.equal(true, typeof a.getFlowRisksUsingGET === 'function');
2403
+ done();
2404
+ } catch (error) {
2405
+ log.error(`Test Failure: ${error}`);
2406
+ done(error);
2407
+ }
2408
+ }).timeout(attemptTimeout);
2409
+ it('should error if - missing flowId', (done) => {
2410
+ try {
2411
+ a.getFlowRisksUsingGET(null, null, (data, error) => {
2412
+ try {
2413
+ const displayE = 'flowId is required';
2414
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getFlowRisksUsingGET', displayE);
2415
+ done();
2416
+ } catch (err) {
2417
+ log.error(`Test Failure: ${err}`);
2418
+ done(err);
2419
+ }
2420
+ });
2421
+ } catch (error) {
2422
+ log.error(`Adapter Exception: ${error}`);
2423
+ done(error);
2424
+ }
2425
+ }).timeout(attemptTimeout);
2426
+ it('should error if - missing id', (done) => {
2427
+ try {
2428
+ a.getFlowRisksUsingGET('fakeparam', null, (data, error) => {
2429
+ try {
2430
+ const displayE = 'id is required';
2431
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getFlowRisksUsingGET', displayE);
2432
+ done();
2433
+ } catch (err) {
2434
+ log.error(`Test Failure: ${err}`);
2435
+ done(err);
2436
+ }
2437
+ });
2438
+ } catch (error) {
2439
+ log.error(`Adapter Exception: ${error}`);
2440
+ done(error);
2441
+ }
2442
+ }).timeout(attemptTimeout);
2443
+ });
2444
+
2445
+ describe('#getAllNetworkObjectsUsingGET - errors', () => {
2446
+ it('should have a getAllNetworkObjectsUsingGET function', (done) => {
2447
+ try {
2448
+ assert.equal(true, typeof a.getAllNetworkObjectsUsingGET === 'function');
2449
+ done();
2450
+ } catch (error) {
2451
+ log.error(`Test Failure: ${error}`);
2452
+ done(error);
2453
+ }
2454
+ }).timeout(attemptTimeout);
2455
+ });
2456
+
2457
+ describe('#findNetworkObjectsByIpUsingGET - errors', () => {
2458
+ it('should have a findNetworkObjectsByIpUsingGET function', (done) => {
2459
+ try {
2460
+ assert.equal(true, typeof a.findNetworkObjectsByIpUsingGET === 'function');
2461
+ done();
2462
+ } catch (error) {
2463
+ log.error(`Test Failure: ${error}`);
2464
+ done(error);
2465
+ }
2466
+ }).timeout(attemptTimeout);
2467
+ it('should error if - missing address', (done) => {
2468
+ try {
2469
+ a.findNetworkObjectsByIpUsingGET(null, null, (data, error) => {
2470
+ try {
2471
+ const displayE = 'address is required';
2472
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-findNetworkObjectsByIpUsingGET', displayE);
2473
+ done();
2474
+ } catch (err) {
2475
+ log.error(`Test Failure: ${err}`);
2476
+ done(err);
2477
+ }
2478
+ });
2479
+ } catch (error) {
2480
+ log.error(`Adapter Exception: ${error}`);
2481
+ done(error);
2482
+ }
2483
+ }).timeout(attemptTimeout);
2484
+ });
2485
+
2486
+ describe('#findNetworkObjectsApplicationsByIpUsingGET - errors', () => {
2487
+ it('should have a findNetworkObjectsApplicationsByIpUsingGET function', (done) => {
2488
+ try {
2489
+ assert.equal(true, typeof a.findNetworkObjectsApplicationsByIpUsingGET === 'function');
2490
+ done();
2491
+ } catch (error) {
2492
+ log.error(`Test Failure: ${error}`);
2493
+ done(error);
2494
+ }
2495
+ }).timeout(attemptTimeout);
2496
+ it('should error if - missing address', (done) => {
2497
+ try {
2498
+ a.findNetworkObjectsApplicationsByIpUsingGET(null, null, (data, error) => {
2499
+ try {
2500
+ const displayE = 'address is required';
2501
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-findNetworkObjectsApplicationsByIpUsingGET', displayE);
2502
+ done();
2503
+ } catch (err) {
2504
+ log.error(`Test Failure: ${err}`);
2505
+ done(err);
2506
+ }
2507
+ });
2508
+ } catch (error) {
2509
+ log.error(`Adapter Exception: ${error}`);
2510
+ done(error);
2511
+ }
2512
+ }).timeout(attemptTimeout);
2513
+ });
2514
+
2515
+ describe('#getNetworkObjectsByNameUsingGET - errors', () => {
2516
+ it('should have a getNetworkObjectsByNameUsingGET function', (done) => {
2517
+ try {
2518
+ assert.equal(true, typeof a.getNetworkObjectsByNameUsingGET === 'function');
2519
+ done();
2520
+ } catch (error) {
2521
+ log.error(`Test Failure: ${error}`);
2522
+ done(error);
2523
+ }
2524
+ }).timeout(attemptTimeout);
2525
+ });
2526
+
2527
+ describe('#createNewEndpointUsingPOST - errors', () => {
2528
+ it('should have a createNewEndpointUsingPOST function', (done) => {
2529
+ try {
2530
+ assert.equal(true, typeof a.createNewEndpointUsingPOST === 'function');
2531
+ done();
2532
+ } catch (error) {
2533
+ log.error(`Test Failure: ${error}`);
2534
+ done(error);
2535
+ }
2536
+ }).timeout(attemptTimeout);
2537
+ it('should error if - missing networkObjectContent', (done) => {
2538
+ try {
2539
+ a.createNewEndpointUsingPOST('fakeparam', null, (data, error) => {
2540
+ try {
2541
+ const displayE = 'networkObjectContent is required';
2542
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-createNewEndpointUsingPOST', displayE);
2543
+ done();
2544
+ } catch (err) {
2545
+ log.error(`Test Failure: ${err}`);
2546
+ done(err);
2547
+ }
2548
+ });
2549
+ } catch (error) {
2550
+ log.error(`Adapter Exception: ${error}`);
2551
+ done(error);
2552
+ }
2553
+ }).timeout(attemptTimeout);
2554
+ });
2555
+
2556
+ describe('#getNetworkObjectByIdUsingGET - errors', () => {
2557
+ it('should have a getNetworkObjectByIdUsingGET function', (done) => {
2558
+ try {
2559
+ assert.equal(true, typeof a.getNetworkObjectByIdUsingGET === 'function');
2560
+ done();
2561
+ } catch (error) {
2562
+ log.error(`Test Failure: ${error}`);
2563
+ done(error);
2564
+ }
2565
+ }).timeout(attemptTimeout);
2566
+ it('should error if - missing id', (done) => {
2567
+ try {
2568
+ a.getNetworkObjectByIdUsingGET(null, (data, error) => {
2569
+ try {
2570
+ const displayE = 'id is required';
2571
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getNetworkObjectByIdUsingGET', displayE);
2572
+ done();
2573
+ } catch (err) {
2574
+ log.error(`Test Failure: ${err}`);
2575
+ done(err);
2576
+ }
2577
+ });
2578
+ } catch (error) {
2579
+ log.error(`Adapter Exception: ${error}`);
2580
+ done(error);
2581
+ }
2582
+ }).timeout(attemptTimeout);
2583
+ });
2584
+
2585
+ describe('#editEndpointUsingPOST - errors', () => {
2586
+ it('should have a editEndpointUsingPOST function', (done) => {
2587
+ try {
2588
+ assert.equal(true, typeof a.editEndpointUsingPOST === 'function');
2589
+ done();
2590
+ } catch (error) {
2591
+ log.error(`Test Failure: ${error}`);
2592
+ done(error);
2593
+ }
2594
+ }).timeout(attemptTimeout);
2595
+ it('should error if - missing id', (done) => {
2596
+ try {
2597
+ a.editEndpointUsingPOST(null, null, (data, error) => {
2598
+ try {
2599
+ const displayE = 'id is required';
2600
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-editEndpointUsingPOST', displayE);
2601
+ done();
2602
+ } catch (err) {
2603
+ log.error(`Test Failure: ${err}`);
2604
+ done(err);
2605
+ }
2606
+ });
2607
+ } catch (error) {
2608
+ log.error(`Adapter Exception: ${error}`);
2609
+ done(error);
2610
+ }
2611
+ }).timeout(attemptTimeout);
2612
+ it('should error if - missing networkObjectsEditContent', (done) => {
2613
+ try {
2614
+ a.editEndpointUsingPOST('fakeparam', null, (data, error) => {
2615
+ try {
2616
+ const displayE = 'networkObjectsEditContent is required';
2617
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-editEndpointUsingPOST', displayE);
2618
+ done();
2619
+ } catch (err) {
2620
+ log.error(`Test Failure: ${err}`);
2621
+ done(err);
2622
+ }
2623
+ });
2624
+ } catch (error) {
2625
+ log.error(`Adapter Exception: ${error}`);
2626
+ done(error);
2627
+ }
2628
+ }).timeout(attemptTimeout);
2629
+ });
2630
+
2631
+ describe('#deleteNetworkObjectByIdUsingDELETE - errors', () => {
2632
+ it('should have a deleteNetworkObjectByIdUsingDELETE function', (done) => {
2633
+ try {
2634
+ assert.equal(true, typeof a.deleteNetworkObjectByIdUsingDELETE === 'function');
2635
+ done();
2636
+ } catch (error) {
2637
+ log.error(`Test Failure: ${error}`);
2638
+ done(error);
2639
+ }
2640
+ }).timeout(attemptTimeout);
2641
+ it('should error if - missing id', (done) => {
2642
+ try {
2643
+ a.deleteNetworkObjectByIdUsingDELETE(null, (data, error) => {
2644
+ try {
2645
+ const displayE = 'id is required';
2646
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-deleteNetworkObjectByIdUsingDELETE', displayE);
2647
+ done();
2648
+ } catch (err) {
2649
+ log.error(`Test Failure: ${err}`);
2650
+ done(err);
2651
+ }
2652
+ });
2653
+ } catch (error) {
2654
+ log.error(`Adapter Exception: ${error}`);
2655
+ done(error);
2656
+ }
2657
+ }).timeout(attemptTimeout);
2658
+ });
2659
+
2660
+ describe('#getNetworkObjectApplicationsUsingGET - errors', () => {
2661
+ it('should have a getNetworkObjectApplicationsUsingGET function', (done) => {
2662
+ try {
2663
+ assert.equal(true, typeof a.getNetworkObjectApplicationsUsingGET === 'function');
2664
+ done();
2665
+ } catch (error) {
2666
+ log.error(`Test Failure: ${error}`);
2667
+ done(error);
2668
+ }
2669
+ }).timeout(attemptTimeout);
2670
+ it('should error if - missing id', (done) => {
2671
+ try {
2672
+ a.getNetworkObjectApplicationsUsingGET(null, (data, error) => {
2673
+ try {
2674
+ const displayE = 'id is required';
2675
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getNetworkObjectApplicationsUsingGET', displayE);
2676
+ done();
2677
+ } catch (err) {
2678
+ log.error(`Test Failure: ${err}`);
2679
+ done(err);
2680
+ }
2681
+ });
2682
+ } catch (error) {
2683
+ log.error(`Adapter Exception: ${error}`);
2684
+ done(error);
2685
+ }
2686
+ }).timeout(attemptTimeout);
2687
+ });
2688
+
2689
+ describe('#replaceAbstractEndpointUsingPOST - errors', () => {
2690
+ it('should have a replaceAbstractEndpointUsingPOST function', (done) => {
2691
+ try {
2692
+ assert.equal(true, typeof a.replaceAbstractEndpointUsingPOST === 'function');
2693
+ done();
2694
+ } catch (error) {
2695
+ log.error(`Test Failure: ${error}`);
2696
+ done(error);
2697
+ }
2698
+ }).timeout(attemptTimeout);
2699
+ it('should error if - missing id', (done) => {
2700
+ try {
2701
+ a.replaceAbstractEndpointUsingPOST(null, null, (data, error) => {
2702
+ try {
2703
+ const displayE = 'id is required';
2704
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-replaceAbstractEndpointUsingPOST', displayE);
2705
+ done();
2706
+ } catch (err) {
2707
+ log.error(`Test Failure: ${err}`);
2708
+ done(err);
2709
+ }
2710
+ });
2711
+ } catch (error) {
2712
+ log.error(`Adapter Exception: ${error}`);
2713
+ done(error);
2714
+ }
2715
+ }).timeout(attemptTimeout);
2716
+ it('should error if - missing replaceObjectInformation', (done) => {
2717
+ try {
2718
+ a.replaceAbstractEndpointUsingPOST('fakeparam', null, (data, error) => {
2719
+ try {
2720
+ const displayE = 'replaceObjectInformation is required';
2721
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-replaceAbstractEndpointUsingPOST', displayE);
2722
+ done();
2723
+ } catch (err) {
2724
+ log.error(`Test Failure: ${err}`);
2725
+ done(err);
2726
+ }
2727
+ });
2728
+ } catch (error) {
2729
+ log.error(`Adapter Exception: ${error}`);
2730
+ done(error);
2731
+ }
2732
+ }).timeout(attemptTimeout);
2733
+ });
2734
+
2735
+ describe('#saveEndpointLabelsUsingPOST - errors', () => {
2736
+ it('should have a saveEndpointLabelsUsingPOST function', (done) => {
2737
+ try {
2738
+ assert.equal(true, typeof a.saveEndpointLabelsUsingPOST === 'function');
2739
+ done();
2740
+ } catch (error) {
2741
+ log.error(`Test Failure: ${error}`);
2742
+ done(error);
2743
+ }
2744
+ }).timeout(attemptTimeout);
2745
+ it('should error if - missing id', (done) => {
2746
+ try {
2747
+ a.saveEndpointLabelsUsingPOST(null, null, (data, error) => {
2748
+ try {
2749
+ const displayE = 'id is required';
2750
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-saveEndpointLabelsUsingPOST', displayE);
2751
+ done();
2752
+ } catch (err) {
2753
+ log.error(`Test Failure: ${err}`);
2754
+ done(err);
2755
+ }
2756
+ });
2757
+ } catch (error) {
2758
+ log.error(`Adapter Exception: ${error}`);
2759
+ done(error);
2760
+ }
2761
+ }).timeout(attemptTimeout);
2762
+ it('should error if - missing labelsRequest', (done) => {
2763
+ try {
2764
+ a.saveEndpointLabelsUsingPOST('fakeparam', null, (data, error) => {
2765
+ try {
2766
+ const displayE = 'labelsRequest is required';
2767
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-saveEndpointLabelsUsingPOST', displayE);
2768
+ done();
2769
+ } catch (err) {
2770
+ log.error(`Test Failure: ${err}`);
2771
+ done(err);
2772
+ }
2773
+ });
2774
+ } catch (error) {
2775
+ log.error(`Adapter Exception: ${error}`);
2776
+ done(error);
2777
+ }
2778
+ }).timeout(attemptTimeout);
2779
+ });
2780
+
2781
+ describe('#syncEndpointUsingPOST - errors', () => {
2782
+ it('should have a syncEndpointUsingPOST function', (done) => {
2783
+ try {
2784
+ assert.equal(true, typeof a.syncEndpointUsingPOST === 'function');
2785
+ done();
2786
+ } catch (error) {
2787
+ log.error(`Test Failure: ${error}`);
2788
+ done(error);
2789
+ }
2790
+ }).timeout(attemptTimeout);
2791
+ it('should error if - missing id', (done) => {
2792
+ try {
2793
+ a.syncEndpointUsingPOST(null, (data, error) => {
2794
+ try {
2795
+ const displayE = 'id is required';
2796
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-syncEndpointUsingPOST', displayE);
2797
+ done();
2798
+ } catch (err) {
2799
+ log.error(`Test Failure: ${err}`);
2800
+ done(err);
2801
+ }
2802
+ });
2803
+ } catch (error) {
2804
+ log.error(`Adapter Exception: ${error}`);
2805
+ done(error);
2806
+ }
2807
+ }).timeout(attemptTimeout);
2808
+ });
2809
+
2810
+ describe('#getNetworkObjectVulnerabilitiesUsingGET - errors', () => {
2811
+ it('should have a getNetworkObjectVulnerabilitiesUsingGET function', (done) => {
2812
+ try {
2813
+ assert.equal(true, typeof a.getNetworkObjectVulnerabilitiesUsingGET === 'function');
2814
+ done();
2815
+ } catch (error) {
2816
+ log.error(`Test Failure: ${error}`);
2817
+ done(error);
2818
+ }
2819
+ }).timeout(attemptTimeout);
2820
+ it('should error if - missing id', (done) => {
2821
+ try {
2822
+ a.getNetworkObjectVulnerabilitiesUsingGET(null, (data, error) => {
2823
+ try {
2824
+ const displayE = 'id is required';
2825
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getNetworkObjectVulnerabilitiesUsingGET', displayE);
2826
+ done();
2827
+ } catch (err) {
2828
+ log.error(`Test Failure: ${err}`);
2829
+ done(err);
2830
+ }
2831
+ });
2832
+ } catch (error) {
2833
+ log.error(`Adapter Exception: ${error}`);
2834
+ done(error);
2835
+ }
2836
+ }).timeout(attemptTimeout);
2837
+ });
2838
+
2839
+ describe('#getAllNetworkServicesUsingGET - errors', () => {
2840
+ it('should have a getAllNetworkServicesUsingGET function', (done) => {
2841
+ try {
2842
+ assert.equal(true, typeof a.getAllNetworkServicesUsingGET === 'function');
2843
+ done();
2844
+ } catch (error) {
2845
+ log.error(`Test Failure: ${error}`);
2846
+ done(error);
2847
+ }
2848
+ }).timeout(attemptTimeout);
2849
+ });
2850
+
2851
+ describe('#getNetworkServiceByNameUsingGET - errors', () => {
2852
+ it('should have a getNetworkServiceByNameUsingGET function', (done) => {
2853
+ try {
2854
+ assert.equal(true, typeof a.getNetworkServiceByNameUsingGET === 'function');
2855
+ done();
2856
+ } catch (error) {
2857
+ log.error(`Test Failure: ${error}`);
2858
+ done(error);
2859
+ }
2860
+ }).timeout(attemptTimeout);
2861
+ });
2862
+
2863
+ describe('#createNewNetworkServiceUsingPOST - errors', () => {
2864
+ it('should have a createNewNetworkServiceUsingPOST function', (done) => {
2865
+ try {
2866
+ assert.equal(true, typeof a.createNewNetworkServiceUsingPOST === 'function');
2867
+ done();
2868
+ } catch (error) {
2869
+ log.error(`Test Failure: ${error}`);
2870
+ done(error);
2871
+ }
2872
+ }).timeout(attemptTimeout);
2873
+ it('should error if - missing networkServiceRequest', (done) => {
2874
+ try {
2875
+ a.createNewNetworkServiceUsingPOST(null, (data, error) => {
2876
+ try {
2877
+ const displayE = 'networkServiceRequest is required';
2878
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-createNewNetworkServiceUsingPOST', displayE);
2879
+ done();
2880
+ } catch (err) {
2881
+ log.error(`Test Failure: ${err}`);
2882
+ done(err);
2883
+ }
2884
+ });
2885
+ } catch (error) {
2886
+ log.error(`Adapter Exception: ${error}`);
2887
+ done(error);
2888
+ }
2889
+ }).timeout(attemptTimeout);
2890
+ });
2891
+
2892
+ describe('#getNetworkServiceByIdUsingGET - errors', () => {
2893
+ it('should have a getNetworkServiceByIdUsingGET function', (done) => {
2894
+ try {
2895
+ assert.equal(true, typeof a.getNetworkServiceByIdUsingGET === 'function');
2896
+ done();
2897
+ } catch (error) {
2898
+ log.error(`Test Failure: ${error}`);
2899
+ done(error);
2900
+ }
2901
+ }).timeout(attemptTimeout);
2902
+ it('should error if - missing id', (done) => {
2903
+ try {
2904
+ a.getNetworkServiceByIdUsingGET(null, (data, error) => {
2905
+ try {
2906
+ const displayE = 'id is required';
2907
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getNetworkServiceByIdUsingGET', displayE);
2908
+ done();
2909
+ } catch (err) {
2910
+ log.error(`Test Failure: ${err}`);
2911
+ done(err);
2912
+ }
2913
+ });
2914
+ } catch (error) {
2915
+ log.error(`Adapter Exception: ${error}`);
2916
+ done(error);
2917
+ }
2918
+ }).timeout(attemptTimeout);
2919
+ });
2920
+
2921
+ describe('#editNetworkServiceUsingPOST - errors', () => {
2922
+ it('should have a editNetworkServiceUsingPOST function', (done) => {
2923
+ try {
2924
+ assert.equal(true, typeof a.editNetworkServiceUsingPOST === 'function');
2925
+ done();
2926
+ } catch (error) {
2927
+ log.error(`Test Failure: ${error}`);
2928
+ done(error);
2929
+ }
2930
+ }).timeout(attemptTimeout);
2931
+ it('should error if - missing id', (done) => {
2932
+ try {
2933
+ a.editNetworkServiceUsingPOST(null, null, (data, error) => {
2934
+ try {
2935
+ const displayE = 'id is required';
2936
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-editNetworkServiceUsingPOST', displayE);
2937
+ done();
2938
+ } catch (err) {
2939
+ log.error(`Test Failure: ${err}`);
2940
+ done(err);
2941
+ }
2942
+ });
2943
+ } catch (error) {
2944
+ log.error(`Adapter Exception: ${error}`);
2945
+ done(error);
2946
+ }
2947
+ }).timeout(attemptTimeout);
2948
+ it('should error if - missing request', (done) => {
2949
+ try {
2950
+ a.editNetworkServiceUsingPOST('fakeparam', null, (data, error) => {
2951
+ try {
2952
+ const displayE = 'request is required';
2953
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-editNetworkServiceUsingPOST', displayE);
2954
+ done();
2955
+ } catch (err) {
2956
+ log.error(`Test Failure: ${err}`);
2957
+ done(err);
2958
+ }
2959
+ });
2960
+ } catch (error) {
2961
+ log.error(`Adapter Exception: ${error}`);
2962
+ done(error);
2963
+ }
2964
+ }).timeout(attemptTimeout);
2965
+ });
2966
+
2967
+ describe('#deleteNetworkServiceByIdUsingDELETE - errors', () => {
2968
+ it('should have a deleteNetworkServiceByIdUsingDELETE function', (done) => {
2969
+ try {
2970
+ assert.equal(true, typeof a.deleteNetworkServiceByIdUsingDELETE === 'function');
2971
+ done();
2972
+ } catch (error) {
2973
+ log.error(`Test Failure: ${error}`);
2974
+ done(error);
2975
+ }
2976
+ }).timeout(attemptTimeout);
2977
+ it('should error if - missing id', (done) => {
2978
+ try {
2979
+ a.deleteNetworkServiceByIdUsingDELETE(null, (data, error) => {
2980
+ try {
2981
+ const displayE = 'id is required';
2982
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-deleteNetworkServiceByIdUsingDELETE', displayE);
2983
+ done();
2984
+ } catch (err) {
2985
+ log.error(`Test Failure: ${err}`);
2986
+ done(err);
2987
+ }
2988
+ });
2989
+ } catch (error) {
2990
+ log.error(`Adapter Exception: ${error}`);
2991
+ done(error);
2992
+ }
2993
+ }).timeout(attemptTimeout);
2994
+ });
2995
+
2996
+ describe('#syncServiceObjectUsingPOST - errors', () => {
2997
+ it('should have a syncServiceObjectUsingPOST function', (done) => {
2998
+ try {
2999
+ assert.equal(true, typeof a.syncServiceObjectUsingPOST === 'function');
3000
+ done();
3001
+ } catch (error) {
3002
+ log.error(`Test Failure: ${error}`);
3003
+ done(error);
3004
+ }
3005
+ }).timeout(attemptTimeout);
3006
+ it('should error if - missing id', (done) => {
3007
+ try {
3008
+ a.syncServiceObjectUsingPOST(null, (data, error) => {
3009
+ try {
3010
+ const displayE = 'id is required';
3011
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-syncServiceObjectUsingPOST', displayE);
3012
+ done();
3013
+ } catch (err) {
3014
+ log.error(`Test Failure: ${err}`);
3015
+ done(err);
3016
+ }
3017
+ });
3018
+ } catch (error) {
3019
+ log.error(`Adapter Exception: ${error}`);
3020
+ done(error);
3021
+ }
3022
+ }).timeout(attemptTimeout);
3023
+ });
3024
+
3025
+ describe('#getDefaultPermissionsUsingGET - errors', () => {
3026
+ it('should have a getDefaultPermissionsUsingGET function', (done) => {
3027
+ try {
3028
+ assert.equal(true, typeof a.getDefaultPermissionsUsingGET === 'function');
3029
+ done();
3030
+ } catch (error) {
3031
+ log.error(`Test Failure: ${error}`);
3032
+ done(error);
3033
+ }
3034
+ }).timeout(attemptTimeout);
3035
+ });
3036
+
3037
+ describe('#getRoleUsingGET - errors', () => {
3038
+ it('should have a getRoleUsingGET function', (done) => {
3039
+ try {
3040
+ assert.equal(true, typeof a.getRoleUsingGET === 'function');
3041
+ done();
3042
+ } catch (error) {
3043
+ log.error(`Test Failure: ${error}`);
3044
+ done(error);
3045
+ }
3046
+ }).timeout(attemptTimeout);
3047
+ it('should error if - missing name', (done) => {
3048
+ try {
3049
+ a.getRoleUsingGET(null, (data, error) => {
3050
+ try {
3051
+ const displayE = 'name is required';
3052
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getRoleUsingGET', displayE);
3053
+ done();
3054
+ } catch (err) {
3055
+ log.error(`Test Failure: ${err}`);
3056
+ done(err);
3057
+ }
3058
+ });
3059
+ } catch (error) {
3060
+ log.error(`Adapter Exception: ${error}`);
3061
+ done(error);
3062
+ }
3063
+ }).timeout(attemptTimeout);
3064
+ });
3065
+
3066
+ describe('#changeRolePermissionsUsingPOST - errors', () => {
3067
+ it('should have a changeRolePermissionsUsingPOST function', (done) => {
3068
+ try {
3069
+ assert.equal(true, typeof a.changeRolePermissionsUsingPOST === 'function');
3070
+ done();
3071
+ } catch (error) {
3072
+ log.error(`Test Failure: ${error}`);
3073
+ done(error);
3074
+ }
3075
+ }).timeout(attemptTimeout);
3076
+ it('should error if - missing apiRolePermChanges', (done) => {
3077
+ try {
3078
+ a.changeRolePermissionsUsingPOST(null, null, (data, error) => {
3079
+ try {
3080
+ const displayE = 'apiRolePermChanges is required';
3081
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-changeRolePermissionsUsingPOST', displayE);
3082
+ done();
3083
+ } catch (err) {
3084
+ log.error(`Test Failure: ${err}`);
3085
+ done(err);
3086
+ }
3087
+ });
3088
+ } catch (error) {
3089
+ log.error(`Adapter Exception: ${error}`);
3090
+ done(error);
3091
+ }
3092
+ }).timeout(attemptTimeout);
3093
+ it('should error if - missing name', (done) => {
3094
+ try {
3095
+ a.changeRolePermissionsUsingPOST('fakeparam', null, (data, error) => {
3096
+ try {
3097
+ const displayE = 'name is required';
3098
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-changeRolePermissionsUsingPOST', displayE);
3099
+ done();
3100
+ } catch (err) {
3101
+ log.error(`Test Failure: ${err}`);
3102
+ done(err);
3103
+ }
3104
+ });
3105
+ } catch (error) {
3106
+ log.error(`Adapter Exception: ${error}`);
3107
+ done(error);
3108
+ }
3109
+ }).timeout(attemptTimeout);
3110
+ });
3111
+
3112
+ describe('#deleteRoleUsingDELETE - errors', () => {
3113
+ it('should have a deleteRoleUsingDELETE function', (done) => {
3114
+ try {
3115
+ assert.equal(true, typeof a.deleteRoleUsingDELETE === 'function');
3116
+ done();
3117
+ } catch (error) {
3118
+ log.error(`Test Failure: ${error}`);
3119
+ done(error);
3120
+ }
3121
+ }).timeout(attemptTimeout);
3122
+ it('should error if - missing name', (done) => {
3123
+ try {
3124
+ a.deleteRoleUsingDELETE(null, (data, error) => {
3125
+ try {
3126
+ const displayE = 'name is required';
3127
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-deleteRoleUsingDELETE', displayE);
3128
+ done();
3129
+ } catch (err) {
3130
+ log.error(`Test Failure: ${err}`);
3131
+ done(err);
3132
+ }
3133
+ });
3134
+ } catch (error) {
3135
+ log.error(`Adapter Exception: ${error}`);
3136
+ done(error);
3137
+ }
3138
+ }).timeout(attemptTimeout);
3139
+ });
3140
+
3141
+ describe('#createRoleUsingPOST - errors', () => {
3142
+ it('should have a createRoleUsingPOST function', (done) => {
3143
+ try {
3144
+ assert.equal(true, typeof a.createRoleUsingPOST === 'function');
3145
+ done();
3146
+ } catch (error) {
3147
+ log.error(`Test Failure: ${error}`);
3148
+ done(error);
3149
+ }
3150
+ }).timeout(attemptTimeout);
3151
+ it('should error if - missing apiNewRole', (done) => {
3152
+ try {
3153
+ a.createRoleUsingPOST(null, (data, error) => {
3154
+ try {
3155
+ const displayE = 'apiNewRole is required';
3156
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-createRoleUsingPOST', displayE);
3157
+ done();
3158
+ } catch (err) {
3159
+ log.error(`Test Failure: ${err}`);
3160
+ done(err);
3161
+ }
3162
+ });
3163
+ } catch (error) {
3164
+ log.error(`Adapter Exception: ${error}`);
3165
+ done(error);
3166
+ }
3167
+ }).timeout(attemptTimeout);
3168
+ });
3169
+
3170
+ describe('#getUserPermissionsUsingGET - errors', () => {
3171
+ it('should have a getUserPermissionsUsingGET function', (done) => {
3172
+ try {
3173
+ assert.equal(true, typeof a.getUserPermissionsUsingGET === 'function');
3174
+ done();
3175
+ } catch (error) {
3176
+ log.error(`Test Failure: ${error}`);
3177
+ done(error);
3178
+ }
3179
+ }).timeout(attemptTimeout);
3180
+ it('should error if - missing name', (done) => {
3181
+ try {
3182
+ a.getUserPermissionsUsingGET(null, (data, error) => {
3183
+ try {
3184
+ const displayE = 'name is required';
3185
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getUserPermissionsUsingGET', displayE);
3186
+ done();
3187
+ } catch (err) {
3188
+ log.error(`Test Failure: ${err}`);
3189
+ done(err);
3190
+ }
3191
+ });
3192
+ } catch (error) {
3193
+ log.error(`Adapter Exception: ${error}`);
3194
+ done(error);
3195
+ }
3196
+ }).timeout(attemptTimeout);
3197
+ });
3198
+
3199
+ describe('#changeUserPermissionsUsingPOST - errors', () => {
3200
+ it('should have a changeUserPermissionsUsingPOST function', (done) => {
3201
+ try {
3202
+ assert.equal(true, typeof a.changeUserPermissionsUsingPOST === 'function');
3203
+ done();
3204
+ } catch (error) {
3205
+ log.error(`Test Failure: ${error}`);
3206
+ done(error);
3207
+ }
3208
+ }).timeout(attemptTimeout);
3209
+ it('should error if - missing apiPermissionChanges', (done) => {
3210
+ try {
3211
+ a.changeUserPermissionsUsingPOST(null, null, (data, error) => {
3212
+ try {
3213
+ const displayE = 'apiPermissionChanges is required';
3214
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-changeUserPermissionsUsingPOST', displayE);
3215
+ done();
3216
+ } catch (err) {
3217
+ log.error(`Test Failure: ${err}`);
3218
+ done(err);
3219
+ }
3220
+ });
3221
+ } catch (error) {
3222
+ log.error(`Adapter Exception: ${error}`);
3223
+ done(error);
3224
+ }
3225
+ }).timeout(attemptTimeout);
3226
+ it('should error if - missing name', (done) => {
3227
+ try {
3228
+ a.changeUserPermissionsUsingPOST('fakeparam', null, (data, error) => {
3229
+ try {
3230
+ const displayE = 'name is required';
3231
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-changeUserPermissionsUsingPOST', displayE);
3232
+ done();
3233
+ } catch (err) {
3234
+ log.error(`Test Failure: ${err}`);
3235
+ done(err);
3236
+ }
3237
+ });
3238
+ } catch (error) {
3239
+ log.error(`Adapter Exception: ${error}`);
3240
+ done(error);
3241
+ }
3242
+ }).timeout(attemptTimeout);
3243
+ });
3244
+
3245
+ describe('#getUserPermittedApplicationsUsingGET - errors', () => {
3246
+ it('should have a getUserPermittedApplicationsUsingGET function', (done) => {
3247
+ try {
3248
+ assert.equal(true, typeof a.getUserPermittedApplicationsUsingGET === 'function');
3249
+ done();
3250
+ } catch (error) {
3251
+ log.error(`Test Failure: ${error}`);
3252
+ done(error);
3253
+ }
3254
+ }).timeout(attemptTimeout);
3255
+ it('should error if - missing id', (done) => {
3256
+ try {
3257
+ a.getUserPermittedApplicationsUsingGET(null, null, (data, error) => {
3258
+ try {
3259
+ const displayE = 'id is required';
3260
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getUserPermittedApplicationsUsingGET', displayE);
3261
+ done();
3262
+ } catch (err) {
3263
+ log.error(`Test Failure: ${err}`);
3264
+ done(err);
3265
+ }
3266
+ });
3267
+ } catch (error) {
3268
+ log.error(`Adapter Exception: ${error}`);
3269
+ done(error);
3270
+ }
3271
+ }).timeout(attemptTimeout);
3272
+ it('should error if - missing name', (done) => {
3273
+ try {
3274
+ a.getUserPermittedApplicationsUsingGET('fakeparam', null, (data, error) => {
3275
+ try {
3276
+ const displayE = 'name is required';
3277
+ runErrorAsserts(data, error, 'AD.300', 'Test-algosec_appviz-adapter-getUserPermittedApplicationsUsingGET', displayE);
3278
+ done();
3279
+ } catch (err) {
3280
+ log.error(`Test Failure: ${err}`);
3281
+ done(err);
3282
+ }
3283
+ });
3284
+ } catch (error) {
3285
+ log.error(`Adapter Exception: ${error}`);
3286
+ done(error);
3287
+ }
3288
+ }).timeout(attemptTimeout);
3289
+ });
3290
+ });
3291
+ });