@itentialopensource/adapter-sevone 2.4.0 → 2.5.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.
- package/CALLS.md +1661 -22
- package/CHANGELOG.md +16 -0
- package/CONTRIBUTING.md +1 -160
- package/ENHANCE.md +2 -2
- package/README.md +32 -23
- package/adapter.js +158 -668
- package/adapterBase.js +549 -879
- package/changelogs/CHANGELOG.md +118 -0
- package/metadata.json +49 -0
- package/package.json +24 -24
- package/pronghorn.json +980 -641
- package/propertiesSchema.json +431 -31
- package/refs?service=git-upload-pack +0 -0
- package/report/adapter-openapi.json +26172 -0
- package/report/adapter-openapi.yaml +11817 -0
- package/report/adapterInfo.json +8 -8
- package/report/updateReport1691508994383.json +120 -0
- package/report/updateReport1692202309339.json +120 -0
- package/report/updateReport1692203396464.json +120 -0
- package/report/updateReport1694470055393.json +120 -0
- package/report/updateReport1698423190930.json +120 -0
- package/sampleProperties.json +63 -2
- package/test/integration/adapterTestBasicGet.js +2 -4
- package/test/integration/adapterTestConnectivity.js +91 -42
- package/test/integration/adapterTestIntegration.js +130 -2
- package/test/unit/adapterBaseTestUnit.js +388 -313
- package/test/unit/adapterTestUnit.js +384 -158
- 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 +2 -2
- package/utils/findPath.js +1 -1
- package/utils/methodDocumentor.js +273 -0
- package/utils/modify.js +13 -15
- package/utils/packModificationScript.js +1 -1
- package/utils/pre-commit.sh +2 -0
- package/utils/taskMover.js +309 -0
- package/utils/tbScript.js +89 -34
- package/utils/tbUtils.js +41 -21
- package/utils/testRunner.js +1 -1
- package/utils/troubleshootingAdapter.js +9 -6
- package/workflows/README.md +0 -3
|
@@ -8,16 +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
|
+
const Ajv = require('ajv');
|
|
20
21
|
|
|
22
|
+
const ajv = new Ajv({ strictSchema: false, allErrors: true, allowUnionTypes: true });
|
|
21
23
|
const anything = td.matchers.anything();
|
|
22
24
|
let logLevel = 'none';
|
|
23
25
|
const isRapidFail = false;
|
|
@@ -41,7 +43,7 @@ samProps.protocol = 'http';
|
|
|
41
43
|
samProps.port = 80;
|
|
42
44
|
samProps.ssl.enabled = false;
|
|
43
45
|
samProps.ssl.accept_invalid_cert = false;
|
|
44
|
-
samProps.request.attempt_timeout =
|
|
46
|
+
samProps.request.attempt_timeout = 1200000;
|
|
45
47
|
const attemptTimeout = samProps.request.attempt_timeout;
|
|
46
48
|
const { stub } = samProps;
|
|
47
49
|
|
|
@@ -220,19 +222,24 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
220
222
|
it('package.json should be validated', (done) => {
|
|
221
223
|
try {
|
|
222
224
|
const packageDotJson = require('../../package.json');
|
|
223
|
-
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
|
|
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']
|
|
227
234
|
};
|
|
228
|
-
const
|
|
235
|
+
const validate = ajv.compile(packageJsonSchema);
|
|
236
|
+
const isValid = validate(packageDotJson);
|
|
229
237
|
|
|
230
|
-
if (
|
|
231
|
-
log.error('The package.json contains
|
|
232
|
-
|
|
233
|
-
assert.equal(true, results.valid);
|
|
238
|
+
if (isValid === false) {
|
|
239
|
+
log.error('The package.json contains errors');
|
|
240
|
+
assert.equal(true, isValid);
|
|
234
241
|
} else {
|
|
235
|
-
assert.equal(true,
|
|
242
|
+
assert.equal(true, isValid);
|
|
236
243
|
}
|
|
237
244
|
|
|
238
245
|
done();
|
|
@@ -271,7 +278,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
271
278
|
assert.notEqual(undefined, packageDotJson.scripts);
|
|
272
279
|
assert.notEqual(null, packageDotJson.scripts);
|
|
273
280
|
assert.notEqual('', packageDotJson.scripts);
|
|
274
|
-
assert.equal('node utils/setup.js
|
|
281
|
+
assert.equal('node utils/setup.js', packageDotJson.scripts.preinstall);
|
|
275
282
|
assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js', packageDotJson.scripts.lint);
|
|
276
283
|
assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js --quiet', packageDotJson.scripts['lint:errors']);
|
|
277
284
|
assert.equal('mocha test/unit/adapterBaseTestUnit.js --LOG=error', packageDotJson.scripts['test:baseunit']);
|
|
@@ -308,17 +315,17 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
308
315
|
assert.notEqual(undefined, packageDotJson.dependencies);
|
|
309
316
|
assert.notEqual(null, packageDotJson.dependencies);
|
|
310
317
|
assert.notEqual('', packageDotJson.dependencies);
|
|
311
|
-
assert.equal('^
|
|
312
|
-
assert.equal('^
|
|
313
|
-
assert.equal('^
|
|
314
|
-
assert.equal('^
|
|
315
|
-
assert.equal('^
|
|
318
|
+
assert.equal('^8.12.0', packageDotJson.dependencies.ajv);
|
|
319
|
+
assert.equal('^1.6.7', 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.3.0', packageDotJson.dependencies.mocha);
|
|
316
323
|
assert.equal('^2.0.1', packageDotJson.dependencies['mocha-param']);
|
|
317
|
-
assert.equal('^0.5.3', packageDotJson.dependencies['network-diagnostics']);
|
|
318
324
|
assert.equal('^15.1.0', packageDotJson.dependencies.nyc);
|
|
325
|
+
assert.equal('^0.4.4', packageDotJson.dependencies.ping);
|
|
319
326
|
assert.equal('^1.4.10', packageDotJson.dependencies['readline-sync']);
|
|
320
|
-
assert.equal('^7.3
|
|
321
|
-
assert.equal('^3.
|
|
327
|
+
assert.equal('^7.5.3', packageDotJson.dependencies.semver);
|
|
328
|
+
assert.equal('^3.9.0', packageDotJson.dependencies.winston);
|
|
322
329
|
done();
|
|
323
330
|
} catch (error) {
|
|
324
331
|
log.error(`Test Failure: ${error}`);
|
|
@@ -331,13 +338,12 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
331
338
|
assert.notEqual(undefined, packageDotJson.devDependencies);
|
|
332
339
|
assert.notEqual(null, packageDotJson.devDependencies);
|
|
333
340
|
assert.notEqual('', packageDotJson.devDependencies);
|
|
334
|
-
assert.equal('^4.3.
|
|
335
|
-
assert.equal('^
|
|
336
|
-
assert.equal('^
|
|
337
|
-
assert.equal('^2.
|
|
338
|
-
assert.equal('^3.
|
|
339
|
-
assert.equal('^
|
|
340
|
-
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);
|
|
341
347
|
done();
|
|
342
348
|
} catch (error) {
|
|
343
349
|
log.error(`Test Failure: ${error}`);
|
|
@@ -381,16 +387,30 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
381
387
|
assert.equal(true, Array.isArray(pronghornDotJson.methods));
|
|
382
388
|
assert.notEqual(0, pronghornDotJson.methods.length);
|
|
383
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'));
|
|
384
393
|
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapFindAdapterPath'));
|
|
385
394
|
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapTroubleshootAdapter'));
|
|
386
395
|
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterHealthcheck'));
|
|
387
396
|
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterConnectivity'));
|
|
388
397
|
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterBasicGet'));
|
|
389
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
390
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
391
|
-
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'));
|
|
392
409
|
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequest'));
|
|
393
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'));
|
|
394
414
|
done();
|
|
395
415
|
} catch (error) {
|
|
396
416
|
log.error(`Test Failure: ${error}`);
|
|
@@ -511,6 +531,39 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
511
531
|
done(error);
|
|
512
532
|
}
|
|
513
533
|
});
|
|
534
|
+
it('pronghorn.json verify input/output schema objects', (done) => {
|
|
535
|
+
const verifySchema = (methodName, schema) => {
|
|
536
|
+
try {
|
|
537
|
+
ajv.compile(schema);
|
|
538
|
+
} catch (error) {
|
|
539
|
+
const errorMessage = `Invalid schema found in '${methodName}' method.
|
|
540
|
+
Schema => ${JSON.stringify(schema)}.
|
|
541
|
+
Details => ${error.message}`;
|
|
542
|
+
throw new Error(errorMessage);
|
|
543
|
+
}
|
|
544
|
+
};
|
|
545
|
+
|
|
546
|
+
try {
|
|
547
|
+
const pronghornDotJson = require('../../pronghorn.json');
|
|
548
|
+
const { methods } = pronghornDotJson;
|
|
549
|
+
for (let i = 0; i < methods.length; i += 1) {
|
|
550
|
+
for (let j = 0; j < methods[i].input.length; j += 1) {
|
|
551
|
+
const inputSchema = methods[i].input[j].schema;
|
|
552
|
+
if (inputSchema) {
|
|
553
|
+
verifySchema(methods[i].name, inputSchema);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
const outputSchema = methods[i].output.schema;
|
|
557
|
+
if (outputSchema) {
|
|
558
|
+
verifySchema(methods[i].name, outputSchema);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
done();
|
|
562
|
+
} catch (error) {
|
|
563
|
+
log.error(`Adapter Exception: ${error}`);
|
|
564
|
+
done(error);
|
|
565
|
+
}
|
|
566
|
+
}).timeout(attemptTimeout);
|
|
514
567
|
});
|
|
515
568
|
|
|
516
569
|
describe('propertiesSchema.json', () => {
|
|
@@ -546,6 +599,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
546
599
|
assert.equal('string', propertiesDotJson.properties.host.type);
|
|
547
600
|
assert.equal('integer', propertiesDotJson.properties.port.type);
|
|
548
601
|
assert.equal('boolean', propertiesDotJson.properties.stub.type);
|
|
602
|
+
assert.equal('string', propertiesDotJson.properties.protocol.type);
|
|
549
603
|
assert.notEqual(undefined, propertiesDotJson.definitions.authentication);
|
|
550
604
|
assert.notEqual(null, propertiesDotJson.definitions.authentication);
|
|
551
605
|
assert.notEqual('', propertiesDotJson.definitions.authentication);
|
|
@@ -579,7 +633,6 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
579
633
|
assert.equal('boolean', propertiesDotJson.properties.encode_pathvars.type);
|
|
580
634
|
assert.equal('boolean', propertiesDotJson.properties.encode_queryvars.type);
|
|
581
635
|
assert.equal(true, Array.isArray(propertiesDotJson.properties.save_metric.type));
|
|
582
|
-
assert.equal('string', propertiesDotJson.properties.protocol.type);
|
|
583
636
|
assert.notEqual(undefined, propertiesDotJson.definitions);
|
|
584
637
|
assert.notEqual(null, propertiesDotJson.definitions);
|
|
585
638
|
assert.notEqual('', propertiesDotJson.definitions);
|
|
@@ -736,6 +789,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
736
789
|
assert.notEqual(undefined, sampleDotJson.properties.host);
|
|
737
790
|
assert.notEqual(undefined, sampleDotJson.properties.port);
|
|
738
791
|
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
792
|
+
assert.notEqual(undefined, sampleDotJson.properties.protocol);
|
|
739
793
|
assert.notEqual(undefined, sampleDotJson.properties.authentication);
|
|
740
794
|
assert.notEqual(null, sampleDotJson.properties.authentication);
|
|
741
795
|
assert.notEqual('', sampleDotJson.properties.authentication);
|
|
@@ -769,7 +823,6 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
769
823
|
assert.notEqual(undefined, sampleDotJson.properties.encode_pathvars);
|
|
770
824
|
assert.notEqual(undefined, sampleDotJson.properties.encode_queryvars);
|
|
771
825
|
assert.notEqual(undefined, sampleDotJson.properties.save_metric);
|
|
772
|
-
assert.notEqual(undefined, sampleDotJson.properties.protocol);
|
|
773
826
|
assert.notEqual(undefined, sampleDotJson.properties.healthcheck);
|
|
774
827
|
assert.notEqual(null, sampleDotJson.properties.healthcheck);
|
|
775
828
|
assert.notEqual('', sampleDotJson.properties.healthcheck);
|
|
@@ -834,6 +887,8 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
834
887
|
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.isAlive);
|
|
835
888
|
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getConfig);
|
|
836
889
|
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getCount);
|
|
890
|
+
assert.notEqual(undefined, sampleDotJson.properties.cache);
|
|
891
|
+
assert.notEqual(undefined, sampleDotJson.properties.cache.entities);
|
|
837
892
|
done();
|
|
838
893
|
} catch (error) {
|
|
839
894
|
log.error(`Test Failure: ${error}`);
|
|
@@ -939,40 +994,6 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
939
994
|
});
|
|
940
995
|
});
|
|
941
996
|
|
|
942
|
-
describe('#iapFindAdapterPath', () => {
|
|
943
|
-
it('should have a iapFindAdapterPath function', (done) => {
|
|
944
|
-
try {
|
|
945
|
-
assert.equal(true, typeof a.iapFindAdapterPath === 'function');
|
|
946
|
-
done();
|
|
947
|
-
} catch (error) {
|
|
948
|
-
log.error(`Test Failure: ${error}`);
|
|
949
|
-
done(error);
|
|
950
|
-
}
|
|
951
|
-
});
|
|
952
|
-
it('iapFindAdapterPath should find atleast one path that matches', (done) => {
|
|
953
|
-
try {
|
|
954
|
-
a.iapFindAdapterPath('{base_path}/{version}', (data, error) => {
|
|
955
|
-
try {
|
|
956
|
-
assert.equal(undefined, error);
|
|
957
|
-
assert.notEqual(undefined, data);
|
|
958
|
-
assert.notEqual(null, data);
|
|
959
|
-
assert.equal(true, data.found);
|
|
960
|
-
assert.notEqual(undefined, data.foundIn);
|
|
961
|
-
assert.notEqual(null, data.foundIn);
|
|
962
|
-
assert.notEqual(0, data.foundIn.length);
|
|
963
|
-
done();
|
|
964
|
-
} catch (err) {
|
|
965
|
-
log.error(`Test Failure: ${err}`);
|
|
966
|
-
done(err);
|
|
967
|
-
}
|
|
968
|
-
});
|
|
969
|
-
} catch (error) {
|
|
970
|
-
log.error(`Adapter Exception: ${error}`);
|
|
971
|
-
done(error);
|
|
972
|
-
}
|
|
973
|
-
}).timeout(attemptTimeout);
|
|
974
|
-
});
|
|
975
|
-
|
|
976
997
|
describe('#iapSuspendAdapter', () => {
|
|
977
998
|
it('should have a iapSuspendAdapter function', (done) => {
|
|
978
999
|
try {
|
|
@@ -1009,6 +1030,40 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
1009
1030
|
});
|
|
1010
1031
|
});
|
|
1011
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
|
+
|
|
1012
1067
|
describe('#iapTroubleshootAdapter', () => {
|
|
1013
1068
|
it('should have a iapTroubleshootAdapter function', (done) => {
|
|
1014
1069
|
try {
|
|
@@ -1154,49 +1209,53 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
1154
1209
|
}).timeout(attemptTimeout);
|
|
1155
1210
|
});
|
|
1156
1211
|
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
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
|
+
});
|
|
1200
1259
|
|
|
1201
1260
|
describe('#hasEntities', () => {
|
|
1202
1261
|
it('should have a hasEntities function', (done) => {
|
|
@@ -1270,6 +1329,173 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
1270
1329
|
});
|
|
1271
1330
|
});
|
|
1272
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-sevone', 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-sevone', 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
|
+
});
|
|
1273
1499
|
/*
|
|
1274
1500
|
-----------------------------------------------------------------------
|
|
1275
1501
|
-----------------------------------------------------------------------
|
|
@@ -1354,7 +1580,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
1354
1580
|
const device = { ipAddress: '10.10.10.1' };
|
|
1355
1581
|
a.createDevice(device, (data, error) => {
|
|
1356
1582
|
try {
|
|
1357
|
-
const displayE = 'Schema validation failed on
|
|
1583
|
+
const displayE = 'Schema validation failed on must have required property \'name\'';
|
|
1358
1584
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
1359
1585
|
done();
|
|
1360
1586
|
} catch (err) {
|
|
@@ -1418,7 +1644,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
1418
1644
|
const device = { ipAddress: '10.10.10.1' };
|
|
1419
1645
|
a.updateDevice(deviceId, device, (data, error) => {
|
|
1420
1646
|
try {
|
|
1421
|
-
const displayE = 'Schema validation failed on
|
|
1647
|
+
const displayE = 'Schema validation failed on must have required property \'name\'';
|
|
1422
1648
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
1423
1649
|
done();
|
|
1424
1650
|
} catch (err) {
|
|
@@ -1509,7 +1735,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
1509
1735
|
const deviceGrp = { parentId: 1 };
|
|
1510
1736
|
a.createDeviceGroup(deviceGrp, (data, error) => {
|
|
1511
1737
|
try {
|
|
1512
|
-
const displayE = 'Schema validation failed on
|
|
1738
|
+
const displayE = 'Schema validation failed on must have required property \'name\'';
|
|
1513
1739
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
1514
1740
|
done();
|
|
1515
1741
|
} catch (err) {
|
|
@@ -1527,7 +1753,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
1527
1753
|
const deviceGrp = { name: 'blah' };
|
|
1528
1754
|
a.createDeviceGroup(deviceGrp, (data, error) => {
|
|
1529
1755
|
try {
|
|
1530
|
-
const displayE = 'Schema validation failed on
|
|
1756
|
+
const displayE = 'Schema validation failed on must have required property \'parentId\'';
|
|
1531
1757
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
1532
1758
|
done();
|
|
1533
1759
|
} catch (err) {
|
|
@@ -1637,7 +1863,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
1637
1863
|
const deviceGrp = { parentId: 1 };
|
|
1638
1864
|
a.updateDeviceGroup(deviceGrpId, deviceGrp, (data, error) => {
|
|
1639
1865
|
try {
|
|
1640
|
-
const displayE = 'Schema validation failed on
|
|
1866
|
+
const displayE = 'Schema validation failed on must have required property \'name\'';
|
|
1641
1867
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
1642
1868
|
done();
|
|
1643
1869
|
} catch (err) {
|
|
@@ -1655,7 +1881,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
1655
1881
|
const deviceGrp = { name: 'blah' };
|
|
1656
1882
|
a.updateDeviceGroup(deviceGrpId, deviceGrp, (data, error) => {
|
|
1657
1883
|
try {
|
|
1658
|
-
const displayE = 'Schema validation failed on
|
|
1884
|
+
const displayE = 'Schema validation failed on must have required property \'parentId\'';
|
|
1659
1885
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
1660
1886
|
done();
|
|
1661
1887
|
} catch (err) {
|
|
@@ -1916,7 +2142,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
1916
2142
|
};
|
|
1917
2143
|
a.createDeviceComponent(deviceId, deviceComp, (data, error) => {
|
|
1918
2144
|
try {
|
|
1919
|
-
const displayE = 'Schema validation failed on
|
|
2145
|
+
const displayE = 'Schema validation failed on must have required property \'name\'';
|
|
1920
2146
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
1921
2147
|
done();
|
|
1922
2148
|
} catch (err) {
|
|
@@ -1936,7 +2162,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
1936
2162
|
};
|
|
1937
2163
|
a.createDeviceComponent(deviceId, deviceComp, (data, error) => {
|
|
1938
2164
|
try {
|
|
1939
|
-
const displayE = 'Schema validation failed on
|
|
2165
|
+
const displayE = 'Schema validation failed on must have required property \'description\'';
|
|
1940
2166
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
1941
2167
|
done();
|
|
1942
2168
|
} catch (err) {
|
|
@@ -1956,7 +2182,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
1956
2182
|
};
|
|
1957
2183
|
a.createDeviceComponent(deviceId, deviceComp, (data, error) => {
|
|
1958
2184
|
try {
|
|
1959
|
-
const displayE = 'Schema validation failed on
|
|
2185
|
+
const displayE = 'Schema validation failed on must have required property \'pluginId\'';
|
|
1960
2186
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
1961
2187
|
done();
|
|
1962
2188
|
} catch (err) {
|
|
@@ -1976,7 +2202,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
1976
2202
|
};
|
|
1977
2203
|
a.createDeviceComponent(deviceId, deviceComp, (data, error) => {
|
|
1978
2204
|
try {
|
|
1979
|
-
const displayE = 'Schema validation failed on
|
|
2205
|
+
const displayE = 'Schema validation failed on must have required property \'pluginObjectTypeId\'';
|
|
1980
2206
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
1981
2207
|
done();
|
|
1982
2208
|
} catch (err) {
|
|
@@ -2059,7 +2285,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
2059
2285
|
};
|
|
2060
2286
|
a.updateDeviceComponent(deviceId, deviceCompId, deviceComp, (data, error) => {
|
|
2061
2287
|
try {
|
|
2062
|
-
const displayE = 'Schema validation failed on
|
|
2288
|
+
const displayE = 'Schema validation failed on must have required property \'name\'';
|
|
2063
2289
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
2064
2290
|
done();
|
|
2065
2291
|
} catch (err) {
|
|
@@ -2079,7 +2305,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
2079
2305
|
};
|
|
2080
2306
|
a.updateDeviceComponent(deviceId, deviceCompId, deviceComp, (data, error) => {
|
|
2081
2307
|
try {
|
|
2082
|
-
const displayE = 'Schema validation failed on
|
|
2308
|
+
const displayE = 'Schema validation failed on must have required property \'description\'';
|
|
2083
2309
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
2084
2310
|
done();
|
|
2085
2311
|
} catch (err) {
|
|
@@ -2099,7 +2325,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
2099
2325
|
};
|
|
2100
2326
|
a.updateDeviceComponent(deviceId, deviceCompId, deviceComp, (data, error) => {
|
|
2101
2327
|
try {
|
|
2102
|
-
const displayE = 'Schema validation failed on
|
|
2328
|
+
const displayE = 'Schema validation failed on must have required property \'pluginId\'';
|
|
2103
2329
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
2104
2330
|
done();
|
|
2105
2331
|
} catch (err) {
|
|
@@ -2119,7 +2345,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
2119
2345
|
};
|
|
2120
2346
|
a.updateDeviceComponent(deviceId, deviceCompId, deviceComp, (data, error) => {
|
|
2121
2347
|
try {
|
|
2122
|
-
const displayE = 'Schema validation failed on
|
|
2348
|
+
const displayE = 'Schema validation failed on must have required property \'pluginObjectTypeId\'';
|
|
2123
2349
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
2124
2350
|
done();
|
|
2125
2351
|
} catch (err) {
|
|
@@ -2227,7 +2453,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
2227
2453
|
const componentGrp = { parentId: 1 };
|
|
2228
2454
|
a.createComponentGroup(componentGrp, (data, error) => {
|
|
2229
2455
|
try {
|
|
2230
|
-
const displayE = 'Schema validation failed on
|
|
2456
|
+
const displayE = 'Schema validation failed on must have required property \'name\'';
|
|
2231
2457
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
2232
2458
|
done();
|
|
2233
2459
|
} catch (err) {
|
|
@@ -2245,7 +2471,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
2245
2471
|
const componentGrp = { name: 'blah' };
|
|
2246
2472
|
a.createComponentGroup(componentGrp, (data, error) => {
|
|
2247
2473
|
try {
|
|
2248
|
-
const displayE = 'Schema validation failed on
|
|
2474
|
+
const displayE = 'Schema validation failed on must have required property \'parentId\'';
|
|
2249
2475
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
2250
2476
|
done();
|
|
2251
2477
|
} catch (err) {
|
|
@@ -2372,7 +2598,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
2372
2598
|
const componentGrp = { parentId: 1 };
|
|
2373
2599
|
a.updateComponentGroup(componentGrpId, componentGrp, (data, error) => {
|
|
2374
2600
|
try {
|
|
2375
|
-
const displayE = 'Schema validation failed on
|
|
2601
|
+
const displayE = 'Schema validation failed on must have required property \'name\'';
|
|
2376
2602
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
2377
2603
|
done();
|
|
2378
2604
|
} catch (err) {
|
|
@@ -2390,7 +2616,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
2390
2616
|
const componentGrp = { name: 'blah' };
|
|
2391
2617
|
a.updateComponentGroup(componentGrpId, componentGrp, (data, error) => {
|
|
2392
2618
|
try {
|
|
2393
|
-
const displayE = 'Schema validation failed on
|
|
2619
|
+
const displayE = 'Schema validation failed on must have required property \'parentId\'';
|
|
2394
2620
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
2395
2621
|
done();
|
|
2396
2622
|
} catch (err) {
|
|
@@ -3111,7 +3337,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3111
3337
|
const mapObj = { imageId: 1 };
|
|
3112
3338
|
a.createMap(mapObj, (data, error) => {
|
|
3113
3339
|
try {
|
|
3114
|
-
const displayE = 'Schema validation failed on
|
|
3340
|
+
const displayE = 'Schema validation failed on must have required property \'name\'';
|
|
3115
3341
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3116
3342
|
done();
|
|
3117
3343
|
} catch (err) {
|
|
@@ -3129,7 +3355,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3129
3355
|
const mapObj = { name: 'blah' };
|
|
3130
3356
|
a.createMap(mapObj, (data, error) => {
|
|
3131
3357
|
try {
|
|
3132
|
-
const displayE = 'Schema validation failed on
|
|
3358
|
+
const displayE = 'Schema validation failed on must have required property \'imageId\'';
|
|
3133
3359
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3134
3360
|
done();
|
|
3135
3361
|
} catch (err) {
|
|
@@ -3193,7 +3419,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3193
3419
|
const mapObj = { imageId: 1 };
|
|
3194
3420
|
a.updateMap(mapId, mapObj, (data, error) => {
|
|
3195
3421
|
try {
|
|
3196
|
-
const displayE = 'Schema validation failed on
|
|
3422
|
+
const displayE = 'Schema validation failed on must have required property \'name\'';
|
|
3197
3423
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3198
3424
|
done();
|
|
3199
3425
|
} catch (err) {
|
|
@@ -3211,7 +3437,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3211
3437
|
const mapObj = { name: 'blah' };
|
|
3212
3438
|
a.updateMap(mapId, mapObj, (data, error) => {
|
|
3213
3439
|
try {
|
|
3214
|
-
const displayE = 'Schema validation failed on
|
|
3440
|
+
const displayE = 'Schema validation failed on must have required property \'imageId\'';
|
|
3215
3441
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3216
3442
|
done();
|
|
3217
3443
|
} catch (err) {
|
|
@@ -3364,7 +3590,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3364
3590
|
const mapConnObj = { nodeBSide: 1, type: 'Device', elements: [] };
|
|
3365
3591
|
a.createMapConnection(mapId, mapConnObj, (data, error) => {
|
|
3366
3592
|
try {
|
|
3367
|
-
const displayE = 'Schema validation failed on
|
|
3593
|
+
const displayE = 'Schema validation failed on must have required property \'nodeASide\'';
|
|
3368
3594
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3369
3595
|
done();
|
|
3370
3596
|
} catch (err) {
|
|
@@ -3382,7 +3608,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3382
3608
|
const mapConnObj = { nodeASide: 1, type: 'Device', elements: [] };
|
|
3383
3609
|
a.createMapConnection(mapId, mapConnObj, (data, error) => {
|
|
3384
3610
|
try {
|
|
3385
|
-
const displayE = 'Schema validation failed on
|
|
3611
|
+
const displayE = 'Schema validation failed on must have required property \'nodeBSide\'';
|
|
3386
3612
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3387
3613
|
done();
|
|
3388
3614
|
} catch (err) {
|
|
@@ -3400,7 +3626,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3400
3626
|
const mapConnObj = { nodeASide: 1, nodeBSide: 1, elements: [] };
|
|
3401
3627
|
a.createMapConnection(mapId, mapConnObj, (data, error) => {
|
|
3402
3628
|
try {
|
|
3403
|
-
const displayE = 'Schema validation failed on
|
|
3629
|
+
const displayE = 'Schema validation failed on must have required property \'type\'';
|
|
3404
3630
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3405
3631
|
done();
|
|
3406
3632
|
} catch (err) {
|
|
@@ -3418,7 +3644,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3418
3644
|
const mapConnObj = { nodeASide: 1, nodeBSide: 1, type: 'Device' };
|
|
3419
3645
|
a.createMapConnection(mapId, mapConnObj, (data, error) => {
|
|
3420
3646
|
try {
|
|
3421
|
-
const displayE = 'Schema validation failed on
|
|
3647
|
+
const displayE = 'Schema validation failed on must have required property \'elements\'';
|
|
3422
3648
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3423
3649
|
done();
|
|
3424
3650
|
} catch (err) {
|
|
@@ -3499,7 +3725,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3499
3725
|
const mapConnObj = { nodeBSide: 1, type: 'Device', elements: [] };
|
|
3500
3726
|
a.updateMapConnection(mapId, mapConnId, mapConnObj, (data, error) => {
|
|
3501
3727
|
try {
|
|
3502
|
-
const displayE = 'Schema validation failed on
|
|
3728
|
+
const displayE = 'Schema validation failed on must have required property \'nodeASide\'';
|
|
3503
3729
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3504
3730
|
done();
|
|
3505
3731
|
} catch (err) {
|
|
@@ -3517,7 +3743,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3517
3743
|
const mapConnObj = { nodeASide: 1, type: 'Device', elements: [] };
|
|
3518
3744
|
a.updateMapConnection(mapId, mapConnId, mapConnObj, (data, error) => {
|
|
3519
3745
|
try {
|
|
3520
|
-
const displayE = 'Schema validation failed on
|
|
3746
|
+
const displayE = 'Schema validation failed on must have required property \'nodeBSide\'';
|
|
3521
3747
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3522
3748
|
done();
|
|
3523
3749
|
} catch (err) {
|
|
@@ -3535,7 +3761,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3535
3761
|
const mapConnObj = { nodeASide: 1, nodeBSide: 1, elements: [] };
|
|
3536
3762
|
a.updateMapConnection(mapId, mapConnId, mapConnObj, (data, error) => {
|
|
3537
3763
|
try {
|
|
3538
|
-
const displayE = 'Schema validation failed on
|
|
3764
|
+
const displayE = 'Schema validation failed on must have required property \'type\'';
|
|
3539
3765
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3540
3766
|
done();
|
|
3541
3767
|
} catch (err) {
|
|
@@ -3553,7 +3779,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3553
3779
|
const mapConnObj = { nodeASide: 1, nodeBSide: 1, type: 'Device' };
|
|
3554
3780
|
a.updateMapConnection(mapId, mapConnId, mapConnObj, (data, error) => {
|
|
3555
3781
|
try {
|
|
3556
|
-
const displayE = 'Schema validation failed on
|
|
3782
|
+
const displayE = 'Schema validation failed on must have required property \'elements\'';
|
|
3557
3783
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3558
3784
|
done();
|
|
3559
3785
|
} catch (err) {
|
|
@@ -3725,7 +3951,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3725
3951
|
};
|
|
3726
3952
|
a.createMapNode(mapId, mapNodeObj, (data, error) => {
|
|
3727
3953
|
try {
|
|
3728
|
-
const displayE = 'Schema validation failed on
|
|
3954
|
+
const displayE = 'Schema validation failed on must have required property \'name\'';
|
|
3729
3955
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3730
3956
|
done();
|
|
3731
3957
|
} catch (err) {
|
|
@@ -3745,7 +3971,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3745
3971
|
};
|
|
3746
3972
|
a.createMapNode(mapId, mapNodeObj, (data, error) => {
|
|
3747
3973
|
try {
|
|
3748
|
-
const displayE = 'Schema validation failed on
|
|
3974
|
+
const displayE = 'Schema validation failed on must have required property \'type\'';
|
|
3749
3975
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3750
3976
|
done();
|
|
3751
3977
|
} catch (err) {
|
|
@@ -3765,7 +3991,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3765
3991
|
};
|
|
3766
3992
|
a.createMapNode(mapId, mapNodeObj, (data, error) => {
|
|
3767
3993
|
try {
|
|
3768
|
-
const displayE = 'Schema validation failed on
|
|
3994
|
+
const displayE = 'Schema validation failed on must have required property \'x\'';
|
|
3769
3995
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3770
3996
|
done();
|
|
3771
3997
|
} catch (err) {
|
|
@@ -3785,7 +4011,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3785
4011
|
};
|
|
3786
4012
|
a.createMapNode(mapId, mapNodeObj, (data, error) => {
|
|
3787
4013
|
try {
|
|
3788
|
-
const displayE = 'Schema validation failed on
|
|
4014
|
+
const displayE = 'Schema validation failed on must have required property \'y\'';
|
|
3789
4015
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3790
4016
|
done();
|
|
3791
4017
|
} catch (err) {
|
|
@@ -3805,7 +4031,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3805
4031
|
};
|
|
3806
4032
|
a.createMapNode(mapId, mapNodeObj, (data, error) => {
|
|
3807
4033
|
try {
|
|
3808
|
-
const displayE = 'Schema validation failed on
|
|
4034
|
+
const displayE = 'Schema validation failed on must have required property \'elements\'';
|
|
3809
4035
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3810
4036
|
done();
|
|
3811
4037
|
} catch (err) {
|
|
@@ -3888,7 +4114,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3888
4114
|
};
|
|
3889
4115
|
a.updateMapNode(mapId, mapNodeId, mapNodeObj, (data, error) => {
|
|
3890
4116
|
try {
|
|
3891
|
-
const displayE = 'Schema validation failed on
|
|
4117
|
+
const displayE = 'Schema validation failed on must have required property \'name\'';
|
|
3892
4118
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3893
4119
|
done();
|
|
3894
4120
|
} catch (err) {
|
|
@@ -3908,7 +4134,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3908
4134
|
};
|
|
3909
4135
|
a.updateMapNode(mapId, mapNodeId, mapNodeObj, (data, error) => {
|
|
3910
4136
|
try {
|
|
3911
|
-
const displayE = 'Schema validation failed on
|
|
4137
|
+
const displayE = 'Schema validation failed on must have required property \'type\'';
|
|
3912
4138
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3913
4139
|
done();
|
|
3914
4140
|
} catch (err) {
|
|
@@ -3928,7 +4154,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3928
4154
|
};
|
|
3929
4155
|
a.updateMapNode(mapId, mapNodeId, mapNodeObj, (data, error) => {
|
|
3930
4156
|
try {
|
|
3931
|
-
const displayE = 'Schema validation failed on
|
|
4157
|
+
const displayE = 'Schema validation failed on must have required property \'x\'';
|
|
3932
4158
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3933
4159
|
done();
|
|
3934
4160
|
} catch (err) {
|
|
@@ -3948,7 +4174,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3948
4174
|
};
|
|
3949
4175
|
a.updateMapNode(mapId, mapNodeId, mapNodeObj, (data, error) => {
|
|
3950
4176
|
try {
|
|
3951
|
-
const displayE = 'Schema validation failed on
|
|
4177
|
+
const displayE = 'Schema validation failed on must have required property \'y\'';
|
|
3952
4178
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3953
4179
|
done();
|
|
3954
4180
|
} catch (err) {
|
|
@@ -3968,7 +4194,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
3968
4194
|
};
|
|
3969
4195
|
a.updateMapNode(mapId, mapNodeId, mapNodeObj, (data, error) => {
|
|
3970
4196
|
try {
|
|
3971
|
-
const displayE = 'Schema validation failed on
|
|
4197
|
+
const displayE = 'Schema validation failed on must have required property \'elements\'';
|
|
3972
4198
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
3973
4199
|
done();
|
|
3974
4200
|
} catch (err) {
|
|
@@ -5915,7 +6141,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
5915
6141
|
const alert = { origin: 'string', deviceId };
|
|
5916
6142
|
a.createAlert(alert, (data, error) => {
|
|
5917
6143
|
try {
|
|
5918
|
-
const displayE = 'Schema validation failed on
|
|
6144
|
+
const displayE = 'Schema validation failed on must have required property \'message\'';
|
|
5919
6145
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
5920
6146
|
done();
|
|
5921
6147
|
} catch (err) {
|
|
@@ -5933,7 +6159,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
5933
6159
|
const alert = { message: 'blah', deviceId };
|
|
5934
6160
|
a.createAlert(alert, (data, error) => {
|
|
5935
6161
|
try {
|
|
5936
|
-
const displayE = 'Schema validation failed on
|
|
6162
|
+
const displayE = 'Schema validation failed on must have required property \'origin\'';
|
|
5937
6163
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
5938
6164
|
done();
|
|
5939
6165
|
} catch (err) {
|
|
@@ -5951,7 +6177,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
5951
6177
|
const alert = { message: 'blah', origin: 'string' };
|
|
5952
6178
|
a.createAlert(alert, (data, error) => {
|
|
5953
6179
|
try {
|
|
5954
|
-
const displayE = 'Schema validation failed on
|
|
6180
|
+
const displayE = 'Schema validation failed on must have required property \'deviceId\'';
|
|
5955
6181
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
5956
6182
|
done();
|
|
5957
6183
|
} catch (err) {
|
|
@@ -6015,7 +6241,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
6015
6241
|
const alert = { origin: 'string', deviceId };
|
|
6016
6242
|
a.updateAlert(alertId, alert, (data, error) => {
|
|
6017
6243
|
try {
|
|
6018
|
-
const displayE = 'Schema validation failed on
|
|
6244
|
+
const displayE = 'Schema validation failed on must have required property \'message\'';
|
|
6019
6245
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
6020
6246
|
done();
|
|
6021
6247
|
} catch (err) {
|
|
@@ -6033,7 +6259,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
6033
6259
|
const alert = { message: 'blah', deviceId };
|
|
6034
6260
|
a.updateAlert(alertId, alert, (data, error) => {
|
|
6035
6261
|
try {
|
|
6036
|
-
const displayE = 'Schema validation failed on
|
|
6262
|
+
const displayE = 'Schema validation failed on must have required property \'origin\'';
|
|
6037
6263
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
6038
6264
|
done();
|
|
6039
6265
|
} catch (err) {
|
|
@@ -6051,7 +6277,7 @@ describe('[unit] SevOne Adapter Test', () => {
|
|
|
6051
6277
|
const alert = { message: 'blah', origin: 'string' };
|
|
6052
6278
|
a.updateAlert(alertId, alert, (data, error) => {
|
|
6053
6279
|
try {
|
|
6054
|
-
const displayE = 'Schema validation failed on
|
|
6280
|
+
const displayE = 'Schema validation failed on must have required property \'deviceId\'';
|
|
6055
6281
|
runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
|
|
6056
6282
|
done();
|
|
6057
6283
|
} catch (err) {
|