@itentialopensource/adapter-sevone 2.3.1 → 2.5.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.
Files changed (59) hide show
  1. package/AUTH.md +39 -0
  2. package/BROKER.md +199 -0
  3. package/CALLS.md +1808 -0
  4. package/CHANGELOG.md +53 -91
  5. package/CODE_OF_CONDUCT.md +12 -17
  6. package/CONTRIBUTING.md +3 -148
  7. package/ENHANCE.md +69 -0
  8. package/PROPERTIES.md +641 -0
  9. package/README.md +237 -578
  10. package/SUMMARY.md +9 -0
  11. package/SYSTEMINFO.md +11 -0
  12. package/TROUBLESHOOT.md +47 -0
  13. package/adapter.js +377 -596
  14. package/adapterBase.js +854 -408
  15. package/changelogs/CHANGELOG.md +118 -0
  16. package/entities/.generic/action.json +110 -5
  17. package/entities/.generic/schema.json +6 -1
  18. package/entities/device/mockdatafiles/getdeviceerror.json +1 -58
  19. package/error.json +6 -0
  20. package/metadata.json +49 -0
  21. package/package.json +28 -22
  22. package/pronghorn.json +673 -70
  23. package/propertiesDecorators.json +14 -0
  24. package/propertiesSchema.json +827 -6
  25. package/refs?service=git-upload-pack +0 -0
  26. package/report/adapter-openapi.json +26172 -0
  27. package/report/adapter-openapi.yaml +11817 -0
  28. package/report/adapterInfo.json +10 -0
  29. package/report/updateReport1653680202971.json +120 -0
  30. package/report/updateReport1691508994383.json +120 -0
  31. package/report/updateReport1692202309339.json +120 -0
  32. package/report/updateReport1692203396464.json +120 -0
  33. package/report/updateReport1694470055393.json +120 -0
  34. package/report/updateReport1698423190930.json +120 -0
  35. package/sampleProperties.json +153 -3
  36. package/test/integration/adapterTestBasicGet.js +3 -5
  37. package/test/integration/adapterTestConnectivity.js +91 -42
  38. package/test/integration/adapterTestIntegration.js +157 -105
  39. package/test/unit/adapterBaseTestUnit.js +388 -308
  40. package/test/unit/adapterTestUnit.js +548 -310
  41. package/utils/adapterInfo.js +206 -0
  42. package/utils/addAuth.js +94 -0
  43. package/utils/artifactize.js +1 -1
  44. package/utils/basicGet.js +1 -14
  45. package/utils/checkMigrate.js +1 -1
  46. package/utils/entitiesToDB.js +179 -0
  47. package/utils/findPath.js +1 -1
  48. package/utils/methodDocumentor.js +273 -0
  49. package/utils/modify.js +14 -16
  50. package/utils/packModificationScript.js +1 -1
  51. package/utils/patches2bundledDeps.js +90 -0
  52. package/utils/pre-commit.sh +5 -0
  53. package/utils/removeHooks.js +20 -0
  54. package/utils/taskMover.js +309 -0
  55. package/utils/tbScript.js +129 -53
  56. package/utils/tbUtils.js +152 -35
  57. package/utils/testRunner.js +17 -17
  58. package/utils/troubleshootingAdapter.js +10 -31
  59. package/workflows/README.md +0 -3
@@ -4,36 +4,48 @@
4
4
  /* global describe it log pronghornProps */
5
5
  /* eslint global-require: warn */
6
6
  /* eslint no-unused-vars: warn */
7
+ /* eslint import/no-dynamic-require:warn */
7
8
 
8
9
  // include required items for testing & logging
9
10
  const assert = require('assert');
10
- const fs = require('fs-extra');
11
- const mocha = require('mocha');
12
11
  const path = require('path');
13
12
  const util = require('util');
14
- const winston = require('winston');
15
13
  const execute = require('child_process').execSync;
14
+ const fs = require('fs-extra');
15
+ const mocha = require('mocha');
16
+ const winston = require('winston');
16
17
  const { expect } = require('chai');
17
18
  const { use } = require('chai');
18
19
  const td = require('testdouble');
20
+ const Ajv = require('ajv');
19
21
 
22
+ const ajv = new Ajv({ strictSchema: false, allErrors: true, allowUnionTypes: true });
20
23
  const anything = td.matchers.anything();
21
-
22
- // stub and attemptTimeout are used throughout the code so set them here
23
24
  let logLevel = 'none';
24
- const stub = true;
25
25
  const isRapidFail = false;
26
- const attemptTimeout = 600000;
26
+
27
+ // read in the properties from the sampleProperties files
28
+ let adaptdir = __dirname;
29
+ if (adaptdir.endsWith('/test/integration')) {
30
+ adaptdir = adaptdir.substring(0, adaptdir.length - 17);
31
+ } else if (adaptdir.endsWith('/test/unit')) {
32
+ adaptdir = adaptdir.substring(0, adaptdir.length - 10);
33
+ }
34
+ const samProps = require(`${adaptdir}/sampleProperties.json`).properties;
27
35
 
28
36
  // these variables can be changed to run in integrated mode so easier to set them here
29
37
  // always check these in with bogus data!!!
30
- const host = 'replace.hostorip.here';
31
- const username = 'username';
32
- const password = 'password';
33
- const protocol = 'http';
34
- const port = 80;
35
- const sslenable = false;
36
- const sslinvalid = false;
38
+ samProps.stub = true;
39
+ samProps.host = 'replace.hostorip.here';
40
+ samProps.authentication.username = 'username';
41
+ samProps.authentication.password = 'password';
42
+ samProps.protocol = 'http';
43
+ samProps.port = 80;
44
+ samProps.ssl.enabled = false;
45
+ samProps.ssl.accept_invalid_cert = false;
46
+ samProps.request.attempt_timeout = 1200000;
47
+ const attemptTimeout = samProps.request.attempt_timeout;
48
+ const { stub } = samProps;
37
49
 
38
50
  // these are the adapter properties. You generally should not need to alter
39
51
  // any of these after they are initially set up
@@ -45,99 +57,7 @@ global.pronghornProps = {
45
57
  adapters: [{
46
58
  id: 'Test-sevone',
47
59
  type: 'SevOne',
48
- properties: {
49
- host,
50
- port,
51
- base_path: '/api',
52
- version: 'v1',
53
- cache_location: 'local',
54
- encode_pathvars: true,
55
- save_metric: false,
56
- protocol,
57
- stub,
58
- authentication: {
59
- auth_method: 'request_token',
60
- username,
61
- password,
62
- token: 'token',
63
- token_timeout: 1800000,
64
- token_cache: 'local',
65
- invalid_token_error: 401,
66
- auth_field: 'header.headers.X-AUTH-TOKEN',
67
- auth_field_format: '{token}',
68
- auth_logging: false
69
- },
70
- healthcheck: {
71
- type: 'startup',
72
- frequency: 60000,
73
- query_object: {}
74
- },
75
- throttle: {
76
- throttle_enabled: false,
77
- number_pronghorns: 1,
78
- sync_async: 'sync',
79
- max_in_queue: 1000,
80
- concurrent_max: 1,
81
- expire_timeout: 0,
82
- avg_runtime: 200,
83
- priorities: [
84
- {
85
- value: 0,
86
- percent: 100
87
- }
88
- ]
89
- },
90
- request: {
91
- number_redirects: 0,
92
- number_retries: 3,
93
- limit_retry_error: 0,
94
- failover_codes: [],
95
- attempt_timeout: attemptTimeout,
96
- global_request: {
97
- payload: {},
98
- uriOptions: {},
99
- addlHeaders: {},
100
- authData: {}
101
- },
102
- healthcheck_on_timeout: true,
103
- raw_return: true,
104
- archiving: false,
105
- return_request: false
106
- },
107
- proxy: {
108
- enabled: false,
109
- host: '',
110
- port: 1,
111
- protocol: 'http',
112
- username: '',
113
- password: ''
114
- },
115
- ssl: {
116
- ecdhCurve: '',
117
- enabled: sslenable,
118
- accept_invalid_cert: sslinvalid,
119
- ca_file: '',
120
- key_file: '',
121
- cert_file: '',
122
- secure_protocol: '',
123
- ciphers: ''
124
- },
125
- mongo: {
126
- host: '',
127
- port: 0,
128
- database: '',
129
- username: '',
130
- password: '',
131
- replSet: '',
132
- db_ssl: {
133
- enabled: false,
134
- accept_invalid_cert: false,
135
- ca_file: '',
136
- key_file: '',
137
- cert_file: ''
138
- }
139
- }
140
- }
60
+ properties: samProps
141
61
  }]
142
62
  }
143
63
  };
@@ -268,10 +188,10 @@ describe('[unit] SevOne Adapter Test', () => {
268
188
  });
269
189
 
270
190
  let wffunctions = [];
271
- describe('#getWorkflowFunctions', () => {
191
+ describe('#iapGetAdapterWorkflowFunctions', () => {
272
192
  it('should retrieve workflow functions', (done) => {
273
193
  try {
274
- wffunctions = a.getWorkflowFunctions([]);
194
+ wffunctions = a.iapGetAdapterWorkflowFunctions([]);
275
195
 
276
196
  try {
277
197
  assert.notEqual(0, wffunctions.length);
@@ -302,19 +222,24 @@ describe('[unit] SevOne Adapter Test', () => {
302
222
  it('package.json should be validated', (done) => {
303
223
  try {
304
224
  const packageDotJson = require('../../package.json');
305
- const { PJV } = require('package-json-validator');
306
- const options = {
307
- warnings: true, // show warnings
308
- recommendations: true // show recommendations
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']
309
234
  };
310
- const results = PJV.validate(JSON.stringify(packageDotJson), 'npm', options);
235
+ const validate = ajv.compile(packageJsonSchema);
236
+ const isValid = validate(packageDotJson);
311
237
 
312
- if (results.valid === false) {
313
- log.error('The package.json contains the following errors: ');
314
- log.error(util.inspect(results));
315
- assert.equal(true, results.valid);
238
+ if (isValid === false) {
239
+ log.error('The package.json contains errors');
240
+ assert.equal(true, isValid);
316
241
  } else {
317
- assert.equal(true, results.valid);
242
+ assert.equal(true, isValid);
318
243
  }
319
244
 
320
245
  done();
@@ -361,7 +286,7 @@ describe('[unit] SevOne Adapter Test', () => {
361
286
  assert.equal('mocha test/integration/adapterTestIntegration.js --LOG=error', packageDotJson.scripts['test:integration']);
362
287
  assert.equal('nyc --reporter html --reporter text mocha --reporter dot test/*', packageDotJson.scripts['test:cover']);
363
288
  assert.equal('npm run test:baseunit && npm run test:unit && npm run test:integration', packageDotJson.scripts.test);
364
- assert.equal('npm publish --registry=http://registry.npmjs.org --access=public', packageDotJson.scripts.deploy);
289
+ assert.equal('npm publish --registry=https://registry.npmjs.org --access=public', packageDotJson.scripts.deploy);
365
290
  assert.equal('npm run deploy', packageDotJson.scripts.build);
366
291
  done();
367
292
  } catch (error) {
@@ -390,17 +315,17 @@ describe('[unit] SevOne Adapter Test', () => {
390
315
  assert.notEqual(undefined, packageDotJson.dependencies);
391
316
  assert.notEqual(null, packageDotJson.dependencies);
392
317
  assert.notEqual('', packageDotJson.dependencies);
393
- assert.equal('^6.12.0', packageDotJson.dependencies.ajv);
394
- assert.equal('^0.21.0', packageDotJson.dependencies.axios);
395
- assert.equal('^2.20.0', packageDotJson.dependencies.commander);
396
- assert.equal('^8.1.0', packageDotJson.dependencies['fs-extra']);
397
- assert.equal('^9.0.1', packageDotJson.dependencies.mocha);
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);
398
323
  assert.equal('^2.0.1', packageDotJson.dependencies['mocha-param']);
399
- assert.equal('^0.5.3', packageDotJson.dependencies['network-diagnostics']);
400
324
  assert.equal('^15.1.0', packageDotJson.dependencies.nyc);
325
+ assert.equal('^0.4.4', packageDotJson.dependencies.ping);
401
326
  assert.equal('^1.4.10', packageDotJson.dependencies['readline-sync']);
402
- assert.equal('^7.3.2', packageDotJson.dependencies.semver);
403
- assert.equal('^3.3.3', packageDotJson.dependencies.winston);
327
+ assert.equal('^7.5.3', packageDotJson.dependencies.semver);
328
+ assert.equal('^3.9.0', packageDotJson.dependencies.winston);
404
329
  done();
405
330
  } catch (error) {
406
331
  log.error(`Test Failure: ${error}`);
@@ -413,13 +338,12 @@ describe('[unit] SevOne Adapter Test', () => {
413
338
  assert.notEqual(undefined, packageDotJson.devDependencies);
414
339
  assert.notEqual(null, packageDotJson.devDependencies);
415
340
  assert.notEqual('', packageDotJson.devDependencies);
416
- assert.equal('^4.3.4', packageDotJson.devDependencies.chai);
417
- assert.equal('^7.29.0', packageDotJson.devDependencies.eslint);
418
- assert.equal('^14.2.1', packageDotJson.devDependencies['eslint-config-airbnb-base']);
419
- assert.equal('^2.23.4', packageDotJson.devDependencies['eslint-plugin-import']);
420
- assert.equal('^3.0.0', packageDotJson.devDependencies['eslint-plugin-json']);
421
- assert.equal('^0.6.3', packageDotJson.devDependencies['package-json-validator']);
422
- 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);
423
347
  done();
424
348
  } catch (error) {
425
349
  log.error(`Test Failure: ${error}`);
@@ -462,16 +386,31 @@ describe('[unit] SevOne Adapter Test', () => {
462
386
  assert.notEqual('', pronghornDotJson.methods);
463
387
  assert.equal(true, Array.isArray(pronghornDotJson.methods));
464
388
  assert.notEqual(0, pronghornDotJson.methods.length);
465
- assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'updateAdapterConfiguration'));
466
- assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'findPath'));
467
- assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'troubleshoot'));
468
- assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'runHealthcheck'));
469
- assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'runConnectivity'));
470
- assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'runBasicGet'));
471
- assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'suspend'));
472
- assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'unsuspend'));
473
- assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'getQueue'));
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'));
393
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapFindAdapterPath'));
394
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapTroubleshootAdapter'));
395
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterHealthcheck'));
396
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterConnectivity'));
397
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterBasicGet'));
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'));
474
409
  assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequest'));
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'));
475
414
  done();
476
415
  } catch (error) {
477
416
  log.error(`Test Failure: ${error}`);
@@ -592,6 +531,39 @@ describe('[unit] SevOne Adapter Test', () => {
592
531
  done(error);
593
532
  }
594
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);
595
567
  });
596
568
 
597
569
  describe('propertiesSchema.json', () => {
@@ -627,6 +599,7 @@ describe('[unit] SevOne Adapter Test', () => {
627
599
  assert.equal('string', propertiesDotJson.properties.host.type);
628
600
  assert.equal('integer', propertiesDotJson.properties.port.type);
629
601
  assert.equal('boolean', propertiesDotJson.properties.stub.type);
602
+ assert.equal('string', propertiesDotJson.properties.protocol.type);
630
603
  assert.notEqual(undefined, propertiesDotJson.definitions.authentication);
631
604
  assert.notEqual(null, propertiesDotJson.definitions.authentication);
632
605
  assert.notEqual('', propertiesDotJson.definitions.authentication);
@@ -643,12 +616,23 @@ describe('[unit] SevOne Adapter Test', () => {
643
616
  assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_id.type);
644
617
  assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_secret.type);
645
618
  assert.equal('string', propertiesDotJson.definitions.authentication.properties.grant_type.type);
619
+ assert.notEqual(undefined, propertiesDotJson.definitions.ssl);
620
+ assert.notEqual(null, propertiesDotJson.definitions.ssl);
621
+ assert.notEqual('', propertiesDotJson.definitions.ssl);
622
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.ecdhCurve.type);
623
+ assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.enabled.type);
624
+ assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.accept_invalid_cert.type);
625
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.ca_file.type);
626
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.key_file.type);
627
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.cert_file.type);
628
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.secure_protocol.type);
629
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.ciphers.type);
646
630
  assert.equal('string', propertiesDotJson.properties.base_path.type);
647
631
  assert.equal('string', propertiesDotJson.properties.version.type);
648
632
  assert.equal('string', propertiesDotJson.properties.cache_location.type);
649
633
  assert.equal('boolean', propertiesDotJson.properties.encode_pathvars.type);
634
+ assert.equal('boolean', propertiesDotJson.properties.encode_queryvars.type);
650
635
  assert.equal(true, Array.isArray(propertiesDotJson.properties.save_metric.type));
651
- assert.equal('string', propertiesDotJson.properties.protocol.type);
652
636
  assert.notEqual(undefined, propertiesDotJson.definitions);
653
637
  assert.notEqual(null, propertiesDotJson.definitions);
654
638
  assert.notEqual('', propertiesDotJson.definitions);
@@ -695,17 +679,6 @@ describe('[unit] SevOne Adapter Test', () => {
695
679
  assert.equal('string', propertiesDotJson.definitions.proxy.properties.protocol.type);
696
680
  assert.equal('string', propertiesDotJson.definitions.proxy.properties.username.type);
697
681
  assert.equal('string', propertiesDotJson.definitions.proxy.properties.password.type);
698
- assert.notEqual(undefined, propertiesDotJson.definitions.ssl);
699
- assert.notEqual(null, propertiesDotJson.definitions.ssl);
700
- assert.notEqual('', propertiesDotJson.definitions.ssl);
701
- assert.equal('string', propertiesDotJson.definitions.ssl.properties.ecdhCurve.type);
702
- assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.enabled.type);
703
- assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.accept_invalid_cert.type);
704
- assert.equal('string', propertiesDotJson.definitions.ssl.properties.ca_file.type);
705
- assert.equal('string', propertiesDotJson.definitions.ssl.properties.key_file.type);
706
- assert.equal('string', propertiesDotJson.definitions.ssl.properties.cert_file.type);
707
- assert.equal('string', propertiesDotJson.definitions.ssl.properties.secure_protocol.type);
708
- assert.equal('string', propertiesDotJson.definitions.ssl.properties.ciphers.type);
709
682
  assert.notEqual(undefined, propertiesDotJson.definitions.mongo);
710
683
  assert.notEqual(null, propertiesDotJson.definitions.mongo);
711
684
  assert.notEqual('', propertiesDotJson.definitions.mongo);
@@ -721,6 +694,12 @@ describe('[unit] SevOne Adapter Test', () => {
721
694
  assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.ca_file.type);
722
695
  assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.key_file.type);
723
696
  assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.cert_file.type);
697
+ assert.notEqual('', propertiesDotJson.definitions.devicebroker);
698
+ assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevice.type);
699
+ assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevicesFiltered.type);
700
+ assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.isAlive.type);
701
+ assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getConfig.type);
702
+ assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getCount.type);
724
703
  done();
725
704
  } catch (error) {
726
705
  log.error(`Test Failure: ${error}`);
@@ -810,6 +789,7 @@ describe('[unit] SevOne Adapter Test', () => {
810
789
  assert.notEqual(undefined, sampleDotJson.properties.host);
811
790
  assert.notEqual(undefined, sampleDotJson.properties.port);
812
791
  assert.notEqual(undefined, sampleDotJson.properties.stub);
792
+ assert.notEqual(undefined, sampleDotJson.properties.protocol);
813
793
  assert.notEqual(undefined, sampleDotJson.properties.authentication);
814
794
  assert.notEqual(null, sampleDotJson.properties.authentication);
815
795
  assert.notEqual('', sampleDotJson.properties.authentication);
@@ -826,17 +806,23 @@ describe('[unit] SevOne Adapter Test', () => {
826
806
  assert.notEqual(undefined, sampleDotJson.properties.authentication.client_id);
827
807
  assert.notEqual(undefined, sampleDotJson.properties.authentication.client_secret);
828
808
  assert.notEqual(undefined, sampleDotJson.properties.authentication.grant_type);
829
-
809
+ assert.notEqual(undefined, sampleDotJson.properties.ssl);
810
+ assert.notEqual(null, sampleDotJson.properties.ssl);
811
+ assert.notEqual('', sampleDotJson.properties.ssl);
812
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.ecdhCurve);
813
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.enabled);
814
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.accept_invalid_cert);
815
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.ca_file);
816
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.key_file);
817
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.cert_file);
818
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.secure_protocol);
819
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.ciphers);
830
820
  assert.notEqual(undefined, sampleDotJson.properties.base_path);
831
821
  assert.notEqual(undefined, sampleDotJson.properties.version);
832
822
  assert.notEqual(undefined, sampleDotJson.properties.cache_location);
833
823
  assert.notEqual(undefined, sampleDotJson.properties.encode_pathvars);
824
+ assert.notEqual(undefined, sampleDotJson.properties.encode_queryvars);
834
825
  assert.notEqual(undefined, sampleDotJson.properties.save_metric);
835
- assert.notEqual(undefined, sampleDotJson.properties.protocol);
836
- assert.notEqual(undefined, sampleDotJson.properties.stub);
837
- assert.notEqual(undefined, sampleDotJson.properties.stub);
838
- assert.notEqual(undefined, sampleDotJson.properties.stub);
839
- assert.notEqual(undefined, sampleDotJson.properties.stub);
840
826
  assert.notEqual(undefined, sampleDotJson.properties.healthcheck);
841
827
  assert.notEqual(null, sampleDotJson.properties.healthcheck);
842
828
  assert.notEqual('', sampleDotJson.properties.healthcheck);
@@ -880,17 +866,6 @@ describe('[unit] SevOne Adapter Test', () => {
880
866
  assert.notEqual(undefined, sampleDotJson.properties.proxy.protocol);
881
867
  assert.notEqual(undefined, sampleDotJson.properties.proxy.username);
882
868
  assert.notEqual(undefined, sampleDotJson.properties.proxy.password);
883
- assert.notEqual(undefined, sampleDotJson.properties.ssl);
884
- assert.notEqual(null, sampleDotJson.properties.ssl);
885
- assert.notEqual('', sampleDotJson.properties.ssl);
886
- assert.notEqual(undefined, sampleDotJson.properties.ssl.ecdhCurve);
887
- assert.notEqual(undefined, sampleDotJson.properties.ssl.enabled);
888
- assert.notEqual(undefined, sampleDotJson.properties.ssl.accept_invalid_cert);
889
- assert.notEqual(undefined, sampleDotJson.properties.ssl.ca_file);
890
- assert.notEqual(undefined, sampleDotJson.properties.ssl.key_file);
891
- assert.notEqual(undefined, sampleDotJson.properties.ssl.cert_file);
892
- assert.notEqual(undefined, sampleDotJson.properties.ssl.secure_protocol);
893
- assert.notEqual(undefined, sampleDotJson.properties.ssl.ciphers);
894
869
  assert.notEqual(undefined, sampleDotJson.properties.mongo);
895
870
  assert.notEqual(null, sampleDotJson.properties.mongo);
896
871
  assert.notEqual('', sampleDotJson.properties.mongo);
@@ -906,6 +881,14 @@ describe('[unit] SevOne Adapter Test', () => {
906
881
  assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.ca_file);
907
882
  assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.key_file);
908
883
  assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.cert_file);
884
+ assert.notEqual(undefined, sampleDotJson.properties.devicebroker);
885
+ assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevice);
886
+ assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevicesFiltered);
887
+ assert.notEqual(undefined, sampleDotJson.properties.devicebroker.isAlive);
888
+ assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getConfig);
889
+ assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getCount);
890
+ assert.notEqual(undefined, sampleDotJson.properties.cache);
891
+ assert.notEqual(undefined, sampleDotJson.properties.cache.entities);
909
892
  done();
910
893
  } catch (error) {
911
894
  log.error(`Test Failure: ${error}`);
@@ -999,10 +982,10 @@ describe('[unit] SevOne Adapter Test', () => {
999
982
  });
1000
983
  });
1001
984
 
1002
- describe('#updateAdapterConfiguration', () => {
1003
- it('should have a updateAdapterConfiguration function', (done) => {
985
+ describe('#iapUpdateAdapterConfiguration', () => {
986
+ it('should have a iapUpdateAdapterConfiguration function', (done) => {
1004
987
  try {
1005
- assert.equal(true, typeof a.updateAdapterConfiguration === 'function');
988
+ assert.equal(true, typeof a.iapUpdateAdapterConfiguration === 'function');
1006
989
  done();
1007
990
  } catch (error) {
1008
991
  log.error(`Test Failure: ${error}`);
@@ -1011,44 +994,34 @@ describe('[unit] SevOne Adapter Test', () => {
1011
994
  });
1012
995
  });
1013
996
 
1014
- describe('#findPath', () => {
1015
- it('should have a findPath function', (done) => {
997
+ describe('#iapSuspendAdapter', () => {
998
+ it('should have a iapSuspendAdapter function', (done) => {
1016
999
  try {
1017
- assert.equal(true, typeof a.findPath === 'function');
1000
+ assert.equal(true, typeof a.iapSuspendAdapter === 'function');
1018
1001
  done();
1019
1002
  } catch (error) {
1020
1003
  log.error(`Test Failure: ${error}`);
1021
1004
  done(error);
1022
1005
  }
1023
1006
  });
1024
- it('findPath should find atleast one path that matches', (done) => {
1007
+ });
1008
+
1009
+ describe('#iapUnsuspendAdapter', () => {
1010
+ it('should have a iapUnsuspendAdapter function', (done) => {
1025
1011
  try {
1026
- a.findPath('{base_path}/{version}', (data, error) => {
1027
- try {
1028
- assert.equal(undefined, error);
1029
- assert.notEqual(undefined, data);
1030
- assert.notEqual(null, data);
1031
- assert.equal(true, data.found);
1032
- assert.notEqual(undefined, data.foundIn);
1033
- assert.notEqual(null, data.foundIn);
1034
- assert.notEqual(0, data.foundIn.length);
1035
- done();
1036
- } catch (err) {
1037
- log.error(`Test Failure: ${err}`);
1038
- done(err);
1039
- }
1040
- });
1012
+ assert.equal(true, typeof a.iapUnsuspendAdapter === 'function');
1013
+ done();
1041
1014
  } catch (error) {
1042
- log.error(`Adapter Exception: ${error}`);
1015
+ log.error(`Test Failure: ${error}`);
1043
1016
  done(error);
1044
1017
  }
1045
- }).timeout(attemptTimeout);
1018
+ });
1046
1019
  });
1047
1020
 
1048
- describe('#suspend', () => {
1049
- it('should have a suspend function', (done) => {
1021
+ describe('#iapGetAdapterQueue', () => {
1022
+ it('should have a iapGetAdapterQueue function', (done) => {
1050
1023
  try {
1051
- assert.equal(true, typeof a.suspend === 'function');
1024
+ assert.equal(true, typeof a.iapGetAdapterQueue === 'function');
1052
1025
  done();
1053
1026
  } catch (error) {
1054
1027
  log.error(`Test Failure: ${error}`);
@@ -1057,22 +1030,44 @@ describe('[unit] SevOne Adapter Test', () => {
1057
1030
  });
1058
1031
  });
1059
1032
 
1060
- describe('#unsuspend', () => {
1061
- it('should have a unsuspend function', (done) => {
1033
+ describe('#iapFindAdapterPath', () => {
1034
+ it('should have a iapFindAdapterPath function', (done) => {
1062
1035
  try {
1063
- assert.equal(true, typeof a.unsuspend === 'function');
1036
+ assert.equal(true, typeof a.iapFindAdapterPath === 'function');
1064
1037
  done();
1065
1038
  } catch (error) {
1066
1039
  log.error(`Test Failure: ${error}`);
1067
1040
  done(error);
1068
1041
  }
1069
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);
1070
1065
  });
1071
1066
 
1072
- describe('#getQueue', () => {
1073
- it('should have a getQueue function', (done) => {
1067
+ describe('#iapTroubleshootAdapter', () => {
1068
+ it('should have a iapTroubleshootAdapter function', (done) => {
1074
1069
  try {
1075
- assert.equal(true, typeof a.getQueue === 'function');
1070
+ assert.equal(true, typeof a.iapTroubleshootAdapter === 'function');
1076
1071
  done();
1077
1072
  } catch (error) {
1078
1073
  log.error(`Test Failure: ${error}`);
@@ -1081,10 +1076,10 @@ describe('[unit] SevOne Adapter Test', () => {
1081
1076
  });
1082
1077
  });
1083
1078
 
1084
- describe('#troubleshoot', () => {
1085
- it('should have a troubleshoot function', (done) => {
1079
+ describe('#iapRunAdapterHealthcheck', () => {
1080
+ it('should have a iapRunAdapterHealthcheck function', (done) => {
1086
1081
  try {
1087
- assert.equal(true, typeof a.troubleshoot === 'function');
1082
+ assert.equal(true, typeof a.iapRunAdapterHealthcheck === 'function');
1088
1083
  done();
1089
1084
  } catch (error) {
1090
1085
  log.error(`Test Failure: ${error}`);
@@ -1093,10 +1088,10 @@ describe('[unit] SevOne Adapter Test', () => {
1093
1088
  });
1094
1089
  });
1095
1090
 
1096
- describe('#runHealthcheck', () => {
1097
- it('should have a runHealthcheck function', (done) => {
1091
+ describe('#iapRunAdapterConnectivity', () => {
1092
+ it('should have a iapRunAdapterConnectivity function', (done) => {
1098
1093
  try {
1099
- assert.equal(true, typeof a.runHealthcheck === 'function');
1094
+ assert.equal(true, typeof a.iapRunAdapterConnectivity === 'function');
1100
1095
  done();
1101
1096
  } catch (error) {
1102
1097
  log.error(`Test Failure: ${error}`);
@@ -1105,10 +1100,10 @@ describe('[unit] SevOne Adapter Test', () => {
1105
1100
  });
1106
1101
  });
1107
1102
 
1108
- describe('#runConnectivity', () => {
1109
- it('should have a runConnectivity function', (done) => {
1103
+ describe('#iapRunAdapterBasicGet', () => {
1104
+ it('should have a iapRunAdapterBasicGet function', (done) => {
1110
1105
  try {
1111
- assert.equal(true, typeof a.runConnectivity === 'function');
1106
+ assert.equal(true, typeof a.iapRunAdapterBasicGet === 'function');
1112
1107
  done();
1113
1108
  } catch (error) {
1114
1109
  log.error(`Test Failure: ${error}`);
@@ -1117,10 +1112,10 @@ describe('[unit] SevOne Adapter Test', () => {
1117
1112
  });
1118
1113
  });
1119
1114
 
1120
- describe('#runBasicGet', () => {
1121
- it('should have a runBasicGet function', (done) => {
1115
+ describe('#iapMoveAdapterEntitiesToDB', () => {
1116
+ it('should have a iapMoveAdapterEntitiesToDB function', (done) => {
1122
1117
  try {
1123
- assert.equal(true, typeof a.runBasicGet === 'function');
1118
+ assert.equal(true, typeof a.iapMoveAdapterEntitiesToDB === 'function');
1124
1119
  done();
1125
1120
  } catch (error) {
1126
1121
  log.error(`Test Failure: ${error}`);
@@ -1214,50 +1209,293 @@ describe('[unit] SevOne Adapter Test', () => {
1214
1209
  }).timeout(attemptTimeout);
1215
1210
  });
1216
1211
 
1217
- // describe('#hasEntity', () => {
1218
- // it('should have a hasEntity function', (done) => {
1219
- // try {
1220
- // assert.equal(true, typeof a.hasEntity === 'function');
1221
- // done();
1222
- // } catch (error) {
1223
- // log.error(`Test Failure: ${error}`);
1224
- // done(error);
1225
- // }
1226
- // });
1227
- // it('should find entity', (done) => {
1228
- // try {
1229
- // a.hasEntity('template_entity', // 'a9e9c33dc61122760072455df62663d2', (data) => {
1230
- // try {
1231
- // assert.equal(true, data[0]);
1232
- // done();
1233
- // } catch (err) {
1234
- // log.error(`Test Failure: ${err}`);
1235
- // done(err);
1236
- // }
1237
- // });
1238
- // } catch (error) {
1239
- // log.error(`Adapter Exception: ${error}`);
1240
- // done(error);
1241
- // }
1242
- // }).timeout(attemptTimeout);
1243
- // it('should not find entity', (done) => {
1244
- // try {
1245
- // a.hasEntity('template_entity', 'blah', (data) => {
1246
- // try {
1247
- // assert.equal(false, data[0]);
1248
- // done();
1249
- // } catch (err) {
1250
- // log.error(`Test Failure: ${err}`);
1251
- // done(err);
1252
- // }
1253
- // });
1254
- // } catch (error) {
1255
- // log.error(`Adapter Exception: ${error}`);
1256
- // done(error);
1257
- // }
1258
- // }).timeout(attemptTimeout);
1259
- // });
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
+ });
1259
+
1260
+ describe('#hasEntities', () => {
1261
+ it('should have a hasEntities function', (done) => {
1262
+ try {
1263
+ assert.equal(true, typeof a.hasEntities === 'function');
1264
+ done();
1265
+ } catch (error) {
1266
+ log.error(`Test Failure: ${error}`);
1267
+ done(error);
1268
+ }
1269
+ });
1270
+ });
1260
1271
 
1272
+ describe('#getDevice', () => {
1273
+ it('should have a getDevice function', (done) => {
1274
+ try {
1275
+ assert.equal(true, typeof a.getDevice === 'function');
1276
+ done();
1277
+ } catch (error) {
1278
+ log.error(`Test Failure: ${error}`);
1279
+ done(error);
1280
+ }
1281
+ });
1282
+ });
1283
+
1284
+ describe('#getDevicesFiltered', () => {
1285
+ it('should have a getDevicesFiltered function', (done) => {
1286
+ try {
1287
+ assert.equal(true, typeof a.getDevicesFiltered === 'function');
1288
+ done();
1289
+ } catch (error) {
1290
+ log.error(`Test Failure: ${error}`);
1291
+ done(error);
1292
+ }
1293
+ });
1294
+ });
1295
+
1296
+ describe('#isAlive', () => {
1297
+ it('should have a isAlive function', (done) => {
1298
+ try {
1299
+ assert.equal(true, typeof a.isAlive === 'function');
1300
+ done();
1301
+ } catch (error) {
1302
+ log.error(`Test Failure: ${error}`);
1303
+ done(error);
1304
+ }
1305
+ });
1306
+ });
1307
+
1308
+ describe('#getConfig', () => {
1309
+ it('should have a getConfig function', (done) => {
1310
+ try {
1311
+ assert.equal(true, typeof a.getConfig === 'function');
1312
+ done();
1313
+ } catch (error) {
1314
+ log.error(`Test Failure: ${error}`);
1315
+ done(error);
1316
+ }
1317
+ });
1318
+ });
1319
+
1320
+ describe('#iapGetDeviceCount', () => {
1321
+ it('should have a iapGetDeviceCount function', (done) => {
1322
+ try {
1323
+ assert.equal(true, typeof a.iapGetDeviceCount === 'function');
1324
+ done();
1325
+ } catch (error) {
1326
+ log.error(`Test Failure: ${error}`);
1327
+ done(error);
1328
+ }
1329
+ });
1330
+ });
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
+ });
1261
1499
  /*
1262
1500
  -----------------------------------------------------------------------
1263
1501
  -----------------------------------------------------------------------
@@ -1300,9 +1538,9 @@ describe('[unit] SevOne Adapter Test', () => {
1300
1538
  });
1301
1539
  });
1302
1540
 
1303
- describe('#getDevicesFiltered - errors', () => {
1304
- it('should have a getDevicesFiltered function', (done) => {
1305
- assert.equal(true, typeof a.getDevicesFiltered === 'function');
1541
+ describe('#getSevDevicesFiltered - errors', () => {
1542
+ it('should have a getSevDevicesFiltered function', (done) => {
1543
+ assert.equal(true, typeof a.getSevDevicesFiltered === 'function');
1306
1544
  done();
1307
1545
  });
1308
1546
  });
@@ -1342,7 +1580,7 @@ describe('[unit] SevOne Adapter Test', () => {
1342
1580
  const device = { ipAddress: '10.10.10.1' };
1343
1581
  a.createDevice(device, (data, error) => {
1344
1582
  try {
1345
- const displayE = 'Schema validation failed on should have required property \'.name\'';
1583
+ const displayE = 'Schema validation failed on must have required property \'name\'';
1346
1584
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
1347
1585
  done();
1348
1586
  } catch (err) {
@@ -1406,7 +1644,7 @@ describe('[unit] SevOne Adapter Test', () => {
1406
1644
  const device = { ipAddress: '10.10.10.1' };
1407
1645
  a.updateDevice(deviceId, device, (data, error) => {
1408
1646
  try {
1409
- const displayE = 'Schema validation failed on should have required property \'.name\'';
1647
+ const displayE = 'Schema validation failed on must have required property \'name\'';
1410
1648
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
1411
1649
  done();
1412
1650
  } catch (err) {
@@ -1497,7 +1735,7 @@ describe('[unit] SevOne Adapter Test', () => {
1497
1735
  const deviceGrp = { parentId: 1 };
1498
1736
  a.createDeviceGroup(deviceGrp, (data, error) => {
1499
1737
  try {
1500
- const displayE = 'Schema validation failed on should have required property \'.name\'';
1738
+ const displayE = 'Schema validation failed on must have required property \'name\'';
1501
1739
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
1502
1740
  done();
1503
1741
  } catch (err) {
@@ -1515,7 +1753,7 @@ describe('[unit] SevOne Adapter Test', () => {
1515
1753
  const deviceGrp = { name: 'blah' };
1516
1754
  a.createDeviceGroup(deviceGrp, (data, error) => {
1517
1755
  try {
1518
- const displayE = 'Schema validation failed on should have required property \'.parentId\'';
1756
+ const displayE = 'Schema validation failed on must have required property \'parentId\'';
1519
1757
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
1520
1758
  done();
1521
1759
  } catch (err) {
@@ -1625,7 +1863,7 @@ describe('[unit] SevOne Adapter Test', () => {
1625
1863
  const deviceGrp = { parentId: 1 };
1626
1864
  a.updateDeviceGroup(deviceGrpId, deviceGrp, (data, error) => {
1627
1865
  try {
1628
- const displayE = 'Schema validation failed on should have required property \'.name\'';
1866
+ const displayE = 'Schema validation failed on must have required property \'name\'';
1629
1867
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
1630
1868
  done();
1631
1869
  } catch (err) {
@@ -1643,7 +1881,7 @@ describe('[unit] SevOne Adapter Test', () => {
1643
1881
  const deviceGrp = { name: 'blah' };
1644
1882
  a.updateDeviceGroup(deviceGrpId, deviceGrp, (data, error) => {
1645
1883
  try {
1646
- const displayE = 'Schema validation failed on should have required property \'.parentId\'';
1884
+ const displayE = 'Schema validation failed on must have required property \'parentId\'';
1647
1885
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
1648
1886
  done();
1649
1887
  } catch (err) {
@@ -1904,7 +2142,7 @@ describe('[unit] SevOne Adapter Test', () => {
1904
2142
  };
1905
2143
  a.createDeviceComponent(deviceId, deviceComp, (data, error) => {
1906
2144
  try {
1907
- const displayE = 'Schema validation failed on should have required property \'.name\'';
2145
+ const displayE = 'Schema validation failed on must have required property \'name\'';
1908
2146
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
1909
2147
  done();
1910
2148
  } catch (err) {
@@ -1924,7 +2162,7 @@ describe('[unit] SevOne Adapter Test', () => {
1924
2162
  };
1925
2163
  a.createDeviceComponent(deviceId, deviceComp, (data, error) => {
1926
2164
  try {
1927
- const displayE = 'Schema validation failed on should have required property \'.description\'';
2165
+ const displayE = 'Schema validation failed on must have required property \'description\'';
1928
2166
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
1929
2167
  done();
1930
2168
  } catch (err) {
@@ -1944,7 +2182,7 @@ describe('[unit] SevOne Adapter Test', () => {
1944
2182
  };
1945
2183
  a.createDeviceComponent(deviceId, deviceComp, (data, error) => {
1946
2184
  try {
1947
- const displayE = 'Schema validation failed on should have required property \'.pluginId\'';
2185
+ const displayE = 'Schema validation failed on must have required property \'pluginId\'';
1948
2186
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
1949
2187
  done();
1950
2188
  } catch (err) {
@@ -1964,7 +2202,7 @@ describe('[unit] SevOne Adapter Test', () => {
1964
2202
  };
1965
2203
  a.createDeviceComponent(deviceId, deviceComp, (data, error) => {
1966
2204
  try {
1967
- const displayE = 'Schema validation failed on should have required property \'.pluginObjectTypeId\'';
2205
+ const displayE = 'Schema validation failed on must have required property \'pluginObjectTypeId\'';
1968
2206
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
1969
2207
  done();
1970
2208
  } catch (err) {
@@ -2047,7 +2285,7 @@ describe('[unit] SevOne Adapter Test', () => {
2047
2285
  };
2048
2286
  a.updateDeviceComponent(deviceId, deviceCompId, deviceComp, (data, error) => {
2049
2287
  try {
2050
- const displayE = 'Schema validation failed on should have required property \'.name\'';
2288
+ const displayE = 'Schema validation failed on must have required property \'name\'';
2051
2289
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
2052
2290
  done();
2053
2291
  } catch (err) {
@@ -2067,7 +2305,7 @@ describe('[unit] SevOne Adapter Test', () => {
2067
2305
  };
2068
2306
  a.updateDeviceComponent(deviceId, deviceCompId, deviceComp, (data, error) => {
2069
2307
  try {
2070
- const displayE = 'Schema validation failed on should have required property \'.description\'';
2308
+ const displayE = 'Schema validation failed on must have required property \'description\'';
2071
2309
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
2072
2310
  done();
2073
2311
  } catch (err) {
@@ -2087,7 +2325,7 @@ describe('[unit] SevOne Adapter Test', () => {
2087
2325
  };
2088
2326
  a.updateDeviceComponent(deviceId, deviceCompId, deviceComp, (data, error) => {
2089
2327
  try {
2090
- const displayE = 'Schema validation failed on should have required property \'.pluginId\'';
2328
+ const displayE = 'Schema validation failed on must have required property \'pluginId\'';
2091
2329
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
2092
2330
  done();
2093
2331
  } catch (err) {
@@ -2107,7 +2345,7 @@ describe('[unit] SevOne Adapter Test', () => {
2107
2345
  };
2108
2346
  a.updateDeviceComponent(deviceId, deviceCompId, deviceComp, (data, error) => {
2109
2347
  try {
2110
- const displayE = 'Schema validation failed on should have required property \'.pluginObjectTypeId\'';
2348
+ const displayE = 'Schema validation failed on must have required property \'pluginObjectTypeId\'';
2111
2349
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
2112
2350
  done();
2113
2351
  } catch (err) {
@@ -2215,7 +2453,7 @@ describe('[unit] SevOne Adapter Test', () => {
2215
2453
  const componentGrp = { parentId: 1 };
2216
2454
  a.createComponentGroup(componentGrp, (data, error) => {
2217
2455
  try {
2218
- const displayE = 'Schema validation failed on should have required property \'.name\'';
2456
+ const displayE = 'Schema validation failed on must have required property \'name\'';
2219
2457
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
2220
2458
  done();
2221
2459
  } catch (err) {
@@ -2233,7 +2471,7 @@ describe('[unit] SevOne Adapter Test', () => {
2233
2471
  const componentGrp = { name: 'blah' };
2234
2472
  a.createComponentGroup(componentGrp, (data, error) => {
2235
2473
  try {
2236
- const displayE = 'Schema validation failed on should have required property \'.parentId\'';
2474
+ const displayE = 'Schema validation failed on must have required property \'parentId\'';
2237
2475
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
2238
2476
  done();
2239
2477
  } catch (err) {
@@ -2360,7 +2598,7 @@ describe('[unit] SevOne Adapter Test', () => {
2360
2598
  const componentGrp = { parentId: 1 };
2361
2599
  a.updateComponentGroup(componentGrpId, componentGrp, (data, error) => {
2362
2600
  try {
2363
- const displayE = 'Schema validation failed on should have required property \'.name\'';
2601
+ const displayE = 'Schema validation failed on must have required property \'name\'';
2364
2602
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
2365
2603
  done();
2366
2604
  } catch (err) {
@@ -2378,7 +2616,7 @@ describe('[unit] SevOne Adapter Test', () => {
2378
2616
  const componentGrp = { name: 'blah' };
2379
2617
  a.updateComponentGroup(componentGrpId, componentGrp, (data, error) => {
2380
2618
  try {
2381
- const displayE = 'Schema validation failed on should have required property \'.parentId\'';
2619
+ const displayE = 'Schema validation failed on must have required property \'parentId\'';
2382
2620
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
2383
2621
  done();
2384
2622
  } catch (err) {
@@ -3099,7 +3337,7 @@ describe('[unit] SevOne Adapter Test', () => {
3099
3337
  const mapObj = { imageId: 1 };
3100
3338
  a.createMap(mapObj, (data, error) => {
3101
3339
  try {
3102
- const displayE = 'Schema validation failed on should have required property \'.name\'';
3340
+ const displayE = 'Schema validation failed on must have required property \'name\'';
3103
3341
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3104
3342
  done();
3105
3343
  } catch (err) {
@@ -3117,7 +3355,7 @@ describe('[unit] SevOne Adapter Test', () => {
3117
3355
  const mapObj = { name: 'blah' };
3118
3356
  a.createMap(mapObj, (data, error) => {
3119
3357
  try {
3120
- const displayE = 'Schema validation failed on should have required property \'.imageId\'';
3358
+ const displayE = 'Schema validation failed on must have required property \'imageId\'';
3121
3359
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3122
3360
  done();
3123
3361
  } catch (err) {
@@ -3181,7 +3419,7 @@ describe('[unit] SevOne Adapter Test', () => {
3181
3419
  const mapObj = { imageId: 1 };
3182
3420
  a.updateMap(mapId, mapObj, (data, error) => {
3183
3421
  try {
3184
- const displayE = 'Schema validation failed on should have required property \'.name\'';
3422
+ const displayE = 'Schema validation failed on must have required property \'name\'';
3185
3423
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3186
3424
  done();
3187
3425
  } catch (err) {
@@ -3199,7 +3437,7 @@ describe('[unit] SevOne Adapter Test', () => {
3199
3437
  const mapObj = { name: 'blah' };
3200
3438
  a.updateMap(mapId, mapObj, (data, error) => {
3201
3439
  try {
3202
- const displayE = 'Schema validation failed on should have required property \'.imageId\'';
3440
+ const displayE = 'Schema validation failed on must have required property \'imageId\'';
3203
3441
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3204
3442
  done();
3205
3443
  } catch (err) {
@@ -3352,7 +3590,7 @@ describe('[unit] SevOne Adapter Test', () => {
3352
3590
  const mapConnObj = { nodeBSide: 1, type: 'Device', elements: [] };
3353
3591
  a.createMapConnection(mapId, mapConnObj, (data, error) => {
3354
3592
  try {
3355
- const displayE = 'Schema validation failed on should have required property \'.nodeASide\'';
3593
+ const displayE = 'Schema validation failed on must have required property \'nodeASide\'';
3356
3594
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3357
3595
  done();
3358
3596
  } catch (err) {
@@ -3370,7 +3608,7 @@ describe('[unit] SevOne Adapter Test', () => {
3370
3608
  const mapConnObj = { nodeASide: 1, type: 'Device', elements: [] };
3371
3609
  a.createMapConnection(mapId, mapConnObj, (data, error) => {
3372
3610
  try {
3373
- const displayE = 'Schema validation failed on should have required property \'.nodeBSide\'';
3611
+ const displayE = 'Schema validation failed on must have required property \'nodeBSide\'';
3374
3612
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3375
3613
  done();
3376
3614
  } catch (err) {
@@ -3388,7 +3626,7 @@ describe('[unit] SevOne Adapter Test', () => {
3388
3626
  const mapConnObj = { nodeASide: 1, nodeBSide: 1, elements: [] };
3389
3627
  a.createMapConnection(mapId, mapConnObj, (data, error) => {
3390
3628
  try {
3391
- const displayE = 'Schema validation failed on should have required property \'.type\'';
3629
+ const displayE = 'Schema validation failed on must have required property \'type\'';
3392
3630
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3393
3631
  done();
3394
3632
  } catch (err) {
@@ -3406,7 +3644,7 @@ describe('[unit] SevOne Adapter Test', () => {
3406
3644
  const mapConnObj = { nodeASide: 1, nodeBSide: 1, type: 'Device' };
3407
3645
  a.createMapConnection(mapId, mapConnObj, (data, error) => {
3408
3646
  try {
3409
- const displayE = 'Schema validation failed on should have required property \'.elements\'';
3647
+ const displayE = 'Schema validation failed on must have required property \'elements\'';
3410
3648
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3411
3649
  done();
3412
3650
  } catch (err) {
@@ -3487,7 +3725,7 @@ describe('[unit] SevOne Adapter Test', () => {
3487
3725
  const mapConnObj = { nodeBSide: 1, type: 'Device', elements: [] };
3488
3726
  a.updateMapConnection(mapId, mapConnId, mapConnObj, (data, error) => {
3489
3727
  try {
3490
- const displayE = 'Schema validation failed on should have required property \'.nodeASide\'';
3728
+ const displayE = 'Schema validation failed on must have required property \'nodeASide\'';
3491
3729
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3492
3730
  done();
3493
3731
  } catch (err) {
@@ -3505,7 +3743,7 @@ describe('[unit] SevOne Adapter Test', () => {
3505
3743
  const mapConnObj = { nodeASide: 1, type: 'Device', elements: [] };
3506
3744
  a.updateMapConnection(mapId, mapConnId, mapConnObj, (data, error) => {
3507
3745
  try {
3508
- const displayE = 'Schema validation failed on should have required property \'.nodeBSide\'';
3746
+ const displayE = 'Schema validation failed on must have required property \'nodeBSide\'';
3509
3747
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3510
3748
  done();
3511
3749
  } catch (err) {
@@ -3523,7 +3761,7 @@ describe('[unit] SevOne Adapter Test', () => {
3523
3761
  const mapConnObj = { nodeASide: 1, nodeBSide: 1, elements: [] };
3524
3762
  a.updateMapConnection(mapId, mapConnId, mapConnObj, (data, error) => {
3525
3763
  try {
3526
- const displayE = 'Schema validation failed on should have required property \'.type\'';
3764
+ const displayE = 'Schema validation failed on must have required property \'type\'';
3527
3765
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3528
3766
  done();
3529
3767
  } catch (err) {
@@ -3541,7 +3779,7 @@ describe('[unit] SevOne Adapter Test', () => {
3541
3779
  const mapConnObj = { nodeASide: 1, nodeBSide: 1, type: 'Device' };
3542
3780
  a.updateMapConnection(mapId, mapConnId, mapConnObj, (data, error) => {
3543
3781
  try {
3544
- const displayE = 'Schema validation failed on should have required property \'.elements\'';
3782
+ const displayE = 'Schema validation failed on must have required property \'elements\'';
3545
3783
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3546
3784
  done();
3547
3785
  } catch (err) {
@@ -3713,7 +3951,7 @@ describe('[unit] SevOne Adapter Test', () => {
3713
3951
  };
3714
3952
  a.createMapNode(mapId, mapNodeObj, (data, error) => {
3715
3953
  try {
3716
- const displayE = 'Schema validation failed on should have required property \'.name\'';
3954
+ const displayE = 'Schema validation failed on must have required property \'name\'';
3717
3955
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3718
3956
  done();
3719
3957
  } catch (err) {
@@ -3733,7 +3971,7 @@ describe('[unit] SevOne Adapter Test', () => {
3733
3971
  };
3734
3972
  a.createMapNode(mapId, mapNodeObj, (data, error) => {
3735
3973
  try {
3736
- const displayE = 'Schema validation failed on should have required property \'.type\'';
3974
+ const displayE = 'Schema validation failed on must have required property \'type\'';
3737
3975
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3738
3976
  done();
3739
3977
  } catch (err) {
@@ -3753,7 +3991,7 @@ describe('[unit] SevOne Adapter Test', () => {
3753
3991
  };
3754
3992
  a.createMapNode(mapId, mapNodeObj, (data, error) => {
3755
3993
  try {
3756
- const displayE = 'Schema validation failed on should have required property \'.x\'';
3994
+ const displayE = 'Schema validation failed on must have required property \'x\'';
3757
3995
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3758
3996
  done();
3759
3997
  } catch (err) {
@@ -3773,7 +4011,7 @@ describe('[unit] SevOne Adapter Test', () => {
3773
4011
  };
3774
4012
  a.createMapNode(mapId, mapNodeObj, (data, error) => {
3775
4013
  try {
3776
- const displayE = 'Schema validation failed on should have required property \'.y\'';
4014
+ const displayE = 'Schema validation failed on must have required property \'y\'';
3777
4015
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3778
4016
  done();
3779
4017
  } catch (err) {
@@ -3793,7 +4031,7 @@ describe('[unit] SevOne Adapter Test', () => {
3793
4031
  };
3794
4032
  a.createMapNode(mapId, mapNodeObj, (data, error) => {
3795
4033
  try {
3796
- const displayE = 'Schema validation failed on should have required property \'.elements\'';
4034
+ const displayE = 'Schema validation failed on must have required property \'elements\'';
3797
4035
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3798
4036
  done();
3799
4037
  } catch (err) {
@@ -3876,7 +4114,7 @@ describe('[unit] SevOne Adapter Test', () => {
3876
4114
  };
3877
4115
  a.updateMapNode(mapId, mapNodeId, mapNodeObj, (data, error) => {
3878
4116
  try {
3879
- const displayE = 'Schema validation failed on should have required property \'.name\'';
4117
+ const displayE = 'Schema validation failed on must have required property \'name\'';
3880
4118
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3881
4119
  done();
3882
4120
  } catch (err) {
@@ -3896,7 +4134,7 @@ describe('[unit] SevOne Adapter Test', () => {
3896
4134
  };
3897
4135
  a.updateMapNode(mapId, mapNodeId, mapNodeObj, (data, error) => {
3898
4136
  try {
3899
- const displayE = 'Schema validation failed on should have required property \'.type\'';
4137
+ const displayE = 'Schema validation failed on must have required property \'type\'';
3900
4138
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3901
4139
  done();
3902
4140
  } catch (err) {
@@ -3916,7 +4154,7 @@ describe('[unit] SevOne Adapter Test', () => {
3916
4154
  };
3917
4155
  a.updateMapNode(mapId, mapNodeId, mapNodeObj, (data, error) => {
3918
4156
  try {
3919
- const displayE = 'Schema validation failed on should have required property \'.x\'';
4157
+ const displayE = 'Schema validation failed on must have required property \'x\'';
3920
4158
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3921
4159
  done();
3922
4160
  } catch (err) {
@@ -3936,7 +4174,7 @@ describe('[unit] SevOne Adapter Test', () => {
3936
4174
  };
3937
4175
  a.updateMapNode(mapId, mapNodeId, mapNodeObj, (data, error) => {
3938
4176
  try {
3939
- const displayE = 'Schema validation failed on should have required property \'.y\'';
4177
+ const displayE = 'Schema validation failed on must have required property \'y\'';
3940
4178
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3941
4179
  done();
3942
4180
  } catch (err) {
@@ -3956,7 +4194,7 @@ describe('[unit] SevOne Adapter Test', () => {
3956
4194
  };
3957
4195
  a.updateMapNode(mapId, mapNodeId, mapNodeObj, (data, error) => {
3958
4196
  try {
3959
- const displayE = 'Schema validation failed on should have required property \'.elements\'';
4197
+ const displayE = 'Schema validation failed on must have required property \'elements\'';
3960
4198
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
3961
4199
  done();
3962
4200
  } catch (err) {
@@ -5903,7 +6141,7 @@ describe('[unit] SevOne Adapter Test', () => {
5903
6141
  const alert = { origin: 'string', deviceId };
5904
6142
  a.createAlert(alert, (data, error) => {
5905
6143
  try {
5906
- const displayE = 'Schema validation failed on should have required property \'.message\'';
6144
+ const displayE = 'Schema validation failed on must have required property \'message\'';
5907
6145
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
5908
6146
  done();
5909
6147
  } catch (err) {
@@ -5921,7 +6159,7 @@ describe('[unit] SevOne Adapter Test', () => {
5921
6159
  const alert = { message: 'blah', deviceId };
5922
6160
  a.createAlert(alert, (data, error) => {
5923
6161
  try {
5924
- const displayE = 'Schema validation failed on should have required property \'.origin\'';
6162
+ const displayE = 'Schema validation failed on must have required property \'origin\'';
5925
6163
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
5926
6164
  done();
5927
6165
  } catch (err) {
@@ -5939,7 +6177,7 @@ describe('[unit] SevOne Adapter Test', () => {
5939
6177
  const alert = { message: 'blah', origin: 'string' };
5940
6178
  a.createAlert(alert, (data, error) => {
5941
6179
  try {
5942
- const displayE = 'Schema validation failed on should have required property \'.deviceId\'';
6180
+ const displayE = 'Schema validation failed on must have required property \'deviceId\'';
5943
6181
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
5944
6182
  done();
5945
6183
  } catch (err) {
@@ -6003,7 +6241,7 @@ describe('[unit] SevOne Adapter Test', () => {
6003
6241
  const alert = { origin: 'string', deviceId };
6004
6242
  a.updateAlert(alertId, alert, (data, error) => {
6005
6243
  try {
6006
- const displayE = 'Schema validation failed on should have required property \'.message\'';
6244
+ const displayE = 'Schema validation failed on must have required property \'message\'';
6007
6245
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
6008
6246
  done();
6009
6247
  } catch (err) {
@@ -6021,7 +6259,7 @@ describe('[unit] SevOne Adapter Test', () => {
6021
6259
  const alert = { message: 'blah', deviceId };
6022
6260
  a.updateAlert(alertId, alert, (data, error) => {
6023
6261
  try {
6024
- const displayE = 'Schema validation failed on should have required property \'.origin\'';
6262
+ const displayE = 'Schema validation failed on must have required property \'origin\'';
6025
6263
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
6026
6264
  done();
6027
6265
  } catch (err) {
@@ -6039,7 +6277,7 @@ describe('[unit] SevOne Adapter Test', () => {
6039
6277
  const alert = { message: 'blah', origin: 'string' };
6040
6278
  a.updateAlert(alertId, alert, (data, error) => {
6041
6279
  try {
6042
- const displayE = 'Schema validation failed on should have required property \'.deviceId\'';
6280
+ const displayE = 'Schema validation failed on must have required property \'deviceId\'';
6043
6281
  runErrorAsserts(data, error, 'AD.312', 'Test-sevone-translatorUtil-buildJSONEntity', displayE);
6044
6282
  done();
6045
6283
  } catch (err) {