@itentialopensource/adapter-kentik 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 (91) 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 +7518 -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/ASGroupService/action.json +106 -0
  28. package/entities/ASGroupService/schema.json +34 -0
  29. package/entities/BgpMonitoringAdminService/action.json +126 -0
  30. package/entities/BgpMonitoringAdminService/schema.json +24 -0
  31. package/entities/BgpMonitoringDataService/action.json +44 -0
  32. package/entities/BgpMonitoringDataService/schema.json +20 -0
  33. package/entities/CapacityPlanService/action.json +88 -0
  34. package/entities/CapacityPlanService/schema.json +22 -0
  35. package/entities/CloudExportAdminService/action.json +106 -0
  36. package/entities/CloudExportAdminService/schema.json +34 -0
  37. package/entities/InterfaceService/action.json +126 -0
  38. package/entities/InterfaceService/schema.json +101 -0
  39. package/entities/KmiService/action.json +65 -0
  40. package/entities/KmiService/schema.json +21 -0
  41. package/entities/LabelService/action.json +85 -0
  42. package/entities/LabelService/schema.json +22 -0
  43. package/entities/NetworkClassService/action.json +45 -0
  44. package/entities/NetworkClassService/schema.json +20 -0
  45. package/entities/NotificationChannelService/action.json +66 -0
  46. package/entities/NotificationChannelService/schema.json +21 -0
  47. package/entities/PackageService/action.json +126 -0
  48. package/entities/PackageService/schema.json +24 -0
  49. package/entities/SiteService/action.json +208 -0
  50. package/entities/SiteService/schema.json +28 -0
  51. package/entities/SyntheticsAdminService/action.json +208 -0
  52. package/entities/SyntheticsAdminService/schema.json +39 -0
  53. package/entities/SyntheticsDataService/action.json +44 -0
  54. package/entities/SyntheticsDataService/schema.json +20 -0
  55. package/entities/TenantService/action.json +126 -0
  56. package/entities/TenantService/schema.json +24 -0
  57. package/entities/UserService/action.json +146 -0
  58. package/entities/UserService/schema.json +25 -0
  59. package/error.json +190 -0
  60. package/package.json +85 -0
  61. package/pronghorn.json +9793 -0
  62. package/propertiesDecorators.json +14 -0
  63. package/propertiesSchema.json +1248 -0
  64. package/refs?service=git-upload-pack +0 -0
  65. package/report/creationReport.json +840 -0
  66. package/report/kentik-openapi-combined.json +8602 -0
  67. package/sampleProperties.json +203 -0
  68. package/test/integration/adapterTestBasicGet.js +83 -0
  69. package/test/integration/adapterTestConnectivity.js +93 -0
  70. package/test/integration/adapterTestIntegration.js +3869 -0
  71. package/test/unit/adapterBaseTestUnit.js +949 -0
  72. package/test/unit/adapterTestUnit.js +3728 -0
  73. package/utils/adapterInfo.js +206 -0
  74. package/utils/addAuth.js +94 -0
  75. package/utils/artifactize.js +146 -0
  76. package/utils/basicGet.js +50 -0
  77. package/utils/checkMigrate.js +63 -0
  78. package/utils/entitiesToDB.js +178 -0
  79. package/utils/findPath.js +74 -0
  80. package/utils/methodDocumentor.js +225 -0
  81. package/utils/modify.js +154 -0
  82. package/utils/packModificationScript.js +35 -0
  83. package/utils/patches2bundledDeps.js +90 -0
  84. package/utils/pre-commit.sh +32 -0
  85. package/utils/removeHooks.js +20 -0
  86. package/utils/setup.js +33 -0
  87. package/utils/tbScript.js +246 -0
  88. package/utils/tbUtils.js +490 -0
  89. package/utils/testRunner.js +298 -0
  90. package/utils/troubleshootingAdapter.js +195 -0
  91. package/workflows/README.md +3 -0
@@ -0,0 +1,3728 @@
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-kentik',
59
+ type: 'Kentik',
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 Kentik = 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] Kentik Adapter Test', () => {
136
+ describe('Kentik Class Tests', () => {
137
+ const a = new Kentik(
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('kentik'));
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('kentik'));
361
+ assert.equal('Adapter', pronghornDotJson.type);
362
+ assert.equal('Kentik', pronghornDotJson.export);
363
+ assert.equal('Kentik', 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-kentik', 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('kentik'));
761
+ assert.equal('Kentik', 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('#listASGroups - errors', () => {
1312
+ it('should have a listASGroups function', (done) => {
1313
+ try {
1314
+ assert.equal(true, typeof a.listASGroups === 'function');
1315
+ done();
1316
+ } catch (error) {
1317
+ log.error(`Test Failure: ${error}`);
1318
+ done(error);
1319
+ }
1320
+ }).timeout(attemptTimeout);
1321
+ });
1322
+
1323
+ describe('#createASGroup - errors', () => {
1324
+ it('should have a createASGroup function', (done) => {
1325
+ try {
1326
+ assert.equal(true, typeof a.createASGroup === 'function');
1327
+ done();
1328
+ } catch (error) {
1329
+ log.error(`Test Failure: ${error}`);
1330
+ done(error);
1331
+ }
1332
+ }).timeout(attemptTimeout);
1333
+ it('should error if - missing body', (done) => {
1334
+ try {
1335
+ a.createASGroup(null, (data, error) => {
1336
+ try {
1337
+ const displayE = 'body is required';
1338
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-createASGroup', displayE);
1339
+ done();
1340
+ } catch (err) {
1341
+ log.error(`Test Failure: ${err}`);
1342
+ done(err);
1343
+ }
1344
+ });
1345
+ } catch (error) {
1346
+ log.error(`Adapter Exception: ${error}`);
1347
+ done(error);
1348
+ }
1349
+ }).timeout(attemptTimeout);
1350
+ });
1351
+
1352
+ describe('#updateASGroup - errors', () => {
1353
+ it('should have a updateASGroup function', (done) => {
1354
+ try {
1355
+ assert.equal(true, typeof a.updateASGroup === 'function');
1356
+ done();
1357
+ } catch (error) {
1358
+ log.error(`Test Failure: ${error}`);
1359
+ done(error);
1360
+ }
1361
+ }).timeout(attemptTimeout);
1362
+ it('should error if - missing asGroupId', (done) => {
1363
+ try {
1364
+ a.updateASGroup(null, null, (data, error) => {
1365
+ try {
1366
+ const displayE = 'asGroupId is required';
1367
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-updateASGroup', displayE);
1368
+ done();
1369
+ } catch (err) {
1370
+ log.error(`Test Failure: ${err}`);
1371
+ done(err);
1372
+ }
1373
+ });
1374
+ } catch (error) {
1375
+ log.error(`Adapter Exception: ${error}`);
1376
+ done(error);
1377
+ }
1378
+ }).timeout(attemptTimeout);
1379
+ it('should error if - missing body', (done) => {
1380
+ try {
1381
+ a.updateASGroup('fakeparam', null, (data, error) => {
1382
+ try {
1383
+ const displayE = 'body is required';
1384
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-updateASGroup', displayE);
1385
+ done();
1386
+ } catch (err) {
1387
+ log.error(`Test Failure: ${err}`);
1388
+ done(err);
1389
+ }
1390
+ });
1391
+ } catch (error) {
1392
+ log.error(`Adapter Exception: ${error}`);
1393
+ done(error);
1394
+ }
1395
+ }).timeout(attemptTimeout);
1396
+ });
1397
+
1398
+ describe('#getASGroup - errors', () => {
1399
+ it('should have a getASGroup function', (done) => {
1400
+ try {
1401
+ assert.equal(true, typeof a.getASGroup === 'function');
1402
+ done();
1403
+ } catch (error) {
1404
+ log.error(`Test Failure: ${error}`);
1405
+ done(error);
1406
+ }
1407
+ }).timeout(attemptTimeout);
1408
+ it('should error if - missing asGroupId', (done) => {
1409
+ try {
1410
+ a.getASGroup(null, (data, error) => {
1411
+ try {
1412
+ const displayE = 'asGroupId is required';
1413
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getASGroup', displayE);
1414
+ done();
1415
+ } catch (err) {
1416
+ log.error(`Test Failure: ${err}`);
1417
+ done(err);
1418
+ }
1419
+ });
1420
+ } catch (error) {
1421
+ log.error(`Adapter Exception: ${error}`);
1422
+ done(error);
1423
+ }
1424
+ }).timeout(attemptTimeout);
1425
+ });
1426
+
1427
+ describe('#deleteASGroup - errors', () => {
1428
+ it('should have a deleteASGroup function', (done) => {
1429
+ try {
1430
+ assert.equal(true, typeof a.deleteASGroup === 'function');
1431
+ done();
1432
+ } catch (error) {
1433
+ log.error(`Test Failure: ${error}`);
1434
+ done(error);
1435
+ }
1436
+ }).timeout(attemptTimeout);
1437
+ it('should error if - missing asGroupId', (done) => {
1438
+ try {
1439
+ a.deleteASGroup(null, (data, error) => {
1440
+ try {
1441
+ const displayE = 'asGroupId is required';
1442
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-deleteASGroup', displayE);
1443
+ done();
1444
+ } catch (err) {
1445
+ log.error(`Test Failure: ${err}`);
1446
+ done(err);
1447
+ }
1448
+ });
1449
+ } catch (error) {
1450
+ log.error(`Adapter Exception: ${error}`);
1451
+ done(error);
1452
+ }
1453
+ }).timeout(attemptTimeout);
1454
+ });
1455
+
1456
+ describe('#listMonitors - errors', () => {
1457
+ it('should have a listMonitors function', (done) => {
1458
+ try {
1459
+ assert.equal(true, typeof a.listMonitors === 'function');
1460
+ done();
1461
+ } catch (error) {
1462
+ log.error(`Test Failure: ${error}`);
1463
+ done(error);
1464
+ }
1465
+ }).timeout(attemptTimeout);
1466
+ });
1467
+
1468
+ describe('#createMonitor - errors', () => {
1469
+ it('should have a createMonitor function', (done) => {
1470
+ try {
1471
+ assert.equal(true, typeof a.createMonitor === 'function');
1472
+ done();
1473
+ } catch (error) {
1474
+ log.error(`Test Failure: ${error}`);
1475
+ done(error);
1476
+ }
1477
+ }).timeout(attemptTimeout);
1478
+ it('should error if - missing body', (done) => {
1479
+ try {
1480
+ a.createMonitor(null, (data, error) => {
1481
+ try {
1482
+ const displayE = 'body is required';
1483
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-createMonitor', displayE);
1484
+ done();
1485
+ } catch (err) {
1486
+ log.error(`Test Failure: ${err}`);
1487
+ done(err);
1488
+ }
1489
+ });
1490
+ } catch (error) {
1491
+ log.error(`Adapter Exception: ${error}`);
1492
+ done(error);
1493
+ }
1494
+ }).timeout(attemptTimeout);
1495
+ });
1496
+
1497
+ describe('#getMonitor - errors', () => {
1498
+ it('should have a getMonitor function', (done) => {
1499
+ try {
1500
+ assert.equal(true, typeof a.getMonitor === 'function');
1501
+ done();
1502
+ } catch (error) {
1503
+ log.error(`Test Failure: ${error}`);
1504
+ done(error);
1505
+ }
1506
+ }).timeout(attemptTimeout);
1507
+ it('should error if - missing id', (done) => {
1508
+ try {
1509
+ a.getMonitor(null, (data, error) => {
1510
+ try {
1511
+ const displayE = 'id is required';
1512
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getMonitor', displayE);
1513
+ done();
1514
+ } catch (err) {
1515
+ log.error(`Test Failure: ${err}`);
1516
+ done(err);
1517
+ }
1518
+ });
1519
+ } catch (error) {
1520
+ log.error(`Adapter Exception: ${error}`);
1521
+ done(error);
1522
+ }
1523
+ }).timeout(attemptTimeout);
1524
+ });
1525
+
1526
+ describe('#deleteMonitor - errors', () => {
1527
+ it('should have a deleteMonitor function', (done) => {
1528
+ try {
1529
+ assert.equal(true, typeof a.deleteMonitor === 'function');
1530
+ done();
1531
+ } catch (error) {
1532
+ log.error(`Test Failure: ${error}`);
1533
+ done(error);
1534
+ }
1535
+ }).timeout(attemptTimeout);
1536
+ it('should error if - missing id', (done) => {
1537
+ try {
1538
+ a.deleteMonitor(null, (data, error) => {
1539
+ try {
1540
+ const displayE = 'id is required';
1541
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-deleteMonitor', displayE);
1542
+ done();
1543
+ } catch (err) {
1544
+ log.error(`Test Failure: ${err}`);
1545
+ done(err);
1546
+ }
1547
+ });
1548
+ } catch (error) {
1549
+ log.error(`Adapter Exception: ${error}`);
1550
+ done(error);
1551
+ }
1552
+ }).timeout(attemptTimeout);
1553
+ });
1554
+
1555
+ describe('#updateMonitor - errors', () => {
1556
+ it('should have a updateMonitor function', (done) => {
1557
+ try {
1558
+ assert.equal(true, typeof a.updateMonitor === 'function');
1559
+ done();
1560
+ } catch (error) {
1561
+ log.error(`Test Failure: ${error}`);
1562
+ done(error);
1563
+ }
1564
+ }).timeout(attemptTimeout);
1565
+ it('should error if - missing id', (done) => {
1566
+ try {
1567
+ a.updateMonitor(null, null, (data, error) => {
1568
+ try {
1569
+ const displayE = 'id is required';
1570
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-updateMonitor', displayE);
1571
+ done();
1572
+ } catch (err) {
1573
+ log.error(`Test Failure: ${err}`);
1574
+ done(err);
1575
+ }
1576
+ });
1577
+ } catch (error) {
1578
+ log.error(`Adapter Exception: ${error}`);
1579
+ done(error);
1580
+ }
1581
+ }).timeout(attemptTimeout);
1582
+ it('should error if - missing body', (done) => {
1583
+ try {
1584
+ a.updateMonitor('fakeparam', null, (data, error) => {
1585
+ try {
1586
+ const displayE = 'body is required';
1587
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-updateMonitor', displayE);
1588
+ done();
1589
+ } catch (err) {
1590
+ log.error(`Test Failure: ${err}`);
1591
+ done(err);
1592
+ }
1593
+ });
1594
+ } catch (error) {
1595
+ log.error(`Adapter Exception: ${error}`);
1596
+ done(error);
1597
+ }
1598
+ }).timeout(attemptTimeout);
1599
+ });
1600
+
1601
+ describe('#setMonitorStatus - errors', () => {
1602
+ it('should have a setMonitorStatus function', (done) => {
1603
+ try {
1604
+ assert.equal(true, typeof a.setMonitorStatus === 'function');
1605
+ done();
1606
+ } catch (error) {
1607
+ log.error(`Test Failure: ${error}`);
1608
+ done(error);
1609
+ }
1610
+ }).timeout(attemptTimeout);
1611
+ it('should error if - missing id', (done) => {
1612
+ try {
1613
+ a.setMonitorStatus(null, null, (data, error) => {
1614
+ try {
1615
+ const displayE = 'id is required';
1616
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-setMonitorStatus', displayE);
1617
+ done();
1618
+ } catch (err) {
1619
+ log.error(`Test Failure: ${err}`);
1620
+ done(err);
1621
+ }
1622
+ });
1623
+ } catch (error) {
1624
+ log.error(`Adapter Exception: ${error}`);
1625
+ done(error);
1626
+ }
1627
+ }).timeout(attemptTimeout);
1628
+ it('should error if - missing body', (done) => {
1629
+ try {
1630
+ a.setMonitorStatus('fakeparam', null, (data, error) => {
1631
+ try {
1632
+ const displayE = 'body is required';
1633
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-setMonitorStatus', displayE);
1634
+ done();
1635
+ } catch (err) {
1636
+ log.error(`Test Failure: ${err}`);
1637
+ done(err);
1638
+ }
1639
+ });
1640
+ } catch (error) {
1641
+ log.error(`Adapter Exception: ${error}`);
1642
+ done(error);
1643
+ }
1644
+ }).timeout(attemptTimeout);
1645
+ });
1646
+
1647
+ describe('#getMetricsForTarget - errors', () => {
1648
+ it('should have a getMetricsForTarget function', (done) => {
1649
+ try {
1650
+ assert.equal(true, typeof a.getMetricsForTarget === 'function');
1651
+ done();
1652
+ } catch (error) {
1653
+ log.error(`Test Failure: ${error}`);
1654
+ done(error);
1655
+ }
1656
+ }).timeout(attemptTimeout);
1657
+ it('should error if - missing body', (done) => {
1658
+ try {
1659
+ a.getMetricsForTarget(null, (data, error) => {
1660
+ try {
1661
+ const displayE = 'body is required';
1662
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getMetricsForTarget', displayE);
1663
+ done();
1664
+ } catch (err) {
1665
+ log.error(`Test Failure: ${err}`);
1666
+ done(err);
1667
+ }
1668
+ });
1669
+ } catch (error) {
1670
+ log.error(`Adapter Exception: ${error}`);
1671
+ done(error);
1672
+ }
1673
+ }).timeout(attemptTimeout);
1674
+ });
1675
+
1676
+ describe('#getRoutesForTarget - errors', () => {
1677
+ it('should have a getRoutesForTarget function', (done) => {
1678
+ try {
1679
+ assert.equal(true, typeof a.getRoutesForTarget === 'function');
1680
+ done();
1681
+ } catch (error) {
1682
+ log.error(`Test Failure: ${error}`);
1683
+ done(error);
1684
+ }
1685
+ }).timeout(attemptTimeout);
1686
+ it('should error if - missing body', (done) => {
1687
+ try {
1688
+ a.getRoutesForTarget(null, (data, error) => {
1689
+ try {
1690
+ const displayE = 'body is required';
1691
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getRoutesForTarget', displayE);
1692
+ done();
1693
+ } catch (err) {
1694
+ log.error(`Test Failure: ${err}`);
1695
+ done(err);
1696
+ }
1697
+ });
1698
+ } catch (error) {
1699
+ log.error(`Adapter Exception: ${error}`);
1700
+ done(error);
1701
+ }
1702
+ }).timeout(attemptTimeout);
1703
+ });
1704
+
1705
+ describe('#listCapacityPlans - errors', () => {
1706
+ it('should have a listCapacityPlans function', (done) => {
1707
+ try {
1708
+ assert.equal(true, typeof a.listCapacityPlans === 'function');
1709
+ done();
1710
+ } catch (error) {
1711
+ log.error(`Test Failure: ${error}`);
1712
+ done(error);
1713
+ }
1714
+ }).timeout(attemptTimeout);
1715
+ });
1716
+
1717
+ describe('#listCapacitySummaries - errors', () => {
1718
+ it('should have a listCapacitySummaries function', (done) => {
1719
+ try {
1720
+ assert.equal(true, typeof a.listCapacitySummaries === 'function');
1721
+ done();
1722
+ } catch (error) {
1723
+ log.error(`Test Failure: ${error}`);
1724
+ done(error);
1725
+ }
1726
+ }).timeout(attemptTimeout);
1727
+ });
1728
+
1729
+ describe('#getCapacityPlan - errors', () => {
1730
+ it('should have a getCapacityPlan function', (done) => {
1731
+ try {
1732
+ assert.equal(true, typeof a.getCapacityPlan === 'function');
1733
+ done();
1734
+ } catch (error) {
1735
+ log.error(`Test Failure: ${error}`);
1736
+ done(error);
1737
+ }
1738
+ }).timeout(attemptTimeout);
1739
+ it('should error if - missing id', (done) => {
1740
+ try {
1741
+ a.getCapacityPlan(null, (data, error) => {
1742
+ try {
1743
+ const displayE = 'id is required';
1744
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getCapacityPlan', displayE);
1745
+ done();
1746
+ } catch (err) {
1747
+ log.error(`Test Failure: ${err}`);
1748
+ done(err);
1749
+ }
1750
+ });
1751
+ } catch (error) {
1752
+ log.error(`Adapter Exception: ${error}`);
1753
+ done(error);
1754
+ }
1755
+ }).timeout(attemptTimeout);
1756
+ });
1757
+
1758
+ describe('#getCapacitySummary - errors', () => {
1759
+ it('should have a getCapacitySummary function', (done) => {
1760
+ try {
1761
+ assert.equal(true, typeof a.getCapacitySummary === 'function');
1762
+ done();
1763
+ } catch (error) {
1764
+ log.error(`Test Failure: ${error}`);
1765
+ done(error);
1766
+ }
1767
+ }).timeout(attemptTimeout);
1768
+ it('should error if - missing id', (done) => {
1769
+ try {
1770
+ a.getCapacitySummary(null, (data, error) => {
1771
+ try {
1772
+ const displayE = 'id is required';
1773
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getCapacitySummary', 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('#listCloudExports - errors', () => {
1788
+ it('should have a listCloudExports function', (done) => {
1789
+ try {
1790
+ assert.equal(true, typeof a.listCloudExports === 'function');
1791
+ done();
1792
+ } catch (error) {
1793
+ log.error(`Test Failure: ${error}`);
1794
+ done(error);
1795
+ }
1796
+ }).timeout(attemptTimeout);
1797
+ });
1798
+
1799
+ describe('#createCloudExport - errors', () => {
1800
+ it('should have a createCloudExport function', (done) => {
1801
+ try {
1802
+ assert.equal(true, typeof a.createCloudExport === 'function');
1803
+ done();
1804
+ } catch (error) {
1805
+ log.error(`Test Failure: ${error}`);
1806
+ done(error);
1807
+ }
1808
+ }).timeout(attemptTimeout);
1809
+ it('should error if - missing body', (done) => {
1810
+ try {
1811
+ a.createCloudExport(null, (data, error) => {
1812
+ try {
1813
+ const displayE = 'body is required';
1814
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-createCloudExport', displayE);
1815
+ done();
1816
+ } catch (err) {
1817
+ log.error(`Test Failure: ${err}`);
1818
+ done(err);
1819
+ }
1820
+ });
1821
+ } catch (error) {
1822
+ log.error(`Adapter Exception: ${error}`);
1823
+ done(error);
1824
+ }
1825
+ }).timeout(attemptTimeout);
1826
+ });
1827
+
1828
+ describe('#updateCloudExport - errors', () => {
1829
+ it('should have a updateCloudExport function', (done) => {
1830
+ try {
1831
+ assert.equal(true, typeof a.updateCloudExport === 'function');
1832
+ done();
1833
+ } catch (error) {
1834
+ log.error(`Test Failure: ${error}`);
1835
+ done(error);
1836
+ }
1837
+ }).timeout(attemptTimeout);
1838
+ it('should error if - missing exportId', (done) => {
1839
+ try {
1840
+ a.updateCloudExport(null, null, (data, error) => {
1841
+ try {
1842
+ const displayE = 'exportId is required';
1843
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-updateCloudExport', displayE);
1844
+ done();
1845
+ } catch (err) {
1846
+ log.error(`Test Failure: ${err}`);
1847
+ done(err);
1848
+ }
1849
+ });
1850
+ } catch (error) {
1851
+ log.error(`Adapter Exception: ${error}`);
1852
+ done(error);
1853
+ }
1854
+ }).timeout(attemptTimeout);
1855
+ it('should error if - missing body', (done) => {
1856
+ try {
1857
+ a.updateCloudExport('fakeparam', null, (data, error) => {
1858
+ try {
1859
+ const displayE = 'body is required';
1860
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-updateCloudExport', 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('#getCloudExport - errors', () => {
1875
+ it('should have a getCloudExport function', (done) => {
1876
+ try {
1877
+ assert.equal(true, typeof a.getCloudExport === '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 exportId', (done) => {
1885
+ try {
1886
+ a.getCloudExport(null, (data, error) => {
1887
+ try {
1888
+ const displayE = 'exportId is required';
1889
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getCloudExport', 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('#deleteCloudExport - errors', () => {
1904
+ it('should have a deleteCloudExport function', (done) => {
1905
+ try {
1906
+ assert.equal(true, typeof a.deleteCloudExport === '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 exportId', (done) => {
1914
+ try {
1915
+ a.deleteCloudExport(null, (data, error) => {
1916
+ try {
1917
+ const displayE = 'exportId is required';
1918
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-deleteCloudExport', 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
+ });
1931
+
1932
+ describe('#listInterface - errors', () => {
1933
+ it('should have a listInterface function', (done) => {
1934
+ try {
1935
+ assert.equal(true, typeof a.listInterface === 'function');
1936
+ done();
1937
+ } catch (error) {
1938
+ log.error(`Test Failure: ${error}`);
1939
+ done(error);
1940
+ }
1941
+ }).timeout(attemptTimeout);
1942
+ });
1943
+
1944
+ describe('#interfaceCreate - errors', () => {
1945
+ it('should have a interfaceCreate function', (done) => {
1946
+ try {
1947
+ assert.equal(true, typeof a.interfaceCreate === 'function');
1948
+ done();
1949
+ } catch (error) {
1950
+ log.error(`Test Failure: ${error}`);
1951
+ done(error);
1952
+ }
1953
+ }).timeout(attemptTimeout);
1954
+ it('should error if - missing body', (done) => {
1955
+ try {
1956
+ a.interfaceCreate(null, (data, error) => {
1957
+ try {
1958
+ const displayE = 'body is required';
1959
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-interfaceCreate', displayE);
1960
+ done();
1961
+ } catch (err) {
1962
+ log.error(`Test Failure: ${err}`);
1963
+ done(err);
1964
+ }
1965
+ });
1966
+ } catch (error) {
1967
+ log.error(`Adapter Exception: ${error}`);
1968
+ done(error);
1969
+ }
1970
+ }).timeout(attemptTimeout);
1971
+ });
1972
+
1973
+ describe('#interfaceGet - errors', () => {
1974
+ it('should have a interfaceGet function', (done) => {
1975
+ try {
1976
+ assert.equal(true, typeof a.interfaceGet === 'function');
1977
+ done();
1978
+ } catch (error) {
1979
+ log.error(`Test Failure: ${error}`);
1980
+ done(error);
1981
+ }
1982
+ }).timeout(attemptTimeout);
1983
+ it('should error if - missing id', (done) => {
1984
+ try {
1985
+ a.interfaceGet(null, (data, error) => {
1986
+ try {
1987
+ const displayE = 'id is required';
1988
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-interfaceGet', displayE);
1989
+ done();
1990
+ } catch (err) {
1991
+ log.error(`Test Failure: ${err}`);
1992
+ done(err);
1993
+ }
1994
+ });
1995
+ } catch (error) {
1996
+ log.error(`Adapter Exception: ${error}`);
1997
+ done(error);
1998
+ }
1999
+ }).timeout(attemptTimeout);
2000
+ });
2001
+
2002
+ describe('#interfaceDelete - errors', () => {
2003
+ it('should have a interfaceDelete function', (done) => {
2004
+ try {
2005
+ assert.equal(true, typeof a.interfaceDelete === 'function');
2006
+ done();
2007
+ } catch (error) {
2008
+ log.error(`Test Failure: ${error}`);
2009
+ done(error);
2010
+ }
2011
+ }).timeout(attemptTimeout);
2012
+ it('should error if - missing id', (done) => {
2013
+ try {
2014
+ a.interfaceDelete(null, (data, error) => {
2015
+ try {
2016
+ const displayE = 'id is required';
2017
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-interfaceDelete', displayE);
2018
+ done();
2019
+ } catch (err) {
2020
+ log.error(`Test Failure: ${err}`);
2021
+ done(err);
2022
+ }
2023
+ });
2024
+ } catch (error) {
2025
+ log.error(`Adapter Exception: ${error}`);
2026
+ done(error);
2027
+ }
2028
+ }).timeout(attemptTimeout);
2029
+ });
2030
+
2031
+ describe('#interfaceUpdate - errors', () => {
2032
+ it('should have a interfaceUpdate function', (done) => {
2033
+ try {
2034
+ assert.equal(true, typeof a.interfaceUpdate === 'function');
2035
+ done();
2036
+ } catch (error) {
2037
+ log.error(`Test Failure: ${error}`);
2038
+ done(error);
2039
+ }
2040
+ }).timeout(attemptTimeout);
2041
+ it('should error if - missing id', (done) => {
2042
+ try {
2043
+ a.interfaceUpdate(null, null, (data, error) => {
2044
+ try {
2045
+ const displayE = 'id is required';
2046
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-interfaceUpdate', displayE);
2047
+ done();
2048
+ } catch (err) {
2049
+ log.error(`Test Failure: ${err}`);
2050
+ done(err);
2051
+ }
2052
+ });
2053
+ } catch (error) {
2054
+ log.error(`Adapter Exception: ${error}`);
2055
+ done(error);
2056
+ }
2057
+ }).timeout(attemptTimeout);
2058
+ it('should error if - missing body', (done) => {
2059
+ try {
2060
+ a.interfaceUpdate('fakeparam', null, (data, error) => {
2061
+ try {
2062
+ const displayE = 'body is required';
2063
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-interfaceUpdate', displayE);
2064
+ done();
2065
+ } catch (err) {
2066
+ log.error(`Test Failure: ${err}`);
2067
+ done(err);
2068
+ }
2069
+ });
2070
+ } catch (error) {
2071
+ log.error(`Adapter Exception: ${error}`);
2072
+ done(error);
2073
+ }
2074
+ }).timeout(attemptTimeout);
2075
+ });
2076
+
2077
+ describe('#manualClassify - errors', () => {
2078
+ it('should have a manualClassify function', (done) => {
2079
+ try {
2080
+ assert.equal(true, typeof a.manualClassify === 'function');
2081
+ done();
2082
+ } catch (error) {
2083
+ log.error(`Test Failure: ${error}`);
2084
+ done(error);
2085
+ }
2086
+ }).timeout(attemptTimeout);
2087
+ it('should error if - missing body', (done) => {
2088
+ try {
2089
+ a.manualClassify(null, (data, error) => {
2090
+ try {
2091
+ const displayE = 'body is required';
2092
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-manualClassify', displayE);
2093
+ done();
2094
+ } catch (err) {
2095
+ log.error(`Test Failure: ${err}`);
2096
+ done(err);
2097
+ }
2098
+ });
2099
+ } catch (error) {
2100
+ log.error(`Adapter Exception: ${error}`);
2101
+ done(error);
2102
+ }
2103
+ }).timeout(attemptTimeout);
2104
+ });
2105
+
2106
+ describe('#getASNDetails - errors', () => {
2107
+ it('should have a getASNDetails function', (done) => {
2108
+ try {
2109
+ assert.equal(true, typeof a.getASNDetails === 'function');
2110
+ done();
2111
+ } catch (error) {
2112
+ log.error(`Test Failure: ${error}`);
2113
+ done(error);
2114
+ }
2115
+ }).timeout(attemptTimeout);
2116
+ it('should error if - missing marketId', (done) => {
2117
+ try {
2118
+ a.getASNDetails(null, null, null, null, (data, error) => {
2119
+ try {
2120
+ const displayE = 'marketId is required';
2121
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getASNDetails', displayE);
2122
+ done();
2123
+ } catch (err) {
2124
+ log.error(`Test Failure: ${err}`);
2125
+ done(err);
2126
+ }
2127
+ });
2128
+ } catch (error) {
2129
+ log.error(`Adapter Exception: ${error}`);
2130
+ done(error);
2131
+ }
2132
+ }).timeout(attemptTimeout);
2133
+ it('should error if - missing asn', (done) => {
2134
+ try {
2135
+ a.getASNDetails('fakeparam', null, null, null, (data, error) => {
2136
+ try {
2137
+ const displayE = 'asn is required';
2138
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getASNDetails', displayE);
2139
+ done();
2140
+ } catch (err) {
2141
+ log.error(`Test Failure: ${err}`);
2142
+ done(err);
2143
+ }
2144
+ });
2145
+ } catch (error) {
2146
+ log.error(`Adapter Exception: ${error}`);
2147
+ done(error);
2148
+ }
2149
+ }).timeout(attemptTimeout);
2150
+ it('should error if - missing type', (done) => {
2151
+ try {
2152
+ a.getASNDetails('fakeparam', 'fakeparam', null, null, (data, error) => {
2153
+ try {
2154
+ const displayE = 'type is required';
2155
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getASNDetails', 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
+ it('should error if - missing body', (done) => {
2168
+ try {
2169
+ a.getASNDetails('fakeparam', 'fakeparam', 'fakeparam', null, (data, error) => {
2170
+ try {
2171
+ const displayE = 'body is required';
2172
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getASNDetails', displayE);
2173
+ done();
2174
+ } catch (err) {
2175
+ log.error(`Test Failure: ${err}`);
2176
+ done(err);
2177
+ }
2178
+ });
2179
+ } catch (error) {
2180
+ log.error(`Adapter Exception: ${error}`);
2181
+ done(error);
2182
+ }
2183
+ }).timeout(attemptTimeout);
2184
+ });
2185
+
2186
+ describe('#getRankings - errors', () => {
2187
+ it('should have a getRankings function', (done) => {
2188
+ try {
2189
+ assert.equal(true, typeof a.getRankings === 'function');
2190
+ done();
2191
+ } catch (error) {
2192
+ log.error(`Test Failure: ${error}`);
2193
+ done(error);
2194
+ }
2195
+ }).timeout(attemptTimeout);
2196
+ it('should error if - missing marketId', (done) => {
2197
+ try {
2198
+ a.getRankings(null, null, null, (data, error) => {
2199
+ try {
2200
+ const displayE = 'marketId is required';
2201
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getRankings', 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
+ it('should error if - missing rankType', (done) => {
2214
+ try {
2215
+ a.getRankings('fakeparam', null, null, (data, error) => {
2216
+ try {
2217
+ const displayE = 'rankType is required';
2218
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getRankings', displayE);
2219
+ done();
2220
+ } catch (err) {
2221
+ log.error(`Test Failure: ${err}`);
2222
+ done(err);
2223
+ }
2224
+ });
2225
+ } catch (error) {
2226
+ log.error(`Adapter Exception: ${error}`);
2227
+ done(error);
2228
+ }
2229
+ }).timeout(attemptTimeout);
2230
+ it('should error if - missing body', (done) => {
2231
+ try {
2232
+ a.getRankings('fakeparam', 'fakeparam', null, (data, error) => {
2233
+ try {
2234
+ const displayE = 'body is required';
2235
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getRankings', displayE);
2236
+ done();
2237
+ } catch (err) {
2238
+ log.error(`Test Failure: ${err}`);
2239
+ done(err);
2240
+ }
2241
+ });
2242
+ } catch (error) {
2243
+ log.error(`Adapter Exception: ${error}`);
2244
+ done(error);
2245
+ }
2246
+ }).timeout(attemptTimeout);
2247
+ });
2248
+
2249
+ describe('#listMarkets - errors', () => {
2250
+ it('should have a listMarkets function', (done) => {
2251
+ try {
2252
+ assert.equal(true, typeof a.listMarkets === 'function');
2253
+ done();
2254
+ } catch (error) {
2255
+ log.error(`Test Failure: ${error}`);
2256
+ done(error);
2257
+ }
2258
+ }).timeout(attemptTimeout);
2259
+ });
2260
+
2261
+ describe('#listLabels - errors', () => {
2262
+ it('should have a listLabels function', (done) => {
2263
+ try {
2264
+ assert.equal(true, typeof a.listLabels === 'function');
2265
+ done();
2266
+ } catch (error) {
2267
+ log.error(`Test Failure: ${error}`);
2268
+ done(error);
2269
+ }
2270
+ }).timeout(attemptTimeout);
2271
+ });
2272
+
2273
+ describe('#createLabel - errors', () => {
2274
+ it('should have a createLabel function', (done) => {
2275
+ try {
2276
+ assert.equal(true, typeof a.createLabel === 'function');
2277
+ done();
2278
+ } catch (error) {
2279
+ log.error(`Test Failure: ${error}`);
2280
+ done(error);
2281
+ }
2282
+ }).timeout(attemptTimeout);
2283
+ it('should error if - missing body', (done) => {
2284
+ try {
2285
+ a.createLabel(null, (data, error) => {
2286
+ try {
2287
+ const displayE = 'body is required';
2288
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-createLabel', displayE);
2289
+ done();
2290
+ } catch (err) {
2291
+ log.error(`Test Failure: ${err}`);
2292
+ done(err);
2293
+ }
2294
+ });
2295
+ } catch (error) {
2296
+ log.error(`Adapter Exception: ${error}`);
2297
+ done(error);
2298
+ }
2299
+ }).timeout(attemptTimeout);
2300
+ });
2301
+
2302
+ describe('#deleteLabel - errors', () => {
2303
+ it('should have a deleteLabel function', (done) => {
2304
+ try {
2305
+ assert.equal(true, typeof a.deleteLabel === 'function');
2306
+ done();
2307
+ } catch (error) {
2308
+ log.error(`Test Failure: ${error}`);
2309
+ done(error);
2310
+ }
2311
+ }).timeout(attemptTimeout);
2312
+ it('should error if - missing id', (done) => {
2313
+ try {
2314
+ a.deleteLabel(null, (data, error) => {
2315
+ try {
2316
+ const displayE = 'id is required';
2317
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-deleteLabel', displayE);
2318
+ done();
2319
+ } catch (err) {
2320
+ log.error(`Test Failure: ${err}`);
2321
+ done(err);
2322
+ }
2323
+ });
2324
+ } catch (error) {
2325
+ log.error(`Adapter Exception: ${error}`);
2326
+ done(error);
2327
+ }
2328
+ }).timeout(attemptTimeout);
2329
+ });
2330
+
2331
+ describe('#updateLabel - errors', () => {
2332
+ it('should have a updateLabel function', (done) => {
2333
+ try {
2334
+ assert.equal(true, typeof a.updateLabel === 'function');
2335
+ done();
2336
+ } catch (error) {
2337
+ log.error(`Test Failure: ${error}`);
2338
+ done(error);
2339
+ }
2340
+ }).timeout(attemptTimeout);
2341
+ it('should error if - missing id', (done) => {
2342
+ try {
2343
+ a.updateLabel(null, null, (data, error) => {
2344
+ try {
2345
+ const displayE = 'id is required';
2346
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-updateLabel', displayE);
2347
+ done();
2348
+ } catch (err) {
2349
+ log.error(`Test Failure: ${err}`);
2350
+ done(err);
2351
+ }
2352
+ });
2353
+ } catch (error) {
2354
+ log.error(`Adapter Exception: ${error}`);
2355
+ done(error);
2356
+ }
2357
+ }).timeout(attemptTimeout);
2358
+ it('should error if - missing body', (done) => {
2359
+ try {
2360
+ a.updateLabel('fakeparam', null, (data, error) => {
2361
+ try {
2362
+ const displayE = 'body is required';
2363
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-updateLabel', displayE);
2364
+ done();
2365
+ } catch (err) {
2366
+ log.error(`Test Failure: ${err}`);
2367
+ done(err);
2368
+ }
2369
+ });
2370
+ } catch (error) {
2371
+ log.error(`Adapter Exception: ${error}`);
2372
+ done(error);
2373
+ }
2374
+ }).timeout(attemptTimeout);
2375
+ });
2376
+
2377
+ describe('#packageList - errors', () => {
2378
+ it('should have a packageList function', (done) => {
2379
+ try {
2380
+ assert.equal(true, typeof a.packageList === 'function');
2381
+ done();
2382
+ } catch (error) {
2383
+ log.error(`Test Failure: ${error}`);
2384
+ done(error);
2385
+ }
2386
+ }).timeout(attemptTimeout);
2387
+ });
2388
+
2389
+ describe('#packageCreate - errors', () => {
2390
+ it('should have a packageCreate function', (done) => {
2391
+ try {
2392
+ assert.equal(true, typeof a.packageCreate === 'function');
2393
+ done();
2394
+ } catch (error) {
2395
+ log.error(`Test Failure: ${error}`);
2396
+ done(error);
2397
+ }
2398
+ }).timeout(attemptTimeout);
2399
+ it('should error if - missing body', (done) => {
2400
+ try {
2401
+ a.packageCreate(null, (data, error) => {
2402
+ try {
2403
+ const displayE = 'body is required';
2404
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-packageCreate', displayE);
2405
+ done();
2406
+ } catch (err) {
2407
+ log.error(`Test Failure: ${err}`);
2408
+ done(err);
2409
+ }
2410
+ });
2411
+ } catch (error) {
2412
+ log.error(`Adapter Exception: ${error}`);
2413
+ done(error);
2414
+ }
2415
+ }).timeout(attemptTimeout);
2416
+ });
2417
+
2418
+ describe('#packageGet - errors', () => {
2419
+ it('should have a packageGet function', (done) => {
2420
+ try {
2421
+ assert.equal(true, typeof a.packageGet === 'function');
2422
+ done();
2423
+ } catch (error) {
2424
+ log.error(`Test Failure: ${error}`);
2425
+ done(error);
2426
+ }
2427
+ }).timeout(attemptTimeout);
2428
+ it('should error if - missing id', (done) => {
2429
+ try {
2430
+ a.packageGet(null, (data, error) => {
2431
+ try {
2432
+ const displayE = 'id is required';
2433
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-packageGet', displayE);
2434
+ done();
2435
+ } catch (err) {
2436
+ log.error(`Test Failure: ${err}`);
2437
+ done(err);
2438
+ }
2439
+ });
2440
+ } catch (error) {
2441
+ log.error(`Adapter Exception: ${error}`);
2442
+ done(error);
2443
+ }
2444
+ }).timeout(attemptTimeout);
2445
+ });
2446
+
2447
+ describe('#packageDelete - errors', () => {
2448
+ it('should have a packageDelete function', (done) => {
2449
+ try {
2450
+ assert.equal(true, typeof a.packageDelete === 'function');
2451
+ done();
2452
+ } catch (error) {
2453
+ log.error(`Test Failure: ${error}`);
2454
+ done(error);
2455
+ }
2456
+ }).timeout(attemptTimeout);
2457
+ it('should error if - missing id', (done) => {
2458
+ try {
2459
+ a.packageDelete(null, (data, error) => {
2460
+ try {
2461
+ const displayE = 'id is required';
2462
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-packageDelete', displayE);
2463
+ done();
2464
+ } catch (err) {
2465
+ log.error(`Test Failure: ${err}`);
2466
+ done(err);
2467
+ }
2468
+ });
2469
+ } catch (error) {
2470
+ log.error(`Adapter Exception: ${error}`);
2471
+ done(error);
2472
+ }
2473
+ }).timeout(attemptTimeout);
2474
+ });
2475
+
2476
+ describe('#packageUpdate - errors', () => {
2477
+ it('should have a packageUpdate function', (done) => {
2478
+ try {
2479
+ assert.equal(true, typeof a.packageUpdate === 'function');
2480
+ done();
2481
+ } catch (error) {
2482
+ log.error(`Test Failure: ${error}`);
2483
+ done(error);
2484
+ }
2485
+ }).timeout(attemptTimeout);
2486
+ it('should error if - missing id', (done) => {
2487
+ try {
2488
+ a.packageUpdate(null, null, (data, error) => {
2489
+ try {
2490
+ const displayE = 'id is required';
2491
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-packageUpdate', displayE);
2492
+ done();
2493
+ } catch (err) {
2494
+ log.error(`Test Failure: ${err}`);
2495
+ done(err);
2496
+ }
2497
+ });
2498
+ } catch (error) {
2499
+ log.error(`Adapter Exception: ${error}`);
2500
+ done(error);
2501
+ }
2502
+ }).timeout(attemptTimeout);
2503
+ it('should error if - missing body', (done) => {
2504
+ try {
2505
+ a.packageUpdate('fakeparam', null, (data, error) => {
2506
+ try {
2507
+ const displayE = 'body is required';
2508
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-packageUpdate', displayE);
2509
+ done();
2510
+ } catch (err) {
2511
+ log.error(`Test Failure: ${err}`);
2512
+ done(err);
2513
+ }
2514
+ });
2515
+ } catch (error) {
2516
+ log.error(`Adapter Exception: ${error}`);
2517
+ done(error);
2518
+ }
2519
+ }).timeout(attemptTimeout);
2520
+ });
2521
+
2522
+ describe('#packagePatch - errors', () => {
2523
+ it('should have a packagePatch function', (done) => {
2524
+ try {
2525
+ assert.equal(true, typeof a.packagePatch === 'function');
2526
+ done();
2527
+ } catch (error) {
2528
+ log.error(`Test Failure: ${error}`);
2529
+ done(error);
2530
+ }
2531
+ }).timeout(attemptTimeout);
2532
+ it('should error if - missing id', (done) => {
2533
+ try {
2534
+ a.packagePatch(null, null, (data, error) => {
2535
+ try {
2536
+ const displayE = 'id is required';
2537
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-packagePatch', displayE);
2538
+ done();
2539
+ } catch (err) {
2540
+ log.error(`Test Failure: ${err}`);
2541
+ done(err);
2542
+ }
2543
+ });
2544
+ } catch (error) {
2545
+ log.error(`Adapter Exception: ${error}`);
2546
+ done(error);
2547
+ }
2548
+ }).timeout(attemptTimeout);
2549
+ it('should error if - missing body', (done) => {
2550
+ try {
2551
+ a.packagePatch('fakeparam', null, (data, error) => {
2552
+ try {
2553
+ const displayE = 'body is required';
2554
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-packagePatch', displayE);
2555
+ done();
2556
+ } catch (err) {
2557
+ log.error(`Test Failure: ${err}`);
2558
+ done(err);
2559
+ }
2560
+ });
2561
+ } catch (error) {
2562
+ log.error(`Adapter Exception: ${error}`);
2563
+ done(error);
2564
+ }
2565
+ }).timeout(attemptTimeout);
2566
+ });
2567
+
2568
+ describe('#tenantList - errors', () => {
2569
+ it('should have a tenantList function', (done) => {
2570
+ try {
2571
+ assert.equal(true, typeof a.tenantList === 'function');
2572
+ done();
2573
+ } catch (error) {
2574
+ log.error(`Test Failure: ${error}`);
2575
+ done(error);
2576
+ }
2577
+ }).timeout(attemptTimeout);
2578
+ });
2579
+
2580
+ describe('#tenantCreate - errors', () => {
2581
+ it('should have a tenantCreate function', (done) => {
2582
+ try {
2583
+ assert.equal(true, typeof a.tenantCreate === 'function');
2584
+ done();
2585
+ } catch (error) {
2586
+ log.error(`Test Failure: ${error}`);
2587
+ done(error);
2588
+ }
2589
+ }).timeout(attemptTimeout);
2590
+ it('should error if - missing body', (done) => {
2591
+ try {
2592
+ a.tenantCreate(null, (data, error) => {
2593
+ try {
2594
+ const displayE = 'body is required';
2595
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-tenantCreate', displayE);
2596
+ done();
2597
+ } catch (err) {
2598
+ log.error(`Test Failure: ${err}`);
2599
+ done(err);
2600
+ }
2601
+ });
2602
+ } catch (error) {
2603
+ log.error(`Adapter Exception: ${error}`);
2604
+ done(error);
2605
+ }
2606
+ }).timeout(attemptTimeout);
2607
+ });
2608
+
2609
+ describe('#tenantGet - errors', () => {
2610
+ it('should have a tenantGet function', (done) => {
2611
+ try {
2612
+ assert.equal(true, typeof a.tenantGet === 'function');
2613
+ done();
2614
+ } catch (error) {
2615
+ log.error(`Test Failure: ${error}`);
2616
+ done(error);
2617
+ }
2618
+ }).timeout(attemptTimeout);
2619
+ it('should error if - missing id', (done) => {
2620
+ try {
2621
+ a.tenantGet(null, (data, error) => {
2622
+ try {
2623
+ const displayE = 'id is required';
2624
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-tenantGet', displayE);
2625
+ done();
2626
+ } catch (err) {
2627
+ log.error(`Test Failure: ${err}`);
2628
+ done(err);
2629
+ }
2630
+ });
2631
+ } catch (error) {
2632
+ log.error(`Adapter Exception: ${error}`);
2633
+ done(error);
2634
+ }
2635
+ }).timeout(attemptTimeout);
2636
+ });
2637
+
2638
+ describe('#tenantDelete - errors', () => {
2639
+ it('should have a tenantDelete function', (done) => {
2640
+ try {
2641
+ assert.equal(true, typeof a.tenantDelete === 'function');
2642
+ done();
2643
+ } catch (error) {
2644
+ log.error(`Test Failure: ${error}`);
2645
+ done(error);
2646
+ }
2647
+ }).timeout(attemptTimeout);
2648
+ it('should error if - missing id', (done) => {
2649
+ try {
2650
+ a.tenantDelete(null, (data, error) => {
2651
+ try {
2652
+ const displayE = 'id is required';
2653
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-tenantDelete', displayE);
2654
+ done();
2655
+ } catch (err) {
2656
+ log.error(`Test Failure: ${err}`);
2657
+ done(err);
2658
+ }
2659
+ });
2660
+ } catch (error) {
2661
+ log.error(`Adapter Exception: ${error}`);
2662
+ done(error);
2663
+ }
2664
+ }).timeout(attemptTimeout);
2665
+ });
2666
+
2667
+ describe('#tenantUpdate - errors', () => {
2668
+ it('should have a tenantUpdate function', (done) => {
2669
+ try {
2670
+ assert.equal(true, typeof a.tenantUpdate === 'function');
2671
+ done();
2672
+ } catch (error) {
2673
+ log.error(`Test Failure: ${error}`);
2674
+ done(error);
2675
+ }
2676
+ }).timeout(attemptTimeout);
2677
+ it('should error if - missing id', (done) => {
2678
+ try {
2679
+ a.tenantUpdate(null, null, (data, error) => {
2680
+ try {
2681
+ const displayE = 'id is required';
2682
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-tenantUpdate', displayE);
2683
+ done();
2684
+ } catch (err) {
2685
+ log.error(`Test Failure: ${err}`);
2686
+ done(err);
2687
+ }
2688
+ });
2689
+ } catch (error) {
2690
+ log.error(`Adapter Exception: ${error}`);
2691
+ done(error);
2692
+ }
2693
+ }).timeout(attemptTimeout);
2694
+ it('should error if - missing body', (done) => {
2695
+ try {
2696
+ a.tenantUpdate('fakeparam', null, (data, error) => {
2697
+ try {
2698
+ const displayE = 'body is required';
2699
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-tenantUpdate', displayE);
2700
+ done();
2701
+ } catch (err) {
2702
+ log.error(`Test Failure: ${err}`);
2703
+ done(err);
2704
+ }
2705
+ });
2706
+ } catch (error) {
2707
+ log.error(`Adapter Exception: ${error}`);
2708
+ done(error);
2709
+ }
2710
+ }).timeout(attemptTimeout);
2711
+ });
2712
+
2713
+ describe('#tenantPatch - errors', () => {
2714
+ it('should have a tenantPatch function', (done) => {
2715
+ try {
2716
+ assert.equal(true, typeof a.tenantPatch === 'function');
2717
+ done();
2718
+ } catch (error) {
2719
+ log.error(`Test Failure: ${error}`);
2720
+ done(error);
2721
+ }
2722
+ }).timeout(attemptTimeout);
2723
+ it('should error if - missing id', (done) => {
2724
+ try {
2725
+ a.tenantPatch(null, null, (data, error) => {
2726
+ try {
2727
+ const displayE = 'id is required';
2728
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-tenantPatch', displayE);
2729
+ done();
2730
+ } catch (err) {
2731
+ log.error(`Test Failure: ${err}`);
2732
+ done(err);
2733
+ }
2734
+ });
2735
+ } catch (error) {
2736
+ log.error(`Adapter Exception: ${error}`);
2737
+ done(error);
2738
+ }
2739
+ }).timeout(attemptTimeout);
2740
+ it('should error if - missing body', (done) => {
2741
+ try {
2742
+ a.tenantPatch('fakeparam', null, (data, error) => {
2743
+ try {
2744
+ const displayE = 'body is required';
2745
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-tenantPatch', displayE);
2746
+ done();
2747
+ } catch (err) {
2748
+ log.error(`Test Failure: ${err}`);
2749
+ done(err);
2750
+ }
2751
+ });
2752
+ } catch (error) {
2753
+ log.error(`Adapter Exception: ${error}`);
2754
+ done(error);
2755
+ }
2756
+ }).timeout(attemptTimeout);
2757
+ });
2758
+
2759
+ describe('#networkClassGet - errors', () => {
2760
+ it('should have a networkClassGet function', (done) => {
2761
+ try {
2762
+ assert.equal(true, typeof a.networkClassGet === 'function');
2763
+ done();
2764
+ } catch (error) {
2765
+ log.error(`Test Failure: ${error}`);
2766
+ done(error);
2767
+ }
2768
+ }).timeout(attemptTimeout);
2769
+ });
2770
+
2771
+ describe('#networkClassUpdate - errors', () => {
2772
+ it('should have a networkClassUpdate function', (done) => {
2773
+ try {
2774
+ assert.equal(true, typeof a.networkClassUpdate === 'function');
2775
+ done();
2776
+ } catch (error) {
2777
+ log.error(`Test Failure: ${error}`);
2778
+ done(error);
2779
+ }
2780
+ }).timeout(attemptTimeout);
2781
+ it('should error if - missing body', (done) => {
2782
+ try {
2783
+ a.networkClassUpdate(null, (data, error) => {
2784
+ try {
2785
+ const displayE = 'body is required';
2786
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-networkClassUpdate', displayE);
2787
+ done();
2788
+ } catch (err) {
2789
+ log.error(`Test Failure: ${err}`);
2790
+ done(err);
2791
+ }
2792
+ });
2793
+ } catch (error) {
2794
+ log.error(`Adapter Exception: ${error}`);
2795
+ done(error);
2796
+ }
2797
+ }).timeout(attemptTimeout);
2798
+ });
2799
+
2800
+ describe('#listNotificationChannels - errors', () => {
2801
+ it('should have a listNotificationChannels function', (done) => {
2802
+ try {
2803
+ assert.equal(true, typeof a.listNotificationChannels === 'function');
2804
+ done();
2805
+ } catch (error) {
2806
+ log.error(`Test Failure: ${error}`);
2807
+ done(error);
2808
+ }
2809
+ }).timeout(attemptTimeout);
2810
+ });
2811
+
2812
+ describe('#searchNotificationChannels - errors', () => {
2813
+ it('should have a searchNotificationChannels function', (done) => {
2814
+ try {
2815
+ assert.equal(true, typeof a.searchNotificationChannels === 'function');
2816
+ done();
2817
+ } catch (error) {
2818
+ log.error(`Test Failure: ${error}`);
2819
+ done(error);
2820
+ }
2821
+ }).timeout(attemptTimeout);
2822
+ it('should error if - missing body', (done) => {
2823
+ try {
2824
+ a.searchNotificationChannels(null, (data, error) => {
2825
+ try {
2826
+ const displayE = 'body is required';
2827
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-searchNotificationChannels', displayE);
2828
+ done();
2829
+ } catch (err) {
2830
+ log.error(`Test Failure: ${err}`);
2831
+ done(err);
2832
+ }
2833
+ });
2834
+ } catch (error) {
2835
+ log.error(`Adapter Exception: ${error}`);
2836
+ done(error);
2837
+ }
2838
+ }).timeout(attemptTimeout);
2839
+ });
2840
+
2841
+ describe('#getNotificationChannel - errors', () => {
2842
+ it('should have a getNotificationChannel function', (done) => {
2843
+ try {
2844
+ assert.equal(true, typeof a.getNotificationChannel === 'function');
2845
+ done();
2846
+ } catch (error) {
2847
+ log.error(`Test Failure: ${error}`);
2848
+ done(error);
2849
+ }
2850
+ }).timeout(attemptTimeout);
2851
+ it('should error if - missing id', (done) => {
2852
+ try {
2853
+ a.getNotificationChannel(null, (data, error) => {
2854
+ try {
2855
+ const displayE = 'id is required';
2856
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getNotificationChannel', displayE);
2857
+ done();
2858
+ } catch (err) {
2859
+ log.error(`Test Failure: ${err}`);
2860
+ done(err);
2861
+ }
2862
+ });
2863
+ } catch (error) {
2864
+ log.error(`Adapter Exception: ${error}`);
2865
+ done(error);
2866
+ }
2867
+ }).timeout(attemptTimeout);
2868
+ });
2869
+
2870
+ describe('#listSiteMarkets - errors', () => {
2871
+ it('should have a listSiteMarkets function', (done) => {
2872
+ try {
2873
+ assert.equal(true, typeof a.listSiteMarkets === 'function');
2874
+ done();
2875
+ } catch (error) {
2876
+ log.error(`Test Failure: ${error}`);
2877
+ done(error);
2878
+ }
2879
+ }).timeout(attemptTimeout);
2880
+ });
2881
+
2882
+ describe('#createSiteMarket - errors', () => {
2883
+ it('should have a createSiteMarket function', (done) => {
2884
+ try {
2885
+ assert.equal(true, typeof a.createSiteMarket === 'function');
2886
+ done();
2887
+ } catch (error) {
2888
+ log.error(`Test Failure: ${error}`);
2889
+ done(error);
2890
+ }
2891
+ }).timeout(attemptTimeout);
2892
+ it('should error if - missing body', (done) => {
2893
+ try {
2894
+ a.createSiteMarket(null, (data, error) => {
2895
+ try {
2896
+ const displayE = 'body is required';
2897
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-createSiteMarket', displayE);
2898
+ done();
2899
+ } catch (err) {
2900
+ log.error(`Test Failure: ${err}`);
2901
+ done(err);
2902
+ }
2903
+ });
2904
+ } catch (error) {
2905
+ log.error(`Adapter Exception: ${error}`);
2906
+ done(error);
2907
+ }
2908
+ }).timeout(attemptTimeout);
2909
+ });
2910
+
2911
+ describe('#getSiteMarket - errors', () => {
2912
+ it('should have a getSiteMarket function', (done) => {
2913
+ try {
2914
+ assert.equal(true, typeof a.getSiteMarket === 'function');
2915
+ done();
2916
+ } catch (error) {
2917
+ log.error(`Test Failure: ${error}`);
2918
+ done(error);
2919
+ }
2920
+ }).timeout(attemptTimeout);
2921
+ it('should error if - missing id', (done) => {
2922
+ try {
2923
+ a.getSiteMarket(null, (data, error) => {
2924
+ try {
2925
+ const displayE = 'id is required';
2926
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getSiteMarket', displayE);
2927
+ done();
2928
+ } catch (err) {
2929
+ log.error(`Test Failure: ${err}`);
2930
+ done(err);
2931
+ }
2932
+ });
2933
+ } catch (error) {
2934
+ log.error(`Adapter Exception: ${error}`);
2935
+ done(error);
2936
+ }
2937
+ }).timeout(attemptTimeout);
2938
+ });
2939
+
2940
+ describe('#deleteSiteMarket - errors', () => {
2941
+ it('should have a deleteSiteMarket function', (done) => {
2942
+ try {
2943
+ assert.equal(true, typeof a.deleteSiteMarket === 'function');
2944
+ done();
2945
+ } catch (error) {
2946
+ log.error(`Test Failure: ${error}`);
2947
+ done(error);
2948
+ }
2949
+ }).timeout(attemptTimeout);
2950
+ it('should error if - missing id', (done) => {
2951
+ try {
2952
+ a.deleteSiteMarket(null, (data, error) => {
2953
+ try {
2954
+ const displayE = 'id is required';
2955
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-deleteSiteMarket', displayE);
2956
+ done();
2957
+ } catch (err) {
2958
+ log.error(`Test Failure: ${err}`);
2959
+ done(err);
2960
+ }
2961
+ });
2962
+ } catch (error) {
2963
+ log.error(`Adapter Exception: ${error}`);
2964
+ done(error);
2965
+ }
2966
+ }).timeout(attemptTimeout);
2967
+ });
2968
+
2969
+ describe('#updateSiteMarket - errors', () => {
2970
+ it('should have a updateSiteMarket function', (done) => {
2971
+ try {
2972
+ assert.equal(true, typeof a.updateSiteMarket === 'function');
2973
+ done();
2974
+ } catch (error) {
2975
+ log.error(`Test Failure: ${error}`);
2976
+ done(error);
2977
+ }
2978
+ }).timeout(attemptTimeout);
2979
+ it('should error if - missing id', (done) => {
2980
+ try {
2981
+ a.updateSiteMarket(null, null, (data, error) => {
2982
+ try {
2983
+ const displayE = 'id is required';
2984
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-updateSiteMarket', displayE);
2985
+ done();
2986
+ } catch (err) {
2987
+ log.error(`Test Failure: ${err}`);
2988
+ done(err);
2989
+ }
2990
+ });
2991
+ } catch (error) {
2992
+ log.error(`Adapter Exception: ${error}`);
2993
+ done(error);
2994
+ }
2995
+ }).timeout(attemptTimeout);
2996
+ it('should error if - missing body', (done) => {
2997
+ try {
2998
+ a.updateSiteMarket('fakeparam', null, (data, error) => {
2999
+ try {
3000
+ const displayE = 'body is required';
3001
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-updateSiteMarket', displayE);
3002
+ done();
3003
+ } catch (err) {
3004
+ log.error(`Test Failure: ${err}`);
3005
+ done(err);
3006
+ }
3007
+ });
3008
+ } catch (error) {
3009
+ log.error(`Adapter Exception: ${error}`);
3010
+ done(error);
3011
+ }
3012
+ }).timeout(attemptTimeout);
3013
+ });
3014
+
3015
+ describe('#listSites - errors', () => {
3016
+ it('should have a listSites function', (done) => {
3017
+ try {
3018
+ assert.equal(true, typeof a.listSites === 'function');
3019
+ done();
3020
+ } catch (error) {
3021
+ log.error(`Test Failure: ${error}`);
3022
+ done(error);
3023
+ }
3024
+ }).timeout(attemptTimeout);
3025
+ });
3026
+
3027
+ describe('#createSite - errors', () => {
3028
+ it('should have a createSite function', (done) => {
3029
+ try {
3030
+ assert.equal(true, typeof a.createSite === 'function');
3031
+ done();
3032
+ } catch (error) {
3033
+ log.error(`Test Failure: ${error}`);
3034
+ done(error);
3035
+ }
3036
+ }).timeout(attemptTimeout);
3037
+ it('should error if - missing body', (done) => {
3038
+ try {
3039
+ a.createSite(null, (data, error) => {
3040
+ try {
3041
+ const displayE = 'body is required';
3042
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-createSite', displayE);
3043
+ done();
3044
+ } catch (err) {
3045
+ log.error(`Test Failure: ${err}`);
3046
+ done(err);
3047
+ }
3048
+ });
3049
+ } catch (error) {
3050
+ log.error(`Adapter Exception: ${error}`);
3051
+ done(error);
3052
+ }
3053
+ }).timeout(attemptTimeout);
3054
+ });
3055
+
3056
+ describe('#getSite - errors', () => {
3057
+ it('should have a getSite function', (done) => {
3058
+ try {
3059
+ assert.equal(true, typeof a.getSite === 'function');
3060
+ done();
3061
+ } catch (error) {
3062
+ log.error(`Test Failure: ${error}`);
3063
+ done(error);
3064
+ }
3065
+ }).timeout(attemptTimeout);
3066
+ it('should error if - missing id', (done) => {
3067
+ try {
3068
+ a.getSite(null, (data, error) => {
3069
+ try {
3070
+ const displayE = 'id is required';
3071
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getSite', displayE);
3072
+ done();
3073
+ } catch (err) {
3074
+ log.error(`Test Failure: ${err}`);
3075
+ done(err);
3076
+ }
3077
+ });
3078
+ } catch (error) {
3079
+ log.error(`Adapter Exception: ${error}`);
3080
+ done(error);
3081
+ }
3082
+ }).timeout(attemptTimeout);
3083
+ });
3084
+
3085
+ describe('#deleteSite - errors', () => {
3086
+ it('should have a deleteSite function', (done) => {
3087
+ try {
3088
+ assert.equal(true, typeof a.deleteSite === 'function');
3089
+ done();
3090
+ } catch (error) {
3091
+ log.error(`Test Failure: ${error}`);
3092
+ done(error);
3093
+ }
3094
+ }).timeout(attemptTimeout);
3095
+ it('should error if - missing id', (done) => {
3096
+ try {
3097
+ a.deleteSite(null, (data, error) => {
3098
+ try {
3099
+ const displayE = 'id is required';
3100
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-deleteSite', displayE);
3101
+ done();
3102
+ } catch (err) {
3103
+ log.error(`Test Failure: ${err}`);
3104
+ done(err);
3105
+ }
3106
+ });
3107
+ } catch (error) {
3108
+ log.error(`Adapter Exception: ${error}`);
3109
+ done(error);
3110
+ }
3111
+ }).timeout(attemptTimeout);
3112
+ });
3113
+
3114
+ describe('#updateSite - errors', () => {
3115
+ it('should have a updateSite function', (done) => {
3116
+ try {
3117
+ assert.equal(true, typeof a.updateSite === 'function');
3118
+ done();
3119
+ } catch (error) {
3120
+ log.error(`Test Failure: ${error}`);
3121
+ done(error);
3122
+ }
3123
+ }).timeout(attemptTimeout);
3124
+ it('should error if - missing id', (done) => {
3125
+ try {
3126
+ a.updateSite(null, null, (data, error) => {
3127
+ try {
3128
+ const displayE = 'id is required';
3129
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-updateSite', displayE);
3130
+ done();
3131
+ } catch (err) {
3132
+ log.error(`Test Failure: ${err}`);
3133
+ done(err);
3134
+ }
3135
+ });
3136
+ } catch (error) {
3137
+ log.error(`Adapter Exception: ${error}`);
3138
+ done(error);
3139
+ }
3140
+ }).timeout(attemptTimeout);
3141
+ it('should error if - missing body', (done) => {
3142
+ try {
3143
+ a.updateSite('fakeparam', null, (data, error) => {
3144
+ try {
3145
+ const displayE = 'body is required';
3146
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-updateSite', displayE);
3147
+ done();
3148
+ } catch (err) {
3149
+ log.error(`Test Failure: ${err}`);
3150
+ done(err);
3151
+ }
3152
+ });
3153
+ } catch (error) {
3154
+ log.error(`Adapter Exception: ${error}`);
3155
+ done(error);
3156
+ }
3157
+ }).timeout(attemptTimeout);
3158
+ });
3159
+
3160
+ describe('#getResultsForTests - errors', () => {
3161
+ it('should have a getResultsForTests function', (done) => {
3162
+ try {
3163
+ assert.equal(true, typeof a.getResultsForTests === 'function');
3164
+ done();
3165
+ } catch (error) {
3166
+ log.error(`Test Failure: ${error}`);
3167
+ done(error);
3168
+ }
3169
+ }).timeout(attemptTimeout);
3170
+ it('should error if - missing body', (done) => {
3171
+ try {
3172
+ a.getResultsForTests(null, (data, error) => {
3173
+ try {
3174
+ const displayE = 'body is required';
3175
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getResultsForTests', displayE);
3176
+ done();
3177
+ } catch (err) {
3178
+ log.error(`Test Failure: ${err}`);
3179
+ done(err);
3180
+ }
3181
+ });
3182
+ } catch (error) {
3183
+ log.error(`Adapter Exception: ${error}`);
3184
+ done(error);
3185
+ }
3186
+ }).timeout(attemptTimeout);
3187
+ });
3188
+
3189
+ describe('#getTraceForTest - errors', () => {
3190
+ it('should have a getTraceForTest function', (done) => {
3191
+ try {
3192
+ assert.equal(true, typeof a.getTraceForTest === 'function');
3193
+ done();
3194
+ } catch (error) {
3195
+ log.error(`Test Failure: ${error}`);
3196
+ done(error);
3197
+ }
3198
+ }).timeout(attemptTimeout);
3199
+ it('should error if - missing body', (done) => {
3200
+ try {
3201
+ a.getTraceForTest(null, (data, error) => {
3202
+ try {
3203
+ const displayE = 'body is required';
3204
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getTraceForTest', displayE);
3205
+ done();
3206
+ } catch (err) {
3207
+ log.error(`Test Failure: ${err}`);
3208
+ done(err);
3209
+ }
3210
+ });
3211
+ } catch (error) {
3212
+ log.error(`Adapter Exception: ${error}`);
3213
+ done(error);
3214
+ }
3215
+ }).timeout(attemptTimeout);
3216
+ });
3217
+
3218
+ describe('#listAgents - errors', () => {
3219
+ it('should have a listAgents function', (done) => {
3220
+ try {
3221
+ assert.equal(true, typeof a.listAgents === 'function');
3222
+ done();
3223
+ } catch (error) {
3224
+ log.error(`Test Failure: ${error}`);
3225
+ done(error);
3226
+ }
3227
+ }).timeout(attemptTimeout);
3228
+ });
3229
+
3230
+ describe('#updateAgent - errors', () => {
3231
+ it('should have a updateAgent function', (done) => {
3232
+ try {
3233
+ assert.equal(true, typeof a.updateAgent === 'function');
3234
+ done();
3235
+ } catch (error) {
3236
+ log.error(`Test Failure: ${error}`);
3237
+ done(error);
3238
+ }
3239
+ }).timeout(attemptTimeout);
3240
+ it('should error if - missing agentId', (done) => {
3241
+ try {
3242
+ a.updateAgent(null, null, (data, error) => {
3243
+ try {
3244
+ const displayE = 'agentId is required';
3245
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-updateAgent', displayE);
3246
+ done();
3247
+ } catch (err) {
3248
+ log.error(`Test Failure: ${err}`);
3249
+ done(err);
3250
+ }
3251
+ });
3252
+ } catch (error) {
3253
+ log.error(`Adapter Exception: ${error}`);
3254
+ done(error);
3255
+ }
3256
+ }).timeout(attemptTimeout);
3257
+ it('should error if - missing body', (done) => {
3258
+ try {
3259
+ a.updateAgent('fakeparam', null, (data, error) => {
3260
+ try {
3261
+ const displayE = 'body is required';
3262
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-updateAgent', displayE);
3263
+ done();
3264
+ } catch (err) {
3265
+ log.error(`Test Failure: ${err}`);
3266
+ done(err);
3267
+ }
3268
+ });
3269
+ } catch (error) {
3270
+ log.error(`Adapter Exception: ${error}`);
3271
+ done(error);
3272
+ }
3273
+ }).timeout(attemptTimeout);
3274
+ });
3275
+
3276
+ describe('#getAgent - errors', () => {
3277
+ it('should have a getAgent function', (done) => {
3278
+ try {
3279
+ assert.equal(true, typeof a.getAgent === 'function');
3280
+ done();
3281
+ } catch (error) {
3282
+ log.error(`Test Failure: ${error}`);
3283
+ done(error);
3284
+ }
3285
+ }).timeout(attemptTimeout);
3286
+ it('should error if - missing agentId', (done) => {
3287
+ try {
3288
+ a.getAgent(null, (data, error) => {
3289
+ try {
3290
+ const displayE = 'agentId is required';
3291
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getAgent', displayE);
3292
+ done();
3293
+ } catch (err) {
3294
+ log.error(`Test Failure: ${err}`);
3295
+ done(err);
3296
+ }
3297
+ });
3298
+ } catch (error) {
3299
+ log.error(`Adapter Exception: ${error}`);
3300
+ done(error);
3301
+ }
3302
+ }).timeout(attemptTimeout);
3303
+ });
3304
+
3305
+ describe('#deleteAgent - errors', () => {
3306
+ it('should have a deleteAgent function', (done) => {
3307
+ try {
3308
+ assert.equal(true, typeof a.deleteAgent === 'function');
3309
+ done();
3310
+ } catch (error) {
3311
+ log.error(`Test Failure: ${error}`);
3312
+ done(error);
3313
+ }
3314
+ }).timeout(attemptTimeout);
3315
+ it('should error if - missing agentId', (done) => {
3316
+ try {
3317
+ a.deleteAgent(null, (data, error) => {
3318
+ try {
3319
+ const displayE = 'agentId is required';
3320
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-deleteAgent', displayE);
3321
+ done();
3322
+ } catch (err) {
3323
+ log.error(`Test Failure: ${err}`);
3324
+ done(err);
3325
+ }
3326
+ });
3327
+ } catch (error) {
3328
+ log.error(`Adapter Exception: ${error}`);
3329
+ done(error);
3330
+ }
3331
+ }).timeout(attemptTimeout);
3332
+ });
3333
+
3334
+ describe('#listTests - errors', () => {
3335
+ it('should have a listTests function', (done) => {
3336
+ try {
3337
+ assert.equal(true, typeof a.listTests === 'function');
3338
+ done();
3339
+ } catch (error) {
3340
+ log.error(`Test Failure: ${error}`);
3341
+ done(error);
3342
+ }
3343
+ }).timeout(attemptTimeout);
3344
+ });
3345
+
3346
+ describe('#createTest - errors', () => {
3347
+ it('should have a createTest function', (done) => {
3348
+ try {
3349
+ assert.equal(true, typeof a.createTest === 'function');
3350
+ done();
3351
+ } catch (error) {
3352
+ log.error(`Test Failure: ${error}`);
3353
+ done(error);
3354
+ }
3355
+ }).timeout(attemptTimeout);
3356
+ it('should error if - missing body', (done) => {
3357
+ try {
3358
+ a.createTest(null, (data, error) => {
3359
+ try {
3360
+ const displayE = 'body is required';
3361
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-createTest', displayE);
3362
+ done();
3363
+ } catch (err) {
3364
+ log.error(`Test Failure: ${err}`);
3365
+ done(err);
3366
+ }
3367
+ });
3368
+ } catch (error) {
3369
+ log.error(`Adapter Exception: ${error}`);
3370
+ done(error);
3371
+ }
3372
+ }).timeout(attemptTimeout);
3373
+ });
3374
+
3375
+ describe('#getTest - errors', () => {
3376
+ it('should have a getTest function', (done) => {
3377
+ try {
3378
+ assert.equal(true, typeof a.getTest === 'function');
3379
+ done();
3380
+ } catch (error) {
3381
+ log.error(`Test Failure: ${error}`);
3382
+ done(error);
3383
+ }
3384
+ }).timeout(attemptTimeout);
3385
+ it('should error if - missing id', (done) => {
3386
+ try {
3387
+ a.getTest(null, (data, error) => {
3388
+ try {
3389
+ const displayE = 'id is required';
3390
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getTest', displayE);
3391
+ done();
3392
+ } catch (err) {
3393
+ log.error(`Test Failure: ${err}`);
3394
+ done(err);
3395
+ }
3396
+ });
3397
+ } catch (error) {
3398
+ log.error(`Adapter Exception: ${error}`);
3399
+ done(error);
3400
+ }
3401
+ }).timeout(attemptTimeout);
3402
+ });
3403
+
3404
+ describe('#deleteTest - errors', () => {
3405
+ it('should have a deleteTest function', (done) => {
3406
+ try {
3407
+ assert.equal(true, typeof a.deleteTest === 'function');
3408
+ done();
3409
+ } catch (error) {
3410
+ log.error(`Test Failure: ${error}`);
3411
+ done(error);
3412
+ }
3413
+ }).timeout(attemptTimeout);
3414
+ it('should error if - missing id', (done) => {
3415
+ try {
3416
+ a.deleteTest(null, (data, error) => {
3417
+ try {
3418
+ const displayE = 'id is required';
3419
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-deleteTest', displayE);
3420
+ done();
3421
+ } catch (err) {
3422
+ log.error(`Test Failure: ${err}`);
3423
+ done(err);
3424
+ }
3425
+ });
3426
+ } catch (error) {
3427
+ log.error(`Adapter Exception: ${error}`);
3428
+ done(error);
3429
+ }
3430
+ }).timeout(attemptTimeout);
3431
+ });
3432
+
3433
+ describe('#updateTest - errors', () => {
3434
+ it('should have a updateTest function', (done) => {
3435
+ try {
3436
+ assert.equal(true, typeof a.updateTest === 'function');
3437
+ done();
3438
+ } catch (error) {
3439
+ log.error(`Test Failure: ${error}`);
3440
+ done(error);
3441
+ }
3442
+ }).timeout(attemptTimeout);
3443
+ it('should error if - missing id', (done) => {
3444
+ try {
3445
+ a.updateTest(null, null, (data, error) => {
3446
+ try {
3447
+ const displayE = 'id is required';
3448
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-updateTest', displayE);
3449
+ done();
3450
+ } catch (err) {
3451
+ log.error(`Test Failure: ${err}`);
3452
+ done(err);
3453
+ }
3454
+ });
3455
+ } catch (error) {
3456
+ log.error(`Adapter Exception: ${error}`);
3457
+ done(error);
3458
+ }
3459
+ }).timeout(attemptTimeout);
3460
+ it('should error if - missing body', (done) => {
3461
+ try {
3462
+ a.updateTest('fakeparam', null, (data, error) => {
3463
+ try {
3464
+ const displayE = 'body is required';
3465
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-updateTest', displayE);
3466
+ done();
3467
+ } catch (err) {
3468
+ log.error(`Test Failure: ${err}`);
3469
+ done(err);
3470
+ }
3471
+ });
3472
+ } catch (error) {
3473
+ log.error(`Adapter Exception: ${error}`);
3474
+ done(error);
3475
+ }
3476
+ }).timeout(attemptTimeout);
3477
+ });
3478
+
3479
+ describe('#setTestStatus - errors', () => {
3480
+ it('should have a setTestStatus function', (done) => {
3481
+ try {
3482
+ assert.equal(true, typeof a.setTestStatus === 'function');
3483
+ done();
3484
+ } catch (error) {
3485
+ log.error(`Test Failure: ${error}`);
3486
+ done(error);
3487
+ }
3488
+ }).timeout(attemptTimeout);
3489
+ it('should error if - missing id', (done) => {
3490
+ try {
3491
+ a.setTestStatus(null, null, (data, error) => {
3492
+ try {
3493
+ const displayE = 'id is required';
3494
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-setTestStatus', displayE);
3495
+ done();
3496
+ } catch (err) {
3497
+ log.error(`Test Failure: ${err}`);
3498
+ done(err);
3499
+ }
3500
+ });
3501
+ } catch (error) {
3502
+ log.error(`Adapter Exception: ${error}`);
3503
+ done(error);
3504
+ }
3505
+ }).timeout(attemptTimeout);
3506
+ it('should error if - missing body', (done) => {
3507
+ try {
3508
+ a.setTestStatus('fakeparam', null, (data, error) => {
3509
+ try {
3510
+ const displayE = 'body is required';
3511
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-setTestStatus', displayE);
3512
+ done();
3513
+ } catch (err) {
3514
+ log.error(`Test Failure: ${err}`);
3515
+ done(err);
3516
+ }
3517
+ });
3518
+ } catch (error) {
3519
+ log.error(`Adapter Exception: ${error}`);
3520
+ done(error);
3521
+ }
3522
+ }).timeout(attemptTimeout);
3523
+ });
3524
+
3525
+ describe('#listUsers - errors', () => {
3526
+ it('should have a listUsers function', (done) => {
3527
+ try {
3528
+ assert.equal(true, typeof a.listUsers === 'function');
3529
+ done();
3530
+ } catch (error) {
3531
+ log.error(`Test Failure: ${error}`);
3532
+ done(error);
3533
+ }
3534
+ }).timeout(attemptTimeout);
3535
+ });
3536
+
3537
+ describe('#createUser - errors', () => {
3538
+ it('should have a createUser function', (done) => {
3539
+ try {
3540
+ assert.equal(true, typeof a.createUser === 'function');
3541
+ done();
3542
+ } catch (error) {
3543
+ log.error(`Test Failure: ${error}`);
3544
+ done(error);
3545
+ }
3546
+ }).timeout(attemptTimeout);
3547
+ it('should error if - missing body', (done) => {
3548
+ try {
3549
+ a.createUser(null, (data, error) => {
3550
+ try {
3551
+ const displayE = 'body is required';
3552
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-createUser', displayE);
3553
+ done();
3554
+ } catch (err) {
3555
+ log.error(`Test Failure: ${err}`);
3556
+ done(err);
3557
+ }
3558
+ });
3559
+ } catch (error) {
3560
+ log.error(`Adapter Exception: ${error}`);
3561
+ done(error);
3562
+ }
3563
+ }).timeout(attemptTimeout);
3564
+ });
3565
+
3566
+ describe('#getUser - errors', () => {
3567
+ it('should have a getUser function', (done) => {
3568
+ try {
3569
+ assert.equal(true, typeof a.getUser === 'function');
3570
+ done();
3571
+ } catch (error) {
3572
+ log.error(`Test Failure: ${error}`);
3573
+ done(error);
3574
+ }
3575
+ }).timeout(attemptTimeout);
3576
+ it('should error if - missing id', (done) => {
3577
+ try {
3578
+ a.getUser(null, (data, error) => {
3579
+ try {
3580
+ const displayE = 'id is required';
3581
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-getUser', displayE);
3582
+ done();
3583
+ } catch (err) {
3584
+ log.error(`Test Failure: ${err}`);
3585
+ done(err);
3586
+ }
3587
+ });
3588
+ } catch (error) {
3589
+ log.error(`Adapter Exception: ${error}`);
3590
+ done(error);
3591
+ }
3592
+ }).timeout(attemptTimeout);
3593
+ });
3594
+
3595
+ describe('#deleteUser - errors', () => {
3596
+ it('should have a deleteUser function', (done) => {
3597
+ try {
3598
+ assert.equal(true, typeof a.deleteUser === 'function');
3599
+ done();
3600
+ } catch (error) {
3601
+ log.error(`Test Failure: ${error}`);
3602
+ done(error);
3603
+ }
3604
+ }).timeout(attemptTimeout);
3605
+ it('should error if - missing id', (done) => {
3606
+ try {
3607
+ a.deleteUser(null, (data, error) => {
3608
+ try {
3609
+ const displayE = 'id is required';
3610
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-deleteUser', displayE);
3611
+ done();
3612
+ } catch (err) {
3613
+ log.error(`Test Failure: ${err}`);
3614
+ done(err);
3615
+ }
3616
+ });
3617
+ } catch (error) {
3618
+ log.error(`Adapter Exception: ${error}`);
3619
+ done(error);
3620
+ }
3621
+ }).timeout(attemptTimeout);
3622
+ });
3623
+
3624
+ describe('#updateUser - errors', () => {
3625
+ it('should have a updateUser function', (done) => {
3626
+ try {
3627
+ assert.equal(true, typeof a.updateUser === 'function');
3628
+ done();
3629
+ } catch (error) {
3630
+ log.error(`Test Failure: ${error}`);
3631
+ done(error);
3632
+ }
3633
+ }).timeout(attemptTimeout);
3634
+ it('should error if - missing id', (done) => {
3635
+ try {
3636
+ a.updateUser(null, null, (data, error) => {
3637
+ try {
3638
+ const displayE = 'id is required';
3639
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-updateUser', displayE);
3640
+ done();
3641
+ } catch (err) {
3642
+ log.error(`Test Failure: ${err}`);
3643
+ done(err);
3644
+ }
3645
+ });
3646
+ } catch (error) {
3647
+ log.error(`Adapter Exception: ${error}`);
3648
+ done(error);
3649
+ }
3650
+ }).timeout(attemptTimeout);
3651
+ it('should error if - missing body', (done) => {
3652
+ try {
3653
+ a.updateUser('fakeparam', null, (data, error) => {
3654
+ try {
3655
+ const displayE = 'body is required';
3656
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-updateUser', displayE);
3657
+ done();
3658
+ } catch (err) {
3659
+ log.error(`Test Failure: ${err}`);
3660
+ done(err);
3661
+ }
3662
+ });
3663
+ } catch (error) {
3664
+ log.error(`Adapter Exception: ${error}`);
3665
+ done(error);
3666
+ }
3667
+ }).timeout(attemptTimeout);
3668
+ });
3669
+
3670
+ describe('#resetActiveSessions - errors', () => {
3671
+ it('should have a resetActiveSessions function', (done) => {
3672
+ try {
3673
+ assert.equal(true, typeof a.resetActiveSessions === 'function');
3674
+ done();
3675
+ } catch (error) {
3676
+ log.error(`Test Failure: ${error}`);
3677
+ done(error);
3678
+ }
3679
+ }).timeout(attemptTimeout);
3680
+ it('should error if - missing id', (done) => {
3681
+ try {
3682
+ a.resetActiveSessions(null, (data, error) => {
3683
+ try {
3684
+ const displayE = 'id is required';
3685
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-resetActiveSessions', displayE);
3686
+ done();
3687
+ } catch (err) {
3688
+ log.error(`Test Failure: ${err}`);
3689
+ done(err);
3690
+ }
3691
+ });
3692
+ } catch (error) {
3693
+ log.error(`Adapter Exception: ${error}`);
3694
+ done(error);
3695
+ }
3696
+ }).timeout(attemptTimeout);
3697
+ });
3698
+
3699
+ describe('#resetApiToken - errors', () => {
3700
+ it('should have a resetApiToken function', (done) => {
3701
+ try {
3702
+ assert.equal(true, typeof a.resetApiToken === 'function');
3703
+ done();
3704
+ } catch (error) {
3705
+ log.error(`Test Failure: ${error}`);
3706
+ done(error);
3707
+ }
3708
+ }).timeout(attemptTimeout);
3709
+ it('should error if - missing id', (done) => {
3710
+ try {
3711
+ a.resetApiToken(null, (data, error) => {
3712
+ try {
3713
+ const displayE = 'id is required';
3714
+ runErrorAsserts(data, error, 'AD.300', 'Test-kentik-adapter-resetApiToken', displayE);
3715
+ done();
3716
+ } catch (err) {
3717
+ log.error(`Test Failure: ${err}`);
3718
+ done(err);
3719
+ }
3720
+ });
3721
+ } catch (error) {
3722
+ log.error(`Adapter Exception: ${error}`);
3723
+ done(error);
3724
+ }
3725
+ }).timeout(attemptTimeout);
3726
+ });
3727
+ });
3728
+ });