@itentialopensource/adapter-dna_center 0.5.6 → 0.5.7

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.
@@ -23,7 +23,7 @@ const anything = td.matchers.anything();
23
23
  let logLevel = 'none';
24
24
  const stub = true;
25
25
  const isRapidFail = false;
26
- const attemptTimeout = 120000;
26
+ const attemptTimeout = 600000;
27
27
 
28
28
  // these variables can be changed to run in integrated mode so easier to set them here
29
29
  // always check these in with bogus data!!!
@@ -65,7 +65,10 @@ global.pronghornProps = {
65
65
  invalid_token_error: 401,
66
66
  auth_field: 'header.headers.Authorization',
67
67
  auth_field_format: 'Basic {b64}{username}:{password}{/b64}',
68
- auth_logging: false
68
+ auth_logging: false,
69
+ client_id: '',
70
+ client_secret: '',
71
+ grant_type: ''
69
72
  },
70
73
  healthcheck: {
71
74
  type: 'startup',
@@ -198,7 +201,7 @@ function runErrorAsserts(data, error, code, origin, displayStr) {
198
201
  }
199
202
 
200
203
  // require the adapter that we are going to be using
201
- const DnaCenter = require('../../adapter.js');
204
+ const DnaCenter = require('../../adapter');
202
205
 
203
206
  // delete the .DS_Store directory in entities -- otherwise this will cause errors
204
207
  const dirPath = path.join(__dirname, '../../entities/.DS_Store');
@@ -240,6 +243,8 @@ describe('[unit] Dna_center Adapter Test', () => {
240
243
  try {
241
244
  assert.notEqual(null, a);
242
245
  assert.notEqual(undefined, a);
246
+ const checkId = global.pronghornProps.adapterProps.adapters[0].id;
247
+ assert.equal(checkId, a.id);
243
248
  assert.notEqual(null, a.allProps);
244
249
  const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
245
250
  assert.equal(check, a.healthcheckType);
@@ -266,10 +271,10 @@ describe('[unit] Dna_center Adapter Test', () => {
266
271
  });
267
272
 
268
273
  let wffunctions = [];
269
- describe('#getWorkflowFunctions', () => {
274
+ describe('#iapGetAdapterWorkflowFunctions', () => {
270
275
  it('should retrieve workflow functions', (done) => {
271
276
  try {
272
- wffunctions = a.getWorkflowFunctions([]);
277
+ wffunctions = a.iapGetAdapterWorkflowFunctions([]);
273
278
 
274
279
  try {
275
280
  assert.notEqual(0, wffunctions.length);
@@ -321,13 +326,103 @@ describe('[unit] Dna_center Adapter Test', () => {
321
326
  done(error);
322
327
  }
323
328
  });
324
- it('package.json should be customized', (done) => {
329
+ it('package.json standard fields should be customized', (done) => {
325
330
  try {
326
331
  const packageDotJson = require('../../package.json');
327
332
  assert.notEqual(-1, packageDotJson.name.indexOf('dna_center'));
328
333
  assert.notEqual(undefined, packageDotJson.version);
329
334
  assert.notEqual(null, packageDotJson.version);
330
335
  assert.notEqual('', packageDotJson.version);
336
+ assert.notEqual(undefined, packageDotJson.description);
337
+ assert.notEqual(null, packageDotJson.description);
338
+ assert.notEqual('', packageDotJson.description);
339
+ assert.equal('adapter.js', packageDotJson.main);
340
+ assert.notEqual(undefined, packageDotJson.wizardVersion);
341
+ assert.notEqual(null, packageDotJson.wizardVersion);
342
+ assert.notEqual('', packageDotJson.wizardVersion);
343
+ assert.notEqual(undefined, packageDotJson.engineVersion);
344
+ assert.notEqual(null, packageDotJson.engineVersion);
345
+ assert.notEqual('', packageDotJson.engineVersion);
346
+ assert.equal('http', packageDotJson.adapterType);
347
+ done();
348
+ } catch (error) {
349
+ log.error(`Test Failure: ${error}`);
350
+ done(error);
351
+ }
352
+ });
353
+ it('package.json proper scripts should be provided', (done) => {
354
+ try {
355
+ const packageDotJson = require('../../package.json');
356
+ assert.notEqual(undefined, packageDotJson.scripts);
357
+ assert.notEqual(null, packageDotJson.scripts);
358
+ assert.notEqual('', packageDotJson.scripts);
359
+ assert.equal('node utils/setup.js && npm install --package-lock-only --ignore-scripts && npx npm-force-resolutions', packageDotJson.scripts.preinstall);
360
+ assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js', packageDotJson.scripts.lint);
361
+ assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js --quiet', packageDotJson.scripts['lint:errors']);
362
+ assert.equal('mocha test/unit/adapterBaseTestUnit.js --LOG=error', packageDotJson.scripts['test:baseunit']);
363
+ assert.equal('mocha test/unit/adapterTestUnit.js --LOG=error', packageDotJson.scripts['test:unit']);
364
+ assert.equal('mocha test/integration/adapterTestIntegration.js --LOG=error', packageDotJson.scripts['test:integration']);
365
+ assert.equal('nyc --reporter html --reporter text mocha --reporter dot test/*', packageDotJson.scripts['test:cover']);
366
+ assert.equal('npm run test:baseunit && npm run test:unit && npm run test:integration', packageDotJson.scripts.test);
367
+ assert.equal('npm publish --registry=https://registry.npmjs.org --access=public', packageDotJson.scripts.deploy);
368
+ assert.equal('npm run deploy', packageDotJson.scripts.build);
369
+ done();
370
+ } catch (error) {
371
+ log.error(`Test Failure: ${error}`);
372
+ done(error);
373
+ }
374
+ });
375
+ it('package.json proper directories should be provided', (done) => {
376
+ try {
377
+ const packageDotJson = require('../../package.json');
378
+ assert.notEqual(undefined, packageDotJson.repository);
379
+ assert.notEqual(null, packageDotJson.repository);
380
+ assert.notEqual('', packageDotJson.repository);
381
+ assert.equal('git', packageDotJson.repository.type);
382
+ assert.equal('git@gitlab.com:itentialopensource/adapters/', packageDotJson.repository.url.substring(0, 43));
383
+ assert.equal('https://gitlab.com/itentialopensource/adapters/', packageDotJson.homepage.substring(0, 47));
384
+ done();
385
+ } catch (error) {
386
+ log.error(`Test Failure: ${error}`);
387
+ done(error);
388
+ }
389
+ });
390
+ it('package.json proper dependencies should be provided', (done) => {
391
+ try {
392
+ const packageDotJson = require('../../package.json');
393
+ assert.notEqual(undefined, packageDotJson.dependencies);
394
+ assert.notEqual(null, packageDotJson.dependencies);
395
+ assert.notEqual('', packageDotJson.dependencies);
396
+ assert.equal('^6.12.0', packageDotJson.dependencies.ajv);
397
+ assert.equal('^0.21.0', packageDotJson.dependencies.axios);
398
+ assert.equal('^2.20.0', packageDotJson.dependencies.commander);
399
+ assert.equal('^8.1.0', packageDotJson.dependencies['fs-extra']);
400
+ assert.equal('^9.0.1', packageDotJson.dependencies.mocha);
401
+ assert.equal('^2.0.1', packageDotJson.dependencies['mocha-param']);
402
+ assert.equal('^0.5.3', packageDotJson.dependencies['network-diagnostics']);
403
+ assert.equal('^15.1.0', packageDotJson.dependencies.nyc);
404
+ assert.equal('^1.4.10', packageDotJson.dependencies['readline-sync']);
405
+ assert.equal('^7.3.2', packageDotJson.dependencies.semver);
406
+ assert.equal('^3.3.3', packageDotJson.dependencies.winston);
407
+ done();
408
+ } catch (error) {
409
+ log.error(`Test Failure: ${error}`);
410
+ done(error);
411
+ }
412
+ });
413
+ it('package.json proper dev dependencies should be provided', (done) => {
414
+ try {
415
+ const packageDotJson = require('../../package.json');
416
+ assert.notEqual(undefined, packageDotJson.devDependencies);
417
+ assert.notEqual(null, packageDotJson.devDependencies);
418
+ assert.notEqual('', packageDotJson.devDependencies);
419
+ assert.equal('^4.3.4', packageDotJson.devDependencies.chai);
420
+ assert.equal('^7.29.0', packageDotJson.devDependencies.eslint);
421
+ assert.equal('^14.2.1', packageDotJson.devDependencies['eslint-config-airbnb-base']);
422
+ assert.equal('^2.23.4', packageDotJson.devDependencies['eslint-plugin-import']);
423
+ assert.equal('^3.0.0', packageDotJson.devDependencies['eslint-plugin-json']);
424
+ assert.equal('^0.6.3', packageDotJson.devDependencies['package-json-validator']);
425
+ assert.equal('^3.16.1', packageDotJson.devDependencies.testdouble);
331
426
  done();
332
427
  } catch (error) {
333
428
  log.error(`Test Failure: ${error}`);
@@ -352,8 +447,35 @@ describe('[unit] Dna_center Adapter Test', () => {
352
447
  try {
353
448
  const pronghornDotJson = require('../../pronghorn.json');
354
449
  assert.notEqual(-1, pronghornDotJson.id.indexOf('dna_center'));
450
+ assert.equal('Adapter', pronghornDotJson.type);
355
451
  assert.equal('DnaCenter', pronghornDotJson.export);
356
452
  assert.equal('Dna_center', pronghornDotJson.title);
453
+ assert.equal('adapter.js', pronghornDotJson.src);
454
+ done();
455
+ } catch (error) {
456
+ log.error(`Test Failure: ${error}`);
457
+ done(error);
458
+ }
459
+ });
460
+ it('pronghorn.json should contain generic adapter methods', (done) => {
461
+ try {
462
+ const pronghornDotJson = require('../../pronghorn.json');
463
+ assert.notEqual(undefined, pronghornDotJson.methods);
464
+ assert.notEqual(null, pronghornDotJson.methods);
465
+ assert.notEqual('', pronghornDotJson.methods);
466
+ assert.equal(true, Array.isArray(pronghornDotJson.methods));
467
+ assert.notEqual(0, pronghornDotJson.methods.length);
468
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUpdateAdapterConfiguration'));
469
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapFindAdapterPath'));
470
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapTroubleshootAdapter'));
471
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterHealthcheck'));
472
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterConnectivity'));
473
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterBasicGet'));
474
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapSuspendAdapter'));
475
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUnsuspendAdapter'));
476
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapGetAdapterQueue'));
477
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequest'));
478
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequestNoBasePath'));
357
479
  done();
358
480
  } catch (error) {
359
481
  log.error(`Test Failure: ${error}`);
@@ -492,6 +614,123 @@ describe('[unit] Dna_center Adapter Test', () => {
492
614
  try {
493
615
  const propertiesDotJson = require('../../propertiesSchema.json');
494
616
  assert.equal('adapter-dna_center', propertiesDotJson.$id);
617
+ assert.equal('object', propertiesDotJson.type);
618
+ assert.equal('http://json-schema.org/draft-07/schema#', propertiesDotJson.$schema);
619
+ done();
620
+ } catch (error) {
621
+ log.error(`Test Failure: ${error}`);
622
+ done(error);
623
+ }
624
+ });
625
+ it('propertiesSchema.json should contain generic adapter properties', (done) => {
626
+ try {
627
+ const propertiesDotJson = require('../../propertiesSchema.json');
628
+ assert.notEqual(undefined, propertiesDotJson.properties);
629
+ assert.notEqual(null, propertiesDotJson.properties);
630
+ assert.notEqual('', propertiesDotJson.properties);
631
+ assert.equal('string', propertiesDotJson.properties.host.type);
632
+ assert.equal('integer', propertiesDotJson.properties.port.type);
633
+ assert.equal('boolean', propertiesDotJson.properties.stub.type);
634
+ assert.notEqual(undefined, propertiesDotJson.definitions.authentication);
635
+ assert.notEqual(null, propertiesDotJson.definitions.authentication);
636
+ assert.notEqual('', propertiesDotJson.definitions.authentication);
637
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.auth_method.type);
638
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.username.type);
639
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.password.type);
640
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.token.type);
641
+ assert.equal('integer', propertiesDotJson.definitions.authentication.properties.invalid_token_error.type);
642
+ assert.equal('integer', propertiesDotJson.definitions.authentication.properties.token_timeout.type);
643
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.token_cache.type);
644
+ assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field.type));
645
+ assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field_format.type));
646
+ assert.equal('boolean', propertiesDotJson.definitions.authentication.properties.auth_logging.type);
647
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_id.type);
648
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_secret.type);
649
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.grant_type.type);
650
+ assert.notEqual('', propertiesDotJson.definitions.ssl);
651
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.ecdhCurve.type);
652
+ assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.enabled.type);
653
+ assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.accept_invalid_cert.type);
654
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.ca_file.type);
655
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.key_file.type);
656
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.cert_file.type);
657
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.secure_protocol.type);
658
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.ciphers.type);
659
+ assert.equal('string', propertiesDotJson.properties.base_path.type);
660
+ assert.equal('string', propertiesDotJson.properties.version.type);
661
+ assert.equal('string', propertiesDotJson.properties.cache_location.type);
662
+ assert.equal('boolean', propertiesDotJson.properties.encode_pathvars.type);
663
+ assert.equal(true, Array.isArray(propertiesDotJson.properties.save_metric.type));
664
+ assert.equal('string', propertiesDotJson.properties.protocol.type);
665
+ assert.notEqual(undefined, propertiesDotJson.definitions);
666
+ assert.notEqual(null, propertiesDotJson.definitions);
667
+ assert.notEqual('', propertiesDotJson.definitions);
668
+ assert.notEqual(undefined, propertiesDotJson.definitions.healthcheck);
669
+ assert.notEqual(null, propertiesDotJson.definitions.healthcheck);
670
+ assert.notEqual('', propertiesDotJson.definitions.healthcheck);
671
+ assert.equal('string', propertiesDotJson.definitions.healthcheck.properties.type.type);
672
+ assert.equal('integer', propertiesDotJson.definitions.healthcheck.properties.frequency.type);
673
+ assert.equal('object', propertiesDotJson.definitions.healthcheck.properties.query_object.type);
674
+ assert.notEqual(undefined, propertiesDotJson.definitions.throttle);
675
+ assert.notEqual(null, propertiesDotJson.definitions.throttle);
676
+ assert.notEqual('', propertiesDotJson.definitions.throttle);
677
+ assert.equal('boolean', propertiesDotJson.definitions.throttle.properties.throttle_enabled.type);
678
+ assert.equal('integer', propertiesDotJson.definitions.throttle.properties.number_pronghorns.type);
679
+ assert.equal('string', propertiesDotJson.definitions.throttle.properties.sync_async.type);
680
+ assert.equal('integer', propertiesDotJson.definitions.throttle.properties.max_in_queue.type);
681
+ assert.equal('integer', propertiesDotJson.definitions.throttle.properties.concurrent_max.type);
682
+ assert.equal('integer', propertiesDotJson.definitions.throttle.properties.expire_timeout.type);
683
+ assert.equal('integer', propertiesDotJson.definitions.throttle.properties.avg_runtime.type);
684
+ assert.equal('array', propertiesDotJson.definitions.throttle.properties.priorities.type);
685
+ assert.notEqual(undefined, propertiesDotJson.definitions.request);
686
+ assert.notEqual(null, propertiesDotJson.definitions.request);
687
+ assert.notEqual('', propertiesDotJson.definitions.request);
688
+ assert.equal('integer', propertiesDotJson.definitions.request.properties.number_redirects.type);
689
+ assert.equal('integer', propertiesDotJson.definitions.request.properties.number_retries.type);
690
+ assert.equal(true, Array.isArray(propertiesDotJson.definitions.request.properties.limit_retry_error.type));
691
+ assert.equal('array', propertiesDotJson.definitions.request.properties.failover_codes.type);
692
+ assert.equal('integer', propertiesDotJson.definitions.request.properties.attempt_timeout.type);
693
+ assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.type);
694
+ assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.payload.type);
695
+ assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.uriOptions.type);
696
+ assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.addlHeaders.type);
697
+ assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.authData.type);
698
+ assert.equal('boolean', propertiesDotJson.definitions.request.properties.healthcheck_on_timeout.type);
699
+ assert.equal('boolean', propertiesDotJson.definitions.request.properties.return_raw.type);
700
+ assert.equal('boolean', propertiesDotJson.definitions.request.properties.archiving.type);
701
+ assert.equal('boolean', propertiesDotJson.definitions.request.properties.return_request.type);
702
+ assert.notEqual(undefined, propertiesDotJson.definitions.proxy);
703
+ assert.notEqual(null, propertiesDotJson.definitions.proxy);
704
+ assert.notEqual('', propertiesDotJson.definitions.proxy);
705
+ assert.equal('boolean', propertiesDotJson.definitions.proxy.properties.enabled.type);
706
+ assert.equal('string', propertiesDotJson.definitions.proxy.properties.host.type);
707
+ assert.equal('integer', propertiesDotJson.definitions.proxy.properties.port.type);
708
+ assert.equal('string', propertiesDotJson.definitions.proxy.properties.protocol.type);
709
+ assert.equal('string', propertiesDotJson.definitions.proxy.properties.username.type);
710
+ assert.equal('string', propertiesDotJson.definitions.proxy.properties.password.type);
711
+ assert.notEqual(undefined, propertiesDotJson.definitions.ssl);
712
+ assert.notEqual(null, propertiesDotJson.definitions.ssl);
713
+ assert.notEqual(undefined, propertiesDotJson.definitions.mongo);
714
+ assert.notEqual(null, propertiesDotJson.definitions.mongo);
715
+ assert.notEqual('', propertiesDotJson.definitions.mongo);
716
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.host.type);
717
+ assert.equal('integer', propertiesDotJson.definitions.mongo.properties.port.type);
718
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.database.type);
719
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.username.type);
720
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.password.type);
721
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.replSet.type);
722
+ assert.equal('object', propertiesDotJson.definitions.mongo.properties.db_ssl.type);
723
+ assert.equal('boolean', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.enabled.type);
724
+ assert.equal('boolean', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.accept_invalid_cert.type);
725
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.ca_file.type);
726
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.key_file.type);
727
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.cert_file.type);
728
+ assert.notEqual('', propertiesDotJson.definitions.devicebroker);
729
+ assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevice.type);
730
+ assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevicesFiltered.type);
731
+ assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.isAlive.type);
732
+ assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getConfig.type);
733
+ assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getCount.type);
495
734
  done();
496
735
  } catch (error) {
497
736
  log.error(`Test Failure: ${error}`);
@@ -512,6 +751,50 @@ describe('[unit] Dna_center Adapter Test', () => {
512
751
  done(error);
513
752
  }
514
753
  });
754
+ it('error.json should have standard adapter errors', (done) => {
755
+ try {
756
+ const errorDotJson = require('../../error.json');
757
+ assert.notEqual(undefined, errorDotJson.errors);
758
+ assert.notEqual(null, errorDotJson.errors);
759
+ assert.notEqual('', errorDotJson.errors);
760
+ assert.equal(true, Array.isArray(errorDotJson.errors));
761
+ assert.notEqual(0, errorDotJson.errors.length);
762
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.100'));
763
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.101'));
764
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.102'));
765
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.110'));
766
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.111'));
767
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.112'));
768
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.113'));
769
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.114'));
770
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.115'));
771
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.116'));
772
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.300'));
773
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.301'));
774
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.302'));
775
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.303'));
776
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.304'));
777
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.305'));
778
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.310'));
779
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.311'));
780
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.312'));
781
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.320'));
782
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.321'));
783
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.400'));
784
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.401'));
785
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.402'));
786
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.500'));
787
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.501'));
788
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.502'));
789
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.503'));
790
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.600'));
791
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.900'));
792
+ done();
793
+ } catch (error) {
794
+ log.error(`Test Failure: ${error}`);
795
+ done(error);
796
+ }
797
+ });
515
798
  });
516
799
 
517
800
  describe('sampleProperties.json', () => {
@@ -526,6 +809,119 @@ describe('[unit] Dna_center Adapter Test', () => {
526
809
  done(error);
527
810
  }
528
811
  });
812
+ it('sampleProperties.json should contain generic adapter properties', (done) => {
813
+ try {
814
+ const sampleDotJson = require('../../sampleProperties.json');
815
+ assert.notEqual(-1, sampleDotJson.id.indexOf('dna_center'));
816
+ assert.equal('DnaCenter', sampleDotJson.type);
817
+ assert.notEqual(undefined, sampleDotJson.properties);
818
+ assert.notEqual(null, sampleDotJson.properties);
819
+ assert.notEqual('', sampleDotJson.properties);
820
+ assert.notEqual(undefined, sampleDotJson.properties.host);
821
+ assert.notEqual(undefined, sampleDotJson.properties.port);
822
+ assert.notEqual(undefined, sampleDotJson.properties.stub);
823
+ assert.notEqual(undefined, sampleDotJson.properties.authentication);
824
+ assert.notEqual(null, sampleDotJson.properties.authentication);
825
+ assert.notEqual('', sampleDotJson.properties.authentication);
826
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_method);
827
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.username);
828
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.password);
829
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.token);
830
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.invalid_token_error);
831
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.token_timeout);
832
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.token_cache);
833
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field);
834
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field_format);
835
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_logging);
836
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.client_id);
837
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.client_secret);
838
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.grant_type);
839
+ assert.notEqual(undefined, sampleDotJson.properties.ssl);
840
+ assert.notEqual(null, sampleDotJson.properties.ssl);
841
+ assert.notEqual('', sampleDotJson.properties.ssl);
842
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.ecdhCurve);
843
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.enabled);
844
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.accept_invalid_cert);
845
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.ca_file);
846
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.key_file);
847
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.cert_file);
848
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.secure_protocol);
849
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.ciphers);
850
+
851
+ assert.notEqual(undefined, sampleDotJson.properties.base_path);
852
+ assert.notEqual(undefined, sampleDotJson.properties.version);
853
+ assert.notEqual(undefined, sampleDotJson.properties.cache_location);
854
+ assert.notEqual(undefined, sampleDotJson.properties.encode_pathvars);
855
+ assert.notEqual(undefined, sampleDotJson.properties.save_metric);
856
+ assert.notEqual(undefined, sampleDotJson.properties.protocol);
857
+ assert.notEqual(undefined, sampleDotJson.properties.stub);
858
+ assert.notEqual(undefined, sampleDotJson.properties.stub);
859
+ assert.notEqual(undefined, sampleDotJson.properties.stub);
860
+ assert.notEqual(undefined, sampleDotJson.properties.stub);
861
+ assert.notEqual(undefined, sampleDotJson.properties.healthcheck);
862
+ assert.notEqual(null, sampleDotJson.properties.healthcheck);
863
+ assert.notEqual('', sampleDotJson.properties.healthcheck);
864
+ assert.notEqual(undefined, sampleDotJson.properties.healthcheck.type);
865
+ assert.notEqual(undefined, sampleDotJson.properties.healthcheck.frequency);
866
+ assert.notEqual(undefined, sampleDotJson.properties.healthcheck.query_object);
867
+ assert.notEqual(undefined, sampleDotJson.properties.throttle);
868
+ assert.notEqual(null, sampleDotJson.properties.throttle);
869
+ assert.notEqual('', sampleDotJson.properties.throttle);
870
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.throttle_enabled);
871
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.number_pronghorns);
872
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.sync_async);
873
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.max_in_queue);
874
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.concurrent_max);
875
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.expire_timeout);
876
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.avg_runtime);
877
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.priorities);
878
+ assert.notEqual(undefined, sampleDotJson.properties.request);
879
+ assert.notEqual(null, sampleDotJson.properties.request);
880
+ assert.notEqual('', sampleDotJson.properties.request);
881
+ assert.notEqual(undefined, sampleDotJson.properties.request.number_redirects);
882
+ assert.notEqual(undefined, sampleDotJson.properties.request.number_retries);
883
+ assert.notEqual(undefined, sampleDotJson.properties.request.limit_retry_error);
884
+ assert.notEqual(undefined, sampleDotJson.properties.request.failover_codes);
885
+ assert.notEqual(undefined, sampleDotJson.properties.request.attempt_timeout);
886
+ assert.notEqual(undefined, sampleDotJson.properties.request.global_request);
887
+ assert.notEqual(undefined, sampleDotJson.properties.request.global_request.payload);
888
+ assert.notEqual(undefined, sampleDotJson.properties.request.global_request.uriOptions);
889
+ assert.notEqual(undefined, sampleDotJson.properties.request.global_request.addlHeaders);
890
+ assert.notEqual(undefined, sampleDotJson.properties.request.global_request.authData);
891
+ assert.notEqual(undefined, sampleDotJson.properties.request.healthcheck_on_timeout);
892
+ assert.notEqual(undefined, sampleDotJson.properties.request.return_raw);
893
+ assert.notEqual(undefined, sampleDotJson.properties.request.archiving);
894
+ assert.notEqual(undefined, sampleDotJson.properties.request.return_request);
895
+ assert.notEqual(undefined, sampleDotJson.properties.proxy);
896
+ assert.notEqual(null, sampleDotJson.properties.proxy);
897
+ assert.notEqual('', sampleDotJson.properties.proxy);
898
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.enabled);
899
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.host);
900
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.port);
901
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.protocol);
902
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.username);
903
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.password);
904
+ assert.notEqual(undefined, sampleDotJson.properties.mongo);
905
+ assert.notEqual(null, sampleDotJson.properties.mongo);
906
+ assert.notEqual('', sampleDotJson.properties.mongo);
907
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.host);
908
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.port);
909
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.database);
910
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.username);
911
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.password);
912
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.replSet);
913
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl);
914
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.enabled);
915
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.accept_invalid_cert);
916
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.ca_file);
917
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.key_file);
918
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.cert_file);
919
+ done();
920
+ } catch (error) {
921
+ log.error(`Test Failure: ${error}`);
922
+ done(error);
923
+ }
924
+ });
529
925
  });
530
926
 
531
927
  describe('#checkProperties', () => {
@@ -613,6 +1009,148 @@ describe('[unit] Dna_center Adapter Test', () => {
613
1009
  });
614
1010
  });
615
1011
 
1012
+ describe('#iapUpdateAdapterConfiguration', () => {
1013
+ it('should have a iapUpdateAdapterConfiguration function', (done) => {
1014
+ try {
1015
+ assert.equal(true, typeof a.iapUpdateAdapterConfiguration === 'function');
1016
+ done();
1017
+ } catch (error) {
1018
+ log.error(`Test Failure: ${error}`);
1019
+ done(error);
1020
+ }
1021
+ });
1022
+ });
1023
+
1024
+ describe('#iapFindAdapterPath', () => {
1025
+ it('should have a iapFindAdapterPath function', (done) => {
1026
+ try {
1027
+ assert.equal(true, typeof a.iapFindAdapterPath === 'function');
1028
+ done();
1029
+ } catch (error) {
1030
+ log.error(`Test Failure: ${error}`);
1031
+ done(error);
1032
+ }
1033
+ });
1034
+ it('iapFindAdapterPath should find atleast one path that matches', (done) => {
1035
+ try {
1036
+ a.iapFindAdapterPath('{base_path}/{version}', (data, error) => {
1037
+ try {
1038
+ assert.equal(undefined, error);
1039
+ assert.notEqual(undefined, data);
1040
+ assert.notEqual(null, data);
1041
+ assert.equal(true, data.found);
1042
+ assert.notEqual(undefined, data.foundIn);
1043
+ assert.notEqual(null, data.foundIn);
1044
+ assert.notEqual(0, data.foundIn.length);
1045
+ done();
1046
+ } catch (err) {
1047
+ log.error(`Test Failure: ${err}`);
1048
+ done(err);
1049
+ }
1050
+ });
1051
+ } catch (error) {
1052
+ log.error(`Adapter Exception: ${error}`);
1053
+ done(error);
1054
+ }
1055
+ }).timeout(attemptTimeout);
1056
+ });
1057
+
1058
+ describe('#iapSuspendAdapter', () => {
1059
+ it('should have a iapSuspendAdapter function', (done) => {
1060
+ try {
1061
+ assert.equal(true, typeof a.iapSuspendAdapter === 'function');
1062
+ done();
1063
+ } catch (error) {
1064
+ log.error(`Test Failure: ${error}`);
1065
+ done(error);
1066
+ }
1067
+ });
1068
+ });
1069
+
1070
+ describe('#iapUnsuspendAdapter', () => {
1071
+ it('should have a iapUnsuspendAdapter function', (done) => {
1072
+ try {
1073
+ assert.equal(true, typeof a.iapUnsuspendAdapter === 'function');
1074
+ done();
1075
+ } catch (error) {
1076
+ log.error(`Test Failure: ${error}`);
1077
+ done(error);
1078
+ }
1079
+ });
1080
+ });
1081
+
1082
+ describe('#iapGetAdapterQueue', () => {
1083
+ it('should have a iapGetAdapterQueue function', (done) => {
1084
+ try {
1085
+ assert.equal(true, typeof a.iapGetAdapterQueue === 'function');
1086
+ done();
1087
+ } catch (error) {
1088
+ log.error(`Test Failure: ${error}`);
1089
+ done(error);
1090
+ }
1091
+ });
1092
+ });
1093
+
1094
+ describe('#iapTroubleshootAdapter', () => {
1095
+ it('should have a iapTroubleshootAdapter function', (done) => {
1096
+ try {
1097
+ assert.equal(true, typeof a.iapTroubleshootAdapter === 'function');
1098
+ done();
1099
+ } catch (error) {
1100
+ log.error(`Test Failure: ${error}`);
1101
+ done(error);
1102
+ }
1103
+ });
1104
+ });
1105
+
1106
+ describe('#iapRunAdapterHealthcheck', () => {
1107
+ it('should have a iapRunAdapterHealthcheck function', (done) => {
1108
+ try {
1109
+ assert.equal(true, typeof a.iapRunAdapterHealthcheck === 'function');
1110
+ done();
1111
+ } catch (error) {
1112
+ log.error(`Test Failure: ${error}`);
1113
+ done(error);
1114
+ }
1115
+ });
1116
+ });
1117
+
1118
+ describe('#iapRunAdapterConnectivity', () => {
1119
+ it('should have a iapRunAdapterConnectivity function', (done) => {
1120
+ try {
1121
+ assert.equal(true, typeof a.iapRunAdapterConnectivity === 'function');
1122
+ done();
1123
+ } catch (error) {
1124
+ log.error(`Test Failure: ${error}`);
1125
+ done(error);
1126
+ }
1127
+ });
1128
+ });
1129
+
1130
+ describe('#iapRunAdapterBasicGet', () => {
1131
+ it('should have a iapRunAdapterBasicGet function', (done) => {
1132
+ try {
1133
+ assert.equal(true, typeof a.iapRunAdapterBasicGet === 'function');
1134
+ done();
1135
+ } catch (error) {
1136
+ log.error(`Test Failure: ${error}`);
1137
+ done(error);
1138
+ }
1139
+ });
1140
+ });
1141
+
1142
+ describe('#iapMoveAdapterEntitiesToDB', () => {
1143
+ it('should have a iapMoveAdapterEntitiesToDB function', (done) => {
1144
+ try {
1145
+ assert.equal(true, typeof a.iapMoveAdapterEntitiesToDB === 'function');
1146
+ done();
1147
+ } catch (error) {
1148
+ log.error(`Test Failure: ${error}`);
1149
+ done(error);
1150
+ }
1151
+ });
1152
+ });
1153
+
616
1154
  describe('#checkActionFiles', () => {
617
1155
  it('should have a checkActionFiles function', (done) => {
618
1156
  try {
@@ -698,10 +1236,10 @@ describe('[unit] Dna_center Adapter Test', () => {
698
1236
  }).timeout(attemptTimeout);
699
1237
  });
700
1238
 
701
- // describe('#hasEntity', () => {
702
- // it('should have a hasEntity function', (done) => {
1239
+ // describe('#iapHasAdapterEntity', () => {
1240
+ // it('should have a iapHasAdapterEntity function', (done) => {
703
1241
  // try {
704
- // assert.equal(true, typeof a.hasEntity === 'function');
1242
+ // assert.equal(true, typeof a.iapHasAdapterEntity === 'function');
705
1243
  // done();
706
1244
  // } catch (error) {
707
1245
  // log.error(`Test Failure: ${error}`);
@@ -710,7 +1248,7 @@ describe('[unit] Dna_center Adapter Test', () => {
710
1248
  // });
711
1249
  // it('should find entity', (done) => {
712
1250
  // try {
713
- // a.hasEntity('template_entity', // 'a9e9c33dc61122760072455df62663d2', (data) => {
1251
+ // a.iapHasAdapterEntity('template_entity', // 'a9e9c33dc61122760072455df62663d2', (data) => {
714
1252
  // try {
715
1253
  // assert.equal(true, data[0]);
716
1254
  // done();
@@ -726,7 +1264,7 @@ describe('[unit] Dna_center Adapter Test', () => {
726
1264
  // }).timeout(attemptTimeout);
727
1265
  // it('should not find entity', (done) => {
728
1266
  // try {
729
- // a.hasEntity('template_entity', 'blah', (data) => {
1267
+ // a.iapHasAdapterEntity('template_entity', 'blah', (data) => {
730
1268
  // try {
731
1269
  // assert.equal(false, data[0]);
732
1270
  // done();
@@ -742,6 +1280,90 @@ describe('[unit] Dna_center Adapter Test', () => {
742
1280
  // }).timeout(attemptTimeout);
743
1281
  // });
744
1282
 
1283
+ describe('#hasEntities', () => {
1284
+ it('should have a hasEntities function', (done) => {
1285
+ try {
1286
+ assert.equal(true, typeof a.hasEntities === 'function');
1287
+ done();
1288
+ } catch (error) {
1289
+ log.error(`Test Failure: ${error}`);
1290
+ done(error);
1291
+ }
1292
+ });
1293
+ });
1294
+
1295
+ describe('#hasDevices', () => {
1296
+ it('should have a hasDevices function', (done) => {
1297
+ try {
1298
+ assert.equal(true, typeof a.hasDevices === 'function');
1299
+ done();
1300
+ } catch (error) {
1301
+ log.error(`Test Failure: ${error}`);
1302
+ done(error);
1303
+ }
1304
+ });
1305
+ });
1306
+
1307
+ describe('#getDevice', () => {
1308
+ it('should have a getDevice function', (done) => {
1309
+ try {
1310
+ assert.equal(true, typeof a.getDevice === 'function');
1311
+ done();
1312
+ } catch (error) {
1313
+ log.error(`Test Failure: ${error}`);
1314
+ done(error);
1315
+ }
1316
+ });
1317
+ });
1318
+
1319
+ describe('#getDevicesFiltered', () => {
1320
+ it('should have a getDevicesFiltered function', (done) => {
1321
+ try {
1322
+ assert.equal(true, typeof a.getDevicesFiltered === 'function');
1323
+ done();
1324
+ } catch (error) {
1325
+ log.error(`Test Failure: ${error}`);
1326
+ done(error);
1327
+ }
1328
+ });
1329
+ });
1330
+
1331
+ describe('#isAlive', () => {
1332
+ it('should have a isAlive function', (done) => {
1333
+ try {
1334
+ assert.equal(true, typeof a.isAlive === 'function');
1335
+ done();
1336
+ } catch (error) {
1337
+ log.error(`Test Failure: ${error}`);
1338
+ done(error);
1339
+ }
1340
+ });
1341
+ });
1342
+
1343
+ describe('#getConfig', () => {
1344
+ it('should have a getConfig function', (done) => {
1345
+ try {
1346
+ assert.equal(true, typeof a.getConfig === 'function');
1347
+ done();
1348
+ } catch (error) {
1349
+ log.error(`Test Failure: ${error}`);
1350
+ done(error);
1351
+ }
1352
+ });
1353
+ });
1354
+
1355
+ describe('#iapGetDeviceCount', () => {
1356
+ it('should have a iapGetDeviceCount function', (done) => {
1357
+ try {
1358
+ assert.equal(true, typeof a.iapGetDeviceCount === 'function');
1359
+ done();
1360
+ } catch (error) {
1361
+ log.error(`Test Failure: ${error}`);
1362
+ done(error);
1363
+ }
1364
+ });
1365
+ });
1366
+
745
1367
  /*
746
1368
  -----------------------------------------------------------------------
747
1369
  -----------------------------------------------------------------------
@@ -5419,6 +6041,149 @@ describe('[unit] Dna_center Adapter Test', () => {
5419
6041
  }).timeout(attemptTimeout);
5420
6042
  });
5421
6043
 
6044
+ describe('#postDnasystemapiv1sitesiteIddevice - errors', () => {
6045
+ it('should have a postDnasystemapiv1sitesiteIddevice function', (done) => {
6046
+ try {
6047
+ assert.equal(true, typeof a.postDnasystemapiv1sitesiteIddevice === 'function');
6048
+ done();
6049
+ } catch (error) {
6050
+ log.error(`Test Failure: ${error}`);
6051
+ done(error);
6052
+ }
6053
+ }).timeout(attemptTimeout);
6054
+ it('should error if - missing request', (done) => {
6055
+ try {
6056
+ a.postDnasystemapiv1sitesiteIddevice(null, null, null, null, null, (data, error) => {
6057
+ try {
6058
+ const displayE = 'request is required';
6059
+ runErrorAsserts(data, error, 'AD.300', 'Test-dna_center-adapter-postDnasystemapiv1sitesiteIddevice', displayE);
6060
+ done();
6061
+ } catch (err) {
6062
+ log.error(`Test Failure: ${err}`);
6063
+ done(err);
6064
+ }
6065
+ });
6066
+ } catch (error) {
6067
+ log.error(`Adapter Exception: ${error}`);
6068
+ done(error);
6069
+ }
6070
+ }).timeout(attemptTimeout);
6071
+ it('should error if - missing Runsync', (done) => {
6072
+ try {
6073
+ a.postDnasystemapiv1sitesiteIddevice('fakeparam', null, null, null, null, (data, error) => {
6074
+ try {
6075
+ const displayE = 'Runsync is required';
6076
+ runErrorAsserts(data, error, 'AD.300', 'Test-dna_center-adapter-postDnasystemapiv1sitesiteIddevice', displayE);
6077
+ done();
6078
+ } catch (err) {
6079
+ log.error(`Test Failure: ${err}`);
6080
+ done(err);
6081
+ }
6082
+ });
6083
+ } catch (error) {
6084
+ log.error(`Adapter Exception: ${error}`);
6085
+ done(error);
6086
+ }
6087
+ }).timeout(attemptTimeout);
6088
+ it('should error if - missing Persistbapioutput', (done) => {
6089
+ try {
6090
+ a.postDnasystemapiv1sitesiteIddevice('fakeparam', 'fakeparam', null, null, null, (data, error) => {
6091
+ try {
6092
+ const displayE = 'Persistbapioutput is required';
6093
+ runErrorAsserts(data, error, 'AD.300', 'Test-dna_center-adapter-postDnasystemapiv1sitesiteIddevice', displayE);
6094
+ done();
6095
+ } catch (err) {
6096
+ log.error(`Test Failure: ${err}`);
6097
+ done(err);
6098
+ }
6099
+ });
6100
+ } catch (error) {
6101
+ log.error(`Adapter Exception: ${error}`);
6102
+ done(error);
6103
+ }
6104
+ }).timeout(attemptTimeout);
6105
+ it('should error if - missing siteId', (done) => {
6106
+ try {
6107
+ a.postDnasystemapiv1sitesiteIddevice('fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', null, (data, error) => {
6108
+ try {
6109
+ const displayE = 'siteId is required';
6110
+ runErrorAsserts(data, error, 'AD.300', 'Test-dna_center-adapter-postDnasystemapiv1sitesiteIddevice', displayE);
6111
+ done();
6112
+ } catch (err) {
6113
+ log.error(`Test Failure: ${err}`);
6114
+ done(err);
6115
+ }
6116
+ });
6117
+ } catch (error) {
6118
+ log.error(`Adapter Exception: ${error}`);
6119
+ done(error);
6120
+ }
6121
+ }).timeout(attemptTimeout);
6122
+ });
6123
+
6124
+ describe('#postDnaintentapiv1site - errors', () => {
6125
+ it('should have a postDnaintentapiv1site function', (done) => {
6126
+ try {
6127
+ assert.equal(true, typeof a.postDnaintentapiv1site === 'function');
6128
+ done();
6129
+ } catch (error) {
6130
+ log.error(`Test Failure: ${error}`);
6131
+ done(error);
6132
+ }
6133
+ }).timeout(attemptTimeout);
6134
+ it('should error if - missing request', (done) => {
6135
+ try {
6136
+ a.postDnaintentapiv1site(null, null, null, null, (data, error) => {
6137
+ try {
6138
+ const displayE = 'request is required';
6139
+ runErrorAsserts(data, error, 'AD.300', 'Test-dna_center-adapter-postDnaintentapiv1site', displayE);
6140
+ done();
6141
+ } catch (err) {
6142
+ log.error(`Test Failure: ${err}`);
6143
+ done(err);
6144
+ }
6145
+ });
6146
+ } catch (error) {
6147
+ log.error(`Adapter Exception: ${error}`);
6148
+ done(error);
6149
+ }
6150
+ }).timeout(attemptTimeout);
6151
+ it('should error if - missing Runsync', (done) => {
6152
+ try {
6153
+ a.postDnaintentapiv1site('fakeparam', null, null, null, (data, error) => {
6154
+ try {
6155
+ const displayE = 'Runsync is required';
6156
+ runErrorAsserts(data, error, 'AD.300', 'Test-dna_center-adapter-postDnaintentapiv1site', displayE);
6157
+ done();
6158
+ } catch (err) {
6159
+ log.error(`Test Failure: ${err}`);
6160
+ done(err);
6161
+ }
6162
+ });
6163
+ } catch (error) {
6164
+ log.error(`Adapter Exception: ${error}`);
6165
+ done(error);
6166
+ }
6167
+ }).timeout(attemptTimeout);
6168
+ it('should error if - missing Persistbapioutput', (done) => {
6169
+ try {
6170
+ a.postDnaintentapiv1site('fakeparam', 'fakeparam', 'fakeparam', null, (data, error) => {
6171
+ try {
6172
+ const displayE = 'Persistbapioutput is required';
6173
+ runErrorAsserts(data, error, 'AD.300', 'Test-dna_center-adapter-postDnaintentapiv1site', displayE);
6174
+ done();
6175
+ } catch (err) {
6176
+ log.error(`Test Failure: ${err}`);
6177
+ done(err);
6178
+ }
6179
+ });
6180
+ } catch (error) {
6181
+ log.error(`Adapter Exception: ${error}`);
6182
+ done(error);
6183
+ }
6184
+ }).timeout(attemptTimeout);
6185
+ });
6186
+
5422
6187
  describe('#postDnasystemapiv1site - errors', () => {
5423
6188
  it('should have a postDnasystemapiv1site function', (done) => {
5424
6189
  try {