@itentialopensource/adapter-etsi_sol003 0.1.2 → 0.3.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 (54) hide show
  1. package/AUTH.md +39 -0
  2. package/BROKER.md +199 -0
  3. package/CALLS.md +707 -0
  4. package/CHANGELOG.md +13 -5
  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 +235 -576
  10. package/SUMMARY.md +9 -0
  11. package/SYSTEMINFO.md +11 -0
  12. package/TROUBLESHOOT.md +47 -0
  13. package/adapter.js +291 -640
  14. package/adapterBase.js +843 -419
  15. package/changelogs/changelog.md +16 -0
  16. package/entities/.generic/action.json +105 -0
  17. package/entities/.generic/schema.json +6 -1
  18. package/error.json +6 -0
  19. package/metadata.json +49 -0
  20. package/package.json +24 -24
  21. package/pronghorn.json +527 -116
  22. package/propertiesDecorators.json +14 -0
  23. package/propertiesSchema.json +827 -6
  24. package/refs?service=git-upload-pack +0 -0
  25. package/report/adapter-openapi.json +7598 -0
  26. package/report/adapter-openapi.yaml +5267 -0
  27. package/report/adapterInfo.json +10 -0
  28. package/report/updateReport1653138357676.json +120 -0
  29. package/report/updateReport1691507408979.json +120 -0
  30. package/report/updateReport1692202442500.json +120 -0
  31. package/report/updateReport1694460725963.json +120 -0
  32. package/report/updateReport1698420524874.json +120 -0
  33. package/sampleProperties.json +153 -3
  34. package/test/integration/adapterTestBasicGet.js +3 -5
  35. package/test/integration/adapterTestConnectivity.js +91 -42
  36. package/test/integration/adapterTestIntegration.js +1784 -2174
  37. package/test/unit/adapterBaseTestUnit.js +388 -308
  38. package/test/unit/adapterTestUnit.js +399 -260
  39. package/utils/adapterInfo.js +206 -0
  40. package/utils/addAuth.js +1 -1
  41. package/utils/artifactize.js +1 -1
  42. package/utils/checkMigrate.js +1 -1
  43. package/utils/entitiesToDB.js +12 -57
  44. package/utils/findPath.js +1 -1
  45. package/utils/methodDocumentor.js +273 -0
  46. package/utils/modify.js +13 -15
  47. package/utils/packModificationScript.js +1 -1
  48. package/utils/pre-commit.sh +5 -0
  49. package/utils/taskMover.js +309 -0
  50. package/utils/tbScript.js +123 -53
  51. package/utils/tbUtils.js +87 -49
  52. package/utils/testRunner.js +17 -17
  53. package/utils/troubleshootingAdapter.js +9 -6
  54. package/workflows/README.md +0 -3
@@ -3,39 +3,51 @@
3
3
  // Set globals
4
4
  /* global describe it log pronghornProps */
5
5
  /* eslint no-unused-vars: warn */
6
- /* eslint no-underscore-dangle: warn */
6
+ /* eslint no-underscore-dangle: 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
11
  const fs = require('fs');
11
- const mocha = require('mocha');
12
12
  const path = require('path');
13
+ const util = require('util');
14
+ const mocha = require('mocha');
13
15
  const winston = require('winston');
14
16
  const { expect } = require('chai');
15
17
  const { use } = require('chai');
16
18
  const td = require('testdouble');
17
- const util = require('util');
18
- const pronghorn = require('../../pronghorn.json');
19
19
 
20
- pronghorn.methodsByName = pronghorn.methods.reduce((result, meth) => ({ ...result, [meth.name]: meth }), {});
21
20
  const anything = td.matchers.anything();
22
21
 
23
22
  // stub and attemptTimeout are used throughout the code so set them here
24
23
  let logLevel = 'none';
25
- const stub = true;
26
24
  const isRapidFail = false;
27
25
  const isSaveMockData = false;
28
- const attemptTimeout = 5000;
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;
29
35
 
30
36
  // these variables can be changed to run in integrated mode so easier to set them here
31
37
  // always check these in with bogus data!!!
32
- const host = 'replace.hostorip.here';
33
- const username = 'username';
34
- const password = 'password';
35
- const protocol = 'http';
36
- const port = 80;
37
- const sslenable = false;
38
- 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
+ if (samProps.request.attempt_timeout < 30000) {
47
+ samProps.request.attempt_timeout = 30000;
48
+ }
49
+ const attemptTimeout = samProps.request.attempt_timeout;
50
+ const { stub } = samProps;
39
51
 
40
52
  // these are the adapter properties. You generally should not need to alter
41
53
  // any of these after they are initially set up
@@ -47,102 +59,7 @@ global.pronghornProps = {
47
59
  adapters: [{
48
60
  id: 'Test-etsi_sol003',
49
61
  type: 'EtsiSol003',
50
- properties: {
51
- host,
52
- port,
53
- base_path: '/',
54
- version: '',
55
- cache_location: 'none',
56
- encode_pathvars: true,
57
- save_metric: false,
58
- stub,
59
- protocol,
60
- authentication: {
61
- auth_method: 'request_token',
62
- username,
63
- password,
64
- token: '',
65
- invalid_token_error: 401,
66
- token_timeout: 1800000,
67
- token_cache: 'local',
68
- auth_field: 'header.headers.Authorization',
69
- auth_field_format: 'Bearer {token}',
70
- auth_logging: false,
71
- client_id: '',
72
- client_secret: '',
73
- grant_type: ''
74
- },
75
- healthcheck: {
76
- type: 'none',
77
- frequency: 60000,
78
- query_object: {}
79
- },
80
- throttle: {
81
- throttle_enabled: false,
82
- number_pronghorns: 1,
83
- sync_async: 'sync',
84
- max_in_queue: 1000,
85
- concurrent_max: 1,
86
- expire_timeout: 0,
87
- avg_runtime: 200,
88
- priorities: [
89
- {
90
- value: 0,
91
- percent: 100
92
- }
93
- ]
94
- },
95
- request: {
96
- number_redirects: 0,
97
- number_retries: 3,
98
- limit_retry_error: [0],
99
- failover_codes: [],
100
- attempt_timeout: attemptTimeout,
101
- global_request: {
102
- payload: {},
103
- uriOptions: {},
104
- addlHeaders: {},
105
- authData: {}
106
- },
107
- healthcheck_on_timeout: true,
108
- return_raw: true,
109
- archiving: false,
110
- return_request: false
111
- },
112
- proxy: {
113
- enabled: false,
114
- host: '',
115
- port: 1,
116
- protocol: 'http',
117
- username: '',
118
- password: ''
119
- },
120
- ssl: {
121
- ecdhCurve: '',
122
- enabled: sslenable,
123
- accept_invalid_cert: sslinvalid,
124
- ca_file: '',
125
- key_file: '',
126
- cert_file: '',
127
- secure_protocol: '',
128
- ciphers: ''
129
- },
130
- mongo: {
131
- host: '',
132
- port: 0,
133
- database: '',
134
- username: '',
135
- password: '',
136
- replSet: '',
137
- db_ssl: {
138
- enabled: false,
139
- accept_invalid_cert: false,
140
- ca_file: '',
141
- key_file: '',
142
- cert_file: ''
143
- }
144
- }
145
- }
62
+ properties: samProps
146
63
  }]
147
64
  }
148
65
  };
@@ -418,6 +335,134 @@ describe('[integration] Etsi_sol003 Adapter Test', () => {
418
335
  }).timeout(attemptTimeout);
419
336
  });
420
337
 
338
+ // broker tests
339
+ describe('#getDevicesFiltered - errors', () => {
340
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
341
+ try {
342
+ const opts = {
343
+ filter: {
344
+ name: 'deviceName'
345
+ }
346
+ };
347
+ a.getDevicesFiltered(opts, (data, error) => {
348
+ try {
349
+ if (stub) {
350
+ if (samProps.devicebroker.getDevicesFiltered[0].handleFailure === 'ignore') {
351
+ assert.equal(null, error);
352
+ assert.notEqual(undefined, data);
353
+ assert.notEqual(null, data);
354
+ assert.equal(0, data.total);
355
+ assert.equal(0, data.list.length);
356
+ } else {
357
+ const displayE = 'Error 400 received on request';
358
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
359
+ }
360
+ } else {
361
+ runCommonAsserts(data, error);
362
+ }
363
+ done();
364
+ } catch (err) {
365
+ log.error(`Test Failure: ${err}`);
366
+ done(err);
367
+ }
368
+ });
369
+ } catch (error) {
370
+ log.error(`Adapter Exception: ${error}`);
371
+ done(error);
372
+ }
373
+ }).timeout(attemptTimeout);
374
+ });
375
+
376
+ describe('#iapGetDeviceCount - errors', () => {
377
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
378
+ try {
379
+ const opts = {
380
+ filter: {
381
+ name: 'deviceName'
382
+ }
383
+ };
384
+ a.iapGetDeviceCount((data, error) => {
385
+ try {
386
+ if (stub) {
387
+ if (samProps.devicebroker.getDevicesFiltered[0].handleFailure === 'ignore') {
388
+ assert.equal(null, error);
389
+ assert.notEqual(undefined, data);
390
+ assert.notEqual(null, data);
391
+ assert.equal(0, data.count);
392
+ } else {
393
+ const displayE = 'Error 400 received on request';
394
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
395
+ }
396
+ } else {
397
+ runCommonAsserts(data, error);
398
+ }
399
+ done();
400
+ } catch (err) {
401
+ log.error(`Test Failure: ${err}`);
402
+ done(err);
403
+ }
404
+ });
405
+ } catch (error) {
406
+ log.error(`Adapter Exception: ${error}`);
407
+ done(error);
408
+ }
409
+ }).timeout(attemptTimeout);
410
+ });
411
+
412
+ // exposed cache tests
413
+ describe('#iapPopulateEntityCache - errors', () => {
414
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
415
+ try {
416
+ a.iapPopulateEntityCache('Device', (data, error) => {
417
+ try {
418
+ if (stub) {
419
+ assert.equal(null, data);
420
+ assert.notEqual(undefined, error);
421
+ assert.notEqual(null, error);
422
+ done();
423
+ } else {
424
+ assert.equal(undefined, error);
425
+ assert.equal('success', data[0]);
426
+ done();
427
+ }
428
+ } catch (err) {
429
+ log.error(`Test Failure: ${err}`);
430
+ done(err);
431
+ }
432
+ });
433
+ } catch (error) {
434
+ log.error(`Adapter Exception: ${error}`);
435
+ done(error);
436
+ }
437
+ }).timeout(attemptTimeout);
438
+ });
439
+
440
+ describe('#iapRetrieveEntitiesCache - errors', () => {
441
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
442
+ try {
443
+ a.iapRetrieveEntitiesCache('Device', {}, (data, error) => {
444
+ try {
445
+ if (stub) {
446
+ assert.equal(null, data);
447
+ assert.notEqual(null, error);
448
+ assert.notEqual(undefined, error);
449
+ } else {
450
+ assert.equal(undefined, error);
451
+ assert.notEqual(null, data);
452
+ assert.notEqual(undefined, data);
453
+ }
454
+ done();
455
+ } catch (err) {
456
+ log.error(`Test Failure: ${err}`);
457
+ done(err);
458
+ }
459
+ });
460
+ } catch (error) {
461
+ log.error(`Adapter Exception: ${error}`);
462
+ done(error);
463
+ }
464
+ }).timeout(attemptTimeout);
465
+ });
421
466
  /*
422
467
  -----------------------------------------------------------------------
423
468
  -----------------------------------------------------------------------
@@ -426,37 +471,29 @@ describe('[integration] Etsi_sol003 Adapter Test', () => {
426
471
  -----------------------------------------------------------------------
427
472
  -----------------------------------------------------------------------
428
473
  */
429
- let skipCount = 0;
430
-
431
474
  describe('#getApiVersions - errors', () => {
432
475
  it('should work if integrated or standalone with mockdata', (done) => {
433
- if (pronghorn.methodsByName.getApiVersions.task) {
434
- try {
435
- a.getApiVersions((data, error) => {
436
- try {
437
- if (stub) {
438
- runCommonAsserts(data, error);
439
- assert.equal('string', data.response.uriPrefix);
440
- assert.equal(true, Array.isArray(data.response.apiVersions));
441
- } else {
442
- runCommonAsserts(data, error);
443
- }
444
- saveMockData('ApiVersions', 'getApiVersions', 'default', data);
445
- done();
446
- } catch (err) {
447
- log.error(`Test Failure: ${err}`);
448
- done(err);
449
- }
450
- });
451
- } catch (error) {
452
- log.error(`Adapter Exception: ${error}`);
453
- done(error);
454
- }
455
- } else {
456
- log.error('getApiVersions task is false, skipping test');
457
- skipCount += 1;
458
- done();
459
- }// end if task
476
+ try {
477
+ a.getApiVersions((data, error) => {
478
+ try {
479
+ if (stub) {
480
+ runCommonAsserts(data, error);
481
+ assert.equal('string', data.response.uriPrefix);
482
+ assert.equal(true, Array.isArray(data.response.apiVersions));
483
+ } else {
484
+ runCommonAsserts(data, error);
485
+ }
486
+ saveMockData('ApiVersions', 'getApiVersions', 'default', data);
487
+ done();
488
+ } catch (err) {
489
+ log.error(`Test Failure: ${err}`);
490
+ done(err);
491
+ }
492
+ });
493
+ } catch (error) {
494
+ log.error(`Adapter Exception: ${error}`);
495
+ done(error);
496
+ }
460
497
  }).timeout(attemptTimeout);
461
498
  });
462
499
 
@@ -466,228 +503,192 @@ describe('[integration] Etsi_sol003 Adapter Test', () => {
466
503
  };
467
504
  describe('#postSubscriptions - errors', () => {
468
505
  it('should work if integrated or standalone with mockdata', (done) => {
469
- if (pronghorn.methodsByName.postSubscriptions.task) {
470
- try {
471
- a.postSubscriptions(subscriptionsPostSubscriptionsBodyParam, (data, error) => {
472
- try {
473
- if (stub) {
474
- runCommonAsserts(data, error);
475
- assert.equal('string', data.response.id);
476
- assert.equal('object', typeof data.response.filter);
477
- assert.equal('string', data.response.callbackUri);
478
- assert.equal('object', typeof data.response._links);
479
- } else {
480
- runCommonAsserts(data, error);
481
- }
482
- subscriptionsSubscriptionId = data.response.id;
483
- saveMockData('Subscriptions', 'postSubscriptions', 'default', data);
484
- done();
485
- } catch (err) {
486
- log.error(`Test Failure: ${err}`);
487
- done(err);
488
- }
489
- });
490
- } catch (error) {
491
- log.error(`Adapter Exception: ${error}`);
492
- done(error);
493
- }
494
- } else {
495
- log.error('postSubscriptions task is false, skipping test');
496
- skipCount += 1;
497
- done();
498
- }// end if task
506
+ try {
507
+ a.postSubscriptions(subscriptionsPostSubscriptionsBodyParam, (data, error) => {
508
+ try {
509
+ if (stub) {
510
+ runCommonAsserts(data, error);
511
+ assert.equal('string', data.response.id);
512
+ assert.equal('object', typeof data.response.filter);
513
+ assert.equal('string', data.response.callbackUri);
514
+ assert.equal('object', typeof data.response._links);
515
+ } else {
516
+ runCommonAsserts(data, error);
517
+ }
518
+ subscriptionsSubscriptionId = data.response.id;
519
+ saveMockData('Subscriptions', 'postSubscriptions', 'default', data);
520
+ done();
521
+ } catch (err) {
522
+ log.error(`Test Failure: ${err}`);
523
+ done(err);
524
+ }
525
+ });
526
+ } catch (error) {
527
+ log.error(`Adapter Exception: ${error}`);
528
+ done(error);
529
+ }
499
530
  }).timeout(attemptTimeout);
500
531
  });
501
532
 
502
533
  describe('#getSubscriptions - errors', () => {
503
534
  it('should work if integrated or standalone with mockdata', (done) => {
504
- if (pronghorn.methodsByName.getSubscriptions.task) {
505
- try {
506
- a.getSubscriptions(null, null, (data, error) => {
507
- try {
508
- if (stub) {
509
- runCommonAsserts(data, error);
510
- assert.equal('object', typeof data.response[0]);
511
- assert.equal('object', typeof data.response[1]);
512
- assert.equal('object', typeof data.response[2]);
513
- } else {
514
- runCommonAsserts(data, error);
515
- }
516
- saveMockData('Subscriptions', 'getSubscriptions', 'default', data);
517
- done();
518
- } catch (err) {
519
- log.error(`Test Failure: ${err}`);
520
- done(err);
521
- }
522
- });
523
- } catch (error) {
524
- log.error(`Adapter Exception: ${error}`);
525
- done(error);
526
- }
527
- } else {
528
- log.error('getSubscriptions task is false, skipping test');
529
- skipCount += 1;
530
- done();
531
- }// end if task
535
+ try {
536
+ a.getSubscriptions(null, null, (data, error) => {
537
+ try {
538
+ if (stub) {
539
+ runCommonAsserts(data, error);
540
+ assert.equal('object', typeof data.response[0]);
541
+ assert.equal('object', typeof data.response[1]);
542
+ assert.equal('object', typeof data.response[2]);
543
+ } else {
544
+ runCommonAsserts(data, error);
545
+ }
546
+ saveMockData('Subscriptions', 'getSubscriptions', 'default', data);
547
+ done();
548
+ } catch (err) {
549
+ log.error(`Test Failure: ${err}`);
550
+ done(err);
551
+ }
552
+ });
553
+ } catch (error) {
554
+ log.error(`Adapter Exception: ${error}`);
555
+ done(error);
556
+ }
532
557
  }).timeout(attemptTimeout);
533
558
  });
534
559
 
535
560
  describe('#getSubscriptionsSubscriptionId - errors', () => {
536
561
  it('should work if integrated or standalone with mockdata', (done) => {
537
- if (pronghorn.methodsByName.getSubscriptionsSubscriptionId.task) {
538
- try {
539
- a.getSubscriptionsSubscriptionId(subscriptionsSubscriptionId, (data, error) => {
540
- try {
541
- if (stub) {
542
- runCommonAsserts(data, error);
543
- assert.equal('string', data.response.id);
544
- assert.equal('object', typeof data.response.filter);
545
- assert.equal('string', data.response.callbackUri);
546
- assert.equal('object', typeof data.response._links);
547
- } else {
548
- runCommonAsserts(data, error);
549
- }
550
- saveMockData('Subscriptions', 'getSubscriptionsSubscriptionId', 'default', data);
551
- done();
552
- } catch (err) {
553
- log.error(`Test Failure: ${err}`);
554
- done(err);
555
- }
556
- });
557
- } catch (error) {
558
- log.error(`Adapter Exception: ${error}`);
559
- done(error);
560
- }
561
- } else {
562
- log.error('getSubscriptionsSubscriptionId task is false, skipping test');
563
- skipCount += 1;
564
- done();
565
- }// end if task
562
+ try {
563
+ a.getSubscriptionsSubscriptionId(subscriptionsSubscriptionId, (data, error) => {
564
+ try {
565
+ if (stub) {
566
+ runCommonAsserts(data, error);
567
+ assert.equal('string', data.response.id);
568
+ assert.equal('object', typeof data.response.filter);
569
+ assert.equal('string', data.response.callbackUri);
570
+ assert.equal('object', typeof data.response._links);
571
+ } else {
572
+ runCommonAsserts(data, error);
573
+ }
574
+ saveMockData('Subscriptions', 'getSubscriptionsSubscriptionId', 'default', data);
575
+ done();
576
+ } catch (err) {
577
+ log.error(`Test Failure: ${err}`);
578
+ done(err);
579
+ }
580
+ });
581
+ } catch (error) {
582
+ log.error(`Adapter Exception: ${error}`);
583
+ done(error);
584
+ }
566
585
  }).timeout(attemptTimeout);
567
586
  });
568
587
 
569
588
  describe('#deleteSubscriptionsSubscriptionId - errors', () => {
570
589
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
571
- if (pronghorn.methodsByName.deleteSubscriptionsSubscriptionId.task) {
572
- try {
573
- a.deleteSubscriptionsSubscriptionId(subscriptionsSubscriptionId, (data, error) => {
574
- try {
575
- if (stub) {
576
- const displayE = 'Error 400 received on request';
577
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
578
- } else {
579
- runCommonAsserts(data, error);
580
- }
581
- saveMockData('Subscriptions', 'deleteSubscriptionsSubscriptionId', 'default', data);
582
- done();
583
- } catch (err) {
584
- log.error(`Test Failure: ${err}`);
585
- done(err);
590
+ try {
591
+ a.deleteSubscriptionsSubscriptionId(subscriptionsSubscriptionId, (data, error) => {
592
+ try {
593
+ if (stub) {
594
+ const displayE = 'Error 400 received on request';
595
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
596
+ } else {
597
+ runCommonAsserts(data, error);
586
598
  }
587
- });
588
- } catch (error) {
589
- log.error(`Adapter Exception: ${error}`);
590
- done(error);
591
- }
592
- } else {
593
- log.error('deleteSubscriptionsSubscriptionId task is false, skipping test');
594
- skipCount += 1;
595
- done();
596
- }// end if task
599
+ saveMockData('Subscriptions', 'deleteSubscriptionsSubscriptionId', 'default', data);
600
+ done();
601
+ } catch (err) {
602
+ log.error(`Test Failure: ${err}`);
603
+ done(err);
604
+ }
605
+ });
606
+ } catch (error) {
607
+ log.error(`Adapter Exception: ${error}`);
608
+ done(error);
609
+ }
597
610
  }).timeout(attemptTimeout);
598
611
  });
599
612
 
600
613
  describe('#getAlarms - errors', () => {
601
614
  it('should work if integrated or standalone with mockdata', (done) => {
602
- if (pronghorn.methodsByName.getAlarms.task) {
603
- try {
604
- a.getAlarms(null, null, (data, error) => {
605
- try {
606
- if (stub) {
607
- runCommonAsserts(data, error);
608
- assert.equal('string', data.response.id);
609
- assert.equal('string', data.response.managedObjectId);
610
- assert.equal('object', typeof data.response.rootCauseFaultyResource);
611
- assert.equal('string', data.response.alarmRaisedTime);
612
- assert.equal('string', data.response.alarmChangedTime);
613
- assert.equal('string', data.response.alarmClearedTime);
614
- assert.equal('string', data.response.alarmAcknowledgedTime);
615
- assert.equal('ACKNOWLEDGED', data.response.ackState);
616
- assert.equal('WARNING', data.response.perceivedSeverity);
617
- assert.equal('string', data.response.eventTime);
618
- assert.equal('COMMUNICATIONS_ALARM', data.response.eventType);
619
- assert.equal('string', data.response.faultType);
620
- assert.equal('string', data.response.probableCause);
621
- assert.equal(true, data.response.isRootCause);
622
- assert.equal(true, Array.isArray(data.response.correlatedAlarmIds));
623
- assert.equal(true, Array.isArray(data.response.faultDetails));
624
- assert.equal('object', typeof data.response._links);
625
- } else {
626
- runCommonAsserts(data, error);
627
- }
628
- saveMockData('Alarms', 'getAlarms', 'default', data);
629
- done();
630
- } catch (err) {
631
- log.error(`Test Failure: ${err}`);
632
- done(err);
633
- }
634
- });
635
- } catch (error) {
636
- log.error(`Adapter Exception: ${error}`);
637
- done(error);
638
- }
639
- } else {
640
- log.error('getAlarms task is false, skipping test');
641
- skipCount += 1;
642
- done();
643
- }// end if task
615
+ try {
616
+ a.getAlarms(null, null, (data, error) => {
617
+ try {
618
+ if (stub) {
619
+ runCommonAsserts(data, error);
620
+ assert.equal('string', data.response.id);
621
+ assert.equal('string', data.response.managedObjectId);
622
+ assert.equal('object', typeof data.response.rootCauseFaultyResource);
623
+ assert.equal('string', data.response.alarmRaisedTime);
624
+ assert.equal('string', data.response.alarmChangedTime);
625
+ assert.equal('string', data.response.alarmClearedTime);
626
+ assert.equal('string', data.response.alarmAcknowledgedTime);
627
+ assert.equal('ACKNOWLEDGED', data.response.ackState);
628
+ assert.equal('WARNING', data.response.perceivedSeverity);
629
+ assert.equal('string', data.response.eventTime);
630
+ assert.equal('COMMUNICATIONS_ALARM', data.response.eventType);
631
+ assert.equal('string', data.response.faultType);
632
+ assert.equal('string', data.response.probableCause);
633
+ assert.equal(true, data.response.isRootCause);
634
+ assert.equal(true, Array.isArray(data.response.correlatedAlarmIds));
635
+ assert.equal(true, Array.isArray(data.response.faultDetails));
636
+ assert.equal('object', typeof data.response._links);
637
+ } else {
638
+ runCommonAsserts(data, error);
639
+ }
640
+ saveMockData('Alarms', 'getAlarms', 'default', data);
641
+ done();
642
+ } catch (err) {
643
+ log.error(`Test Failure: ${err}`);
644
+ done(err);
645
+ }
646
+ });
647
+ } catch (error) {
648
+ log.error(`Adapter Exception: ${error}`);
649
+ done(error);
650
+ }
644
651
  }).timeout(attemptTimeout);
645
652
  });
646
653
 
647
654
  describe('#getAlarmsAlarmId - errors', () => {
648
655
  it('should work if integrated or standalone with mockdata', (done) => {
649
- if (pronghorn.methodsByName.getAlarmsAlarmId.task) {
650
- try {
651
- a.getAlarmsAlarmId('fakedata', (data, error) => {
652
- try {
653
- if (stub) {
654
- runCommonAsserts(data, error);
655
- assert.equal('string', data.response.id);
656
- assert.equal('string', data.response.managedObjectId);
657
- assert.equal('object', typeof data.response.rootCauseFaultyResource);
658
- assert.equal('string', data.response.alarmRaisedTime);
659
- assert.equal('string', data.response.alarmChangedTime);
660
- assert.equal('string', data.response.alarmClearedTime);
661
- assert.equal('string', data.response.alarmAcknowledgedTime);
662
- assert.equal('UNACKNOWLEDGED', data.response.ackState);
663
- assert.equal('WARNING', data.response.perceivedSeverity);
664
- assert.equal('string', data.response.eventTime);
665
- assert.equal('ENVIRONMENTAL_ALARM', data.response.eventType);
666
- assert.equal('string', data.response.faultType);
667
- assert.equal('string', data.response.probableCause);
668
- assert.equal(true, data.response.isRootCause);
669
- assert.equal(true, Array.isArray(data.response.correlatedAlarmIds));
670
- assert.equal(true, Array.isArray(data.response.faultDetails));
671
- assert.equal('object', typeof data.response._links);
672
- } else {
673
- runCommonAsserts(data, error);
674
- }
675
- saveMockData('Alarms', 'getAlarmsAlarmId', 'default', data);
676
- done();
677
- } catch (err) {
678
- log.error(`Test Failure: ${err}`);
679
- done(err);
680
- }
681
- });
682
- } catch (error) {
683
- log.error(`Adapter Exception: ${error}`);
684
- done(error);
685
- }
686
- } else {
687
- log.error('getAlarmsAlarmId task is false, skipping test');
688
- skipCount += 1;
689
- done();
690
- }// end if task
656
+ try {
657
+ a.getAlarmsAlarmId('fakedata', (data, error) => {
658
+ try {
659
+ if (stub) {
660
+ runCommonAsserts(data, error);
661
+ assert.equal('string', data.response.id);
662
+ assert.equal('string', data.response.managedObjectId);
663
+ assert.equal('object', typeof data.response.rootCauseFaultyResource);
664
+ assert.equal('string', data.response.alarmRaisedTime);
665
+ assert.equal('string', data.response.alarmChangedTime);
666
+ assert.equal('string', data.response.alarmClearedTime);
667
+ assert.equal('string', data.response.alarmAcknowledgedTime);
668
+ assert.equal('UNACKNOWLEDGED', data.response.ackState);
669
+ assert.equal('WARNING', data.response.perceivedSeverity);
670
+ assert.equal('string', data.response.eventTime);
671
+ assert.equal('ENVIRONMENTAL_ALARM', data.response.eventType);
672
+ assert.equal('string', data.response.faultType);
673
+ assert.equal('string', data.response.probableCause);
674
+ assert.equal(true, data.response.isRootCause);
675
+ assert.equal(true, Array.isArray(data.response.correlatedAlarmIds));
676
+ assert.equal(true, Array.isArray(data.response.faultDetails));
677
+ assert.equal('object', typeof data.response._links);
678
+ } else {
679
+ runCommonAsserts(data, error);
680
+ }
681
+ saveMockData('Alarms', 'getAlarmsAlarmId', 'default', data);
682
+ done();
683
+ } catch (err) {
684
+ log.error(`Test Failure: ${err}`);
685
+ done(err);
686
+ }
687
+ });
688
+ } catch (error) {
689
+ log.error(`Adapter Exception: ${error}`);
690
+ done(error);
691
+ }
691
692
  }).timeout(attemptTimeout);
692
693
  });
693
694
 
@@ -696,197 +697,161 @@ describe('[integration] Etsi_sol003 Adapter Test', () => {
696
697
  };
697
698
  describe('#patchAlarmsAlarmId - errors', () => {
698
699
  it('should work if integrated or standalone with mockdata', (done) => {
699
- if (pronghorn.methodsByName.patchAlarmsAlarmId.task) {
700
- try {
701
- a.patchAlarmsAlarmId('fakedata', alarmsPatchAlarmsAlarmIdBodyParam, (data, error) => {
702
- try {
703
- if (stub) {
704
- runCommonAsserts(data, error);
705
- assert.equal('success', data.response);
706
- } else {
707
- runCommonAsserts(data, error);
708
- }
709
- saveMockData('Alarms', 'patchAlarmsAlarmId', 'default', data);
710
- done();
711
- } catch (err) {
712
- log.error(`Test Failure: ${err}`);
713
- done(err);
700
+ try {
701
+ a.patchAlarmsAlarmId('fakedata', alarmsPatchAlarmsAlarmIdBodyParam, (data, error) => {
702
+ try {
703
+ if (stub) {
704
+ runCommonAsserts(data, error);
705
+ assert.equal('success', data.response);
706
+ } else {
707
+ runCommonAsserts(data, error);
714
708
  }
715
- });
716
- } catch (error) {
717
- log.error(`Adapter Exception: ${error}`);
718
- done(error);
719
- }
720
- } else {
721
- log.error('patchAlarmsAlarmId task is false, skipping test');
722
- skipCount += 1;
723
- done();
724
- }// end if task
709
+ saveMockData('Alarms', 'patchAlarmsAlarmId', 'default', data);
710
+ done();
711
+ } catch (err) {
712
+ log.error(`Test Failure: ${err}`);
713
+ done(err);
714
+ }
715
+ });
716
+ } catch (error) {
717
+ log.error(`Adapter Exception: ${error}`);
718
+ done(error);
719
+ }
725
720
  }).timeout(attemptTimeout);
726
721
  });
727
722
 
728
723
  describe('#getIndicators - errors', () => {
729
724
  it('should work if integrated or standalone with mockdata', (done) => {
730
- if (pronghorn.methodsByName.getIndicators.task) {
731
- try {
732
- a.getIndicators(null, null, (data, error) => {
733
- try {
734
- if (stub) {
735
- runCommonAsserts(data, error);
736
- assert.equal('object', typeof data.response[0]);
737
- assert.equal('object', typeof data.response[1]);
738
- assert.equal('object', typeof data.response[2]);
739
- assert.equal('object', typeof data.response[3]);
740
- } else {
741
- runCommonAsserts(data, error);
742
- }
743
- saveMockData('Indicators', 'getIndicators', 'default', data);
744
- done();
745
- } catch (err) {
746
- log.error(`Test Failure: ${err}`);
747
- done(err);
748
- }
749
- });
750
- } catch (error) {
751
- log.error(`Adapter Exception: ${error}`);
752
- done(error);
753
- }
754
- } else {
755
- log.error('getIndicators task is false, skipping test');
756
- skipCount += 1;
757
- done();
758
- }// end if task
725
+ try {
726
+ a.getIndicators(null, null, (data, error) => {
727
+ try {
728
+ if (stub) {
729
+ runCommonAsserts(data, error);
730
+ assert.equal('object', typeof data.response[0]);
731
+ assert.equal('object', typeof data.response[1]);
732
+ assert.equal('object', typeof data.response[2]);
733
+ assert.equal('object', typeof data.response[3]);
734
+ } else {
735
+ runCommonAsserts(data, error);
736
+ }
737
+ saveMockData('Indicators', 'getIndicators', 'default', data);
738
+ done();
739
+ } catch (err) {
740
+ log.error(`Test Failure: ${err}`);
741
+ done(err);
742
+ }
743
+ });
744
+ } catch (error) {
745
+ log.error(`Adapter Exception: ${error}`);
746
+ done(error);
747
+ }
759
748
  }).timeout(attemptTimeout);
760
749
  });
761
750
 
762
751
  describe('#getIndicatorsVnfInstanceId - errors', () => {
763
752
  it('should work if integrated or standalone with mockdata', (done) => {
764
- if (pronghorn.methodsByName.getIndicatorsVnfInstanceId.task) {
765
- try {
766
- a.getIndicatorsVnfInstanceId('fakedata', null, null, (data, error) => {
767
- try {
768
- if (stub) {
769
- runCommonAsserts(data, error);
770
- assert.equal('object', typeof data.response[0]);
771
- } else {
772
- runCommonAsserts(data, error);
773
- }
774
- saveMockData('Indicators', 'getIndicatorsVnfInstanceId', 'default', data);
775
- done();
776
- } catch (err) {
777
- log.error(`Test Failure: ${err}`);
778
- done(err);
753
+ try {
754
+ a.getIndicatorsVnfInstanceId('fakedata', null, null, (data, error) => {
755
+ try {
756
+ if (stub) {
757
+ runCommonAsserts(data, error);
758
+ assert.equal('object', typeof data.response[0]);
759
+ } else {
760
+ runCommonAsserts(data, error);
779
761
  }
780
- });
781
- } catch (error) {
782
- log.error(`Adapter Exception: ${error}`);
783
- done(error);
784
- }
785
- } else {
786
- log.error('getIndicatorsVnfInstanceId task is false, skipping test');
787
- skipCount += 1;
788
- done();
789
- }// end if task
762
+ saveMockData('Indicators', 'getIndicatorsVnfInstanceId', 'default', data);
763
+ done();
764
+ } catch (err) {
765
+ log.error(`Test Failure: ${err}`);
766
+ done(err);
767
+ }
768
+ });
769
+ } catch (error) {
770
+ log.error(`Adapter Exception: ${error}`);
771
+ done(error);
772
+ }
790
773
  }).timeout(attemptTimeout);
791
774
  });
792
775
 
793
776
  describe('#getIndicatorsVnfInstanceIdIndicatorId - errors', () => {
794
777
  it('should work if integrated or standalone with mockdata', (done) => {
795
- if (pronghorn.methodsByName.getIndicatorsVnfInstanceIdIndicatorId.task) {
796
- try {
797
- a.getIndicatorsVnfInstanceIdIndicatorId('fakedata', 'fakedata', (data, error) => {
798
- try {
799
- if (stub) {
800
- runCommonAsserts(data, error);
801
- assert.equal('string', data.response.id);
802
- assert.equal('string', data.response.name);
803
- assert.equal('object', typeof data.response.value);
804
- assert.equal('string', data.response.vnfInstanceId);
805
- assert.equal('object', typeof data.response._links);
806
- } else {
807
- runCommonAsserts(data, error);
808
- }
809
- saveMockData('Indicators', 'getIndicatorsVnfInstanceIdIndicatorId', 'default', data);
810
- done();
811
- } catch (err) {
812
- log.error(`Test Failure: ${err}`);
813
- done(err);
814
- }
815
- });
816
- } catch (error) {
817
- log.error(`Adapter Exception: ${error}`);
818
- done(error);
819
- }
820
- } else {
821
- log.error('getIndicatorsVnfInstanceIdIndicatorId task is false, skipping test');
822
- skipCount += 1;
823
- done();
824
- }// end if task
778
+ try {
779
+ a.getIndicatorsVnfInstanceIdIndicatorId('fakedata', 'fakedata', (data, error) => {
780
+ try {
781
+ if (stub) {
782
+ runCommonAsserts(data, error);
783
+ assert.equal('string', data.response.id);
784
+ assert.equal('string', data.response.name);
785
+ assert.equal('object', typeof data.response.value);
786
+ assert.equal('string', data.response.vnfInstanceId);
787
+ assert.equal('object', typeof data.response._links);
788
+ } else {
789
+ runCommonAsserts(data, error);
790
+ }
791
+ saveMockData('Indicators', 'getIndicatorsVnfInstanceIdIndicatorId', 'default', data);
792
+ done();
793
+ } catch (err) {
794
+ log.error(`Test Failure: ${err}`);
795
+ done(err);
796
+ }
797
+ });
798
+ } catch (error) {
799
+ log.error(`Adapter Exception: ${error}`);
800
+ done(error);
801
+ }
825
802
  }).timeout(attemptTimeout);
826
803
  });
827
804
 
828
805
  describe('#getIndicatorsSubscriptionsSubscriptionId - errors', () => {
829
806
  it('should work if integrated or standalone with mockdata', (done) => {
830
- if (pronghorn.methodsByName.getIndicatorsSubscriptionsSubscriptionId.task) {
831
- try {
832
- a.getIndicatorsSubscriptionsSubscriptionId('fakedata', (data, error) => {
833
- try {
834
- if (stub) {
835
- runCommonAsserts(data, error);
836
- assert.equal('string', data.response.id);
837
- assert.equal('object', typeof data.response.filter);
838
- assert.equal('string', data.response.callbackUri);
839
- assert.equal('object', typeof data.response._links);
840
- } else {
841
- runCommonAsserts(data, error);
842
- }
843
- saveMockData('Indicators', 'getIndicatorsSubscriptionsSubscriptionId', 'default', data);
844
- done();
845
- } catch (err) {
846
- log.error(`Test Failure: ${err}`);
847
- done(err);
848
- }
849
- });
850
- } catch (error) {
851
- log.error(`Adapter Exception: ${error}`);
852
- done(error);
853
- }
854
- } else {
855
- log.error('getIndicatorsSubscriptionsSubscriptionId task is false, skipping test');
856
- skipCount += 1;
857
- done();
858
- }// end if task
807
+ try {
808
+ a.getIndicatorsSubscriptionsSubscriptionId('fakedata', (data, error) => {
809
+ try {
810
+ if (stub) {
811
+ runCommonAsserts(data, error);
812
+ assert.equal('string', data.response.id);
813
+ assert.equal('object', typeof data.response.filter);
814
+ assert.equal('string', data.response.callbackUri);
815
+ assert.equal('object', typeof data.response._links);
816
+ } else {
817
+ runCommonAsserts(data, error);
818
+ }
819
+ saveMockData('Indicators', 'getIndicatorsSubscriptionsSubscriptionId', 'default', data);
820
+ done();
821
+ } catch (err) {
822
+ log.error(`Test Failure: ${err}`);
823
+ done(err);
824
+ }
825
+ });
826
+ } catch (error) {
827
+ log.error(`Adapter Exception: ${error}`);
828
+ done(error);
829
+ }
859
830
  }).timeout(attemptTimeout);
860
831
  });
861
832
 
862
833
  describe('#deleteIndicatorsSubscriptionsSubscriptionId - errors', () => {
863
834
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
864
- if (pronghorn.methodsByName.deleteIndicatorsSubscriptionsSubscriptionId.task) {
865
- try {
866
- a.deleteIndicatorsSubscriptionsSubscriptionId('fakedata', (data, error) => {
867
- try {
868
- if (stub) {
869
- const displayE = 'Error 400 received on request';
870
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
871
- } else {
872
- runCommonAsserts(data, error);
873
- }
874
- saveMockData('Indicators', 'deleteIndicatorsSubscriptionsSubscriptionId', 'default', data);
875
- done();
876
- } catch (err) {
877
- log.error(`Test Failure: ${err}`);
878
- done(err);
835
+ try {
836
+ a.deleteIndicatorsSubscriptionsSubscriptionId('fakedata', (data, error) => {
837
+ try {
838
+ if (stub) {
839
+ const displayE = 'Error 400 received on request';
840
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
841
+ } else {
842
+ runCommonAsserts(data, error);
879
843
  }
880
- });
881
- } catch (error) {
882
- log.error(`Adapter Exception: ${error}`);
883
- done(error);
884
- }
885
- } else {
886
- log.error('deleteIndicatorsSubscriptionsSubscriptionId task is false, skipping test');
887
- skipCount += 1;
888
- done();
889
- }// end if task
844
+ saveMockData('Indicators', 'deleteIndicatorsSubscriptionsSubscriptionId', 'default', data);
845
+ done();
846
+ } catch (err) {
847
+ log.error(`Test Failure: ${err}`);
848
+ done(err);
849
+ }
850
+ });
851
+ } catch (error) {
852
+ log.error(`Adapter Exception: ${error}`);
853
+ done(error);
854
+ }
890
855
  }).timeout(attemptTimeout);
891
856
  });
892
857
 
@@ -895,122 +860,104 @@ describe('[integration] Etsi_sol003 Adapter Test', () => {
895
860
  };
896
861
  describe('#postVnfInstances - errors', () => {
897
862
  it('should work if integrated or standalone with mockdata', (done) => {
898
- if (pronghorn.methodsByName.postVnfInstances.task) {
899
- try {
900
- a.postVnfInstances(vnfInstancesPostVnfInstancesBodyParam, (data, error) => {
901
- try {
902
- if (stub) {
903
- runCommonAsserts(data, error);
904
- assert.equal('string', data.response.id);
905
- assert.equal('string', data.response.vnfInstanceName);
906
- assert.equal('string', data.response.vnfInstanceDescription);
907
- assert.equal('string', data.response.vnfdId);
908
- assert.equal('string', data.response.vnfProvider);
909
- assert.equal('string', data.response.vnfProductName);
910
- assert.equal('string', data.response.vnfSoftwareVersion);
911
- assert.equal('string', data.response.vnfdVersion);
912
- assert.equal('object', typeof data.response.vnfConfigurableProperties);
913
- assert.equal('object', typeof data.response.vimConnectionInfo);
914
- assert.equal('NOT_INSTANTIATED', data.response.instantiationState);
915
- assert.equal('object', typeof data.response.instantiatedVnfInfo);
916
- assert.equal('object', typeof data.response.metadata);
917
- assert.equal('object', typeof data.response._links);
918
- } else {
919
- runCommonAsserts(data, error);
920
- }
921
- saveMockData('VnfInstances', 'postVnfInstances', 'default', data);
922
- done();
923
- } catch (err) {
924
- log.error(`Test Failure: ${err}`);
925
- done(err);
926
- }
927
- });
928
- } catch (error) {
929
- log.error(`Adapter Exception: ${error}`);
930
- done(error);
931
- }
932
- } else {
933
- log.error('postVnfInstances task is false, skipping test');
934
- skipCount += 1;
935
- done();
936
- }// end if task
863
+ try {
864
+ a.postVnfInstances(vnfInstancesPostVnfInstancesBodyParam, (data, error) => {
865
+ try {
866
+ if (stub) {
867
+ runCommonAsserts(data, error);
868
+ assert.equal('string', data.response.id);
869
+ assert.equal('string', data.response.vnfInstanceName);
870
+ assert.equal('string', data.response.vnfInstanceDescription);
871
+ assert.equal('string', data.response.vnfdId);
872
+ assert.equal('string', data.response.vnfProvider);
873
+ assert.equal('string', data.response.vnfProductName);
874
+ assert.equal('string', data.response.vnfSoftwareVersion);
875
+ assert.equal('string', data.response.vnfdVersion);
876
+ assert.equal('object', typeof data.response.vnfConfigurableProperties);
877
+ assert.equal('object', typeof data.response.vimConnectionInfo);
878
+ assert.equal('NOT_INSTANTIATED', data.response.instantiationState);
879
+ assert.equal('object', typeof data.response.instantiatedVnfInfo);
880
+ assert.equal('object', typeof data.response.metadata);
881
+ assert.equal('object', typeof data.response._links);
882
+ } else {
883
+ runCommonAsserts(data, error);
884
+ }
885
+ saveMockData('VnfInstances', 'postVnfInstances', 'default', data);
886
+ done();
887
+ } catch (err) {
888
+ log.error(`Test Failure: ${err}`);
889
+ done(err);
890
+ }
891
+ });
892
+ } catch (error) {
893
+ log.error(`Adapter Exception: ${error}`);
894
+ done(error);
895
+ }
937
896
  }).timeout(attemptTimeout);
938
897
  });
939
898
 
940
899
  describe('#getVnfInstances - errors', () => {
941
900
  it('should work if integrated or standalone with mockdata', (done) => {
942
- if (pronghorn.methodsByName.getVnfInstances.task) {
943
- try {
944
- a.getVnfInstances(null, null, null, null, null, null, (data, error) => {
945
- try {
946
- if (stub) {
947
- runCommonAsserts(data, error);
948
- assert.equal('object', typeof data.response[0]);
949
- assert.equal('object', typeof data.response[1]);
950
- assert.equal('object', typeof data.response[2]);
951
- } else {
952
- runCommonAsserts(data, error);
953
- }
954
- saveMockData('VnfInstances', 'getVnfInstances', 'default', data);
955
- done();
956
- } catch (err) {
957
- log.error(`Test Failure: ${err}`);
958
- done(err);
959
- }
960
- });
961
- } catch (error) {
962
- log.error(`Adapter Exception: ${error}`);
963
- done(error);
964
- }
965
- } else {
966
- log.error('getVnfInstances task is false, skipping test');
967
- skipCount += 1;
968
- done();
969
- }// end if task
901
+ try {
902
+ a.getVnfInstances(null, null, null, null, null, null, (data, error) => {
903
+ try {
904
+ if (stub) {
905
+ runCommonAsserts(data, error);
906
+ assert.equal('object', typeof data.response[0]);
907
+ assert.equal('object', typeof data.response[1]);
908
+ assert.equal('object', typeof data.response[2]);
909
+ } else {
910
+ runCommonAsserts(data, error);
911
+ }
912
+ saveMockData('VnfInstances', 'getVnfInstances', 'default', data);
913
+ done();
914
+ } catch (err) {
915
+ log.error(`Test Failure: ${err}`);
916
+ done(err);
917
+ }
918
+ });
919
+ } catch (error) {
920
+ log.error(`Adapter Exception: ${error}`);
921
+ done(error);
922
+ }
970
923
  }).timeout(attemptTimeout);
971
924
  });
972
925
 
973
926
  describe('#getVnfInstancesVnfInstanceId - errors', () => {
974
927
  it('should work if integrated or standalone with mockdata', (done) => {
975
- if (pronghorn.methodsByName.getVnfInstancesVnfInstanceId.task) {
976
- try {
977
- a.getVnfInstancesVnfInstanceId('fakedata', (data, error) => {
978
- try {
979
- if (stub) {
980
- runCommonAsserts(data, error);
981
- assert.equal('string', data.response.id);
982
- assert.equal('string', data.response.vnfInstanceName);
983
- assert.equal('string', data.response.vnfInstanceDescription);
984
- assert.equal('string', data.response.vnfdId);
985
- assert.equal('string', data.response.vnfProvider);
986
- assert.equal('string', data.response.vnfProductName);
987
- assert.equal('string', data.response.vnfSoftwareVersion);
988
- assert.equal('string', data.response.vnfdVersion);
989
- assert.equal('object', typeof data.response.vnfConfigurableProperties);
990
- assert.equal('object', typeof data.response.vimConnectionInfo);
991
- assert.equal('INSTANTIATED', data.response.instantiationState);
992
- assert.equal('object', typeof data.response.instantiatedVnfInfo);
993
- assert.equal('object', typeof data.response.metadata);
994
- assert.equal('object', typeof data.response._links);
995
- } else {
996
- runCommonAsserts(data, error);
997
- }
998
- saveMockData('VnfInstances', 'getVnfInstancesVnfInstanceId', 'default', data);
999
- done();
1000
- } catch (err) {
1001
- log.error(`Test Failure: ${err}`);
1002
- done(err);
1003
- }
1004
- });
1005
- } catch (error) {
1006
- log.error(`Adapter Exception: ${error}`);
1007
- done(error);
1008
- }
1009
- } else {
1010
- log.error('getVnfInstancesVnfInstanceId task is false, skipping test');
1011
- skipCount += 1;
1012
- done();
1013
- }// end if task
928
+ try {
929
+ a.getVnfInstancesVnfInstanceId('fakedata', (data, error) => {
930
+ try {
931
+ if (stub) {
932
+ runCommonAsserts(data, error);
933
+ assert.equal('string', data.response.id);
934
+ assert.equal('string', data.response.vnfInstanceName);
935
+ assert.equal('string', data.response.vnfInstanceDescription);
936
+ assert.equal('string', data.response.vnfdId);
937
+ assert.equal('string', data.response.vnfProvider);
938
+ assert.equal('string', data.response.vnfProductName);
939
+ assert.equal('string', data.response.vnfSoftwareVersion);
940
+ assert.equal('string', data.response.vnfdVersion);
941
+ assert.equal('object', typeof data.response.vnfConfigurableProperties);
942
+ assert.equal('object', typeof data.response.vimConnectionInfo);
943
+ assert.equal('INSTANTIATED', data.response.instantiationState);
944
+ assert.equal('object', typeof data.response.instantiatedVnfInfo);
945
+ assert.equal('object', typeof data.response.metadata);
946
+ assert.equal('object', typeof data.response._links);
947
+ } else {
948
+ runCommonAsserts(data, error);
949
+ }
950
+ saveMockData('VnfInstances', 'getVnfInstancesVnfInstanceId', 'default', data);
951
+ done();
952
+ } catch (err) {
953
+ log.error(`Test Failure: ${err}`);
954
+ done(err);
955
+ }
956
+ });
957
+ } catch (error) {
958
+ log.error(`Adapter Exception: ${error}`);
959
+ done(error);
960
+ }
1014
961
  }).timeout(attemptTimeout);
1015
962
  });
1016
963
 
@@ -1025,63 +972,51 @@ describe('[integration] Etsi_sol003 Adapter Test', () => {
1025
972
  };
1026
973
  describe('#patchVnfInstancesVnfInstanceId - errors', () => {
1027
974
  it('should work if integrated or standalone with mockdata', (done) => {
1028
- if (pronghorn.methodsByName.patchVnfInstancesVnfInstanceId.task) {
1029
- try {
1030
- a.patchVnfInstancesVnfInstanceId('fakedata', vnfInstancesPatchVnfInstancesVnfInstanceIdBodyParam, (data, error) => {
1031
- try {
1032
- if (stub) {
1033
- runCommonAsserts(data, error);
1034
- assert.equal('success', data.response);
1035
- } else {
1036
- runCommonAsserts(data, error);
1037
- }
1038
- saveMockData('VnfInstances', 'patchVnfInstancesVnfInstanceId', 'default', data);
1039
- done();
1040
- } catch (err) {
1041
- log.error(`Test Failure: ${err}`);
1042
- done(err);
975
+ try {
976
+ a.patchVnfInstancesVnfInstanceId('fakedata', vnfInstancesPatchVnfInstancesVnfInstanceIdBodyParam, (data, error) => {
977
+ try {
978
+ if (stub) {
979
+ runCommonAsserts(data, error);
980
+ assert.equal('success', data.response);
981
+ } else {
982
+ runCommonAsserts(data, error);
1043
983
  }
1044
- });
1045
- } catch (error) {
1046
- log.error(`Adapter Exception: ${error}`);
1047
- done(error);
1048
- }
1049
- } else {
1050
- log.error('patchVnfInstancesVnfInstanceId task is false, skipping test');
1051
- skipCount += 1;
1052
- done();
1053
- }// end if task
984
+ saveMockData('VnfInstances', 'patchVnfInstancesVnfInstanceId', 'default', data);
985
+ done();
986
+ } catch (err) {
987
+ log.error(`Test Failure: ${err}`);
988
+ done(err);
989
+ }
990
+ });
991
+ } catch (error) {
992
+ log.error(`Adapter Exception: ${error}`);
993
+ done(error);
994
+ }
1054
995
  }).timeout(attemptTimeout);
1055
996
  });
1056
997
 
1057
998
  describe('#deleteVnfInstancesVnfInstanceId - errors', () => {
1058
999
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1059
- if (pronghorn.methodsByName.deleteVnfInstancesVnfInstanceId.task) {
1060
- try {
1061
- a.deleteVnfInstancesVnfInstanceId('fakedata', (data, error) => {
1062
- try {
1063
- if (stub) {
1064
- const displayE = 'Error 400 received on request';
1065
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1066
- } else {
1067
- runCommonAsserts(data, error);
1068
- }
1069
- saveMockData('VnfInstances', 'deleteVnfInstancesVnfInstanceId', 'default', data);
1070
- done();
1071
- } catch (err) {
1072
- log.error(`Test Failure: ${err}`);
1073
- done(err);
1000
+ try {
1001
+ a.deleteVnfInstancesVnfInstanceId('fakedata', (data, error) => {
1002
+ try {
1003
+ if (stub) {
1004
+ const displayE = 'Error 400 received on request';
1005
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1006
+ } else {
1007
+ runCommonAsserts(data, error);
1074
1008
  }
1075
- });
1076
- } catch (error) {
1077
- log.error(`Adapter Exception: ${error}`);
1078
- done(error);
1079
- }
1080
- } else {
1081
- log.error('deleteVnfInstancesVnfInstanceId task is false, skipping test');
1082
- skipCount += 1;
1083
- done();
1084
- }// end if task
1009
+ saveMockData('VnfInstances', 'deleteVnfInstancesVnfInstanceId', 'default', data);
1010
+ done();
1011
+ } catch (err) {
1012
+ log.error(`Test Failure: ${err}`);
1013
+ done(err);
1014
+ }
1015
+ });
1016
+ } catch (error) {
1017
+ log.error(`Adapter Exception: ${error}`);
1018
+ done(error);
1019
+ }
1085
1020
  }).timeout(attemptTimeout);
1086
1021
  });
1087
1022
 
@@ -1090,32 +1025,26 @@ describe('[integration] Etsi_sol003 Adapter Test', () => {
1090
1025
  };
1091
1026
  describe('#postVnfInstancesVnfInstanceIdInstantiate - errors', () => {
1092
1027
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1093
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdInstantiate.task) {
1094
- try {
1095
- a.postVnfInstancesVnfInstanceIdInstantiate('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdInstantiateBodyParam, (data, error) => {
1096
- try {
1097
- if (stub) {
1098
- const displayE = 'Error 400 received on request';
1099
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1100
- } else {
1101
- runCommonAsserts(data, error);
1102
- }
1103
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdInstantiate', 'default', data);
1104
- done();
1105
- } catch (err) {
1106
- log.error(`Test Failure: ${err}`);
1107
- done(err);
1028
+ try {
1029
+ a.postVnfInstancesVnfInstanceIdInstantiate('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdInstantiateBodyParam, (data, error) => {
1030
+ try {
1031
+ if (stub) {
1032
+ const displayE = 'Error 400 received on request';
1033
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1034
+ } else {
1035
+ runCommonAsserts(data, error);
1108
1036
  }
1109
- });
1110
- } catch (error) {
1111
- log.error(`Adapter Exception: ${error}`);
1112
- done(error);
1113
- }
1114
- } else {
1115
- log.error('postVnfInstancesVnfInstanceIdInstantiate task is false, skipping test');
1116
- skipCount += 1;
1117
- done();
1118
- }// end if task
1037
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdInstantiate', 'default', data);
1038
+ done();
1039
+ } catch (err) {
1040
+ log.error(`Test Failure: ${err}`);
1041
+ done(err);
1042
+ }
1043
+ });
1044
+ } catch (error) {
1045
+ log.error(`Adapter Exception: ${error}`);
1046
+ done(error);
1047
+ }
1119
1048
  }).timeout(attemptTimeout);
1120
1049
  });
1121
1050
 
@@ -1125,34 +1054,28 @@ describe('[integration] Etsi_sol003 Adapter Test', () => {
1125
1054
  };
1126
1055
  describe('#postVnfInstancesVnfInstanceIdScale - errors', () => {
1127
1056
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1128
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdScale.task) {
1129
- try {
1130
- a.postVnfInstancesVnfInstanceIdScale('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdScaleBodyParam, (data, error) => {
1131
- try {
1132
- if (stub) {
1133
- const displayE = 'Error 400 received on request';
1134
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1135
- } else {
1136
- runCommonAsserts(data, error);
1137
- }
1138
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdScale', 'default', data);
1139
- done();
1140
- } catch (err) {
1141
- log.error(`Test Failure: ${err}`);
1142
- done(err);
1057
+ try {
1058
+ a.postVnfInstancesVnfInstanceIdScale('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdScaleBodyParam, (data, error) => {
1059
+ try {
1060
+ if (stub) {
1061
+ const displayE = 'Error 400 received on request';
1062
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1063
+ } else {
1064
+ runCommonAsserts(data, error);
1143
1065
  }
1144
- });
1145
- } catch (error) {
1146
- log.error(`Adapter Exception: ${error}`);
1147
- done(error);
1148
- }
1149
- } else {
1150
- log.error('postVnfInstancesVnfInstanceIdScale task is false, skipping test');
1151
- skipCount += 1;
1152
- done();
1153
- }// end if task
1154
- }).timeout(attemptTimeout);
1155
- });
1066
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdScale', 'default', data);
1067
+ done();
1068
+ } catch (err) {
1069
+ log.error(`Test Failure: ${err}`);
1070
+ done(err);
1071
+ }
1072
+ });
1073
+ } catch (error) {
1074
+ log.error(`Adapter Exception: ${error}`);
1075
+ done(error);
1076
+ }
1077
+ }).timeout(attemptTimeout);
1078
+ });
1156
1079
 
1157
1080
  const vnfInstancesPostVnfInstancesVnfInstanceIdScaleToLevelBodyParam = {
1158
1081
  instantiationLevelId: 'string',
@@ -1167,32 +1090,26 @@ describe('[integration] Etsi_sol003 Adapter Test', () => {
1167
1090
  };
1168
1091
  describe('#postVnfInstancesVnfInstanceIdScaleToLevel - errors', () => {
1169
1092
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1170
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdScaleToLevel.task) {
1171
- try {
1172
- a.postVnfInstancesVnfInstanceIdScaleToLevel('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdScaleToLevelBodyParam, (data, error) => {
1173
- try {
1174
- if (stub) {
1175
- const displayE = 'Error 400 received on request';
1176
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1177
- } else {
1178
- runCommonAsserts(data, error);
1179
- }
1180
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdScaleToLevel', 'default', data);
1181
- done();
1182
- } catch (err) {
1183
- log.error(`Test Failure: ${err}`);
1184
- done(err);
1093
+ try {
1094
+ a.postVnfInstancesVnfInstanceIdScaleToLevel('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdScaleToLevelBodyParam, (data, error) => {
1095
+ try {
1096
+ if (stub) {
1097
+ const displayE = 'Error 400 received on request';
1098
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1099
+ } else {
1100
+ runCommonAsserts(data, error);
1185
1101
  }
1186
- });
1187
- } catch (error) {
1188
- log.error(`Adapter Exception: ${error}`);
1189
- done(error);
1190
- }
1191
- } else {
1192
- log.error('postVnfInstancesVnfInstanceIdScaleToLevel task is false, skipping test');
1193
- skipCount += 1;
1194
- done();
1195
- }// end if task
1102
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdScaleToLevel', 'default', data);
1103
+ done();
1104
+ } catch (err) {
1105
+ log.error(`Test Failure: ${err}`);
1106
+ done(err);
1107
+ }
1108
+ });
1109
+ } catch (error) {
1110
+ log.error(`Adapter Exception: ${error}`);
1111
+ done(error);
1112
+ }
1196
1113
  }).timeout(attemptTimeout);
1197
1114
  });
1198
1115
 
@@ -1201,32 +1118,26 @@ describe('[integration] Etsi_sol003 Adapter Test', () => {
1201
1118
  };
1202
1119
  describe('#postVnfInstancesVnfInstanceIdChangeFlavour - errors', () => {
1203
1120
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1204
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdChangeFlavour.task) {
1205
- try {
1206
- a.postVnfInstancesVnfInstanceIdChangeFlavour('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdChangeFlavourBodyParam, (data, error) => {
1207
- try {
1208
- if (stub) {
1209
- const displayE = 'Error 400 received on request';
1210
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1211
- } else {
1212
- runCommonAsserts(data, error);
1213
- }
1214
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdChangeFlavour', 'default', data);
1215
- done();
1216
- } catch (err) {
1217
- log.error(`Test Failure: ${err}`);
1218
- done(err);
1121
+ try {
1122
+ a.postVnfInstancesVnfInstanceIdChangeFlavour('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdChangeFlavourBodyParam, (data, error) => {
1123
+ try {
1124
+ if (stub) {
1125
+ const displayE = 'Error 400 received on request';
1126
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1127
+ } else {
1128
+ runCommonAsserts(data, error);
1219
1129
  }
1220
- });
1221
- } catch (error) {
1222
- log.error(`Adapter Exception: ${error}`);
1223
- done(error);
1224
- }
1225
- } else {
1226
- log.error('postVnfInstancesVnfInstanceIdChangeFlavour task is false, skipping test');
1227
- skipCount += 1;
1228
- done();
1229
- }// end if task
1130
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdChangeFlavour', 'default', data);
1131
+ done();
1132
+ } catch (err) {
1133
+ log.error(`Test Failure: ${err}`);
1134
+ done(err);
1135
+ }
1136
+ });
1137
+ } catch (error) {
1138
+ log.error(`Adapter Exception: ${error}`);
1139
+ done(error);
1140
+ }
1230
1141
  }).timeout(attemptTimeout);
1231
1142
  });
1232
1143
 
@@ -1235,32 +1146,26 @@ describe('[integration] Etsi_sol003 Adapter Test', () => {
1235
1146
  };
1236
1147
  describe('#postVnfInstancesVnfInstanceIdTerminate - errors', () => {
1237
1148
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1238
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdTerminate.task) {
1239
- try {
1240
- a.postVnfInstancesVnfInstanceIdTerminate('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdTerminateBodyParam, (data, error) => {
1241
- try {
1242
- if (stub) {
1243
- const displayE = 'Error 400 received on request';
1244
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1245
- } else {
1246
- runCommonAsserts(data, error);
1247
- }
1248
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdTerminate', 'default', data);
1249
- done();
1250
- } catch (err) {
1251
- log.error(`Test Failure: ${err}`);
1252
- done(err);
1149
+ try {
1150
+ a.postVnfInstancesVnfInstanceIdTerminate('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdTerminateBodyParam, (data, error) => {
1151
+ try {
1152
+ if (stub) {
1153
+ const displayE = 'Error 400 received on request';
1154
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1155
+ } else {
1156
+ runCommonAsserts(data, error);
1253
1157
  }
1254
- });
1255
- } catch (error) {
1256
- log.error(`Adapter Exception: ${error}`);
1257
- done(error);
1258
- }
1259
- } else {
1260
- log.error('postVnfInstancesVnfInstanceIdTerminate task is false, skipping test');
1261
- skipCount += 1;
1262
- done();
1263
- }// end if task
1158
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdTerminate', 'default', data);
1159
+ done();
1160
+ } catch (err) {
1161
+ log.error(`Test Failure: ${err}`);
1162
+ done(err);
1163
+ }
1164
+ });
1165
+ } catch (error) {
1166
+ log.error(`Adapter Exception: ${error}`);
1167
+ done(error);
1168
+ }
1264
1169
  }).timeout(attemptTimeout);
1265
1170
  });
1266
1171
 
@@ -1270,32 +1175,26 @@ describe('[integration] Etsi_sol003 Adapter Test', () => {
1270
1175
  };
1271
1176
  describe('#postVnfInstancesVnfInstanceIdHeal - errors', () => {
1272
1177
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1273
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdHeal.task) {
1274
- try {
1275
- a.postVnfInstancesVnfInstanceIdHeal('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdHealBodyParam, (data, error) => {
1276
- try {
1277
- if (stub) {
1278
- const displayE = 'Error 400 received on request';
1279
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1280
- } else {
1281
- runCommonAsserts(data, error);
1282
- }
1283
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdHeal', 'default', data);
1284
- done();
1285
- } catch (err) {
1286
- log.error(`Test Failure: ${err}`);
1287
- done(err);
1178
+ try {
1179
+ a.postVnfInstancesVnfInstanceIdHeal('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdHealBodyParam, (data, error) => {
1180
+ try {
1181
+ if (stub) {
1182
+ const displayE = 'Error 400 received on request';
1183
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1184
+ } else {
1185
+ runCommonAsserts(data, error);
1288
1186
  }
1289
- });
1290
- } catch (error) {
1291
- log.error(`Adapter Exception: ${error}`);
1292
- done(error);
1293
- }
1294
- } else {
1295
- log.error('postVnfInstancesVnfInstanceIdHeal task is false, skipping test');
1296
- skipCount += 1;
1297
- done();
1298
- }// end if task
1187
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdHeal', 'default', data);
1188
+ done();
1189
+ } catch (err) {
1190
+ log.error(`Test Failure: ${err}`);
1191
+ done(err);
1192
+ }
1193
+ });
1194
+ } catch (error) {
1195
+ log.error(`Adapter Exception: ${error}`);
1196
+ done(error);
1197
+ }
1299
1198
  }).timeout(attemptTimeout);
1300
1199
  });
1301
1200
 
@@ -1304,32 +1203,26 @@ describe('[integration] Etsi_sol003 Adapter Test', () => {
1304
1203
  };
1305
1204
  describe('#postVnfInstancesVnfInstanceIdOperate - errors', () => {
1306
1205
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1307
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdOperate.task) {
1308
- try {
1309
- a.postVnfInstancesVnfInstanceIdOperate('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdOperateBodyParam, (data, error) => {
1310
- try {
1311
- if (stub) {
1312
- const displayE = 'Error 400 received on request';
1313
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1314
- } else {
1315
- runCommonAsserts(data, error);
1316
- }
1317
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdOperate', 'default', data);
1318
- done();
1319
- } catch (err) {
1320
- log.error(`Test Failure: ${err}`);
1321
- done(err);
1206
+ try {
1207
+ a.postVnfInstancesVnfInstanceIdOperate('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdOperateBodyParam, (data, error) => {
1208
+ try {
1209
+ if (stub) {
1210
+ const displayE = 'Error 400 received on request';
1211
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1212
+ } else {
1213
+ runCommonAsserts(data, error);
1322
1214
  }
1323
- });
1324
- } catch (error) {
1325
- log.error(`Adapter Exception: ${error}`);
1326
- done(error);
1327
- }
1328
- } else {
1329
- log.error('postVnfInstancesVnfInstanceIdOperate task is false, skipping test');
1330
- skipCount += 1;
1331
- done();
1332
- }// end if task
1215
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdOperate', 'default', data);
1216
+ done();
1217
+ } catch (err) {
1218
+ log.error(`Test Failure: ${err}`);
1219
+ done(err);
1220
+ }
1221
+ });
1222
+ } catch (error) {
1223
+ log.error(`Adapter Exception: ${error}`);
1224
+ done(error);
1225
+ }
1333
1226
  }).timeout(attemptTimeout);
1334
1227
  });
1335
1228
 
@@ -1340,32 +1233,26 @@ describe('[integration] Etsi_sol003 Adapter Test', () => {
1340
1233
  };
1341
1234
  describe('#postVnfInstancesVnfInstanceIdChangeExtConn - errors', () => {
1342
1235
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1343
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdChangeExtConn.task) {
1344
- try {
1345
- a.postVnfInstancesVnfInstanceIdChangeExtConn('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdChangeExtConnBodyParam, (data, error) => {
1346
- try {
1347
- if (stub) {
1348
- const displayE = 'Error 400 received on request';
1349
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1350
- } else {
1351
- runCommonAsserts(data, error);
1352
- }
1353
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdChangeExtConn', 'default', data);
1354
- done();
1355
- } catch (err) {
1356
- log.error(`Test Failure: ${err}`);
1357
- done(err);
1236
+ try {
1237
+ a.postVnfInstancesVnfInstanceIdChangeExtConn('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdChangeExtConnBodyParam, (data, error) => {
1238
+ try {
1239
+ if (stub) {
1240
+ const displayE = 'Error 400 received on request';
1241
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1242
+ } else {
1243
+ runCommonAsserts(data, error);
1358
1244
  }
1359
- });
1360
- } catch (error) {
1361
- log.error(`Adapter Exception: ${error}`);
1362
- done(error);
1363
- }
1364
- } else {
1365
- log.error('postVnfInstancesVnfInstanceIdChangeExtConn task is false, skipping test');
1366
- skipCount += 1;
1367
- done();
1368
- }// end if task
1245
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdChangeExtConn', 'default', data);
1246
+ done();
1247
+ } catch (err) {
1248
+ log.error(`Test Failure: ${err}`);
1249
+ done(err);
1250
+ }
1251
+ });
1252
+ } catch (error) {
1253
+ log.error(`Adapter Exception: ${error}`);
1254
+ done(error);
1255
+ }
1369
1256
  }).timeout(attemptTimeout);
1370
1257
  });
1371
1258
 
@@ -1374,64 +1261,52 @@ describe('[integration] Etsi_sol003 Adapter Test', () => {
1374
1261
  };
1375
1262
  describe('#postVnfInstancesVnfInstanceIdChangeVnfpkg - errors', () => {
1376
1263
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1377
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdChangeVnfpkg.task) {
1378
- try {
1379
- a.postVnfInstancesVnfInstanceIdChangeVnfpkg('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdChangeVnfpkgBodyParam, (data, error) => {
1380
- try {
1381
- if (stub) {
1382
- const displayE = 'Error 400 received on request';
1383
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1384
- } else {
1385
- runCommonAsserts(data, error);
1386
- }
1387
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdChangeVnfpkg', 'default', data);
1388
- done();
1389
- } catch (err) {
1390
- log.error(`Test Failure: ${err}`);
1391
- done(err);
1264
+ try {
1265
+ a.postVnfInstancesVnfInstanceIdChangeVnfpkg('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdChangeVnfpkgBodyParam, (data, error) => {
1266
+ try {
1267
+ if (stub) {
1268
+ const displayE = 'Error 400 received on request';
1269
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1270
+ } else {
1271
+ runCommonAsserts(data, error);
1392
1272
  }
1393
- });
1394
- } catch (error) {
1395
- log.error(`Adapter Exception: ${error}`);
1396
- done(error);
1397
- }
1398
- } else {
1399
- log.error('postVnfInstancesVnfInstanceIdChangeVnfpkg task is false, skipping test');
1400
- skipCount += 1;
1401
- done();
1402
- }// end if task
1273
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdChangeVnfpkg', 'default', data);
1274
+ done();
1275
+ } catch (err) {
1276
+ log.error(`Test Failure: ${err}`);
1277
+ done(err);
1278
+ }
1279
+ });
1280
+ } catch (error) {
1281
+ log.error(`Adapter Exception: ${error}`);
1282
+ done(error);
1283
+ }
1403
1284
  }).timeout(attemptTimeout);
1404
1285
  });
1405
1286
 
1406
1287
  const vnfInstancesPostVnfInstancesVnfInstanceIdCreateSnapshotBodyParam = {};
1407
1288
  describe('#postVnfInstancesVnfInstanceIdCreateSnapshot - errors', () => {
1408
1289
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1409
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdCreateSnapshot.task) {
1410
- try {
1411
- a.postVnfInstancesVnfInstanceIdCreateSnapshot('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdCreateSnapshotBodyParam, (data, error) => {
1412
- try {
1413
- if (stub) {
1414
- const displayE = 'Error 400 received on request';
1415
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1416
- } else {
1417
- runCommonAsserts(data, error);
1418
- }
1419
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdCreateSnapshot', 'default', data);
1420
- done();
1421
- } catch (err) {
1422
- log.error(`Test Failure: ${err}`);
1423
- done(err);
1290
+ try {
1291
+ a.postVnfInstancesVnfInstanceIdCreateSnapshot('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdCreateSnapshotBodyParam, (data, error) => {
1292
+ try {
1293
+ if (stub) {
1294
+ const displayE = 'Error 400 received on request';
1295
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1296
+ } else {
1297
+ runCommonAsserts(data, error);
1424
1298
  }
1425
- });
1426
- } catch (error) {
1427
- log.error(`Adapter Exception: ${error}`);
1428
- done(error);
1429
- }
1430
- } else {
1431
- log.error('postVnfInstancesVnfInstanceIdCreateSnapshot task is false, skipping test');
1432
- skipCount += 1;
1433
- done();
1434
- }// end if task
1299
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdCreateSnapshot', 'default', data);
1300
+ done();
1301
+ } catch (err) {
1302
+ log.error(`Test Failure: ${err}`);
1303
+ done(err);
1304
+ }
1305
+ });
1306
+ } catch (error) {
1307
+ log.error(`Adapter Exception: ${error}`);
1308
+ done(error);
1309
+ }
1435
1310
  }).timeout(attemptTimeout);
1436
1311
  });
1437
1312
 
@@ -1440,269 +1315,227 @@ describe('[integration] Etsi_sol003 Adapter Test', () => {
1440
1315
  };
1441
1316
  describe('#postVnfInstancesVnfInstanceIdRevertToSnapshot - errors', () => {
1442
1317
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1443
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdRevertToSnapshot.task) {
1444
- try {
1445
- a.postVnfInstancesVnfInstanceIdRevertToSnapshot('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdRevertToSnapshotBodyParam, (data, error) => {
1446
- try {
1447
- if (stub) {
1448
- const displayE = 'Error 400 received on request';
1449
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1450
- } else {
1451
- runCommonAsserts(data, error);
1452
- }
1453
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdRevertToSnapshot', 'default', data);
1454
- done();
1455
- } catch (err) {
1456
- log.error(`Test Failure: ${err}`);
1457
- done(err);
1318
+ try {
1319
+ a.postVnfInstancesVnfInstanceIdRevertToSnapshot('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdRevertToSnapshotBodyParam, (data, error) => {
1320
+ try {
1321
+ if (stub) {
1322
+ const displayE = 'Error 400 received on request';
1323
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1324
+ } else {
1325
+ runCommonAsserts(data, error);
1458
1326
  }
1459
- });
1460
- } catch (error) {
1461
- log.error(`Adapter Exception: ${error}`);
1462
- done(error);
1463
- }
1464
- } else {
1465
- log.error('postVnfInstancesVnfInstanceIdRevertToSnapshot task is false, skipping test');
1466
- skipCount += 1;
1467
- done();
1468
- }// end if task
1327
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdRevertToSnapshot', 'default', data);
1328
+ done();
1329
+ } catch (err) {
1330
+ log.error(`Test Failure: ${err}`);
1331
+ done(err);
1332
+ }
1333
+ });
1334
+ } catch (error) {
1335
+ log.error(`Adapter Exception: ${error}`);
1336
+ done(error);
1337
+ }
1469
1338
  }).timeout(attemptTimeout);
1470
1339
  });
1471
1340
 
1472
1341
  describe('#getVnfLcmOpOccs - errors', () => {
1473
1342
  it('should work if integrated or standalone with mockdata', (done) => {
1474
- if (pronghorn.methodsByName.getVnfLcmOpOccs.task) {
1475
- try {
1476
- a.getVnfLcmOpOccs(null, null, null, null, null, null, (data, error) => {
1477
- try {
1478
- if (stub) {
1479
- runCommonAsserts(data, error);
1480
- assert.equal('string', data.response.id);
1481
- assert.equal('COMPLETED', data.response.operationState);
1482
- assert.equal('string', data.response.stateEnteredTime);
1483
- assert.equal('string', data.response.startTime);
1484
- assert.equal('string', data.response.vnfInstanceId);
1485
- assert.equal('string', data.response.grantId);
1486
- assert.equal('OPERATE', data.response.operation);
1487
- assert.equal(false, data.response.isAutomaticInvocation);
1488
- assert.equal('object', typeof data.response.operationParams);
1489
- assert.equal(false, data.response.isCancelPending);
1490
- assert.equal('GRACEFUL', data.response.cancelMode);
1491
- assert.equal('object', typeof data.response.error);
1492
- assert.equal('object', typeof data.response.resourceChanges);
1493
- assert.equal('object', typeof data.response.changedInfo);
1494
- assert.equal(true, Array.isArray(data.response.changedExtConnectivity));
1495
- assert.equal('object', typeof data.response.modificationsTriggeredByVnfPkgChange);
1496
- assert.equal('string', data.response.vnfSnapshotInfoId);
1497
- assert.equal('object', typeof data.response._links);
1498
- } else {
1499
- runCommonAsserts(data, error);
1500
- }
1501
- saveMockData('VnfLcmOpOccs', 'getVnfLcmOpOccs', 'default', data);
1502
- done();
1503
- } catch (err) {
1504
- log.error(`Test Failure: ${err}`);
1505
- done(err);
1506
- }
1507
- });
1508
- } catch (error) {
1509
- log.error(`Adapter Exception: ${error}`);
1510
- done(error);
1511
- }
1512
- } else {
1513
- log.error('getVnfLcmOpOccs task is false, skipping test');
1514
- skipCount += 1;
1515
- done();
1516
- }// end if task
1343
+ try {
1344
+ a.getVnfLcmOpOccs(null, null, null, null, null, null, (data, error) => {
1345
+ try {
1346
+ if (stub) {
1347
+ runCommonAsserts(data, error);
1348
+ assert.equal('string', data.response.id);
1349
+ assert.equal('COMPLETED', data.response.operationState);
1350
+ assert.equal('string', data.response.stateEnteredTime);
1351
+ assert.equal('string', data.response.startTime);
1352
+ assert.equal('string', data.response.vnfInstanceId);
1353
+ assert.equal('string', data.response.grantId);
1354
+ assert.equal('OPERATE', data.response.operation);
1355
+ assert.equal(false, data.response.isAutomaticInvocation);
1356
+ assert.equal('object', typeof data.response.operationParams);
1357
+ assert.equal(false, data.response.isCancelPending);
1358
+ assert.equal('GRACEFUL', data.response.cancelMode);
1359
+ assert.equal('object', typeof data.response.error);
1360
+ assert.equal('object', typeof data.response.resourceChanges);
1361
+ assert.equal('object', typeof data.response.changedInfo);
1362
+ assert.equal(true, Array.isArray(data.response.changedExtConnectivity));
1363
+ assert.equal('object', typeof data.response.modificationsTriggeredByVnfPkgChange);
1364
+ assert.equal('string', data.response.vnfSnapshotInfoId);
1365
+ assert.equal('object', typeof data.response._links);
1366
+ } else {
1367
+ runCommonAsserts(data, error);
1368
+ }
1369
+ saveMockData('VnfLcmOpOccs', 'getVnfLcmOpOccs', 'default', data);
1370
+ done();
1371
+ } catch (err) {
1372
+ log.error(`Test Failure: ${err}`);
1373
+ done(err);
1374
+ }
1375
+ });
1376
+ } catch (error) {
1377
+ log.error(`Adapter Exception: ${error}`);
1378
+ done(error);
1379
+ }
1517
1380
  }).timeout(attemptTimeout);
1518
1381
  });
1519
1382
 
1520
1383
  describe('#getVnfLcmOpOccsVnfLcmOpOccId - errors', () => {
1521
1384
  it('should work if integrated or standalone with mockdata', (done) => {
1522
- if (pronghorn.methodsByName.getVnfLcmOpOccsVnfLcmOpOccId.task) {
1523
- try {
1524
- a.getVnfLcmOpOccsVnfLcmOpOccId('fakedata', (data, error) => {
1525
- try {
1526
- if (stub) {
1527
- runCommonAsserts(data, error);
1528
- assert.equal('string', data.response.id);
1529
- assert.equal('STARTING', data.response.operationState);
1530
- assert.equal('string', data.response.stateEnteredTime);
1531
- assert.equal('string', data.response.startTime);
1532
- assert.equal('string', data.response.vnfInstanceId);
1533
- assert.equal('string', data.response.grantId);
1534
- assert.equal('REVERT_TO_SNAPSHOT', data.response.operation);
1535
- assert.equal(true, data.response.isAutomaticInvocation);
1536
- assert.equal('object', typeof data.response.operationParams);
1537
- assert.equal(false, data.response.isCancelPending);
1538
- assert.equal('GRACEFUL', data.response.cancelMode);
1539
- assert.equal('object', typeof data.response.error);
1540
- assert.equal('object', typeof data.response.resourceChanges);
1541
- assert.equal('object', typeof data.response.changedInfo);
1542
- assert.equal(true, Array.isArray(data.response.changedExtConnectivity));
1543
- assert.equal('object', typeof data.response.modificationsTriggeredByVnfPkgChange);
1544
- assert.equal('string', data.response.vnfSnapshotInfoId);
1545
- assert.equal('object', typeof data.response._links);
1546
- } else {
1547
- runCommonAsserts(data, error);
1548
- }
1549
- saveMockData('VnfLcmOpOccs', 'getVnfLcmOpOccsVnfLcmOpOccId', 'default', data);
1550
- done();
1551
- } catch (err) {
1552
- log.error(`Test Failure: ${err}`);
1553
- done(err);
1554
- }
1555
- });
1556
- } catch (error) {
1557
- log.error(`Adapter Exception: ${error}`);
1558
- done(error);
1559
- }
1560
- } else {
1561
- log.error('getVnfLcmOpOccsVnfLcmOpOccId task is false, skipping test');
1562
- skipCount += 1;
1563
- done();
1564
- }// end if task
1385
+ try {
1386
+ a.getVnfLcmOpOccsVnfLcmOpOccId('fakedata', (data, error) => {
1387
+ try {
1388
+ if (stub) {
1389
+ runCommonAsserts(data, error);
1390
+ assert.equal('string', data.response.id);
1391
+ assert.equal('STARTING', data.response.operationState);
1392
+ assert.equal('string', data.response.stateEnteredTime);
1393
+ assert.equal('string', data.response.startTime);
1394
+ assert.equal('string', data.response.vnfInstanceId);
1395
+ assert.equal('string', data.response.grantId);
1396
+ assert.equal('REVERT_TO_SNAPSHOT', data.response.operation);
1397
+ assert.equal(true, data.response.isAutomaticInvocation);
1398
+ assert.equal('object', typeof data.response.operationParams);
1399
+ assert.equal(false, data.response.isCancelPending);
1400
+ assert.equal('GRACEFUL', data.response.cancelMode);
1401
+ assert.equal('object', typeof data.response.error);
1402
+ assert.equal('object', typeof data.response.resourceChanges);
1403
+ assert.equal('object', typeof data.response.changedInfo);
1404
+ assert.equal(true, Array.isArray(data.response.changedExtConnectivity));
1405
+ assert.equal('object', typeof data.response.modificationsTriggeredByVnfPkgChange);
1406
+ assert.equal('string', data.response.vnfSnapshotInfoId);
1407
+ assert.equal('object', typeof data.response._links);
1408
+ } else {
1409
+ runCommonAsserts(data, error);
1410
+ }
1411
+ saveMockData('VnfLcmOpOccs', 'getVnfLcmOpOccsVnfLcmOpOccId', 'default', data);
1412
+ done();
1413
+ } catch (err) {
1414
+ log.error(`Test Failure: ${err}`);
1415
+ done(err);
1416
+ }
1417
+ });
1418
+ } catch (error) {
1419
+ log.error(`Adapter Exception: ${error}`);
1420
+ done(error);
1421
+ }
1565
1422
  }).timeout(attemptTimeout);
1566
1423
  });
1567
1424
 
1568
1425
  describe('#postVnfLcmOpOccsVnfLcmOpOccIdRetry - errors', () => {
1569
1426
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1570
- if (pronghorn.methodsByName.postVnfLcmOpOccsVnfLcmOpOccIdRetry.task) {
1571
- try {
1572
- a.postVnfLcmOpOccsVnfLcmOpOccIdRetry('fakedata', (data, error) => {
1573
- try {
1574
- if (stub) {
1575
- const displayE = 'Error 400 received on request';
1576
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1577
- } else {
1578
- runCommonAsserts(data, error);
1579
- }
1580
- saveMockData('VnfLcmOpOccs', 'postVnfLcmOpOccsVnfLcmOpOccIdRetry', 'default', data);
1581
- done();
1582
- } catch (err) {
1583
- log.error(`Test Failure: ${err}`);
1584
- done(err);
1427
+ try {
1428
+ a.postVnfLcmOpOccsVnfLcmOpOccIdRetry('fakedata', (data, error) => {
1429
+ try {
1430
+ if (stub) {
1431
+ const displayE = 'Error 400 received on request';
1432
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1433
+ } else {
1434
+ runCommonAsserts(data, error);
1585
1435
  }
1586
- });
1587
- } catch (error) {
1588
- log.error(`Adapter Exception: ${error}`);
1589
- done(error);
1590
- }
1591
- } else {
1592
- log.error('postVnfLcmOpOccsVnfLcmOpOccIdRetry task is false, skipping test');
1593
- skipCount += 1;
1594
- done();
1595
- }// end if task
1436
+ saveMockData('VnfLcmOpOccs', 'postVnfLcmOpOccsVnfLcmOpOccIdRetry', 'default', data);
1437
+ done();
1438
+ } catch (err) {
1439
+ log.error(`Test Failure: ${err}`);
1440
+ done(err);
1441
+ }
1442
+ });
1443
+ } catch (error) {
1444
+ log.error(`Adapter Exception: ${error}`);
1445
+ done(error);
1446
+ }
1596
1447
  }).timeout(attemptTimeout);
1597
1448
  });
1598
1449
 
1599
1450
  describe('#postVnfLcmOpOccsVnfLcmOpOccIdRollback - errors', () => {
1600
1451
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1601
- if (pronghorn.methodsByName.postVnfLcmOpOccsVnfLcmOpOccIdRollback.task) {
1602
- try {
1603
- a.postVnfLcmOpOccsVnfLcmOpOccIdRollback('fakedata', (data, error) => {
1604
- try {
1605
- if (stub) {
1606
- const displayE = 'Error 400 received on request';
1607
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1608
- } else {
1609
- runCommonAsserts(data, error);
1610
- }
1611
- saveMockData('VnfLcmOpOccs', 'postVnfLcmOpOccsVnfLcmOpOccIdRollback', 'default', data);
1612
- done();
1613
- } catch (err) {
1614
- log.error(`Test Failure: ${err}`);
1615
- done(err);
1452
+ try {
1453
+ a.postVnfLcmOpOccsVnfLcmOpOccIdRollback('fakedata', (data, error) => {
1454
+ try {
1455
+ if (stub) {
1456
+ const displayE = 'Error 400 received on request';
1457
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1458
+ } else {
1459
+ runCommonAsserts(data, error);
1616
1460
  }
1617
- });
1618
- } catch (error) {
1619
- log.error(`Adapter Exception: ${error}`);
1620
- done(error);
1621
- }
1622
- } else {
1623
- log.error('postVnfLcmOpOccsVnfLcmOpOccIdRollback task is false, skipping test');
1624
- skipCount += 1;
1625
- done();
1626
- }// end if task
1461
+ saveMockData('VnfLcmOpOccs', 'postVnfLcmOpOccsVnfLcmOpOccIdRollback', 'default', data);
1462
+ done();
1463
+ } catch (err) {
1464
+ log.error(`Test Failure: ${err}`);
1465
+ done(err);
1466
+ }
1467
+ });
1468
+ } catch (error) {
1469
+ log.error(`Adapter Exception: ${error}`);
1470
+ done(error);
1471
+ }
1627
1472
  }).timeout(attemptTimeout);
1628
1473
  });
1629
1474
 
1630
1475
  describe('#postVnfLcmOpOccsVnfLcmOpOccIdFail - errors', () => {
1631
1476
  it('should work if integrated or standalone with mockdata', (done) => {
1632
- if (pronghorn.methodsByName.postVnfLcmOpOccsVnfLcmOpOccIdFail.task) {
1633
- try {
1634
- a.postVnfLcmOpOccsVnfLcmOpOccIdFail('fakedata', (data, error) => {
1635
- try {
1636
- if (stub) {
1637
- runCommonAsserts(data, error);
1638
- assert.equal('string', data.response.id);
1639
- assert.equal('STARTING', data.response.operationState);
1640
- assert.equal('string', data.response.stateEnteredTime);
1641
- assert.equal('string', data.response.startTime);
1642
- assert.equal('string', data.response.vnfInstanceId);
1643
- assert.equal('string', data.response.grantId);
1644
- assert.equal('SCALE', data.response.operation);
1645
- assert.equal(false, data.response.isAutomaticInvocation);
1646
- assert.equal('object', typeof data.response.operationParams);
1647
- assert.equal(false, data.response.isCancelPending);
1648
- assert.equal('FORCEFUL', data.response.cancelMode);
1649
- assert.equal('object', typeof data.response.error);
1650
- assert.equal('object', typeof data.response.resourceChanges);
1651
- assert.equal('object', typeof data.response.changedInfo);
1652
- assert.equal(true, Array.isArray(data.response.changedExtConnectivity));
1653
- assert.equal('object', typeof data.response.modificationsTriggeredByVnfPkgChange);
1654
- assert.equal('string', data.response.vnfSnapshotInfoId);
1655
- assert.equal('object', typeof data.response._links);
1656
- } else {
1657
- runCommonAsserts(data, error);
1658
- }
1659
- saveMockData('VnfLcmOpOccs', 'postVnfLcmOpOccsVnfLcmOpOccIdFail', 'default', data);
1660
- done();
1661
- } catch (err) {
1662
- log.error(`Test Failure: ${err}`);
1663
- done(err);
1664
- }
1665
- });
1666
- } catch (error) {
1667
- log.error(`Adapter Exception: ${error}`);
1668
- done(error);
1669
- }
1670
- } else {
1671
- log.error('postVnfLcmOpOccsVnfLcmOpOccIdFail task is false, skipping test');
1672
- skipCount += 1;
1673
- done();
1674
- }// end if task
1477
+ try {
1478
+ a.postVnfLcmOpOccsVnfLcmOpOccIdFail('fakedata', (data, error) => {
1479
+ try {
1480
+ if (stub) {
1481
+ runCommonAsserts(data, error);
1482
+ assert.equal('string', data.response.id);
1483
+ assert.equal('STARTING', data.response.operationState);
1484
+ assert.equal('string', data.response.stateEnteredTime);
1485
+ assert.equal('string', data.response.startTime);
1486
+ assert.equal('string', data.response.vnfInstanceId);
1487
+ assert.equal('string', data.response.grantId);
1488
+ assert.equal('SCALE', data.response.operation);
1489
+ assert.equal(false, data.response.isAutomaticInvocation);
1490
+ assert.equal('object', typeof data.response.operationParams);
1491
+ assert.equal(false, data.response.isCancelPending);
1492
+ assert.equal('FORCEFUL', data.response.cancelMode);
1493
+ assert.equal('object', typeof data.response.error);
1494
+ assert.equal('object', typeof data.response.resourceChanges);
1495
+ assert.equal('object', typeof data.response.changedInfo);
1496
+ assert.equal(true, Array.isArray(data.response.changedExtConnectivity));
1497
+ assert.equal('object', typeof data.response.modificationsTriggeredByVnfPkgChange);
1498
+ assert.equal('string', data.response.vnfSnapshotInfoId);
1499
+ assert.equal('object', typeof data.response._links);
1500
+ } else {
1501
+ runCommonAsserts(data, error);
1502
+ }
1503
+ saveMockData('VnfLcmOpOccs', 'postVnfLcmOpOccsVnfLcmOpOccIdFail', 'default', data);
1504
+ done();
1505
+ } catch (err) {
1506
+ log.error(`Test Failure: ${err}`);
1507
+ done(err);
1508
+ }
1509
+ });
1510
+ } catch (error) {
1511
+ log.error(`Adapter Exception: ${error}`);
1512
+ done(error);
1513
+ }
1675
1514
  }).timeout(attemptTimeout);
1676
1515
  });
1677
1516
 
1678
1517
  describe('#postVnfLcmOpOccsVnfLcmOpOccIdCancel - errors', () => {
1679
1518
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1680
- if (pronghorn.methodsByName.postVnfLcmOpOccsVnfLcmOpOccIdCancel.task) {
1681
- try {
1682
- a.postVnfLcmOpOccsVnfLcmOpOccIdCancel('fakedata', (data, error) => {
1683
- try {
1684
- if (stub) {
1685
- const displayE = 'Error 400 received on request';
1686
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1687
- } else {
1688
- runCommonAsserts(data, error);
1689
- }
1690
- saveMockData('VnfLcmOpOccs', 'postVnfLcmOpOccsVnfLcmOpOccIdCancel', 'default', data);
1691
- done();
1692
- } catch (err) {
1693
- log.error(`Test Failure: ${err}`);
1694
- done(err);
1519
+ try {
1520
+ a.postVnfLcmOpOccsVnfLcmOpOccIdCancel('fakedata', (data, error) => {
1521
+ try {
1522
+ if (stub) {
1523
+ const displayE = 'Error 400 received on request';
1524
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1525
+ } else {
1526
+ runCommonAsserts(data, error);
1695
1527
  }
1696
- });
1697
- } catch (error) {
1698
- log.error(`Adapter Exception: ${error}`);
1699
- done(error);
1700
- }
1701
- } else {
1702
- log.error('postVnfLcmOpOccsVnfLcmOpOccIdCancel task is false, skipping test');
1703
- skipCount += 1;
1704
- done();
1705
- }// end if task
1528
+ saveMockData('VnfLcmOpOccs', 'postVnfLcmOpOccsVnfLcmOpOccIdCancel', 'default', data);
1529
+ done();
1530
+ } catch (err) {
1531
+ log.error(`Test Failure: ${err}`);
1532
+ done(err);
1533
+ }
1534
+ });
1535
+ } catch (error) {
1536
+ log.error(`Adapter Exception: ${error}`);
1537
+ done(error);
1538
+ }
1706
1539
  }).timeout(attemptTimeout);
1707
1540
  });
1708
1541
 
@@ -2021,99 +1854,81 @@ describe('[integration] Etsi_sol003 Adapter Test', () => {
2021
1854
  };
2022
1855
  describe('#postVnfSnapshots - errors', () => {
2023
1856
  it('should work if integrated or standalone with mockdata', (done) => {
2024
- if (pronghorn.methodsByName.postVnfSnapshots.task) {
2025
- try {
2026
- a.postVnfSnapshots(vnfSnapshotsPostVnfSnapshotsBodyParam, (data, error) => {
2027
- try {
2028
- if (stub) {
2029
- runCommonAsserts(data, error);
2030
- assert.equal('string', data.response.id);
2031
- assert.equal('string', data.response.vnfSnapshotPkgId);
2032
- assert.equal('object', typeof data.response.vnfSnapshot);
2033
- assert.equal('object', typeof data.response._links);
2034
- } else {
2035
- runCommonAsserts(data, error);
2036
- }
2037
- saveMockData('VnfSnapshots', 'postVnfSnapshots', 'default', data);
2038
- done();
2039
- } catch (err) {
2040
- log.error(`Test Failure: ${err}`);
2041
- done(err);
2042
- }
2043
- });
2044
- } catch (error) {
2045
- log.error(`Adapter Exception: ${error}`);
2046
- done(error);
2047
- }
2048
- } else {
2049
- log.error('postVnfSnapshots task is false, skipping test');
2050
- skipCount += 1;
2051
- done();
2052
- }// end if task
1857
+ try {
1858
+ a.postVnfSnapshots(vnfSnapshotsPostVnfSnapshotsBodyParam, (data, error) => {
1859
+ try {
1860
+ if (stub) {
1861
+ runCommonAsserts(data, error);
1862
+ assert.equal('string', data.response.id);
1863
+ assert.equal('string', data.response.vnfSnapshotPkgId);
1864
+ assert.equal('object', typeof data.response.vnfSnapshot);
1865
+ assert.equal('object', typeof data.response._links);
1866
+ } else {
1867
+ runCommonAsserts(data, error);
1868
+ }
1869
+ saveMockData('VnfSnapshots', 'postVnfSnapshots', 'default', data);
1870
+ done();
1871
+ } catch (err) {
1872
+ log.error(`Test Failure: ${err}`);
1873
+ done(err);
1874
+ }
1875
+ });
1876
+ } catch (error) {
1877
+ log.error(`Adapter Exception: ${error}`);
1878
+ done(error);
1879
+ }
2053
1880
  }).timeout(attemptTimeout);
2054
1881
  });
2055
1882
 
2056
1883
  describe('#getVnfSnapshots - errors', () => {
2057
1884
  it('should work if integrated or standalone with mockdata', (done) => {
2058
- if (pronghorn.methodsByName.getVnfSnapshots.task) {
2059
- try {
2060
- a.getVnfSnapshots(null, null, null, null, null, null, (data, error) => {
2061
- try {
2062
- if (stub) {
2063
- runCommonAsserts(data, error);
2064
- assert.equal('object', typeof data.response[0]);
2065
- } else {
2066
- runCommonAsserts(data, error);
2067
- }
2068
- saveMockData('VnfSnapshots', 'getVnfSnapshots', 'default', data);
2069
- done();
2070
- } catch (err) {
2071
- log.error(`Test Failure: ${err}`);
2072
- done(err);
1885
+ try {
1886
+ a.getVnfSnapshots(null, null, null, null, null, null, (data, error) => {
1887
+ try {
1888
+ if (stub) {
1889
+ runCommonAsserts(data, error);
1890
+ assert.equal('object', typeof data.response[0]);
1891
+ } else {
1892
+ runCommonAsserts(data, error);
2073
1893
  }
2074
- });
2075
- } catch (error) {
2076
- log.error(`Adapter Exception: ${error}`);
2077
- done(error);
2078
- }
2079
- } else {
2080
- log.error('getVnfSnapshots task is false, skipping test');
2081
- skipCount += 1;
2082
- done();
2083
- }// end if task
1894
+ saveMockData('VnfSnapshots', 'getVnfSnapshots', 'default', data);
1895
+ done();
1896
+ } catch (err) {
1897
+ log.error(`Test Failure: ${err}`);
1898
+ done(err);
1899
+ }
1900
+ });
1901
+ } catch (error) {
1902
+ log.error(`Adapter Exception: ${error}`);
1903
+ done(error);
1904
+ }
2084
1905
  }).timeout(attemptTimeout);
2085
1906
  });
2086
1907
 
2087
1908
  describe('#getVnfSnapshotsVnfSnapshotInfoId - errors', () => {
2088
1909
  it('should work if integrated or standalone with mockdata', (done) => {
2089
- if (pronghorn.methodsByName.getVnfSnapshotsVnfSnapshotInfoId.task) {
2090
- try {
2091
- a.getVnfSnapshotsVnfSnapshotInfoId('fakedata', (data, error) => {
2092
- try {
2093
- if (stub) {
2094
- runCommonAsserts(data, error);
2095
- assert.equal('object', typeof data.response[0]);
2096
- assert.equal('object', typeof data.response[1]);
2097
- assert.equal('object', typeof data.response[2]);
2098
- } else {
2099
- runCommonAsserts(data, error);
2100
- }
2101
- saveMockData('VnfSnapshots', 'getVnfSnapshotsVnfSnapshotInfoId', 'default', data);
2102
- done();
2103
- } catch (err) {
2104
- log.error(`Test Failure: ${err}`);
2105
- done(err);
2106
- }
2107
- });
2108
- } catch (error) {
2109
- log.error(`Adapter Exception: ${error}`);
2110
- done(error);
2111
- }
2112
- } else {
2113
- log.error('getVnfSnapshotsVnfSnapshotInfoId task is false, skipping test');
2114
- skipCount += 1;
2115
- done();
2116
- }// end if task
1910
+ try {
1911
+ a.getVnfSnapshotsVnfSnapshotInfoId('fakedata', (data, error) => {
1912
+ try {
1913
+ if (stub) {
1914
+ runCommonAsserts(data, error);
1915
+ assert.equal('object', typeof data.response[0]);
1916
+ assert.equal('object', typeof data.response[1]);
1917
+ assert.equal('object', typeof data.response[2]);
1918
+ } else {
1919
+ runCommonAsserts(data, error);
1920
+ }
1921
+ saveMockData('VnfSnapshots', 'getVnfSnapshotsVnfSnapshotInfoId', 'default', data);
1922
+ done();
1923
+ } catch (err) {
1924
+ log.error(`Test Failure: ${err}`);
1925
+ done(err);
1926
+ }
1927
+ });
1928
+ } catch (error) {
1929
+ log.error(`Adapter Exception: ${error}`);
1930
+ done(error);
1931
+ }
2117
1932
  }).timeout(attemptTimeout);
2118
1933
  });
2119
1934
 
@@ -2432,94 +2247,76 @@ describe('[integration] Etsi_sol003 Adapter Test', () => {
2432
2247
  };
2433
2248
  describe('#patchVnfSnapshotsVnfSnapshotInfoId - errors', () => {
2434
2249
  it('should work if integrated or standalone with mockdata', (done) => {
2435
- if (pronghorn.methodsByName.patchVnfSnapshotsVnfSnapshotInfoId.task) {
2436
- try {
2437
- a.patchVnfSnapshotsVnfSnapshotInfoId('fakedata', vnfSnapshotsPatchVnfSnapshotsVnfSnapshotInfoIdBodyParam, (data, error) => {
2438
- try {
2439
- if (stub) {
2440
- runCommonAsserts(data, error);
2441
- assert.equal('success', data.response);
2442
- } else {
2443
- runCommonAsserts(data, error);
2444
- }
2445
- saveMockData('VnfSnapshots', 'patchVnfSnapshotsVnfSnapshotInfoId', 'default', data);
2446
- done();
2447
- } catch (err) {
2448
- log.error(`Test Failure: ${err}`);
2449
- done(err);
2250
+ try {
2251
+ a.patchVnfSnapshotsVnfSnapshotInfoId('fakedata', vnfSnapshotsPatchVnfSnapshotsVnfSnapshotInfoIdBodyParam, (data, error) => {
2252
+ try {
2253
+ if (stub) {
2254
+ runCommonAsserts(data, error);
2255
+ assert.equal('success', data.response);
2256
+ } else {
2257
+ runCommonAsserts(data, error);
2450
2258
  }
2451
- });
2452
- } catch (error) {
2453
- log.error(`Adapter Exception: ${error}`);
2454
- done(error);
2455
- }
2456
- } else {
2457
- log.error('patchVnfSnapshotsVnfSnapshotInfoId task is false, skipping test');
2458
- skipCount += 1;
2459
- done();
2460
- }// end if task
2259
+ saveMockData('VnfSnapshots', 'patchVnfSnapshotsVnfSnapshotInfoId', 'default', data);
2260
+ done();
2261
+ } catch (err) {
2262
+ log.error(`Test Failure: ${err}`);
2263
+ done(err);
2264
+ }
2265
+ });
2266
+ } catch (error) {
2267
+ log.error(`Adapter Exception: ${error}`);
2268
+ done(error);
2269
+ }
2461
2270
  }).timeout(attemptTimeout);
2462
2271
  });
2463
2272
 
2464
2273
  describe('#deleteVnfSnapshotsVnfSnapshotInfoId - errors', () => {
2465
2274
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2466
- if (pronghorn.methodsByName.deleteVnfSnapshotsVnfSnapshotInfoId.task) {
2467
- try {
2468
- a.deleteVnfSnapshotsVnfSnapshotInfoId('fakedata', (data, error) => {
2469
- try {
2470
- if (stub) {
2471
- const displayE = 'Error 400 received on request';
2472
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2473
- } else {
2474
- runCommonAsserts(data, error);
2475
- }
2476
- saveMockData('VnfSnapshots', 'deleteVnfSnapshotsVnfSnapshotInfoId', 'default', data);
2477
- done();
2478
- } catch (err) {
2479
- log.error(`Test Failure: ${err}`);
2480
- done(err);
2275
+ try {
2276
+ a.deleteVnfSnapshotsVnfSnapshotInfoId('fakedata', (data, error) => {
2277
+ try {
2278
+ if (stub) {
2279
+ const displayE = 'Error 400 received on request';
2280
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2281
+ } else {
2282
+ runCommonAsserts(data, error);
2481
2283
  }
2482
- });
2483
- } catch (error) {
2484
- log.error(`Adapter Exception: ${error}`);
2485
- done(error);
2486
- }
2487
- } else {
2488
- log.error('deleteVnfSnapshotsVnfSnapshotInfoId task is false, skipping test');
2489
- skipCount += 1;
2490
- done();
2491
- }// end if task
2284
+ saveMockData('VnfSnapshots', 'deleteVnfSnapshotsVnfSnapshotInfoId', 'default', data);
2285
+ done();
2286
+ } catch (err) {
2287
+ log.error(`Test Failure: ${err}`);
2288
+ done(err);
2289
+ }
2290
+ });
2291
+ } catch (error) {
2292
+ log.error(`Adapter Exception: ${error}`);
2293
+ done(error);
2294
+ }
2492
2295
  }).timeout(attemptTimeout);
2493
2296
  });
2494
2297
 
2495
2298
  describe('#getVnfSnapshotsVnfSnapshotInfoIdVnfStateSnapshot - errors', () => {
2496
2299
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2497
- if (pronghorn.methodsByName.getVnfSnapshotsVnfSnapshotInfoIdVnfStateSnapshot.task) {
2498
- try {
2499
- a.getVnfSnapshotsVnfSnapshotInfoIdVnfStateSnapshot('fakedata', (data, error) => {
2500
- try {
2501
- if (stub) {
2502
- const displayE = 'Error 400 received on request';
2503
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2504
- } else {
2505
- runCommonAsserts(data, error);
2506
- }
2507
- saveMockData('VnfSnapshots', 'getVnfSnapshotsVnfSnapshotInfoIdVnfStateSnapshot', 'default', data);
2508
- done();
2509
- } catch (err) {
2510
- log.error(`Test Failure: ${err}`);
2511
- done(err);
2300
+ try {
2301
+ a.getVnfSnapshotsVnfSnapshotInfoIdVnfStateSnapshot('fakedata', (data, error) => {
2302
+ try {
2303
+ if (stub) {
2304
+ const displayE = 'Error 400 received on request';
2305
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2306
+ } else {
2307
+ runCommonAsserts(data, error);
2512
2308
  }
2513
- });
2514
- } catch (error) {
2515
- log.error(`Adapter Exception: ${error}`);
2516
- done(error);
2517
- }
2518
- } else {
2519
- log.error('getVnfSnapshotsVnfSnapshotInfoIdVnfStateSnapshot task is false, skipping test');
2520
- skipCount += 1;
2521
- done();
2522
- }// end if task
2309
+ saveMockData('VnfSnapshots', 'getVnfSnapshotsVnfSnapshotInfoIdVnfStateSnapshot', 'default', data);
2310
+ done();
2311
+ } catch (err) {
2312
+ log.error(`Test Failure: ${err}`);
2313
+ done(err);
2314
+ }
2315
+ });
2316
+ } catch (error) {
2317
+ log.error(`Adapter Exception: ${error}`);
2318
+ done(error);
2319
+ }
2523
2320
  }).timeout(attemptTimeout);
2524
2321
  });
2525
2322
 
@@ -2533,530 +2330,440 @@ describe('[integration] Etsi_sol003 Adapter Test', () => {
2533
2330
  };
2534
2331
  describe('#postGrants - errors', () => {
2535
2332
  it('should work if integrated or standalone with mockdata', (done) => {
2536
- if (pronghorn.methodsByName.postGrants.task) {
2537
- try {
2538
- a.postGrants(grantsPostGrantsBodyParam, (data, error) => {
2539
- try {
2540
- if (stub) {
2541
- runCommonAsserts(data, error);
2542
- assert.equal('string', data.response.id);
2543
- assert.equal('string', data.response.vnfInstanceId);
2544
- assert.equal('string', data.response.vnfLcmOpOccId);
2545
- assert.equal('object', typeof data.response.vimConnectionInfo);
2546
- assert.equal(true, Array.isArray(data.response.zones));
2547
- assert.equal(true, Array.isArray(data.response.zoneGroups));
2548
- assert.equal(true, Array.isArray(data.response.addResources));
2549
- assert.equal(true, Array.isArray(data.response.tempResources));
2550
- assert.equal(true, Array.isArray(data.response.removeResources));
2551
- assert.equal(true, Array.isArray(data.response.updateResources));
2552
- assert.equal('object', typeof data.response.vimAssets);
2553
- assert.equal(true, Array.isArray(data.response.extVirtualLinks));
2554
- assert.equal(true, Array.isArray(data.response.extManagedVirtualLinks));
2555
- assert.equal('object', typeof data.response.additionalParams);
2556
- assert.equal('object', typeof data.response._links);
2557
- } else {
2558
- runCommonAsserts(data, error);
2559
- }
2560
- saveMockData('Grants', 'postGrants', 'default', data);
2561
- done();
2562
- } catch (err) {
2563
- log.error(`Test Failure: ${err}`);
2564
- done(err);
2565
- }
2566
- });
2567
- } catch (error) {
2568
- log.error(`Adapter Exception: ${error}`);
2569
- done(error);
2570
- }
2571
- } else {
2572
- log.error('postGrants task is false, skipping test');
2573
- skipCount += 1;
2574
- done();
2575
- }// end if task
2333
+ try {
2334
+ a.postGrants(grantsPostGrantsBodyParam, (data, error) => {
2335
+ try {
2336
+ if (stub) {
2337
+ runCommonAsserts(data, error);
2338
+ assert.equal('string', data.response.id);
2339
+ assert.equal('string', data.response.vnfInstanceId);
2340
+ assert.equal('string', data.response.vnfLcmOpOccId);
2341
+ assert.equal('object', typeof data.response.vimConnectionInfo);
2342
+ assert.equal(true, Array.isArray(data.response.zones));
2343
+ assert.equal(true, Array.isArray(data.response.zoneGroups));
2344
+ assert.equal(true, Array.isArray(data.response.addResources));
2345
+ assert.equal(true, Array.isArray(data.response.tempResources));
2346
+ assert.equal(true, Array.isArray(data.response.removeResources));
2347
+ assert.equal(true, Array.isArray(data.response.updateResources));
2348
+ assert.equal('object', typeof data.response.vimAssets);
2349
+ assert.equal(true, Array.isArray(data.response.extVirtualLinks));
2350
+ assert.equal(true, Array.isArray(data.response.extManagedVirtualLinks));
2351
+ assert.equal('object', typeof data.response.additionalParams);
2352
+ assert.equal('object', typeof data.response._links);
2353
+ } else {
2354
+ runCommonAsserts(data, error);
2355
+ }
2356
+ saveMockData('Grants', 'postGrants', 'default', data);
2357
+ done();
2358
+ } catch (err) {
2359
+ log.error(`Test Failure: ${err}`);
2360
+ done(err);
2361
+ }
2362
+ });
2363
+ } catch (error) {
2364
+ log.error(`Adapter Exception: ${error}`);
2365
+ done(error);
2366
+ }
2576
2367
  }).timeout(attemptTimeout);
2577
2368
  });
2578
2369
 
2579
2370
  describe('#getGrantsGrantId - errors', () => {
2580
2371
  it('should work if integrated or standalone with mockdata', (done) => {
2581
- if (pronghorn.methodsByName.getGrantsGrantId.task) {
2582
- try {
2583
- a.getGrantsGrantId('fakedata', (data, error) => {
2584
- try {
2585
- if (stub) {
2586
- runCommonAsserts(data, error);
2587
- assert.equal('string', data.response.id);
2588
- assert.equal('string', data.response.vnfInstanceId);
2589
- assert.equal('string', data.response.vnfLcmOpOccId);
2590
- assert.equal('object', typeof data.response.vimConnectionInfo);
2591
- assert.equal(true, Array.isArray(data.response.zones));
2592
- assert.equal(true, Array.isArray(data.response.zoneGroups));
2593
- assert.equal(true, Array.isArray(data.response.addResources));
2594
- assert.equal(true, Array.isArray(data.response.tempResources));
2595
- assert.equal(true, Array.isArray(data.response.removeResources));
2596
- assert.equal(true, Array.isArray(data.response.updateResources));
2597
- assert.equal('object', typeof data.response.vimAssets);
2598
- assert.equal(true, Array.isArray(data.response.extVirtualLinks));
2599
- assert.equal(true, Array.isArray(data.response.extManagedVirtualLinks));
2600
- assert.equal('object', typeof data.response.additionalParams);
2601
- assert.equal('object', typeof data.response._links);
2602
- } else {
2603
- runCommonAsserts(data, error);
2604
- }
2605
- saveMockData('Grants', 'getGrantsGrantId', 'default', data);
2606
- done();
2607
- } catch (err) {
2608
- log.error(`Test Failure: ${err}`);
2609
- done(err);
2610
- }
2611
- });
2612
- } catch (error) {
2613
- log.error(`Adapter Exception: ${error}`);
2614
- done(error);
2615
- }
2616
- } else {
2617
- log.error('getGrantsGrantId task is false, skipping test');
2618
- skipCount += 1;
2619
- done();
2620
- }// end if task
2372
+ try {
2373
+ a.getGrantsGrantId('fakedata', (data, error) => {
2374
+ try {
2375
+ if (stub) {
2376
+ runCommonAsserts(data, error);
2377
+ assert.equal('string', data.response.id);
2378
+ assert.equal('string', data.response.vnfInstanceId);
2379
+ assert.equal('string', data.response.vnfLcmOpOccId);
2380
+ assert.equal('object', typeof data.response.vimConnectionInfo);
2381
+ assert.equal(true, Array.isArray(data.response.zones));
2382
+ assert.equal(true, Array.isArray(data.response.zoneGroups));
2383
+ assert.equal(true, Array.isArray(data.response.addResources));
2384
+ assert.equal(true, Array.isArray(data.response.tempResources));
2385
+ assert.equal(true, Array.isArray(data.response.removeResources));
2386
+ assert.equal(true, Array.isArray(data.response.updateResources));
2387
+ assert.equal('object', typeof data.response.vimAssets);
2388
+ assert.equal(true, Array.isArray(data.response.extVirtualLinks));
2389
+ assert.equal(true, Array.isArray(data.response.extManagedVirtualLinks));
2390
+ assert.equal('object', typeof data.response.additionalParams);
2391
+ assert.equal('object', typeof data.response._links);
2392
+ } else {
2393
+ runCommonAsserts(data, error);
2394
+ }
2395
+ saveMockData('Grants', 'getGrantsGrantId', 'default', data);
2396
+ done();
2397
+ } catch (err) {
2398
+ log.error(`Test Failure: ${err}`);
2399
+ done(err);
2400
+ }
2401
+ });
2402
+ } catch (error) {
2403
+ log.error(`Adapter Exception: ${error}`);
2404
+ done(error);
2405
+ }
2621
2406
  }).timeout(attemptTimeout);
2622
2407
  });
2623
2408
 
2624
2409
  describe('#getOnboardedVnfPackages - errors', () => {
2625
2410
  it('should work if integrated or standalone with mockdata', (done) => {
2626
- if (pronghorn.methodsByName.getOnboardedVnfPackages.task) {
2627
- try {
2628
- a.getOnboardedVnfPackages(null, null, null, null, null, null, (data, error) => {
2629
- try {
2630
- if (stub) {
2631
- runCommonAsserts(data, error);
2632
- assert.equal('object', typeof data.response[0]);
2633
- } else {
2634
- runCommonAsserts(data, error);
2635
- }
2636
- saveMockData('OnboardedVnfPackages', 'getOnboardedVnfPackages', 'default', data);
2637
- done();
2638
- } catch (err) {
2639
- log.error(`Test Failure: ${err}`);
2640
- done(err);
2641
- }
2642
- });
2643
- } catch (error) {
2644
- log.error(`Adapter Exception: ${error}`);
2645
- done(error);
2646
- }
2647
- } else {
2648
- log.error('getOnboardedVnfPackages task is false, skipping test');
2649
- skipCount += 1;
2650
- done();
2651
- }// end if task
2411
+ try {
2412
+ a.getOnboardedVnfPackages(null, null, null, null, null, null, (data, error) => {
2413
+ try {
2414
+ if (stub) {
2415
+ runCommonAsserts(data, error);
2416
+ assert.equal('object', typeof data.response[0]);
2417
+ } else {
2418
+ runCommonAsserts(data, error);
2419
+ }
2420
+ saveMockData('OnboardedVnfPackages', 'getOnboardedVnfPackages', 'default', data);
2421
+ done();
2422
+ } catch (err) {
2423
+ log.error(`Test Failure: ${err}`);
2424
+ done(err);
2425
+ }
2426
+ });
2427
+ } catch (error) {
2428
+ log.error(`Adapter Exception: ${error}`);
2429
+ done(error);
2430
+ }
2652
2431
  }).timeout(attemptTimeout);
2653
2432
  });
2654
2433
 
2655
2434
  describe('#getOnboardedVnfPackagesVnfdId - errors', () => {
2656
2435
  it('should work if integrated or standalone with mockdata', (done) => {
2657
- if (pronghorn.methodsByName.getOnboardedVnfPackagesVnfdId.task) {
2658
- try {
2659
- a.getOnboardedVnfPackagesVnfdId('fakedata', (data, error) => {
2660
- try {
2661
- if (stub) {
2662
- runCommonAsserts(data, error);
2663
- assert.equal('string', data.response.id);
2664
- assert.equal('string', data.response.vnfdId);
2665
- assert.equal('string', data.response.vnfProvider);
2666
- assert.equal('string', data.response.vnfProductName);
2667
- assert.equal('string', data.response.vnfSoftwareVersion);
2668
- assert.equal('string', data.response.vnfdVersion);
2669
- assert.equal(true, Array.isArray(data.response.compatibleSpecificationVersions));
2670
- assert.equal('string', data.response.checksum);
2671
- assert.equal('OPTION_1', data.response.packageSecurityOption);
2672
- assert.equal('string', data.response.signingCertificate);
2673
- assert.equal(true, Array.isArray(data.response.softwareImages));
2674
- assert.equal(true, Array.isArray(data.response.additionalArtifacts));
2675
- assert.equal('UPLOADING', data.response.onboardingState);
2676
- assert.equal('DISABLED', data.response.operationalState);
2677
- assert.equal('IN_USE', data.response.usageState);
2678
- assert.equal('string', data.response.vnfmInfo);
2679
- assert.equal('object', typeof data.response.userDefinedData);
2680
- assert.equal('object', typeof data.response.onboardingFailureDetails);
2681
- assert.equal('object', typeof data.response._links);
2682
- } else {
2683
- runCommonAsserts(data, error);
2684
- }
2685
- saveMockData('OnboardedVnfPackages', 'getOnboardedVnfPackagesVnfdId', 'default', data);
2686
- done();
2687
- } catch (err) {
2688
- log.error(`Test Failure: ${err}`);
2689
- done(err);
2690
- }
2691
- });
2692
- } catch (error) {
2693
- log.error(`Adapter Exception: ${error}`);
2694
- done(error);
2695
- }
2696
- } else {
2697
- log.error('getOnboardedVnfPackagesVnfdId task is false, skipping test');
2698
- skipCount += 1;
2699
- done();
2700
- }// end if task
2436
+ try {
2437
+ a.getOnboardedVnfPackagesVnfdId('fakedata', (data, error) => {
2438
+ try {
2439
+ if (stub) {
2440
+ runCommonAsserts(data, error);
2441
+ assert.equal('string', data.response.id);
2442
+ assert.equal('string', data.response.vnfdId);
2443
+ assert.equal('string', data.response.vnfProvider);
2444
+ assert.equal('string', data.response.vnfProductName);
2445
+ assert.equal('string', data.response.vnfSoftwareVersion);
2446
+ assert.equal('string', data.response.vnfdVersion);
2447
+ assert.equal(true, Array.isArray(data.response.compatibleSpecificationVersions));
2448
+ assert.equal('string', data.response.checksum);
2449
+ assert.equal('OPTION_1', data.response.packageSecurityOption);
2450
+ assert.equal('string', data.response.signingCertificate);
2451
+ assert.equal(true, Array.isArray(data.response.softwareImages));
2452
+ assert.equal(true, Array.isArray(data.response.additionalArtifacts));
2453
+ assert.equal('UPLOADING', data.response.onboardingState);
2454
+ assert.equal('DISABLED', data.response.operationalState);
2455
+ assert.equal('IN_USE', data.response.usageState);
2456
+ assert.equal('string', data.response.vnfmInfo);
2457
+ assert.equal('object', typeof data.response.userDefinedData);
2458
+ assert.equal('object', typeof data.response.onboardingFailureDetails);
2459
+ assert.equal('object', typeof data.response._links);
2460
+ } else {
2461
+ runCommonAsserts(data, error);
2462
+ }
2463
+ saveMockData('OnboardedVnfPackages', 'getOnboardedVnfPackagesVnfdId', 'default', data);
2464
+ done();
2465
+ } catch (err) {
2466
+ log.error(`Test Failure: ${err}`);
2467
+ done(err);
2468
+ }
2469
+ });
2470
+ } catch (error) {
2471
+ log.error(`Adapter Exception: ${error}`);
2472
+ done(error);
2473
+ }
2701
2474
  }).timeout(attemptTimeout);
2702
2475
  });
2703
2476
 
2704
2477
  describe('#getOnboardedVnfPackagesVnfdIdVnfd - errors', () => {
2705
2478
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2706
- if (pronghorn.methodsByName.getOnboardedVnfPackagesVnfdIdVnfd.task) {
2707
- try {
2708
- a.getOnboardedVnfPackagesVnfdIdVnfd('fakedata', null, (data, error) => {
2709
- try {
2710
- if (stub) {
2711
- const displayE = 'Error 400 received on request';
2712
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2713
- } else {
2714
- runCommonAsserts(data, error);
2715
- }
2716
- saveMockData('OnboardedVnfPackages', 'getOnboardedVnfPackagesVnfdIdVnfd', 'default', data);
2717
- done();
2718
- } catch (err) {
2719
- log.error(`Test Failure: ${err}`);
2720
- done(err);
2479
+ try {
2480
+ a.getOnboardedVnfPackagesVnfdIdVnfd('fakedata', null, (data, error) => {
2481
+ try {
2482
+ if (stub) {
2483
+ const displayE = 'Error 400 received on request';
2484
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2485
+ } else {
2486
+ runCommonAsserts(data, error);
2721
2487
  }
2722
- });
2723
- } catch (error) {
2724
- log.error(`Adapter Exception: ${error}`);
2725
- done(error);
2726
- }
2727
- } else {
2728
- log.error('getOnboardedVnfPackagesVnfdIdVnfd task is false, skipping test');
2729
- skipCount += 1;
2730
- done();
2731
- }// end if task
2488
+ saveMockData('OnboardedVnfPackages', 'getOnboardedVnfPackagesVnfdIdVnfd', 'default', data);
2489
+ done();
2490
+ } catch (err) {
2491
+ log.error(`Test Failure: ${err}`);
2492
+ done(err);
2493
+ }
2494
+ });
2495
+ } catch (error) {
2496
+ log.error(`Adapter Exception: ${error}`);
2497
+ done(error);
2498
+ }
2732
2499
  }).timeout(attemptTimeout);
2733
2500
  });
2734
2501
 
2735
2502
  describe('#getOnboardedVnfPackagesVnfdIdManifest - errors', () => {
2736
2503
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2737
- if (pronghorn.methodsByName.getOnboardedVnfPackagesVnfdIdManifest.task) {
2738
- try {
2739
- a.getOnboardedVnfPackagesVnfdIdManifest('fakedata', null, (data, error) => {
2740
- try {
2741
- if (stub) {
2742
- const displayE = 'Error 400 received on request';
2743
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2744
- } else {
2745
- runCommonAsserts(data, error);
2746
- }
2747
- saveMockData('OnboardedVnfPackages', 'getOnboardedVnfPackagesVnfdIdManifest', 'default', data);
2748
- done();
2749
- } catch (err) {
2750
- log.error(`Test Failure: ${err}`);
2751
- done(err);
2504
+ try {
2505
+ a.getOnboardedVnfPackagesVnfdIdManifest('fakedata', null, (data, error) => {
2506
+ try {
2507
+ if (stub) {
2508
+ const displayE = 'Error 400 received on request';
2509
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2510
+ } else {
2511
+ runCommonAsserts(data, error);
2752
2512
  }
2753
- });
2754
- } catch (error) {
2755
- log.error(`Adapter Exception: ${error}`);
2756
- done(error);
2757
- }
2758
- } else {
2759
- log.error('getOnboardedVnfPackagesVnfdIdManifest task is false, skipping test');
2760
- skipCount += 1;
2761
- done();
2762
- }// end if task
2513
+ saveMockData('OnboardedVnfPackages', 'getOnboardedVnfPackagesVnfdIdManifest', 'default', data);
2514
+ done();
2515
+ } catch (err) {
2516
+ log.error(`Test Failure: ${err}`);
2517
+ done(err);
2518
+ }
2519
+ });
2520
+ } catch (error) {
2521
+ log.error(`Adapter Exception: ${error}`);
2522
+ done(error);
2523
+ }
2763
2524
  }).timeout(attemptTimeout);
2764
2525
  });
2765
2526
 
2766
2527
  describe('#getOnboardedVnfPackagesVnfdIdPackageContent - errors', () => {
2767
2528
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2768
- if (pronghorn.methodsByName.getOnboardedVnfPackagesVnfdIdPackageContent.task) {
2769
- try {
2770
- a.getOnboardedVnfPackagesVnfdIdPackageContent('fakedata', (data, error) => {
2771
- try {
2772
- if (stub) {
2773
- const displayE = 'Error 400 received on request';
2774
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2775
- } else {
2776
- runCommonAsserts(data, error);
2777
- }
2778
- saveMockData('OnboardedVnfPackages', 'getOnboardedVnfPackagesVnfdIdPackageContent', 'default', data);
2779
- done();
2780
- } catch (err) {
2781
- log.error(`Test Failure: ${err}`);
2782
- done(err);
2529
+ try {
2530
+ a.getOnboardedVnfPackagesVnfdIdPackageContent('fakedata', (data, error) => {
2531
+ try {
2532
+ if (stub) {
2533
+ const displayE = 'Error 400 received on request';
2534
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2535
+ } else {
2536
+ runCommonAsserts(data, error);
2783
2537
  }
2784
- });
2785
- } catch (error) {
2786
- log.error(`Adapter Exception: ${error}`);
2787
- done(error);
2788
- }
2789
- } else {
2790
- log.error('getOnboardedVnfPackagesVnfdIdPackageContent task is false, skipping test');
2791
- skipCount += 1;
2792
- done();
2793
- }// end if task
2538
+ saveMockData('OnboardedVnfPackages', 'getOnboardedVnfPackagesVnfdIdPackageContent', 'default', data);
2539
+ done();
2540
+ } catch (err) {
2541
+ log.error(`Test Failure: ${err}`);
2542
+ done(err);
2543
+ }
2544
+ });
2545
+ } catch (error) {
2546
+ log.error(`Adapter Exception: ${error}`);
2547
+ done(error);
2548
+ }
2794
2549
  }).timeout(attemptTimeout);
2795
2550
  });
2796
2551
 
2797
2552
  describe('#getOnboardedVnfPackagesVnfdIdArtifacts - errors', () => {
2798
2553
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2799
- if (pronghorn.methodsByName.getOnboardedVnfPackagesVnfdIdArtifacts.task) {
2800
- try {
2801
- a.getOnboardedVnfPackagesVnfdIdArtifacts('fakedata', (data, error) => {
2802
- try {
2803
- if (stub) {
2804
- const displayE = 'Error 400 received on request';
2805
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2806
- } else {
2807
- runCommonAsserts(data, error);
2808
- }
2809
- saveMockData('OnboardedVnfPackages', 'getOnboardedVnfPackagesVnfdIdArtifacts', 'default', data);
2810
- done();
2811
- } catch (err) {
2812
- log.error(`Test Failure: ${err}`);
2813
- done(err);
2554
+ try {
2555
+ a.getOnboardedVnfPackagesVnfdIdArtifacts('fakedata', (data, error) => {
2556
+ try {
2557
+ if (stub) {
2558
+ const displayE = 'Error 400 received on request';
2559
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2560
+ } else {
2561
+ runCommonAsserts(data, error);
2814
2562
  }
2815
- });
2816
- } catch (error) {
2817
- log.error(`Adapter Exception: ${error}`);
2818
- done(error);
2819
- }
2820
- } else {
2821
- log.error('getOnboardedVnfPackagesVnfdIdArtifacts task is false, skipping test');
2822
- skipCount += 1;
2823
- done();
2824
- }// end if task
2563
+ saveMockData('OnboardedVnfPackages', 'getOnboardedVnfPackagesVnfdIdArtifacts', 'default', data);
2564
+ done();
2565
+ } catch (err) {
2566
+ log.error(`Test Failure: ${err}`);
2567
+ done(err);
2568
+ }
2569
+ });
2570
+ } catch (error) {
2571
+ log.error(`Adapter Exception: ${error}`);
2572
+ done(error);
2573
+ }
2825
2574
  }).timeout(attemptTimeout);
2826
2575
  });
2827
2576
 
2828
2577
  describe('#getOnboardedVnfPackagesVnfdIdArtifactsArtifactPath - errors', () => {
2829
2578
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2830
- if (pronghorn.methodsByName.getOnboardedVnfPackagesVnfdIdArtifactsArtifactPath.task) {
2831
- try {
2832
- a.getOnboardedVnfPackagesVnfdIdArtifactsArtifactPath('fakedata', 'fakedata', null, (data, error) => {
2833
- try {
2834
- if (stub) {
2835
- const displayE = 'Error 400 received on request';
2836
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2837
- } else {
2838
- runCommonAsserts(data, error);
2839
- }
2840
- saveMockData('OnboardedVnfPackages', 'getOnboardedVnfPackagesVnfdIdArtifactsArtifactPath', 'default', data);
2841
- done();
2842
- } catch (err) {
2843
- log.error(`Test Failure: ${err}`);
2844
- done(err);
2579
+ try {
2580
+ a.getOnboardedVnfPackagesVnfdIdArtifactsArtifactPath('fakedata', 'fakedata', null, (data, error) => {
2581
+ try {
2582
+ if (stub) {
2583
+ const displayE = 'Error 400 received on request';
2584
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2585
+ } else {
2586
+ runCommonAsserts(data, error);
2845
2587
  }
2846
- });
2847
- } catch (error) {
2848
- log.error(`Adapter Exception: ${error}`);
2849
- done(error);
2850
- }
2851
- } else {
2852
- log.error('getOnboardedVnfPackagesVnfdIdArtifactsArtifactPath task is false, skipping test');
2853
- skipCount += 1;
2854
- done();
2855
- }// end if task
2588
+ saveMockData('OnboardedVnfPackages', 'getOnboardedVnfPackagesVnfdIdArtifactsArtifactPath', 'default', data);
2589
+ done();
2590
+ } catch (err) {
2591
+ log.error(`Test Failure: ${err}`);
2592
+ done(err);
2593
+ }
2594
+ });
2595
+ } catch (error) {
2596
+ log.error(`Adapter Exception: ${error}`);
2597
+ done(error);
2598
+ }
2856
2599
  }).timeout(attemptTimeout);
2857
2600
  });
2858
2601
 
2859
2602
  describe('#getVnfPackagesVnfPkgId - errors', () => {
2860
2603
  it('should work if integrated or standalone with mockdata', (done) => {
2861
- if (pronghorn.methodsByName.getVnfPackagesVnfPkgId.task) {
2862
- try {
2863
- a.getVnfPackagesVnfPkgId('fakedata', null, (data, error) => {
2864
- try {
2865
- if (stub) {
2866
- runCommonAsserts(data, error);
2867
- assert.equal('string', data.response.id);
2868
- assert.equal('string', data.response.vnfdId);
2869
- assert.equal('string', data.response.vnfProvider);
2870
- assert.equal('string', data.response.vnfProductName);
2871
- assert.equal('string', data.response.vnfSoftwareVersion);
2872
- assert.equal('string', data.response.vnfdVersion);
2873
- assert.equal(true, Array.isArray(data.response.compatibleSpecificationVersions));
2874
- assert.equal('string', data.response.checksum);
2875
- assert.equal('OPTION_1', data.response.packageSecurityOption);
2876
- assert.equal('string', data.response.signingCertificate);
2877
- assert.equal(true, Array.isArray(data.response.softwareImages));
2878
- assert.equal(true, Array.isArray(data.response.additionalArtifacts));
2879
- assert.equal('UPLOADING', data.response.onboardingState);
2880
- assert.equal('DISABLED', data.response.operationalState);
2881
- assert.equal('NOT_IN_USE', data.response.usageState);
2882
- assert.equal('string', data.response.vnfmInfo);
2883
- assert.equal('object', typeof data.response.userDefinedData);
2884
- assert.equal('object', typeof data.response.onboardingFailureDetails);
2885
- assert.equal('object', typeof data.response._links);
2886
- } else {
2887
- runCommonAsserts(data, error);
2888
- }
2889
- saveMockData('VnfPackages', 'getVnfPackagesVnfPkgId', 'default', data);
2890
- done();
2891
- } catch (err) {
2892
- log.error(`Test Failure: ${err}`);
2893
- done(err);
2894
- }
2895
- });
2896
- } catch (error) {
2897
- log.error(`Adapter Exception: ${error}`);
2898
- done(error);
2899
- }
2900
- } else {
2901
- log.error('getVnfPackagesVnfPkgId task is false, skipping test');
2902
- skipCount += 1;
2903
- done();
2904
- }// end if task
2604
+ try {
2605
+ a.getVnfPackagesVnfPkgId('fakedata', null, (data, error) => {
2606
+ try {
2607
+ if (stub) {
2608
+ runCommonAsserts(data, error);
2609
+ assert.equal('string', data.response.id);
2610
+ assert.equal('string', data.response.vnfdId);
2611
+ assert.equal('string', data.response.vnfProvider);
2612
+ assert.equal('string', data.response.vnfProductName);
2613
+ assert.equal('string', data.response.vnfSoftwareVersion);
2614
+ assert.equal('string', data.response.vnfdVersion);
2615
+ assert.equal(true, Array.isArray(data.response.compatibleSpecificationVersions));
2616
+ assert.equal('string', data.response.checksum);
2617
+ assert.equal('OPTION_1', data.response.packageSecurityOption);
2618
+ assert.equal('string', data.response.signingCertificate);
2619
+ assert.equal(true, Array.isArray(data.response.softwareImages));
2620
+ assert.equal(true, Array.isArray(data.response.additionalArtifacts));
2621
+ assert.equal('UPLOADING', data.response.onboardingState);
2622
+ assert.equal('DISABLED', data.response.operationalState);
2623
+ assert.equal('NOT_IN_USE', data.response.usageState);
2624
+ assert.equal('string', data.response.vnfmInfo);
2625
+ assert.equal('object', typeof data.response.userDefinedData);
2626
+ assert.equal('object', typeof data.response.onboardingFailureDetails);
2627
+ assert.equal('object', typeof data.response._links);
2628
+ } else {
2629
+ runCommonAsserts(data, error);
2630
+ }
2631
+ saveMockData('VnfPackages', 'getVnfPackagesVnfPkgId', 'default', data);
2632
+ done();
2633
+ } catch (err) {
2634
+ log.error(`Test Failure: ${err}`);
2635
+ done(err);
2636
+ }
2637
+ });
2638
+ } catch (error) {
2639
+ log.error(`Adapter Exception: ${error}`);
2640
+ done(error);
2641
+ }
2905
2642
  }).timeout(attemptTimeout);
2906
2643
  });
2907
2644
 
2908
2645
  describe('#getVnfPackagesVnfPkgIdVnfd - errors', () => {
2909
2646
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2910
- if (pronghorn.methodsByName.getVnfPackagesVnfPkgIdVnfd.task) {
2911
- try {
2912
- a.getVnfPackagesVnfPkgIdVnfd('fakedata', null, (data, error) => {
2913
- try {
2914
- if (stub) {
2915
- const displayE = 'Error 400 received on request';
2916
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2917
- } else {
2918
- runCommonAsserts(data, error);
2919
- }
2920
- saveMockData('VnfPackages', 'getVnfPackagesVnfPkgIdVnfd', 'default', data);
2921
- done();
2922
- } catch (err) {
2923
- log.error(`Test Failure: ${err}`);
2924
- done(err);
2647
+ try {
2648
+ a.getVnfPackagesVnfPkgIdVnfd('fakedata', null, (data, error) => {
2649
+ try {
2650
+ if (stub) {
2651
+ const displayE = 'Error 400 received on request';
2652
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2653
+ } else {
2654
+ runCommonAsserts(data, error);
2925
2655
  }
2926
- });
2927
- } catch (error) {
2928
- log.error(`Adapter Exception: ${error}`);
2929
- done(error);
2930
- }
2931
- } else {
2932
- log.error('getVnfPackagesVnfPkgIdVnfd task is false, skipping test');
2933
- skipCount += 1;
2934
- done();
2935
- }// end if task
2656
+ saveMockData('VnfPackages', 'getVnfPackagesVnfPkgIdVnfd', 'default', data);
2657
+ done();
2658
+ } catch (err) {
2659
+ log.error(`Test Failure: ${err}`);
2660
+ done(err);
2661
+ }
2662
+ });
2663
+ } catch (error) {
2664
+ log.error(`Adapter Exception: ${error}`);
2665
+ done(error);
2666
+ }
2936
2667
  }).timeout(attemptTimeout);
2937
2668
  });
2938
2669
 
2939
2670
  describe('#getVnfPackagesVnfPkgIdManifest - errors', () => {
2940
2671
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2941
- if (pronghorn.methodsByName.getVnfPackagesVnfPkgIdManifest.task) {
2942
- try {
2943
- a.getVnfPackagesVnfPkgIdManifest('fakedata', null, (data, error) => {
2944
- try {
2945
- if (stub) {
2946
- const displayE = 'Error 400 received on request';
2947
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2948
- } else {
2949
- runCommonAsserts(data, error);
2950
- }
2951
- saveMockData('VnfPackages', 'getVnfPackagesVnfPkgIdManifest', 'default', data);
2952
- done();
2953
- } catch (err) {
2954
- log.error(`Test Failure: ${err}`);
2955
- done(err);
2672
+ try {
2673
+ a.getVnfPackagesVnfPkgIdManifest('fakedata', null, (data, error) => {
2674
+ try {
2675
+ if (stub) {
2676
+ const displayE = 'Error 400 received on request';
2677
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2678
+ } else {
2679
+ runCommonAsserts(data, error);
2956
2680
  }
2957
- });
2958
- } catch (error) {
2959
- log.error(`Adapter Exception: ${error}`);
2960
- done(error);
2961
- }
2962
- } else {
2963
- log.error('getVnfPackagesVnfPkgIdManifest task is false, skipping test');
2964
- skipCount += 1;
2965
- done();
2966
- }// end if task
2681
+ saveMockData('VnfPackages', 'getVnfPackagesVnfPkgIdManifest', 'default', data);
2682
+ done();
2683
+ } catch (err) {
2684
+ log.error(`Test Failure: ${err}`);
2685
+ done(err);
2686
+ }
2687
+ });
2688
+ } catch (error) {
2689
+ log.error(`Adapter Exception: ${error}`);
2690
+ done(error);
2691
+ }
2967
2692
  }).timeout(attemptTimeout);
2968
2693
  });
2969
2694
 
2970
2695
  describe('#getVnfPackagesVnfPkgIdPackageContent - errors', () => {
2971
2696
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2972
- if (pronghorn.methodsByName.getVnfPackagesVnfPkgIdPackageContent.task) {
2973
- try {
2974
- a.getVnfPackagesVnfPkgIdPackageContent('fakedata', (data, error) => {
2975
- try {
2976
- if (stub) {
2977
- const displayE = 'Error 400 received on request';
2978
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2979
- } else {
2980
- runCommonAsserts(data, error);
2981
- }
2982
- saveMockData('VnfPackages', 'getVnfPackagesVnfPkgIdPackageContent', 'default', data);
2983
- done();
2984
- } catch (err) {
2985
- log.error(`Test Failure: ${err}`);
2986
- done(err);
2697
+ try {
2698
+ a.getVnfPackagesVnfPkgIdPackageContent('fakedata', (data, error) => {
2699
+ try {
2700
+ if (stub) {
2701
+ const displayE = 'Error 400 received on request';
2702
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2703
+ } else {
2704
+ runCommonAsserts(data, error);
2987
2705
  }
2988
- });
2989
- } catch (error) {
2990
- log.error(`Adapter Exception: ${error}`);
2991
- done(error);
2992
- }
2993
- } else {
2994
- log.error('getVnfPackagesVnfPkgIdPackageContent task is false, skipping test');
2995
- skipCount += 1;
2996
- done();
2997
- }// end if task
2706
+ saveMockData('VnfPackages', 'getVnfPackagesVnfPkgIdPackageContent', 'default', data);
2707
+ done();
2708
+ } catch (err) {
2709
+ log.error(`Test Failure: ${err}`);
2710
+ done(err);
2711
+ }
2712
+ });
2713
+ } catch (error) {
2714
+ log.error(`Adapter Exception: ${error}`);
2715
+ done(error);
2716
+ }
2998
2717
  }).timeout(attemptTimeout);
2999
2718
  });
3000
2719
 
3001
2720
  describe('#getVnfPackagesVnfPkgIdArtifacts - errors', () => {
3002
2721
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
3003
- if (pronghorn.methodsByName.getVnfPackagesVnfPkgIdArtifacts.task) {
3004
- try {
3005
- a.getVnfPackagesVnfPkgIdArtifacts('fakedata', (data, error) => {
3006
- try {
3007
- if (stub) {
3008
- const displayE = 'Error 400 received on request';
3009
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
3010
- } else {
3011
- runCommonAsserts(data, error);
3012
- }
3013
- saveMockData('VnfPackages', 'getVnfPackagesVnfPkgIdArtifacts', 'default', data);
3014
- done();
3015
- } catch (err) {
3016
- log.error(`Test Failure: ${err}`);
3017
- done(err);
2722
+ try {
2723
+ a.getVnfPackagesVnfPkgIdArtifacts('fakedata', (data, error) => {
2724
+ try {
2725
+ if (stub) {
2726
+ const displayE = 'Error 400 received on request';
2727
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2728
+ } else {
2729
+ runCommonAsserts(data, error);
3018
2730
  }
3019
- });
3020
- } catch (error) {
3021
- log.error(`Adapter Exception: ${error}`);
3022
- done(error);
3023
- }
3024
- } else {
3025
- log.error('getVnfPackagesVnfPkgIdArtifacts task is false, skipping test');
3026
- skipCount += 1;
3027
- done();
3028
- }// end if task
2731
+ saveMockData('VnfPackages', 'getVnfPackagesVnfPkgIdArtifacts', 'default', data);
2732
+ done();
2733
+ } catch (err) {
2734
+ log.error(`Test Failure: ${err}`);
2735
+ done(err);
2736
+ }
2737
+ });
2738
+ } catch (error) {
2739
+ log.error(`Adapter Exception: ${error}`);
2740
+ done(error);
2741
+ }
3029
2742
  }).timeout(attemptTimeout);
3030
2743
  });
3031
2744
 
3032
2745
  describe('#getVnfPackagesVnfPkgIdArtifactsArtifactPath - errors', () => {
3033
2746
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
3034
- if (pronghorn.methodsByName.getVnfPackagesVnfPkgIdArtifactsArtifactPath.task) {
3035
- try {
3036
- a.getVnfPackagesVnfPkgIdArtifactsArtifactPath('fakedata', 'fakedata', null, (data, error) => {
3037
- try {
3038
- if (stub) {
3039
- const displayE = 'Error 400 received on request';
3040
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
3041
- } else {
3042
- runCommonAsserts(data, error);
3043
- }
3044
- saveMockData('VnfPackages', 'getVnfPackagesVnfPkgIdArtifactsArtifactPath', 'default', data);
3045
- done();
3046
- } catch (err) {
3047
- log.error(`Test Failure: ${err}`);
3048
- done(err);
2747
+ try {
2748
+ a.getVnfPackagesVnfPkgIdArtifactsArtifactPath('fakedata', 'fakedata', null, (data, error) => {
2749
+ try {
2750
+ if (stub) {
2751
+ const displayE = 'Error 400 received on request';
2752
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2753
+ } else {
2754
+ runCommonAsserts(data, error);
3049
2755
  }
3050
- });
3051
- } catch (error) {
3052
- log.error(`Adapter Exception: ${error}`);
3053
- done(error);
3054
- }
3055
- } else {
3056
- log.error('getVnfPackagesVnfPkgIdArtifactsArtifactPath task is false, skipping test');
3057
- skipCount += 1;
3058
- done();
3059
- }// end if task
2756
+ saveMockData('VnfPackages', 'getVnfPackagesVnfPkgIdArtifactsArtifactPath', 'default', data);
2757
+ done();
2758
+ } catch (err) {
2759
+ log.error(`Test Failure: ${err}`);
2760
+ done(err);
2761
+ }
2762
+ });
2763
+ } catch (error) {
2764
+ log.error(`Adapter Exception: ${error}`);
2765
+ done(error);
2766
+ }
3060
2767
  }).timeout(attemptTimeout);
3061
2768
  });
3062
2769
 
@@ -3070,203 +2777,167 @@ describe('[integration] Etsi_sol003 Adapter Test', () => {
3070
2777
  };
3071
2778
  describe('#postPmJobs - errors', () => {
3072
2779
  it('should work if integrated or standalone with mockdata', (done) => {
3073
- if (pronghorn.methodsByName.postPmJobs.task) {
3074
- try {
3075
- a.postPmJobs(pmJobsPostPmJobsBodyParam, (data, error) => {
3076
- try {
3077
- if (stub) {
3078
- runCommonAsserts(data, error);
3079
- assert.equal('string', data.response.id);
3080
- assert.equal('string', data.response.objectType);
3081
- assert.equal(true, Array.isArray(data.response.objectInstanceIds));
3082
- assert.equal(true, Array.isArray(data.response.subObjectInstanceIds));
3083
- assert.equal('object', typeof data.response.criteria);
3084
- assert.equal('string', data.response.callbackUri);
3085
- assert.equal('object', typeof data.response.reports);
3086
- assert.equal('object', typeof data.response._links);
3087
- } else {
3088
- runCommonAsserts(data, error);
3089
- }
3090
- saveMockData('PmJobs', 'postPmJobs', 'default', data);
3091
- done();
3092
- } catch (err) {
3093
- log.error(`Test Failure: ${err}`);
3094
- done(err);
3095
- }
3096
- });
3097
- } catch (error) {
3098
- log.error(`Adapter Exception: ${error}`);
3099
- done(error);
3100
- }
3101
- } else {
3102
- log.error('postPmJobs task is false, skipping test');
3103
- skipCount += 1;
3104
- done();
3105
- }// end if task
2780
+ try {
2781
+ a.postPmJobs(pmJobsPostPmJobsBodyParam, (data, error) => {
2782
+ try {
2783
+ if (stub) {
2784
+ runCommonAsserts(data, error);
2785
+ assert.equal('string', data.response.id);
2786
+ assert.equal('string', data.response.objectType);
2787
+ assert.equal(true, Array.isArray(data.response.objectInstanceIds));
2788
+ assert.equal(true, Array.isArray(data.response.subObjectInstanceIds));
2789
+ assert.equal('object', typeof data.response.criteria);
2790
+ assert.equal('string', data.response.callbackUri);
2791
+ assert.equal('object', typeof data.response.reports);
2792
+ assert.equal('object', typeof data.response._links);
2793
+ } else {
2794
+ runCommonAsserts(data, error);
2795
+ }
2796
+ saveMockData('PmJobs', 'postPmJobs', 'default', data);
2797
+ done();
2798
+ } catch (err) {
2799
+ log.error(`Test Failure: ${err}`);
2800
+ done(err);
2801
+ }
2802
+ });
2803
+ } catch (error) {
2804
+ log.error(`Adapter Exception: ${error}`);
2805
+ done(error);
2806
+ }
3106
2807
  }).timeout(attemptTimeout);
3107
2808
  });
3108
2809
 
3109
2810
  describe('#getPmJobs - errors', () => {
3110
2811
  it('should work if integrated or standalone with mockdata', (done) => {
3111
- if (pronghorn.methodsByName.getPmJobs.task) {
3112
- try {
3113
- a.getPmJobs(null, null, null, null, null, null, (data, error) => {
3114
- try {
3115
- if (stub) {
3116
- runCommonAsserts(data, error);
3117
- assert.equal('object', typeof data.response[0]);
3118
- assert.equal('object', typeof data.response[1]);
3119
- assert.equal('object', typeof data.response[2]);
3120
- } else {
3121
- runCommonAsserts(data, error);
3122
- }
3123
- saveMockData('PmJobs', 'getPmJobs', 'default', data);
3124
- done();
3125
- } catch (err) {
3126
- log.error(`Test Failure: ${err}`);
3127
- done(err);
3128
- }
3129
- });
3130
- } catch (error) {
3131
- log.error(`Adapter Exception: ${error}`);
3132
- done(error);
3133
- }
3134
- } else {
3135
- log.error('getPmJobs task is false, skipping test');
3136
- skipCount += 1;
3137
- done();
3138
- }// end if task
2812
+ try {
2813
+ a.getPmJobs(null, null, null, null, null, null, (data, error) => {
2814
+ try {
2815
+ if (stub) {
2816
+ runCommonAsserts(data, error);
2817
+ assert.equal('object', typeof data.response[0]);
2818
+ assert.equal('object', typeof data.response[1]);
2819
+ assert.equal('object', typeof data.response[2]);
2820
+ } else {
2821
+ runCommonAsserts(data, error);
2822
+ }
2823
+ saveMockData('PmJobs', 'getPmJobs', 'default', data);
2824
+ done();
2825
+ } catch (err) {
2826
+ log.error(`Test Failure: ${err}`);
2827
+ done(err);
2828
+ }
2829
+ });
2830
+ } catch (error) {
2831
+ log.error(`Adapter Exception: ${error}`);
2832
+ done(error);
2833
+ }
3139
2834
  }).timeout(attemptTimeout);
3140
2835
  });
3141
2836
 
3142
2837
  describe('#getPmJobsPmJobId - errors', () => {
3143
2838
  it('should work if integrated or standalone with mockdata', (done) => {
3144
- if (pronghorn.methodsByName.getPmJobsPmJobId.task) {
3145
- try {
3146
- a.getPmJobsPmJobId('fakedata', (data, error) => {
3147
- try {
3148
- if (stub) {
3149
- runCommonAsserts(data, error);
3150
- assert.equal('string', data.response.id);
3151
- assert.equal('string', data.response.objectType);
3152
- assert.equal(true, Array.isArray(data.response.objectInstanceIds));
3153
- assert.equal(true, Array.isArray(data.response.subObjectInstanceIds));
3154
- assert.equal('object', typeof data.response.criteria);
3155
- assert.equal('string', data.response.callbackUri);
3156
- assert.equal('object', typeof data.response.reports);
3157
- assert.equal('object', typeof data.response._links);
3158
- } else {
3159
- runCommonAsserts(data, error);
3160
- }
3161
- saveMockData('PmJobs', 'getPmJobsPmJobId', 'default', data);
3162
- done();
3163
- } catch (err) {
3164
- log.error(`Test Failure: ${err}`);
3165
- done(err);
3166
- }
3167
- });
3168
- } catch (error) {
3169
- log.error(`Adapter Exception: ${error}`);
3170
- done(error);
3171
- }
3172
- } else {
3173
- log.error('getPmJobsPmJobId task is false, skipping test');
3174
- skipCount += 1;
3175
- done();
3176
- }// end if task
2839
+ try {
2840
+ a.getPmJobsPmJobId('fakedata', (data, error) => {
2841
+ try {
2842
+ if (stub) {
2843
+ runCommonAsserts(data, error);
2844
+ assert.equal('string', data.response.id);
2845
+ assert.equal('string', data.response.objectType);
2846
+ assert.equal(true, Array.isArray(data.response.objectInstanceIds));
2847
+ assert.equal(true, Array.isArray(data.response.subObjectInstanceIds));
2848
+ assert.equal('object', typeof data.response.criteria);
2849
+ assert.equal('string', data.response.callbackUri);
2850
+ assert.equal('object', typeof data.response.reports);
2851
+ assert.equal('object', typeof data.response._links);
2852
+ } else {
2853
+ runCommonAsserts(data, error);
2854
+ }
2855
+ saveMockData('PmJobs', 'getPmJobsPmJobId', 'default', data);
2856
+ done();
2857
+ } catch (err) {
2858
+ log.error(`Test Failure: ${err}`);
2859
+ done(err);
2860
+ }
2861
+ });
2862
+ } catch (error) {
2863
+ log.error(`Adapter Exception: ${error}`);
2864
+ done(error);
2865
+ }
3177
2866
  }).timeout(attemptTimeout);
3178
2867
  });
3179
2868
 
3180
2869
  describe('#patchPmJobsPmJobId - errors', () => {
3181
2870
  it('should work if integrated or standalone with mockdata', (done) => {
3182
- if (pronghorn.methodsByName.patchPmJobsPmJobId.task) {
3183
- try {
3184
- a.patchPmJobsPmJobId('fakedata', (data, error) => {
3185
- try {
3186
- if (stub) {
3187
- runCommonAsserts(data, error);
3188
- assert.equal('success', data.response);
3189
- } else {
3190
- runCommonAsserts(data, error);
3191
- }
3192
- saveMockData('PmJobs', 'patchPmJobsPmJobId', 'default', data);
3193
- done();
3194
- } catch (err) {
3195
- log.error(`Test Failure: ${err}`);
3196
- done(err);
2871
+ try {
2872
+ a.patchPmJobsPmJobId('fakedata', (data, error) => {
2873
+ try {
2874
+ if (stub) {
2875
+ runCommonAsserts(data, error);
2876
+ assert.equal('success', data.response);
2877
+ } else {
2878
+ runCommonAsserts(data, error);
3197
2879
  }
3198
- });
3199
- } catch (error) {
3200
- log.error(`Adapter Exception: ${error}`);
3201
- done(error);
3202
- }
3203
- } else {
3204
- log.error('patchPmJobsPmJobId task is false, skipping test');
3205
- skipCount += 1;
3206
- done();
3207
- }// end if task
2880
+ saveMockData('PmJobs', 'patchPmJobsPmJobId', 'default', data);
2881
+ done();
2882
+ } catch (err) {
2883
+ log.error(`Test Failure: ${err}`);
2884
+ done(err);
2885
+ }
2886
+ });
2887
+ } catch (error) {
2888
+ log.error(`Adapter Exception: ${error}`);
2889
+ done(error);
2890
+ }
3208
2891
  }).timeout(attemptTimeout);
3209
2892
  });
3210
2893
 
3211
2894
  describe('#deletePmJobsPmJobId - errors', () => {
3212
2895
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
3213
- if (pronghorn.methodsByName.deletePmJobsPmJobId.task) {
3214
- try {
3215
- a.deletePmJobsPmJobId('fakedata', (data, error) => {
3216
- try {
3217
- if (stub) {
3218
- const displayE = 'Error 400 received on request';
3219
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
3220
- } else {
3221
- runCommonAsserts(data, error);
3222
- }
3223
- saveMockData('PmJobs', 'deletePmJobsPmJobId', 'default', data);
3224
- done();
3225
- } catch (err) {
3226
- log.error(`Test Failure: ${err}`);
3227
- done(err);
2896
+ try {
2897
+ a.deletePmJobsPmJobId('fakedata', (data, error) => {
2898
+ try {
2899
+ if (stub) {
2900
+ const displayE = 'Error 400 received on request';
2901
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2902
+ } else {
2903
+ runCommonAsserts(data, error);
3228
2904
  }
3229
- });
3230
- } catch (error) {
3231
- log.error(`Adapter Exception: ${error}`);
3232
- done(error);
3233
- }
3234
- } else {
3235
- log.error('deletePmJobsPmJobId task is false, skipping test');
3236
- skipCount += 1;
3237
- done();
3238
- }// end if task
2905
+ saveMockData('PmJobs', 'deletePmJobsPmJobId', 'default', data);
2906
+ done();
2907
+ } catch (err) {
2908
+ log.error(`Test Failure: ${err}`);
2909
+ done(err);
2910
+ }
2911
+ });
2912
+ } catch (error) {
2913
+ log.error(`Adapter Exception: ${error}`);
2914
+ done(error);
2915
+ }
3239
2916
  }).timeout(attemptTimeout);
3240
2917
  });
3241
2918
 
3242
2919
  describe('#getPmJobsPmJobIdReportsReportId - errors', () => {
3243
2920
  it('should work if integrated or standalone with mockdata', (done) => {
3244
- if (pronghorn.methodsByName.getPmJobsPmJobIdReportsReportId.task) {
3245
- try {
3246
- a.getPmJobsPmJobIdReportsReportId('fakedata', 'fakedata', (data, error) => {
3247
- try {
3248
- if (stub) {
3249
- runCommonAsserts(data, error);
3250
- assert.equal(true, Array.isArray(data.response.entries));
3251
- } else {
3252
- runCommonAsserts(data, error);
3253
- }
3254
- saveMockData('PmJobs', 'getPmJobsPmJobIdReportsReportId', 'default', data);
3255
- done();
3256
- } catch (err) {
3257
- log.error(`Test Failure: ${err}`);
3258
- done(err);
2921
+ try {
2922
+ a.getPmJobsPmJobIdReportsReportId('fakedata', 'fakedata', (data, error) => {
2923
+ try {
2924
+ if (stub) {
2925
+ runCommonAsserts(data, error);
2926
+ assert.equal(true, Array.isArray(data.response.entries));
2927
+ } else {
2928
+ runCommonAsserts(data, error);
3259
2929
  }
3260
- });
3261
- } catch (error) {
3262
- log.error(`Adapter Exception: ${error}`);
3263
- done(error);
3264
- }
3265
- } else {
3266
- log.error('getPmJobsPmJobIdReportsReportId task is false, skipping test');
3267
- skipCount += 1;
3268
- done();
3269
- }// end if task
2930
+ saveMockData('PmJobs', 'getPmJobsPmJobIdReportsReportId', 'default', data);
2931
+ done();
2932
+ } catch (err) {
2933
+ log.error(`Test Failure: ${err}`);
2934
+ done(err);
2935
+ }
2936
+ });
2937
+ } catch (error) {
2938
+ log.error(`Adapter Exception: ${error}`);
2939
+ done(error);
2940
+ }
3270
2941
  }).timeout(attemptTimeout);
3271
2942
  });
3272
2943
 
@@ -3278,320 +2949,259 @@ describe('[integration] Etsi_sol003 Adapter Test', () => {
3278
2949
  };
3279
2950
  describe('#postThresholds - errors', () => {
3280
2951
  it('should work if integrated or standalone with mockdata', (done) => {
3281
- if (pronghorn.methodsByName.postThresholds.task) {
3282
- try {
3283
- a.postThresholds(thresholdsPostThresholdsBodyParam, (data, error) => {
3284
- try {
3285
- if (stub) {
3286
- runCommonAsserts(data, error);
3287
- assert.equal('string', data.response.id);
3288
- assert.equal('string', data.response.objectType);
3289
- assert.equal('string', data.response.objectInstanceId);
3290
- assert.equal(true, Array.isArray(data.response.subObjectInstanceIds));
3291
- assert.equal('object', typeof data.response.criteria);
3292
- assert.equal('string', data.response.callbackUri);
3293
- assert.equal('object', typeof data.response._links);
3294
- } else {
3295
- runCommonAsserts(data, error);
3296
- }
3297
- saveMockData('Thresholds', 'postThresholds', 'default', data);
3298
- done();
3299
- } catch (err) {
3300
- log.error(`Test Failure: ${err}`);
3301
- done(err);
3302
- }
3303
- });
3304
- } catch (error) {
3305
- log.error(`Adapter Exception: ${error}`);
3306
- done(error);
3307
- }
3308
- } else {
3309
- log.error('postThresholds task is false, skipping test');
3310
- skipCount += 1;
3311
- done();
3312
- }// end if task
2952
+ try {
2953
+ a.postThresholds(thresholdsPostThresholdsBodyParam, (data, error) => {
2954
+ try {
2955
+ if (stub) {
2956
+ runCommonAsserts(data, error);
2957
+ assert.equal('string', data.response.id);
2958
+ assert.equal('string', data.response.objectType);
2959
+ assert.equal('string', data.response.objectInstanceId);
2960
+ assert.equal(true, Array.isArray(data.response.subObjectInstanceIds));
2961
+ assert.equal('object', typeof data.response.criteria);
2962
+ assert.equal('string', data.response.callbackUri);
2963
+ assert.equal('object', typeof data.response._links);
2964
+ } else {
2965
+ runCommonAsserts(data, error);
2966
+ }
2967
+ saveMockData('Thresholds', 'postThresholds', 'default', data);
2968
+ done();
2969
+ } catch (err) {
2970
+ log.error(`Test Failure: ${err}`);
2971
+ done(err);
2972
+ }
2973
+ });
2974
+ } catch (error) {
2975
+ log.error(`Adapter Exception: ${error}`);
2976
+ done(error);
2977
+ }
3313
2978
  }).timeout(attemptTimeout);
3314
2979
  });
3315
2980
 
3316
2981
  describe('#getThresholds - errors', () => {
3317
2982
  it('should work if integrated or standalone with mockdata', (done) => {
3318
- if (pronghorn.methodsByName.getThresholds.task) {
3319
- try {
3320
- a.getThresholds(null, null, (data, error) => {
3321
- try {
3322
- if (stub) {
3323
- runCommonAsserts(data, error);
3324
- assert.equal('object', typeof data.response[0]);
3325
- assert.equal('object', typeof data.response[1]);
3326
- } else {
3327
- runCommonAsserts(data, error);
3328
- }
3329
- saveMockData('Thresholds', 'getThresholds', 'default', data);
3330
- done();
3331
- } catch (err) {
3332
- log.error(`Test Failure: ${err}`);
3333
- done(err);
3334
- }
3335
- });
3336
- } catch (error) {
3337
- log.error(`Adapter Exception: ${error}`);
3338
- done(error);
3339
- }
3340
- } else {
3341
- log.error('getThresholds task is false, skipping test');
3342
- skipCount += 1;
3343
- done();
3344
- }// end if task
2983
+ try {
2984
+ a.getThresholds(null, null, (data, error) => {
2985
+ try {
2986
+ if (stub) {
2987
+ runCommonAsserts(data, error);
2988
+ assert.equal('object', typeof data.response[0]);
2989
+ assert.equal('object', typeof data.response[1]);
2990
+ } else {
2991
+ runCommonAsserts(data, error);
2992
+ }
2993
+ saveMockData('Thresholds', 'getThresholds', 'default', data);
2994
+ done();
2995
+ } catch (err) {
2996
+ log.error(`Test Failure: ${err}`);
2997
+ done(err);
2998
+ }
2999
+ });
3000
+ } catch (error) {
3001
+ log.error(`Adapter Exception: ${error}`);
3002
+ done(error);
3003
+ }
3345
3004
  }).timeout(attemptTimeout);
3346
3005
  });
3347
3006
 
3348
3007
  describe('#getThresholdsThresholdId - errors', () => {
3349
3008
  it('should work if integrated or standalone with mockdata', (done) => {
3350
- if (pronghorn.methodsByName.getThresholdsThresholdId.task) {
3351
- try {
3352
- a.getThresholdsThresholdId('fakedata', (data, error) => {
3353
- try {
3354
- if (stub) {
3355
- runCommonAsserts(data, error);
3356
- assert.equal('string', data.response.id);
3357
- assert.equal('string', data.response.objectType);
3358
- assert.equal('string', data.response.objectInstanceId);
3359
- assert.equal(true, Array.isArray(data.response.subObjectInstanceIds));
3360
- assert.equal('object', typeof data.response.criteria);
3361
- assert.equal('string', data.response.callbackUri);
3362
- assert.equal('object', typeof data.response._links);
3363
- } else {
3364
- runCommonAsserts(data, error);
3365
- }
3366
- saveMockData('Thresholds', 'getThresholdsThresholdId', 'default', data);
3367
- done();
3368
- } catch (err) {
3369
- log.error(`Test Failure: ${err}`);
3370
- done(err);
3371
- }
3372
- });
3373
- } catch (error) {
3374
- log.error(`Adapter Exception: ${error}`);
3375
- done(error);
3376
- }
3377
- } else {
3378
- log.error('getThresholdsThresholdId task is false, skipping test');
3379
- skipCount += 1;
3380
- done();
3381
- }// end if task
3009
+ try {
3010
+ a.getThresholdsThresholdId('fakedata', (data, error) => {
3011
+ try {
3012
+ if (stub) {
3013
+ runCommonAsserts(data, error);
3014
+ assert.equal('string', data.response.id);
3015
+ assert.equal('string', data.response.objectType);
3016
+ assert.equal('string', data.response.objectInstanceId);
3017
+ assert.equal(true, Array.isArray(data.response.subObjectInstanceIds));
3018
+ assert.equal('object', typeof data.response.criteria);
3019
+ assert.equal('string', data.response.callbackUri);
3020
+ assert.equal('object', typeof data.response._links);
3021
+ } else {
3022
+ runCommonAsserts(data, error);
3023
+ }
3024
+ saveMockData('Thresholds', 'getThresholdsThresholdId', 'default', data);
3025
+ done();
3026
+ } catch (err) {
3027
+ log.error(`Test Failure: ${err}`);
3028
+ done(err);
3029
+ }
3030
+ });
3031
+ } catch (error) {
3032
+ log.error(`Adapter Exception: ${error}`);
3033
+ done(error);
3034
+ }
3382
3035
  }).timeout(attemptTimeout);
3383
3036
  });
3384
3037
 
3385
3038
  describe('#patchThresholdsThresholdId - errors', () => {
3386
3039
  it('should work if integrated or standalone with mockdata', (done) => {
3387
- if (pronghorn.methodsByName.patchThresholdsThresholdId.task) {
3388
- try {
3389
- a.patchThresholdsThresholdId('fakedata', (data, error) => {
3390
- try {
3391
- if (stub) {
3392
- runCommonAsserts(data, error);
3393
- assert.equal('success', data.response);
3394
- } else {
3395
- runCommonAsserts(data, error);
3396
- }
3397
- saveMockData('Thresholds', 'patchThresholdsThresholdId', 'default', data);
3398
- done();
3399
- } catch (err) {
3400
- log.error(`Test Failure: ${err}`);
3401
- done(err);
3040
+ try {
3041
+ a.patchThresholdsThresholdId('fakedata', (data, error) => {
3042
+ try {
3043
+ if (stub) {
3044
+ runCommonAsserts(data, error);
3045
+ assert.equal('success', data.response);
3046
+ } else {
3047
+ runCommonAsserts(data, error);
3402
3048
  }
3403
- });
3404
- } catch (error) {
3405
- log.error(`Adapter Exception: ${error}`);
3406
- done(error);
3407
- }
3408
- } else {
3409
- log.error('patchThresholdsThresholdId task is false, skipping test');
3410
- skipCount += 1;
3411
- done();
3412
- }// end if task
3049
+ saveMockData('Thresholds', 'patchThresholdsThresholdId', 'default', data);
3050
+ done();
3051
+ } catch (err) {
3052
+ log.error(`Test Failure: ${err}`);
3053
+ done(err);
3054
+ }
3055
+ });
3056
+ } catch (error) {
3057
+ log.error(`Adapter Exception: ${error}`);
3058
+ done(error);
3059
+ }
3413
3060
  }).timeout(attemptTimeout);
3414
3061
  });
3415
3062
 
3416
3063
  describe('#deleteThresholdsThresholdId - errors', () => {
3417
3064
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
3418
- if (pronghorn.methodsByName.deleteThresholdsThresholdId.task) {
3419
- try {
3420
- a.deleteThresholdsThresholdId('fakedata', (data, error) => {
3421
- try {
3422
- if (stub) {
3423
- const displayE = 'Error 400 received on request';
3424
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
3425
- } else {
3426
- runCommonAsserts(data, error);
3427
- }
3428
- saveMockData('Thresholds', 'deleteThresholdsThresholdId', 'default', data);
3429
- done();
3430
- } catch (err) {
3431
- log.error(`Test Failure: ${err}`);
3432
- done(err);
3065
+ try {
3066
+ a.deleteThresholdsThresholdId('fakedata', (data, error) => {
3067
+ try {
3068
+ if (stub) {
3069
+ const displayE = 'Error 400 received on request';
3070
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
3071
+ } else {
3072
+ runCommonAsserts(data, error);
3433
3073
  }
3434
- });
3435
- } catch (error) {
3436
- log.error(`Adapter Exception: ${error}`);
3437
- done(error);
3438
- }
3439
- } else {
3440
- log.error('deleteThresholdsThresholdId task is false, skipping test');
3441
- skipCount += 1;
3442
- done();
3443
- }// end if task
3074
+ saveMockData('Thresholds', 'deleteThresholdsThresholdId', 'default', data);
3075
+ done();
3076
+ } catch (err) {
3077
+ log.error(`Test Failure: ${err}`);
3078
+ done(err);
3079
+ }
3080
+ });
3081
+ } catch (error) {
3082
+ log.error(`Adapter Exception: ${error}`);
3083
+ done(error);
3084
+ }
3444
3085
  }).timeout(attemptTimeout);
3445
3086
  });
3446
3087
 
3447
3088
  describe('#getVnfSnapshotPackages - errors', () => {
3448
3089
  it('should work if integrated or standalone with mockdata', (done) => {
3449
- if (pronghorn.methodsByName.getVnfSnapshotPackages.task) {
3450
- try {
3451
- a.getVnfSnapshotPackages(null, null, (data, error) => {
3452
- try {
3453
- if (stub) {
3454
- runCommonAsserts(data, error);
3455
- assert.equal('object', typeof data.response[0]);
3456
- assert.equal('object', typeof data.response[1]);
3457
- assert.equal('object', typeof data.response[2]);
3458
- assert.equal('object', typeof data.response[3]);
3459
- } else {
3460
- runCommonAsserts(data, error);
3461
- }
3462
- saveMockData('VnfSnapshotPackages', 'getVnfSnapshotPackages', 'default', data);
3463
- done();
3464
- } catch (err) {
3465
- log.error(`Test Failure: ${err}`);
3466
- done(err);
3467
- }
3468
- });
3469
- } catch (error) {
3470
- log.error(`Adapter Exception: ${error}`);
3471
- done(error);
3472
- }
3473
- } else {
3474
- log.error('getVnfSnapshotPackages task is false, skipping test');
3475
- skipCount += 1;
3476
- done();
3477
- }// end if task
3090
+ try {
3091
+ a.getVnfSnapshotPackages(null, null, (data, error) => {
3092
+ try {
3093
+ if (stub) {
3094
+ runCommonAsserts(data, error);
3095
+ assert.equal('object', typeof data.response[0]);
3096
+ assert.equal('object', typeof data.response[1]);
3097
+ assert.equal('object', typeof data.response[2]);
3098
+ assert.equal('object', typeof data.response[3]);
3099
+ } else {
3100
+ runCommonAsserts(data, error);
3101
+ }
3102
+ saveMockData('VnfSnapshotPackages', 'getVnfSnapshotPackages', 'default', data);
3103
+ done();
3104
+ } catch (err) {
3105
+ log.error(`Test Failure: ${err}`);
3106
+ done(err);
3107
+ }
3108
+ });
3109
+ } catch (error) {
3110
+ log.error(`Adapter Exception: ${error}`);
3111
+ done(error);
3112
+ }
3478
3113
  }).timeout(attemptTimeout);
3479
3114
  });
3480
3115
 
3481
3116
  describe('#getVnfSnapshotPackagesVnfSnapshotPkgId - errors', () => {
3482
3117
  it('should work if integrated or standalone with mockdata', (done) => {
3483
- if (pronghorn.methodsByName.getVnfSnapshotPackagesVnfSnapshotPkgId.task) {
3484
- try {
3485
- a.getVnfSnapshotPackagesVnfSnapshotPkgId('fakedata', null, null, (data, error) => {
3486
- try {
3487
- if (stub) {
3488
- runCommonAsserts(data, error);
3489
- assert.equal('string', data.response.id);
3490
- assert.equal('string', data.response.vnfSnapshotPkgUniqueId);
3491
- assert.equal('string', data.response.name);
3492
- assert.equal('string', data.response.checksum);
3493
- assert.equal('string', data.response.createdAt);
3494
- assert.equal('string', data.response.vnfSnapshotId);
3495
- assert.equal('object', typeof data.response.vnfcSnapshotInfoIds);
3496
- assert.equal(false, data.response.isFullSnapshot);
3497
- assert.equal('object', typeof data.response.vnfdInfo);
3498
- assert.equal('object', typeof data.response.vnfsr);
3499
- assert.equal('object', typeof data.response.vnfcSnapshotImages);
3500
- assert.equal('object', typeof data.response.additionalArtifacts);
3501
- assert.equal('BUILDING', data.response.state);
3502
- assert.equal(true, data.response.isCancelPending);
3503
- assert.equal('object', typeof data.response.failureDetails);
3504
- assert.equal('object', typeof data.response.userDefinedData);
3505
- assert.equal('object', typeof data.response._links);
3506
- } else {
3507
- runCommonAsserts(data, error);
3508
- }
3509
- saveMockData('VnfSnapshotPackages', 'getVnfSnapshotPackagesVnfSnapshotPkgId', 'default', data);
3510
- done();
3511
- } catch (err) {
3512
- log.error(`Test Failure: ${err}`);
3513
- done(err);
3514
- }
3515
- });
3516
- } catch (error) {
3517
- log.error(`Adapter Exception: ${error}`);
3518
- done(error);
3519
- }
3520
- } else {
3521
- log.error('getVnfSnapshotPackagesVnfSnapshotPkgId task is false, skipping test');
3522
- skipCount += 1;
3523
- done();
3524
- }// end if task
3118
+ try {
3119
+ a.getVnfSnapshotPackagesVnfSnapshotPkgId('fakedata', null, null, (data, error) => {
3120
+ try {
3121
+ if (stub) {
3122
+ runCommonAsserts(data, error);
3123
+ assert.equal('string', data.response.id);
3124
+ assert.equal('string', data.response.vnfSnapshotPkgUniqueId);
3125
+ assert.equal('string', data.response.name);
3126
+ assert.equal('string', data.response.checksum);
3127
+ assert.equal('string', data.response.createdAt);
3128
+ assert.equal('string', data.response.vnfSnapshotId);
3129
+ assert.equal('object', typeof data.response.vnfcSnapshotInfoIds);
3130
+ assert.equal(false, data.response.isFullSnapshot);
3131
+ assert.equal('object', typeof data.response.vnfdInfo);
3132
+ assert.equal('object', typeof data.response.vnfsr);
3133
+ assert.equal('object', typeof data.response.vnfcSnapshotImages);
3134
+ assert.equal('object', typeof data.response.additionalArtifacts);
3135
+ assert.equal('BUILDING', data.response.state);
3136
+ assert.equal(true, data.response.isCancelPending);
3137
+ assert.equal('object', typeof data.response.failureDetails);
3138
+ assert.equal('object', typeof data.response.userDefinedData);
3139
+ assert.equal('object', typeof data.response._links);
3140
+ } else {
3141
+ runCommonAsserts(data, error);
3142
+ }
3143
+ saveMockData('VnfSnapshotPackages', 'getVnfSnapshotPackagesVnfSnapshotPkgId', 'default', data);
3144
+ done();
3145
+ } catch (err) {
3146
+ log.error(`Test Failure: ${err}`);
3147
+ done(err);
3148
+ }
3149
+ });
3150
+ } catch (error) {
3151
+ log.error(`Adapter Exception: ${error}`);
3152
+ done(error);
3153
+ }
3525
3154
  }).timeout(attemptTimeout);
3526
3155
  });
3527
3156
 
3528
3157
  describe('#getVnfSnapshotPackagesVnfSnapshotPkgIdPackageContent - errors', () => {
3529
3158
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
3530
- if (pronghorn.methodsByName.getVnfSnapshotPackagesVnfSnapshotPkgIdPackageContent.task) {
3531
- try {
3532
- a.getVnfSnapshotPackagesVnfSnapshotPkgIdPackageContent('fakedata', (data, error) => {
3533
- try {
3534
- if (stub) {
3535
- const displayE = 'Error 400 received on request';
3536
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
3537
- } else {
3538
- runCommonAsserts(data, error);
3539
- }
3540
- saveMockData('VnfSnapshotPackages', 'getVnfSnapshotPackagesVnfSnapshotPkgIdPackageContent', 'default', data);
3541
- done();
3542
- } catch (err) {
3543
- log.error(`Test Failure: ${err}`);
3544
- done(err);
3159
+ try {
3160
+ a.getVnfSnapshotPackagesVnfSnapshotPkgIdPackageContent('fakedata', (data, error) => {
3161
+ try {
3162
+ if (stub) {
3163
+ const displayE = 'Error 400 received on request';
3164
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
3165
+ } else {
3166
+ runCommonAsserts(data, error);
3545
3167
  }
3546
- });
3547
- } catch (error) {
3548
- log.error(`Adapter Exception: ${error}`);
3549
- done(error);
3550
- }
3551
- } else {
3552
- log.error('getVnfSnapshotPackagesVnfSnapshotPkgIdPackageContent task is false, skipping test');
3553
- skipCount += 1;
3554
- done();
3555
- }// end if task
3168
+ saveMockData('VnfSnapshotPackages', 'getVnfSnapshotPackagesVnfSnapshotPkgIdPackageContent', 'default', data);
3169
+ done();
3170
+ } catch (err) {
3171
+ log.error(`Test Failure: ${err}`);
3172
+ done(err);
3173
+ }
3174
+ });
3175
+ } catch (error) {
3176
+ log.error(`Adapter Exception: ${error}`);
3177
+ done(error);
3178
+ }
3556
3179
  }).timeout(attemptTimeout);
3557
3180
  });
3558
3181
 
3559
3182
  describe('#getVnfSnapshotPackagesVnfSnapshotPkgIdArtifactsArtifactPath - errors', () => {
3560
3183
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
3561
- if (pronghorn.methodsByName.getVnfSnapshotPackagesVnfSnapshotPkgIdArtifactsArtifactPath.task) {
3562
- try {
3563
- a.getVnfSnapshotPackagesVnfSnapshotPkgIdArtifactsArtifactPath('fakedata', 'fakedata', (data, error) => {
3564
- try {
3565
- if (stub) {
3566
- const displayE = 'Error 400 received on request';
3567
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
3568
- } else {
3569
- runCommonAsserts(data, error);
3570
- }
3571
- saveMockData('VnfSnapshotPackages', 'getVnfSnapshotPackagesVnfSnapshotPkgIdArtifactsArtifactPath', 'default', data);
3572
- done();
3573
- } catch (err) {
3574
- log.error(`Test Failure: ${err}`);
3575
- done(err);
3184
+ try {
3185
+ a.getVnfSnapshotPackagesVnfSnapshotPkgIdArtifactsArtifactPath('fakedata', 'fakedata', (data, error) => {
3186
+ try {
3187
+ if (stub) {
3188
+ const displayE = 'Error 400 received on request';
3189
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
3190
+ } else {
3191
+ runCommonAsserts(data, error);
3576
3192
  }
3577
- });
3578
- } catch (error) {
3579
- log.error(`Adapter Exception: ${error}`);
3580
- done(error);
3581
- }
3582
- } else {
3583
- log.error('getVnfSnapshotPackagesVnfSnapshotPkgIdArtifactsArtifactPath task is false, skipping test');
3584
- skipCount += 1;
3585
- done();
3586
- }// end if task
3193
+ saveMockData('VnfSnapshotPackages', 'getVnfSnapshotPackagesVnfSnapshotPkgIdArtifactsArtifactPath', 'default', data);
3194
+ done();
3195
+ } catch (err) {
3196
+ log.error(`Test Failure: ${err}`);
3197
+ done(err);
3198
+ }
3199
+ });
3200
+ } catch (error) {
3201
+ log.error(`Adapter Exception: ${error}`);
3202
+ done(error);
3203
+ }
3587
3204
  }).timeout(attemptTimeout);
3588
3205
  });
3589
-
3590
- describe('#Skipped test count', () => {
3591
- it('count skipped tests', (done) => {
3592
- console.log(`skipped ${skipCount} tests because \x1b[33mtask: false\x1b[0m`);
3593
- done();
3594
- });
3595
- });
3596
3206
  });
3597
3207
  });