@itentialopensource/adapter-paragon_insights 0.1.2 → 0.2.0
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.
- package/.eslintignore +0 -1
- package/.jshintrc +3 -0
- package/CALLS.md +638 -483
- package/CHANGELOG.md +16 -0
- package/CONTRIBUTING.md +1 -160
- package/ENHANCE.md +2 -2
- package/README.md +31 -22
- package/adapter.js +10567 -8758
- package/adapterBase.js +538 -873
- package/changelogs/CHANGELOG.md +16 -0
- package/entities/Config/action.json +306 -0
- package/entities/Config/mockdatafiles/retrieveHealthbotIngestIfaDeviceIds-default.json +4 -0
- package/entities/Config/mockdatafiles/retrieveHealthbotIngestIfaDevices-default.json +10 -0
- package/entities/Config/schema.json +16 -1
- package/entities/Configuration/action.json +61 -0
- package/entities/Configuration/schema.json +4 -1
- package/entities/Utility/action.json +44 -0
- package/entities/Utility/schema.json +20 -0
- package/metadata.json +51 -0
- package/package.json +23 -25
- package/pronghorn.json +1480 -343
- package/propertiesSchema.json +453 -41
- package/refs?service=git-upload-pack +0 -0
- package/report/adapter-openapi.json +42358 -0
- package/report/adapter-openapi.yaml +29640 -0
- package/report/adapterInfo.json +8 -8
- package/report/updateReport1691508880430.json +120 -0
- package/report/updateReport1692202195666.json +120 -0
- package/report/updateReport1692203297401.json +120 -0
- package/report/updateReport1694469141676.json +120 -0
- package/report/updateReport1698422888699.json +120 -0
- package/sampleProperties.json +67 -14
- package/test/integration/adapterTestBasicGet.js +1 -1
- package/test/integration/adapterTestConnectivity.js +91 -42
- package/test/integration/adapterTestIntegration.js +640 -2
- package/test/unit/adapterBaseTestUnit.js +388 -315
- package/test/unit/adapterTestUnit.js +870 -110
- package/utils/adapterInfo.js +1 -1
- package/utils/addAuth.js +1 -1
- package/utils/artifactize.js +1 -1
- package/utils/checkMigrate.js +1 -1
- package/utils/entitiesToDB.js +1 -0
- package/utils/findPath.js +1 -1
- package/utils/methodDocumentor.js +71 -23
- package/utils/modify.js +13 -15
- package/utils/packModificationScript.js +1 -1
- package/utils/taskMover.js +309 -0
- package/utils/tbScript.js +3 -10
- package/utils/tbUtils.js +2 -3
- package/utils/testRunner.js +1 -1
- package/utils/troubleshootingAdapter.js +1 -3
- package/workflows/README.md +0 -3
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
|
|
9
9
|
// include required items for testing & logging
|
|
10
10
|
const assert = require('assert');
|
|
11
|
-
const fs = require('fs-extra');
|
|
12
|
-
const mocha = require('mocha');
|
|
13
11
|
const path = require('path');
|
|
14
12
|
const util = require('util');
|
|
15
|
-
const winston = require('winston');
|
|
16
13
|
const execute = require('child_process').execSync;
|
|
14
|
+
const fs = require('fs-extra');
|
|
15
|
+
const mocha = require('mocha');
|
|
16
|
+
const winston = require('winston');
|
|
17
17
|
const { expect } = require('chai');
|
|
18
18
|
const { use } = require('chai');
|
|
19
19
|
const td = require('testdouble');
|
|
20
20
|
const Ajv = require('ajv');
|
|
21
21
|
|
|
22
|
-
const ajv = new Ajv({ allErrors: true,
|
|
22
|
+
const ajv = new Ajv({ strictSchema: false, allErrors: true, allowUnionTypes: true });
|
|
23
23
|
const anything = td.matchers.anything();
|
|
24
24
|
let logLevel = 'none';
|
|
25
25
|
const isRapidFail = false;
|
|
@@ -222,19 +222,24 @@ describe('[unit] Paragon_insights Adapter Test', () => {
|
|
|
222
222
|
it('package.json should be validated', (done) => {
|
|
223
223
|
try {
|
|
224
224
|
const packageDotJson = require('../../package.json');
|
|
225
|
-
|
|
226
|
-
const
|
|
227
|
-
|
|
228
|
-
|
|
225
|
+
// Define the JSON schema for package.json
|
|
226
|
+
const packageJsonSchema = {
|
|
227
|
+
type: 'object',
|
|
228
|
+
properties: {
|
|
229
|
+
name: { type: 'string' },
|
|
230
|
+
version: { type: 'string' }
|
|
231
|
+
// May need to add more properties as needed
|
|
232
|
+
},
|
|
233
|
+
required: ['name', 'version']
|
|
229
234
|
};
|
|
230
|
-
const
|
|
235
|
+
const validate = ajv.compile(packageJsonSchema);
|
|
236
|
+
const isValid = validate(packageDotJson);
|
|
231
237
|
|
|
232
|
-
if (
|
|
233
|
-
log.error('The package.json contains
|
|
234
|
-
|
|
235
|
-
assert.equal(true, results.valid);
|
|
238
|
+
if (isValid === false) {
|
|
239
|
+
log.error('The package.json contains errors');
|
|
240
|
+
assert.equal(true, isValid);
|
|
236
241
|
} else {
|
|
237
|
-
assert.equal(true,
|
|
242
|
+
assert.equal(true, isValid);
|
|
238
243
|
}
|
|
239
244
|
|
|
240
245
|
done();
|
|
@@ -273,6 +278,7 @@ describe('[unit] Paragon_insights Adapter Test', () => {
|
|
|
273
278
|
assert.notEqual(undefined, packageDotJson.scripts);
|
|
274
279
|
assert.notEqual(null, packageDotJson.scripts);
|
|
275
280
|
assert.notEqual('', packageDotJson.scripts);
|
|
281
|
+
assert.equal('node utils/setup.js', packageDotJson.scripts.preinstall);
|
|
276
282
|
assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js', packageDotJson.scripts.lint);
|
|
277
283
|
assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js --quiet', packageDotJson.scripts['lint:errors']);
|
|
278
284
|
assert.equal('mocha test/unit/adapterBaseTestUnit.js --LOG=error', packageDotJson.scripts['test:baseunit']);
|
|
@@ -280,6 +286,8 @@ describe('[unit] Paragon_insights Adapter Test', () => {
|
|
|
280
286
|
assert.equal('mocha test/integration/adapterTestIntegration.js --LOG=error', packageDotJson.scripts['test:integration']);
|
|
281
287
|
assert.equal('nyc --reporter html --reporter text mocha --reporter dot test/*', packageDotJson.scripts['test:cover']);
|
|
282
288
|
assert.equal('npm run test:baseunit && npm run test:unit && npm run test:integration', packageDotJson.scripts.test);
|
|
289
|
+
assert.equal('npm publish --registry=https://registry.npmjs.org --access=public', packageDotJson.scripts.deploy);
|
|
290
|
+
assert.equal('npm run deploy', packageDotJson.scripts.build);
|
|
283
291
|
done();
|
|
284
292
|
} catch (error) {
|
|
285
293
|
log.error(`Test Failure: ${error}`);
|
|
@@ -292,6 +300,9 @@ describe('[unit] Paragon_insights Adapter Test', () => {
|
|
|
292
300
|
assert.notEqual(undefined, packageDotJson.repository);
|
|
293
301
|
assert.notEqual(null, packageDotJson.repository);
|
|
294
302
|
assert.notEqual('', packageDotJson.repository);
|
|
303
|
+
assert.equal('git', packageDotJson.repository.type);
|
|
304
|
+
assert.equal('git@gitlab.com:itentialopensource/adapters/', packageDotJson.repository.url.substring(0, 43));
|
|
305
|
+
assert.equal('https://gitlab.com/itentialopensource/adapters/', packageDotJson.homepage.substring(0, 47));
|
|
295
306
|
done();
|
|
296
307
|
} catch (error) {
|
|
297
308
|
log.error(`Test Failure: ${error}`);
|
|
@@ -304,17 +315,17 @@ describe('[unit] Paragon_insights Adapter Test', () => {
|
|
|
304
315
|
assert.notEqual(undefined, packageDotJson.dependencies);
|
|
305
316
|
assert.notEqual(null, packageDotJson.dependencies);
|
|
306
317
|
assert.notEqual('', packageDotJson.dependencies);
|
|
307
|
-
assert.equal('^
|
|
308
|
-
assert.equal('^
|
|
309
|
-
assert.equal('^
|
|
310
|
-
assert.equal('^
|
|
311
|
-
assert.equal('^
|
|
318
|
+
assert.equal('^8.12.0', packageDotJson.dependencies.ajv);
|
|
319
|
+
assert.equal('^1.6.3', packageDotJson.dependencies.axios);
|
|
320
|
+
assert.equal('^11.0.0', packageDotJson.dependencies.commander);
|
|
321
|
+
assert.equal('^11.1.1', packageDotJson.dependencies['fs-extra']);
|
|
322
|
+
assert.equal('^10.2.0', packageDotJson.dependencies.mocha);
|
|
312
323
|
assert.equal('^2.0.1', packageDotJson.dependencies['mocha-param']);
|
|
313
|
-
assert.equal('^0.5.3', packageDotJson.dependencies['network-diagnostics']);
|
|
314
324
|
assert.equal('^15.1.0', packageDotJson.dependencies.nyc);
|
|
325
|
+
assert.equal('^0.4.4', packageDotJson.dependencies.ping);
|
|
315
326
|
assert.equal('^1.4.10', packageDotJson.dependencies['readline-sync']);
|
|
316
|
-
assert.equal('^7.3
|
|
317
|
-
assert.equal('^3.
|
|
327
|
+
assert.equal('^7.5.3', packageDotJson.dependencies.semver);
|
|
328
|
+
assert.equal('^3.9.0', packageDotJson.dependencies.winston);
|
|
318
329
|
done();
|
|
319
330
|
} catch (error) {
|
|
320
331
|
log.error(`Test Failure: ${error}`);
|
|
@@ -327,13 +338,12 @@ describe('[unit] Paragon_insights Adapter Test', () => {
|
|
|
327
338
|
assert.notEqual(undefined, packageDotJson.devDependencies);
|
|
328
339
|
assert.notEqual(null, packageDotJson.devDependencies);
|
|
329
340
|
assert.notEqual('', packageDotJson.devDependencies);
|
|
330
|
-
assert.equal('^4.3.
|
|
331
|
-
assert.equal('^
|
|
332
|
-
assert.equal('^
|
|
333
|
-
assert.equal('^2.
|
|
334
|
-
assert.equal('^3.
|
|
335
|
-
assert.equal('^
|
|
336
|
-
assert.equal('^3.16.1', packageDotJson.devDependencies.testdouble);
|
|
341
|
+
assert.equal('^4.3.7', packageDotJson.devDependencies.chai);
|
|
342
|
+
assert.equal('^8.44.0', packageDotJson.devDependencies.eslint);
|
|
343
|
+
assert.equal('^15.0.0', packageDotJson.devDependencies['eslint-config-airbnb-base']);
|
|
344
|
+
assert.equal('^2.27.5', packageDotJson.devDependencies['eslint-plugin-import']);
|
|
345
|
+
assert.equal('^3.1.0', packageDotJson.devDependencies['eslint-plugin-json']);
|
|
346
|
+
assert.equal('^3.18.0', packageDotJson.devDependencies.testdouble);
|
|
337
347
|
done();
|
|
338
348
|
} catch (error) {
|
|
339
349
|
log.error(`Test Failure: ${error}`);
|
|
@@ -377,16 +387,30 @@ describe('[unit] Paragon_insights Adapter Test', () => {
|
|
|
377
387
|
assert.equal(true, Array.isArray(pronghornDotJson.methods));
|
|
378
388
|
assert.notEqual(0, pronghornDotJson.methods.length);
|
|
379
389
|
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUpdateAdapterConfiguration'));
|
|
390
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapSuspendAdapter'));
|
|
391
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUnsuspendAdapter'));
|
|
392
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapGetAdapterQueue'));
|
|
380
393
|
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapFindAdapterPath'));
|
|
381
394
|
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapTroubleshootAdapter'));
|
|
382
395
|
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterHealthcheck'));
|
|
383
396
|
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterConnectivity'));
|
|
384
397
|
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterBasicGet'));
|
|
385
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
386
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
387
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
398
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapMoveAdapterEntitiesToDB'));
|
|
399
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapDeactivateTasks'));
|
|
400
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapActivateTasks'));
|
|
401
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapPopulateEntityCache'));
|
|
402
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRetrieveEntitiesCache'));
|
|
403
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'getDevice'));
|
|
404
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'getDevicesFiltered'));
|
|
405
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'isAlive'));
|
|
406
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'getConfig'));
|
|
407
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapGetDeviceCount'));
|
|
408
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapExpandedGenericAdapterRequest'));
|
|
388
409
|
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequest'));
|
|
389
410
|
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequestNoBasePath'));
|
|
411
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterLint'));
|
|
412
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterTests'));
|
|
413
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapGetAdapterInventory'));
|
|
390
414
|
done();
|
|
391
415
|
} catch (error) {
|
|
392
416
|
log.error(`Test Failure: ${error}`);
|
|
@@ -539,7 +563,7 @@ describe('[unit] Paragon_insights Adapter Test', () => {
|
|
|
539
563
|
log.error(`Adapter Exception: ${error}`);
|
|
540
564
|
done(error);
|
|
541
565
|
}
|
|
542
|
-
});
|
|
566
|
+
}).timeout(attemptTimeout);
|
|
543
567
|
});
|
|
544
568
|
|
|
545
569
|
describe('propertiesSchema.json', () => {
|
|
@@ -863,6 +887,8 @@ describe('[unit] Paragon_insights Adapter Test', () => {
|
|
|
863
887
|
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.isAlive);
|
|
864
888
|
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getConfig);
|
|
865
889
|
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getCount);
|
|
890
|
+
assert.notEqual(undefined, sampleDotJson.properties.cache);
|
|
891
|
+
assert.notEqual(undefined, sampleDotJson.properties.cache.entities);
|
|
866
892
|
done();
|
|
867
893
|
} catch (error) {
|
|
868
894
|
log.error(`Test Failure: ${error}`);
|
|
@@ -968,40 +994,6 @@ describe('[unit] Paragon_insights Adapter Test', () => {
|
|
|
968
994
|
});
|
|
969
995
|
});
|
|
970
996
|
|
|
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
997
|
describe('#iapSuspendAdapter', () => {
|
|
1006
998
|
it('should have a iapSuspendAdapter function', (done) => {
|
|
1007
999
|
try {
|
|
@@ -1038,6 +1030,40 @@ describe('[unit] Paragon_insights Adapter Test', () => {
|
|
|
1038
1030
|
});
|
|
1039
1031
|
});
|
|
1040
1032
|
|
|
1033
|
+
describe('#iapFindAdapterPath', () => {
|
|
1034
|
+
it('should have a iapFindAdapterPath function', (done) => {
|
|
1035
|
+
try {
|
|
1036
|
+
assert.equal(true, typeof a.iapFindAdapterPath === 'function');
|
|
1037
|
+
done();
|
|
1038
|
+
} catch (error) {
|
|
1039
|
+
log.error(`Test Failure: ${error}`);
|
|
1040
|
+
done(error);
|
|
1041
|
+
}
|
|
1042
|
+
});
|
|
1043
|
+
it('iapFindAdapterPath should find atleast one path that matches', (done) => {
|
|
1044
|
+
try {
|
|
1045
|
+
a.iapFindAdapterPath('{base_path}/{version}', (data, error) => {
|
|
1046
|
+
try {
|
|
1047
|
+
assert.equal(undefined, error);
|
|
1048
|
+
assert.notEqual(undefined, data);
|
|
1049
|
+
assert.notEqual(null, data);
|
|
1050
|
+
assert.equal(true, data.found);
|
|
1051
|
+
assert.notEqual(undefined, data.foundIn);
|
|
1052
|
+
assert.notEqual(null, data.foundIn);
|
|
1053
|
+
assert.notEqual(0, data.foundIn.length);
|
|
1054
|
+
done();
|
|
1055
|
+
} catch (err) {
|
|
1056
|
+
log.error(`Test Failure: ${err}`);
|
|
1057
|
+
done(err);
|
|
1058
|
+
}
|
|
1059
|
+
});
|
|
1060
|
+
} catch (error) {
|
|
1061
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1062
|
+
done(error);
|
|
1063
|
+
}
|
|
1064
|
+
}).timeout(attemptTimeout);
|
|
1065
|
+
});
|
|
1066
|
+
|
|
1041
1067
|
describe('#iapTroubleshootAdapter', () => {
|
|
1042
1068
|
it('should have a iapTroubleshootAdapter function', (done) => {
|
|
1043
1069
|
try {
|
|
@@ -1183,49 +1209,53 @@ describe('[unit] Paragon_insights Adapter Test', () => {
|
|
|
1183
1209
|
}).timeout(attemptTimeout);
|
|
1184
1210
|
});
|
|
1185
1211
|
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1212
|
+
describe('#iapDeactivateTasks', () => {
|
|
1213
|
+
it('should have a iapDeactivateTasks function', (done) => {
|
|
1214
|
+
try {
|
|
1215
|
+
assert.equal(true, typeof a.iapDeactivateTasks === 'function');
|
|
1216
|
+
done();
|
|
1217
|
+
} catch (error) {
|
|
1218
|
+
log.error(`Test Failure: ${error}`);
|
|
1219
|
+
done(error);
|
|
1220
|
+
}
|
|
1221
|
+
});
|
|
1222
|
+
});
|
|
1223
|
+
|
|
1224
|
+
describe('#iapActivateTasks', () => {
|
|
1225
|
+
it('should have a iapActivateTasks function', (done) => {
|
|
1226
|
+
try {
|
|
1227
|
+
assert.equal(true, typeof a.iapActivateTasks === 'function');
|
|
1228
|
+
done();
|
|
1229
|
+
} catch (error) {
|
|
1230
|
+
log.error(`Test Failure: ${error}`);
|
|
1231
|
+
done(error);
|
|
1232
|
+
}
|
|
1233
|
+
});
|
|
1234
|
+
});
|
|
1235
|
+
|
|
1236
|
+
describe('#iapPopulateEntityCache', () => {
|
|
1237
|
+
it('should have a iapPopulateEntityCache function', (done) => {
|
|
1238
|
+
try {
|
|
1239
|
+
assert.equal(true, typeof a.iapPopulateEntityCache === 'function');
|
|
1240
|
+
done();
|
|
1241
|
+
} catch (error) {
|
|
1242
|
+
log.error(`Test Failure: ${error}`);
|
|
1243
|
+
done(error);
|
|
1244
|
+
}
|
|
1245
|
+
});
|
|
1246
|
+
});
|
|
1247
|
+
|
|
1248
|
+
describe('#iapRetrieveEntitiesCache', () => {
|
|
1249
|
+
it('should have a iapRetrieveEntitiesCache function', (done) => {
|
|
1250
|
+
try {
|
|
1251
|
+
assert.equal(true, typeof a.iapRetrieveEntitiesCache === 'function');
|
|
1252
|
+
done();
|
|
1253
|
+
} catch (error) {
|
|
1254
|
+
log.error(`Test Failure: ${error}`);
|
|
1255
|
+
done(error);
|
|
1256
|
+
}
|
|
1257
|
+
});
|
|
1258
|
+
});
|
|
1229
1259
|
|
|
1230
1260
|
describe('#hasEntities', () => {
|
|
1231
1261
|
it('should have a hasEntities function', (done) => {
|
|
@@ -1299,6 +1329,173 @@ describe('[unit] Paragon_insights Adapter Test', () => {
|
|
|
1299
1329
|
});
|
|
1300
1330
|
});
|
|
1301
1331
|
|
|
1332
|
+
describe('#iapExpandedGenericAdapterRequest', () => {
|
|
1333
|
+
it('should have a iapExpandedGenericAdapterRequest function', (done) => {
|
|
1334
|
+
try {
|
|
1335
|
+
assert.equal(true, typeof a.iapExpandedGenericAdapterRequest === 'function');
|
|
1336
|
+
done();
|
|
1337
|
+
} catch (error) {
|
|
1338
|
+
log.error(`Test Failure: ${error}`);
|
|
1339
|
+
done(error);
|
|
1340
|
+
}
|
|
1341
|
+
});
|
|
1342
|
+
});
|
|
1343
|
+
|
|
1344
|
+
describe('#genericAdapterRequest', () => {
|
|
1345
|
+
it('should have a genericAdapterRequest function', (done) => {
|
|
1346
|
+
try {
|
|
1347
|
+
assert.equal(true, typeof a.genericAdapterRequest === 'function');
|
|
1348
|
+
done();
|
|
1349
|
+
} catch (error) {
|
|
1350
|
+
log.error(`Test Failure: ${error}`);
|
|
1351
|
+
done(error);
|
|
1352
|
+
}
|
|
1353
|
+
});
|
|
1354
|
+
});
|
|
1355
|
+
|
|
1356
|
+
describe('#genericAdapterRequestNoBasePath', () => {
|
|
1357
|
+
it('should have a genericAdapterRequestNoBasePath function', (done) => {
|
|
1358
|
+
try {
|
|
1359
|
+
assert.equal(true, typeof a.genericAdapterRequestNoBasePath === 'function');
|
|
1360
|
+
done();
|
|
1361
|
+
} catch (error) {
|
|
1362
|
+
log.error(`Test Failure: ${error}`);
|
|
1363
|
+
done(error);
|
|
1364
|
+
}
|
|
1365
|
+
});
|
|
1366
|
+
});
|
|
1367
|
+
|
|
1368
|
+
describe('#iapRunAdapterLint', () => {
|
|
1369
|
+
it('should have a iapRunAdapterLint function', (done) => {
|
|
1370
|
+
try {
|
|
1371
|
+
assert.equal(true, typeof a.iapRunAdapterLint === 'function');
|
|
1372
|
+
done();
|
|
1373
|
+
} catch (error) {
|
|
1374
|
+
log.error(`Test Failure: ${error}`);
|
|
1375
|
+
done(error);
|
|
1376
|
+
}
|
|
1377
|
+
});
|
|
1378
|
+
it('retrieve the lint results', (done) => {
|
|
1379
|
+
try {
|
|
1380
|
+
a.iapRunAdapterLint((data, error) => {
|
|
1381
|
+
try {
|
|
1382
|
+
assert.equal(undefined, error);
|
|
1383
|
+
assert.notEqual(undefined, data);
|
|
1384
|
+
assert.notEqual(null, data);
|
|
1385
|
+
assert.notEqual(undefined, data.status);
|
|
1386
|
+
assert.notEqual(null, data.status);
|
|
1387
|
+
assert.equal('SUCCESS', data.status);
|
|
1388
|
+
done();
|
|
1389
|
+
} catch (err) {
|
|
1390
|
+
log.error(`Test Failure: ${err}`);
|
|
1391
|
+
done(err);
|
|
1392
|
+
}
|
|
1393
|
+
});
|
|
1394
|
+
} catch (error) {
|
|
1395
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1396
|
+
done(error);
|
|
1397
|
+
}
|
|
1398
|
+
}).timeout(attemptTimeout);
|
|
1399
|
+
});
|
|
1400
|
+
|
|
1401
|
+
describe('#iapRunAdapterTests', () => {
|
|
1402
|
+
it('should have a iapRunAdapterTests function', (done) => {
|
|
1403
|
+
try {
|
|
1404
|
+
assert.equal(true, typeof a.iapRunAdapterTests === 'function');
|
|
1405
|
+
done();
|
|
1406
|
+
} catch (error) {
|
|
1407
|
+
log.error(`Test Failure: ${error}`);
|
|
1408
|
+
done(error);
|
|
1409
|
+
}
|
|
1410
|
+
});
|
|
1411
|
+
});
|
|
1412
|
+
|
|
1413
|
+
describe('#iapGetAdapterInventory', () => {
|
|
1414
|
+
it('should have a iapGetAdapterInventory function', (done) => {
|
|
1415
|
+
try {
|
|
1416
|
+
assert.equal(true, typeof a.iapGetAdapterInventory === 'function');
|
|
1417
|
+
done();
|
|
1418
|
+
} catch (error) {
|
|
1419
|
+
log.error(`Test Failure: ${error}`);
|
|
1420
|
+
done(error);
|
|
1421
|
+
}
|
|
1422
|
+
});
|
|
1423
|
+
it('retrieve the inventory', (done) => {
|
|
1424
|
+
try {
|
|
1425
|
+
a.iapGetAdapterInventory((data, error) => {
|
|
1426
|
+
try {
|
|
1427
|
+
assert.equal(undefined, error);
|
|
1428
|
+
assert.notEqual(undefined, data);
|
|
1429
|
+
assert.notEqual(null, data);
|
|
1430
|
+
done();
|
|
1431
|
+
} catch (err) {
|
|
1432
|
+
log.error(`Test Failure: ${err}`);
|
|
1433
|
+
done(err);
|
|
1434
|
+
}
|
|
1435
|
+
});
|
|
1436
|
+
} catch (error) {
|
|
1437
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1438
|
+
done(error);
|
|
1439
|
+
}
|
|
1440
|
+
}).timeout(attemptTimeout);
|
|
1441
|
+
});
|
|
1442
|
+
describe('metadata.json', () => {
|
|
1443
|
+
it('should have a metadata.json', (done) => {
|
|
1444
|
+
try {
|
|
1445
|
+
fs.exists('metadata.json', (val) => {
|
|
1446
|
+
assert.equal(true, val);
|
|
1447
|
+
done();
|
|
1448
|
+
});
|
|
1449
|
+
} catch (error) {
|
|
1450
|
+
log.error(`Test Failure: ${error}`);
|
|
1451
|
+
done(error);
|
|
1452
|
+
}
|
|
1453
|
+
});
|
|
1454
|
+
it('metadata.json is customized', (done) => {
|
|
1455
|
+
try {
|
|
1456
|
+
const metadataDotJson = require('../../metadata.json');
|
|
1457
|
+
assert.equal('adapter-paragon_insights', metadataDotJson.name);
|
|
1458
|
+
assert.notEqual(undefined, metadataDotJson.webName);
|
|
1459
|
+
assert.notEqual(null, metadataDotJson.webName);
|
|
1460
|
+
assert.notEqual('', metadataDotJson.webName);
|
|
1461
|
+
assert.equal('Adapter', metadataDotJson.type);
|
|
1462
|
+
done();
|
|
1463
|
+
} catch (error) {
|
|
1464
|
+
log.error(`Test Failure: ${error}`);
|
|
1465
|
+
done(error);
|
|
1466
|
+
}
|
|
1467
|
+
});
|
|
1468
|
+
it('metadata.json contains accurate documentation', (done) => {
|
|
1469
|
+
try {
|
|
1470
|
+
const metadataDotJson = require('../../metadata.json');
|
|
1471
|
+
assert.notEqual(undefined, metadataDotJson.documentation);
|
|
1472
|
+
assert.equal('https://www.npmjs.com/package/@itentialopensource/adapter-paragon_insights', metadataDotJson.documentation.npmLink);
|
|
1473
|
+
assert.equal('https://docs.itential.com/opensource/docs/troubleshooting-an-adapter', metadataDotJson.documentation.faqLink);
|
|
1474
|
+
assert.equal('https://gitlab.com/itentialopensource/adapters/contributing-guide', metadataDotJson.documentation.contributeLink);
|
|
1475
|
+
assert.equal('https://itential.atlassian.net/servicedesk/customer/portals', metadataDotJson.documentation.issueLink);
|
|
1476
|
+
done();
|
|
1477
|
+
} catch (error) {
|
|
1478
|
+
log.error(`Test Failure: ${error}`);
|
|
1479
|
+
done(error);
|
|
1480
|
+
}
|
|
1481
|
+
});
|
|
1482
|
+
it('metadata.json has related items', (done) => {
|
|
1483
|
+
try {
|
|
1484
|
+
const metadataDotJson = require('../../metadata.json');
|
|
1485
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems);
|
|
1486
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems.adapters);
|
|
1487
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems.integrations);
|
|
1488
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems.ecosystemApplications);
|
|
1489
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems.workflowProjects);
|
|
1490
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems.transformationProjects);
|
|
1491
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems.exampleProjects);
|
|
1492
|
+
done();
|
|
1493
|
+
} catch (error) {
|
|
1494
|
+
log.error(`Test Failure: ${error}`);
|
|
1495
|
+
done(error);
|
|
1496
|
+
}
|
|
1497
|
+
});
|
|
1498
|
+
});
|
|
1302
1499
|
/*
|
|
1303
1500
|
-----------------------------------------------------------------------
|
|
1304
1501
|
-----------------------------------------------------------------------
|
|
@@ -14652,5 +14849,568 @@ describe('[unit] Paragon_insights Adapter Test', () => {
|
|
|
14652
14849
|
}
|
|
14653
14850
|
}).timeout(attemptTimeout);
|
|
14654
14851
|
});
|
|
14852
|
+
|
|
14853
|
+
describe('#retrieveDeviceTriggerInfo - errors', () => {
|
|
14854
|
+
it('should have a retrieveDeviceTriggerInfo function', (done) => {
|
|
14855
|
+
try {
|
|
14856
|
+
assert.equal(true, typeof a.retrieveDeviceTriggerInfo === 'function');
|
|
14857
|
+
done();
|
|
14858
|
+
} catch (error) {
|
|
14859
|
+
log.error(`Test Failure: ${error}`);
|
|
14860
|
+
done(error);
|
|
14861
|
+
}
|
|
14862
|
+
}).timeout(attemptTimeout);
|
|
14863
|
+
it('should error if - missing deviceId', (done) => {
|
|
14864
|
+
try {
|
|
14865
|
+
a.retrieveDeviceTriggerInfo(null, (data, error) => {
|
|
14866
|
+
try {
|
|
14867
|
+
const displayE = 'deviceId is required';
|
|
14868
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-paragon_insights-adapter-retrieveDeviceTriggerInfo', displayE);
|
|
14869
|
+
done();
|
|
14870
|
+
} catch (err) {
|
|
14871
|
+
log.error(`Test Failure: ${err}`);
|
|
14872
|
+
done(err);
|
|
14873
|
+
}
|
|
14874
|
+
});
|
|
14875
|
+
} catch (error) {
|
|
14876
|
+
log.error(`Adapter Exception: ${error}`);
|
|
14877
|
+
done(error);
|
|
14878
|
+
}
|
|
14879
|
+
}).timeout(attemptTimeout);
|
|
14880
|
+
});
|
|
14881
|
+
|
|
14882
|
+
describe('#removeIcebergDevicesFromGroup - errors', () => {
|
|
14883
|
+
it('should have a removeIcebergDevicesFromGroup function', (done) => {
|
|
14884
|
+
try {
|
|
14885
|
+
assert.equal(true, typeof a.removeIcebergDevicesFromGroup === 'function');
|
|
14886
|
+
done();
|
|
14887
|
+
} catch (error) {
|
|
14888
|
+
log.error(`Test Failure: ${error}`);
|
|
14889
|
+
done(error);
|
|
14890
|
+
}
|
|
14891
|
+
}).timeout(attemptTimeout);
|
|
14892
|
+
it('should error if - missing deviceGroupName', (done) => {
|
|
14893
|
+
try {
|
|
14894
|
+
a.removeIcebergDevicesFromGroup(null, (data, error) => {
|
|
14895
|
+
try {
|
|
14896
|
+
const displayE = 'deviceGroupName is required';
|
|
14897
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-paragon_insights-adapter-removeIcebergDevicesFromGroup', displayE);
|
|
14898
|
+
done();
|
|
14899
|
+
} catch (err) {
|
|
14900
|
+
log.error(`Test Failure: ${err}`);
|
|
14901
|
+
done(err);
|
|
14902
|
+
}
|
|
14903
|
+
});
|
|
14904
|
+
} catch (error) {
|
|
14905
|
+
log.error(`Adapter Exception: ${error}`);
|
|
14906
|
+
done(error);
|
|
14907
|
+
}
|
|
14908
|
+
}).timeout(attemptTimeout);
|
|
14909
|
+
});
|
|
14910
|
+
|
|
14911
|
+
describe('#removeIcebergNetworkGroupNetworkGroupById - errors', () => {
|
|
14912
|
+
it('should have a removeIcebergNetworkGroupNetworkGroupById function', (done) => {
|
|
14913
|
+
try {
|
|
14914
|
+
assert.equal(true, typeof a.removeIcebergNetworkGroupNetworkGroupById === 'function');
|
|
14915
|
+
done();
|
|
14916
|
+
} catch (error) {
|
|
14917
|
+
log.error(`Test Failure: ${error}`);
|
|
14918
|
+
done(error);
|
|
14919
|
+
}
|
|
14920
|
+
}).timeout(attemptTimeout);
|
|
14921
|
+
it('should error if - missing networkGroupName', (done) => {
|
|
14922
|
+
try {
|
|
14923
|
+
a.removeIcebergNetworkGroupNetworkGroupById(null, (data, error) => {
|
|
14924
|
+
try {
|
|
14925
|
+
const displayE = 'networkGroupName is required';
|
|
14926
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-paragon_insights-adapter-removeIcebergNetworkGroupNetworkGroupById', displayE);
|
|
14927
|
+
done();
|
|
14928
|
+
} catch (err) {
|
|
14929
|
+
log.error(`Test Failure: ${err}`);
|
|
14930
|
+
done(err);
|
|
14931
|
+
}
|
|
14932
|
+
});
|
|
14933
|
+
} catch (error) {
|
|
14934
|
+
log.error(`Adapter Exception: ${error}`);
|
|
14935
|
+
done(error);
|
|
14936
|
+
}
|
|
14937
|
+
}).timeout(attemptTimeout);
|
|
14938
|
+
});
|
|
14939
|
+
|
|
14940
|
+
describe('#retrieveHealthbotIngestSettingsPaa - errors', () => {
|
|
14941
|
+
it('should have a retrieveHealthbotIngestSettingsPaa function', (done) => {
|
|
14942
|
+
try {
|
|
14943
|
+
assert.equal(true, typeof a.retrieveHealthbotIngestSettingsPaa === 'function');
|
|
14944
|
+
done();
|
|
14945
|
+
} catch (error) {
|
|
14946
|
+
log.error(`Test Failure: ${error}`);
|
|
14947
|
+
done(error);
|
|
14948
|
+
}
|
|
14949
|
+
}).timeout(attemptTimeout);
|
|
14950
|
+
});
|
|
14951
|
+
|
|
14952
|
+
describe('#deleteHealthbotIngestPaaByPaaName - errors', () => {
|
|
14953
|
+
it('should have a deleteHealthbotIngestPaaByPaaName function', (done) => {
|
|
14954
|
+
try {
|
|
14955
|
+
assert.equal(true, typeof a.deleteHealthbotIngestPaaByPaaName === 'function');
|
|
14956
|
+
done();
|
|
14957
|
+
} catch (error) {
|
|
14958
|
+
log.error(`Test Failure: ${error}`);
|
|
14959
|
+
done(error);
|
|
14960
|
+
}
|
|
14961
|
+
}).timeout(attemptTimeout);
|
|
14962
|
+
it('should error if - missing paaName', (done) => {
|
|
14963
|
+
try {
|
|
14964
|
+
a.deleteHealthbotIngestPaaByPaaName(null, (data, error) => {
|
|
14965
|
+
try {
|
|
14966
|
+
const displayE = 'paaName is required';
|
|
14967
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-paragon_insights-adapter-deleteHealthbotIngestPaaByPaaName', displayE);
|
|
14968
|
+
done();
|
|
14969
|
+
} catch (err) {
|
|
14970
|
+
log.error(`Test Failure: ${err}`);
|
|
14971
|
+
done(err);
|
|
14972
|
+
}
|
|
14973
|
+
});
|
|
14974
|
+
} catch (error) {
|
|
14975
|
+
log.error(`Adapter Exception: ${error}`);
|
|
14976
|
+
done(error);
|
|
14977
|
+
}
|
|
14978
|
+
}).timeout(attemptTimeout);
|
|
14979
|
+
});
|
|
14980
|
+
|
|
14981
|
+
describe('#retrieveHealthbotIngestPaaByPaaName - errors', () => {
|
|
14982
|
+
it('should have a retrieveHealthbotIngestPaaByPaaName function', (done) => {
|
|
14983
|
+
try {
|
|
14984
|
+
assert.equal(true, typeof a.retrieveHealthbotIngestPaaByPaaName === 'function');
|
|
14985
|
+
done();
|
|
14986
|
+
} catch (error) {
|
|
14987
|
+
log.error(`Test Failure: ${error}`);
|
|
14988
|
+
done(error);
|
|
14989
|
+
}
|
|
14990
|
+
}).timeout(attemptTimeout);
|
|
14991
|
+
it('should error if - missing paaName', (done) => {
|
|
14992
|
+
try {
|
|
14993
|
+
a.retrieveHealthbotIngestPaaByPaaName(null, null, (data, error) => {
|
|
14994
|
+
try {
|
|
14995
|
+
const displayE = 'paaName is required';
|
|
14996
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-paragon_insights-adapter-retrieveHealthbotIngestPaaByPaaName', displayE);
|
|
14997
|
+
done();
|
|
14998
|
+
} catch (err) {
|
|
14999
|
+
log.error(`Test Failure: ${err}`);
|
|
15000
|
+
done(err);
|
|
15001
|
+
}
|
|
15002
|
+
});
|
|
15003
|
+
} catch (error) {
|
|
15004
|
+
log.error(`Adapter Exception: ${error}`);
|
|
15005
|
+
done(error);
|
|
15006
|
+
}
|
|
15007
|
+
}).timeout(attemptTimeout);
|
|
15008
|
+
});
|
|
15009
|
+
|
|
15010
|
+
describe('#updateIngestPaaByPaaName - errors', () => {
|
|
15011
|
+
it('should have a updateIngestPaaByPaaName function', (done) => {
|
|
15012
|
+
try {
|
|
15013
|
+
assert.equal(true, typeof a.updateIngestPaaByPaaName === 'function');
|
|
15014
|
+
done();
|
|
15015
|
+
} catch (error) {
|
|
15016
|
+
log.error(`Test Failure: ${error}`);
|
|
15017
|
+
done(error);
|
|
15018
|
+
}
|
|
15019
|
+
}).timeout(attemptTimeout);
|
|
15020
|
+
it('should error if - missing paaName', (done) => {
|
|
15021
|
+
try {
|
|
15022
|
+
a.updateIngestPaaByPaaName(null, null, (data, error) => {
|
|
15023
|
+
try {
|
|
15024
|
+
const displayE = 'paaName is required';
|
|
15025
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-paragon_insights-adapter-updateIngestPaaByPaaName', displayE);
|
|
15026
|
+
done();
|
|
15027
|
+
} catch (err) {
|
|
15028
|
+
log.error(`Test Failure: ${err}`);
|
|
15029
|
+
done(err);
|
|
15030
|
+
}
|
|
15031
|
+
});
|
|
15032
|
+
} catch (error) {
|
|
15033
|
+
log.error(`Adapter Exception: ${error}`);
|
|
15034
|
+
done(error);
|
|
15035
|
+
}
|
|
15036
|
+
}).timeout(attemptTimeout);
|
|
15037
|
+
it('should error if - missing body', (done) => {
|
|
15038
|
+
try {
|
|
15039
|
+
a.updateIngestPaaByPaaName('fakeparam', null, (data, error) => {
|
|
15040
|
+
try {
|
|
15041
|
+
const displayE = 'body is required';
|
|
15042
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-paragon_insights-adapter-updateIngestPaaByPaaName', displayE);
|
|
15043
|
+
done();
|
|
15044
|
+
} catch (err) {
|
|
15045
|
+
log.error(`Test Failure: ${err}`);
|
|
15046
|
+
done(err);
|
|
15047
|
+
}
|
|
15048
|
+
});
|
|
15049
|
+
} catch (error) {
|
|
15050
|
+
log.error(`Adapter Exception: ${error}`);
|
|
15051
|
+
done(error);
|
|
15052
|
+
}
|
|
15053
|
+
}).timeout(attemptTimeout);
|
|
15054
|
+
});
|
|
15055
|
+
|
|
15056
|
+
describe('#createIngestPaaByPaaName - errors', () => {
|
|
15057
|
+
it('should have a createIngestPaaByPaaName function', (done) => {
|
|
15058
|
+
try {
|
|
15059
|
+
assert.equal(true, typeof a.createIngestPaaByPaaName === 'function');
|
|
15060
|
+
done();
|
|
15061
|
+
} catch (error) {
|
|
15062
|
+
log.error(`Test Failure: ${error}`);
|
|
15063
|
+
done(error);
|
|
15064
|
+
}
|
|
15065
|
+
}).timeout(attemptTimeout);
|
|
15066
|
+
it('should error if - missing paaName', (done) => {
|
|
15067
|
+
try {
|
|
15068
|
+
a.createIngestPaaByPaaName(null, null, (data, error) => {
|
|
15069
|
+
try {
|
|
15070
|
+
const displayE = 'paaName is required';
|
|
15071
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-paragon_insights-adapter-createIngestPaaByPaaName', displayE);
|
|
15072
|
+
done();
|
|
15073
|
+
} catch (err) {
|
|
15074
|
+
log.error(`Test Failure: ${err}`);
|
|
15075
|
+
done(err);
|
|
15076
|
+
}
|
|
15077
|
+
});
|
|
15078
|
+
} catch (error) {
|
|
15079
|
+
log.error(`Adapter Exception: ${error}`);
|
|
15080
|
+
done(error);
|
|
15081
|
+
}
|
|
15082
|
+
}).timeout(attemptTimeout);
|
|
15083
|
+
it('should error if - missing body', (done) => {
|
|
15084
|
+
try {
|
|
15085
|
+
a.createIngestPaaByPaaName('fakeparam', null, (data, error) => {
|
|
15086
|
+
try {
|
|
15087
|
+
const displayE = 'body is required';
|
|
15088
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-paragon_insights-adapter-createIngestPaaByPaaName', displayE);
|
|
15089
|
+
done();
|
|
15090
|
+
} catch (err) {
|
|
15091
|
+
log.error(`Test Failure: ${err}`);
|
|
15092
|
+
done(err);
|
|
15093
|
+
}
|
|
15094
|
+
});
|
|
15095
|
+
} catch (error) {
|
|
15096
|
+
log.error(`Adapter Exception: ${error}`);
|
|
15097
|
+
done(error);
|
|
15098
|
+
}
|
|
15099
|
+
}).timeout(attemptTimeout);
|
|
15100
|
+
});
|
|
15101
|
+
|
|
15102
|
+
describe('#deleteHealthbotIngestIfa - errors', () => {
|
|
15103
|
+
it('should have a deleteHealthbotIngestIfa function', (done) => {
|
|
15104
|
+
try {
|
|
15105
|
+
assert.equal(true, typeof a.deleteHealthbotIngestIfa === 'function');
|
|
15106
|
+
done();
|
|
15107
|
+
} catch (error) {
|
|
15108
|
+
log.error(`Test Failure: ${error}`);
|
|
15109
|
+
done(error);
|
|
15110
|
+
}
|
|
15111
|
+
}).timeout(attemptTimeout);
|
|
15112
|
+
});
|
|
15113
|
+
|
|
15114
|
+
describe('#retrieveHealthbotIngestIfa - errors', () => {
|
|
15115
|
+
it('should have a retrieveHealthbotIngestIfa function', (done) => {
|
|
15116
|
+
try {
|
|
15117
|
+
assert.equal(true, typeof a.retrieveHealthbotIngestIfa === 'function');
|
|
15118
|
+
done();
|
|
15119
|
+
} catch (error) {
|
|
15120
|
+
log.error(`Test Failure: ${error}`);
|
|
15121
|
+
done(error);
|
|
15122
|
+
}
|
|
15123
|
+
}).timeout(attemptTimeout);
|
|
15124
|
+
});
|
|
15125
|
+
|
|
15126
|
+
describe('#createHealthbotIngestIfa - errors', () => {
|
|
15127
|
+
it('should have a createHealthbotIngestIfa function', (done) => {
|
|
15128
|
+
try {
|
|
15129
|
+
assert.equal(true, typeof a.createHealthbotIngestIfa === 'function');
|
|
15130
|
+
done();
|
|
15131
|
+
} catch (error) {
|
|
15132
|
+
log.error(`Test Failure: ${error}`);
|
|
15133
|
+
done(error);
|
|
15134
|
+
}
|
|
15135
|
+
}).timeout(attemptTimeout);
|
|
15136
|
+
it('should error if - missing body', (done) => {
|
|
15137
|
+
try {
|
|
15138
|
+
a.createHealthbotIngestIfa(null, (data, error) => {
|
|
15139
|
+
try {
|
|
15140
|
+
const displayE = 'body is required';
|
|
15141
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-paragon_insights-adapter-createHealthbotIngestIfa', displayE);
|
|
15142
|
+
done();
|
|
15143
|
+
} catch (err) {
|
|
15144
|
+
log.error(`Test Failure: ${err}`);
|
|
15145
|
+
done(err);
|
|
15146
|
+
}
|
|
15147
|
+
});
|
|
15148
|
+
} catch (error) {
|
|
15149
|
+
log.error(`Adapter Exception: ${error}`);
|
|
15150
|
+
done(error);
|
|
15151
|
+
}
|
|
15152
|
+
}).timeout(attemptTimeout);
|
|
15153
|
+
});
|
|
15154
|
+
|
|
15155
|
+
describe('#updateHealthbotIngestIfa - errors', () => {
|
|
15156
|
+
it('should have a updateHealthbotIngestIfa function', (done) => {
|
|
15157
|
+
try {
|
|
15158
|
+
assert.equal(true, typeof a.updateHealthbotIngestIfa === 'function');
|
|
15159
|
+
done();
|
|
15160
|
+
} catch (error) {
|
|
15161
|
+
log.error(`Test Failure: ${error}`);
|
|
15162
|
+
done(error);
|
|
15163
|
+
}
|
|
15164
|
+
}).timeout(attemptTimeout);
|
|
15165
|
+
it('should error if - missing body', (done) => {
|
|
15166
|
+
try {
|
|
15167
|
+
a.updateHealthbotIngestIfa(null, (data, error) => {
|
|
15168
|
+
try {
|
|
15169
|
+
const displayE = 'body is required';
|
|
15170
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-paragon_insights-adapter-updateHealthbotIngestIfa', displayE);
|
|
15171
|
+
done();
|
|
15172
|
+
} catch (err) {
|
|
15173
|
+
log.error(`Test Failure: ${err}`);
|
|
15174
|
+
done(err);
|
|
15175
|
+
}
|
|
15176
|
+
});
|
|
15177
|
+
} catch (error) {
|
|
15178
|
+
log.error(`Adapter Exception: ${error}`);
|
|
15179
|
+
done(error);
|
|
15180
|
+
}
|
|
15181
|
+
}).timeout(attemptTimeout);
|
|
15182
|
+
});
|
|
15183
|
+
|
|
15184
|
+
describe('#retrieveHealthbotIngestIfaDeviceIds - errors', () => {
|
|
15185
|
+
it('should have a retrieveHealthbotIngestIfaDeviceIds function', (done) => {
|
|
15186
|
+
try {
|
|
15187
|
+
assert.equal(true, typeof a.retrieveHealthbotIngestIfaDeviceIds === 'function');
|
|
15188
|
+
done();
|
|
15189
|
+
} catch (error) {
|
|
15190
|
+
log.error(`Test Failure: ${error}`);
|
|
15191
|
+
done(error);
|
|
15192
|
+
}
|
|
15193
|
+
}).timeout(attemptTimeout);
|
|
15194
|
+
});
|
|
15195
|
+
|
|
15196
|
+
describe('#retrieveHealthbotIngestIfaDevices - errors', () => {
|
|
15197
|
+
it('should have a retrieveHealthbotIngestIfaDevices function', (done) => {
|
|
15198
|
+
try {
|
|
15199
|
+
assert.equal(true, typeof a.retrieveHealthbotIngestIfaDevices === 'function');
|
|
15200
|
+
done();
|
|
15201
|
+
} catch (error) {
|
|
15202
|
+
log.error(`Test Failure: ${error}`);
|
|
15203
|
+
done(error);
|
|
15204
|
+
}
|
|
15205
|
+
}).timeout(attemptTimeout);
|
|
15206
|
+
});
|
|
15207
|
+
|
|
15208
|
+
describe('#deleteHealthbotIngestIfaDeviceById - errors', () => {
|
|
15209
|
+
it('should have a deleteHealthbotIngestIfaDeviceById function', (done) => {
|
|
15210
|
+
try {
|
|
15211
|
+
assert.equal(true, typeof a.deleteHealthbotIngestIfaDeviceById === 'function');
|
|
15212
|
+
done();
|
|
15213
|
+
} catch (error) {
|
|
15214
|
+
log.error(`Test Failure: ${error}`);
|
|
15215
|
+
done(error);
|
|
15216
|
+
}
|
|
15217
|
+
}).timeout(attemptTimeout);
|
|
15218
|
+
it('should error if - missing id', (done) => {
|
|
15219
|
+
try {
|
|
15220
|
+
a.deleteHealthbotIngestIfaDeviceById(null, (data, error) => {
|
|
15221
|
+
try {
|
|
15222
|
+
const displayE = 'id is required';
|
|
15223
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-paragon_insights-adapter-deleteHealthbotIngestIfaDeviceById', displayE);
|
|
15224
|
+
done();
|
|
15225
|
+
} catch (err) {
|
|
15226
|
+
log.error(`Test Failure: ${err}`);
|
|
15227
|
+
done(err);
|
|
15228
|
+
}
|
|
15229
|
+
});
|
|
15230
|
+
} catch (error) {
|
|
15231
|
+
log.error(`Adapter Exception: ${error}`);
|
|
15232
|
+
done(error);
|
|
15233
|
+
}
|
|
15234
|
+
}).timeout(attemptTimeout);
|
|
15235
|
+
});
|
|
15236
|
+
|
|
15237
|
+
describe('#retrieveHealthbotIngestIfaDeviceById - errors', () => {
|
|
15238
|
+
it('should have a retrieveHealthbotIngestIfaDeviceById function', (done) => {
|
|
15239
|
+
try {
|
|
15240
|
+
assert.equal(true, typeof a.retrieveHealthbotIngestIfaDeviceById === 'function');
|
|
15241
|
+
done();
|
|
15242
|
+
} catch (error) {
|
|
15243
|
+
log.error(`Test Failure: ${error}`);
|
|
15244
|
+
done(error);
|
|
15245
|
+
}
|
|
15246
|
+
}).timeout(attemptTimeout);
|
|
15247
|
+
it('should error if - missing id', (done) => {
|
|
15248
|
+
try {
|
|
15249
|
+
a.retrieveHealthbotIngestIfaDeviceById(null, null, (data, error) => {
|
|
15250
|
+
try {
|
|
15251
|
+
const displayE = 'id is required';
|
|
15252
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-paragon_insights-adapter-retrieveHealthbotIngestIfaDeviceById', displayE);
|
|
15253
|
+
done();
|
|
15254
|
+
} catch (err) {
|
|
15255
|
+
log.error(`Test Failure: ${err}`);
|
|
15256
|
+
done(err);
|
|
15257
|
+
}
|
|
15258
|
+
});
|
|
15259
|
+
} catch (error) {
|
|
15260
|
+
log.error(`Adapter Exception: ${error}`);
|
|
15261
|
+
done(error);
|
|
15262
|
+
}
|
|
15263
|
+
}).timeout(attemptTimeout);
|
|
15264
|
+
});
|
|
15265
|
+
|
|
15266
|
+
describe('#createHealthbotIngestIfaDeviceById - errors', () => {
|
|
15267
|
+
it('should have a createHealthbotIngestIfaDeviceById function', (done) => {
|
|
15268
|
+
try {
|
|
15269
|
+
assert.equal(true, typeof a.createHealthbotIngestIfaDeviceById === 'function');
|
|
15270
|
+
done();
|
|
15271
|
+
} catch (error) {
|
|
15272
|
+
log.error(`Test Failure: ${error}`);
|
|
15273
|
+
done(error);
|
|
15274
|
+
}
|
|
15275
|
+
}).timeout(attemptTimeout);
|
|
15276
|
+
it('should error if - missing id', (done) => {
|
|
15277
|
+
try {
|
|
15278
|
+
a.createHealthbotIngestIfaDeviceById(null, null, (data, error) => {
|
|
15279
|
+
try {
|
|
15280
|
+
const displayE = 'id is required';
|
|
15281
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-paragon_insights-adapter-createHealthbotIngestIfaDeviceById', displayE);
|
|
15282
|
+
done();
|
|
15283
|
+
} catch (err) {
|
|
15284
|
+
log.error(`Test Failure: ${err}`);
|
|
15285
|
+
done(err);
|
|
15286
|
+
}
|
|
15287
|
+
});
|
|
15288
|
+
} catch (error) {
|
|
15289
|
+
log.error(`Adapter Exception: ${error}`);
|
|
15290
|
+
done(error);
|
|
15291
|
+
}
|
|
15292
|
+
}).timeout(attemptTimeout);
|
|
15293
|
+
it('should error if - missing body', (done) => {
|
|
15294
|
+
try {
|
|
15295
|
+
a.createHealthbotIngestIfaDeviceById('fakeparam', null, (data, error) => {
|
|
15296
|
+
try {
|
|
15297
|
+
const displayE = 'body is required';
|
|
15298
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-paragon_insights-adapter-createHealthbotIngestIfaDeviceById', displayE);
|
|
15299
|
+
done();
|
|
15300
|
+
} catch (err) {
|
|
15301
|
+
log.error(`Test Failure: ${err}`);
|
|
15302
|
+
done(err);
|
|
15303
|
+
}
|
|
15304
|
+
});
|
|
15305
|
+
} catch (error) {
|
|
15306
|
+
log.error(`Adapter Exception: ${error}`);
|
|
15307
|
+
done(error);
|
|
15308
|
+
}
|
|
15309
|
+
}).timeout(attemptTimeout);
|
|
15310
|
+
});
|
|
15311
|
+
|
|
15312
|
+
describe('#updateHealthbotIngestIfaDeviceById - errors', () => {
|
|
15313
|
+
it('should have a updateHealthbotIngestIfaDeviceById function', (done) => {
|
|
15314
|
+
try {
|
|
15315
|
+
assert.equal(true, typeof a.updateHealthbotIngestIfaDeviceById === 'function');
|
|
15316
|
+
done();
|
|
15317
|
+
} catch (error) {
|
|
15318
|
+
log.error(`Test Failure: ${error}`);
|
|
15319
|
+
done(error);
|
|
15320
|
+
}
|
|
15321
|
+
}).timeout(attemptTimeout);
|
|
15322
|
+
it('should error if - missing id', (done) => {
|
|
15323
|
+
try {
|
|
15324
|
+
a.updateHealthbotIngestIfaDeviceById(null, null, (data, error) => {
|
|
15325
|
+
try {
|
|
15326
|
+
const displayE = 'id is required';
|
|
15327
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-paragon_insights-adapter-updateHealthbotIngestIfaDeviceById', displayE);
|
|
15328
|
+
done();
|
|
15329
|
+
} catch (err) {
|
|
15330
|
+
log.error(`Test Failure: ${err}`);
|
|
15331
|
+
done(err);
|
|
15332
|
+
}
|
|
15333
|
+
});
|
|
15334
|
+
} catch (error) {
|
|
15335
|
+
log.error(`Adapter Exception: ${error}`);
|
|
15336
|
+
done(error);
|
|
15337
|
+
}
|
|
15338
|
+
}).timeout(attemptTimeout);
|
|
15339
|
+
it('should error if - missing body', (done) => {
|
|
15340
|
+
try {
|
|
15341
|
+
a.updateHealthbotIngestIfaDeviceById('fakeparam', null, (data, error) => {
|
|
15342
|
+
try {
|
|
15343
|
+
const displayE = 'body is required';
|
|
15344
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-paragon_insights-adapter-updateHealthbotIngestIfaDeviceById', displayE);
|
|
15345
|
+
done();
|
|
15346
|
+
} catch (err) {
|
|
15347
|
+
log.error(`Test Failure: ${err}`);
|
|
15348
|
+
done(err);
|
|
15349
|
+
}
|
|
15350
|
+
});
|
|
15351
|
+
} catch (error) {
|
|
15352
|
+
log.error(`Adapter Exception: ${error}`);
|
|
15353
|
+
done(error);
|
|
15354
|
+
}
|
|
15355
|
+
}).timeout(attemptTimeout);
|
|
15356
|
+
});
|
|
15357
|
+
|
|
15358
|
+
describe('#postJunosEncode - errors', () => {
|
|
15359
|
+
it('should have a postJunosEncode function', (done) => {
|
|
15360
|
+
try {
|
|
15361
|
+
assert.equal(true, typeof a.postJunosEncode === 'function');
|
|
15362
|
+
done();
|
|
15363
|
+
} catch (error) {
|
|
15364
|
+
log.error(`Test Failure: ${error}`);
|
|
15365
|
+
done(error);
|
|
15366
|
+
}
|
|
15367
|
+
}).timeout(attemptTimeout);
|
|
15368
|
+
it('should error if - missing body', (done) => {
|
|
15369
|
+
try {
|
|
15370
|
+
a.postJunosEncode(null, (data, error) => {
|
|
15371
|
+
try {
|
|
15372
|
+
const displayE = 'body is required';
|
|
15373
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-paragon_insights-adapter-postJunosEncode', displayE);
|
|
15374
|
+
done();
|
|
15375
|
+
} catch (err) {
|
|
15376
|
+
log.error(`Test Failure: ${err}`);
|
|
15377
|
+
done(err);
|
|
15378
|
+
}
|
|
15379
|
+
});
|
|
15380
|
+
} catch (error) {
|
|
15381
|
+
log.error(`Adapter Exception: ${error}`);
|
|
15382
|
+
done(error);
|
|
15383
|
+
}
|
|
15384
|
+
}).timeout(attemptTimeout);
|
|
15385
|
+
});
|
|
15386
|
+
|
|
15387
|
+
describe('#postJunosDecode - errors', () => {
|
|
15388
|
+
it('should have a postJunosDecode function', (done) => {
|
|
15389
|
+
try {
|
|
15390
|
+
assert.equal(true, typeof a.postJunosDecode === 'function');
|
|
15391
|
+
done();
|
|
15392
|
+
} catch (error) {
|
|
15393
|
+
log.error(`Test Failure: ${error}`);
|
|
15394
|
+
done(error);
|
|
15395
|
+
}
|
|
15396
|
+
}).timeout(attemptTimeout);
|
|
15397
|
+
it('should error if - missing body', (done) => {
|
|
15398
|
+
try {
|
|
15399
|
+
a.postJunosDecode(null, (data, error) => {
|
|
15400
|
+
try {
|
|
15401
|
+
const displayE = 'body is required';
|
|
15402
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-paragon_insights-adapter-postJunosDecode', displayE);
|
|
15403
|
+
done();
|
|
15404
|
+
} catch (err) {
|
|
15405
|
+
log.error(`Test Failure: ${err}`);
|
|
15406
|
+
done(err);
|
|
15407
|
+
}
|
|
15408
|
+
});
|
|
15409
|
+
} catch (error) {
|
|
15410
|
+
log.error(`Adapter Exception: ${error}`);
|
|
15411
|
+
done(error);
|
|
15412
|
+
}
|
|
15413
|
+
}).timeout(attemptTimeout);
|
|
15414
|
+
});
|
|
14655
15415
|
});
|
|
14656
15416
|
});
|