@itentialopensource/adapter-etsi_sol002 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,8 @@
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');
@@ -15,27 +16,38 @@ const { expect } = require('chai');
15
16
  const { use } = require('chai');
16
17
  const td = require('testdouble');
17
18
  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_sol002',
49
61
  type: 'EtsiSol002',
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
  };
@@ -426,37 +343,29 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
426
343
  -----------------------------------------------------------------------
427
344
  -----------------------------------------------------------------------
428
345
  */
429
- let skipCount = 0;
430
-
431
346
  describe('#getApiVersions - errors', () => {
432
347
  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);
348
+ try {
349
+ a.getApiVersions((data, error) => {
350
+ try {
351
+ if (stub) {
352
+ runCommonAsserts(data, error);
353
+ assert.equal('string', data.response.uriPrefix);
354
+ assert.equal(true, Array.isArray(data.response.apiVersions));
355
+ } else {
356
+ runCommonAsserts(data, error);
449
357
  }
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
358
+ saveMockData('ApiVersions', 'getApiVersions', 'default', data);
359
+ done();
360
+ } catch (err) {
361
+ log.error(`Test Failure: ${err}`);
362
+ done(err);
363
+ }
364
+ });
365
+ } catch (error) {
366
+ log.error(`Adapter Exception: ${error}`);
367
+ done(error);
368
+ }
460
369
  }).timeout(attemptTimeout);
461
370
  });
462
371
 
@@ -510,196 +419,160 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
510
419
  };
511
420
  describe('#patchConfiguration - errors', () => {
512
421
  it('should work if integrated or standalone with mockdata', (done) => {
513
- if (pronghorn.methodsByName.patchConfiguration.task) {
514
- try {
515
- a.patchConfiguration(configurationPatchConfigurationBodyParam, (data, error) => {
516
- try {
517
- if (stub) {
518
- runCommonAsserts(data, error);
519
- assert.equal('success', data.response);
520
- } else {
521
- runCommonAsserts(data, error);
522
- }
523
- saveMockData('Configuration', 'patchConfiguration', 'default', data);
524
- done();
525
- } catch (err) {
526
- log.error(`Test Failure: ${err}`);
527
- done(err);
422
+ try {
423
+ a.patchConfiguration(configurationPatchConfigurationBodyParam, (data, error) => {
424
+ try {
425
+ if (stub) {
426
+ runCommonAsserts(data, error);
427
+ assert.equal('success', data.response);
428
+ } else {
429
+ runCommonAsserts(data, error);
528
430
  }
529
- });
530
- } catch (error) {
531
- log.error(`Adapter Exception: ${error}`);
532
- done(error);
533
- }
534
- } else {
535
- log.error('patchConfiguration task is false, skipping test');
536
- skipCount += 1;
537
- done();
538
- }// end if task
431
+ saveMockData('Configuration', 'patchConfiguration', 'default', data);
432
+ done();
433
+ } catch (err) {
434
+ log.error(`Test Failure: ${err}`);
435
+ done(err);
436
+ }
437
+ });
438
+ } catch (error) {
439
+ log.error(`Adapter Exception: ${error}`);
440
+ done(error);
441
+ }
539
442
  }).timeout(attemptTimeout);
540
443
  });
541
444
 
542
445
  describe('#getConfiguration - errors', () => {
543
446
  it('should work if integrated or standalone with mockdata', (done) => {
544
- if (pronghorn.methodsByName.getConfiguration.task) {
545
- try {
546
- a.getConfiguration((data, error) => {
547
- try {
548
- if (stub) {
549
- runCommonAsserts(data, error);
550
- assert.equal('object', typeof data.response.vnfConfigurationData);
551
- assert.equal(true, Array.isArray(data.response.vnfcConfigurationData));
552
- } else {
553
- runCommonAsserts(data, error);
554
- }
555
- saveMockData('Configuration', 'getConfiguration', 'default', data);
556
- done();
557
- } catch (err) {
558
- log.error(`Test Failure: ${err}`);
559
- done(err);
447
+ try {
448
+ a.getConfiguration((data, error) => {
449
+ try {
450
+ if (stub) {
451
+ runCommonAsserts(data, error);
452
+ assert.equal('object', typeof data.response.vnfConfigurationData);
453
+ assert.equal(true, Array.isArray(data.response.vnfcConfigurationData));
454
+ } else {
455
+ runCommonAsserts(data, error);
560
456
  }
561
- });
562
- } catch (error) {
563
- log.error(`Adapter Exception: ${error}`);
564
- done(error);
565
- }
566
- } else {
567
- log.error('getConfiguration task is false, skipping test');
568
- skipCount += 1;
569
- done();
570
- }// end if task
457
+ saveMockData('Configuration', 'getConfiguration', 'default', data);
458
+ done();
459
+ } catch (err) {
460
+ log.error(`Test Failure: ${err}`);
461
+ done(err);
462
+ }
463
+ });
464
+ } catch (error) {
465
+ log.error(`Adapter Exception: ${error}`);
466
+ done(error);
467
+ }
571
468
  }).timeout(attemptTimeout);
572
469
  });
573
470
 
574
471
  describe('#getIndicators - errors', () => {
575
472
  it('should work if integrated or standalone with mockdata', (done) => {
576
- if (pronghorn.methodsByName.getIndicators.task) {
577
- try {
578
- a.getIndicators(null, null, (data, error) => {
579
- try {
580
- if (stub) {
581
- runCommonAsserts(data, error);
582
- assert.equal('object', typeof data.response[0]);
583
- assert.equal('object', typeof data.response[1]);
584
- } else {
585
- runCommonAsserts(data, error);
586
- }
587
- saveMockData('Indicators', 'getIndicators', 'default', data);
588
- done();
589
- } catch (err) {
590
- log.error(`Test Failure: ${err}`);
591
- done(err);
473
+ try {
474
+ a.getIndicators(null, null, (data, error) => {
475
+ try {
476
+ if (stub) {
477
+ runCommonAsserts(data, error);
478
+ assert.equal('object', typeof data.response[0]);
479
+ assert.equal('object', typeof data.response[1]);
480
+ } else {
481
+ runCommonAsserts(data, error);
592
482
  }
593
- });
594
- } catch (error) {
595
- log.error(`Adapter Exception: ${error}`);
596
- done(error);
597
- }
598
- } else {
599
- log.error('getIndicators task is false, skipping test');
600
- skipCount += 1;
601
- done();
602
- }// end if task
483
+ saveMockData('Indicators', 'getIndicators', '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
+ }
603
494
  }).timeout(attemptTimeout);
604
495
  });
605
496
 
606
497
  describe('#getIndicatorsVnfInstanceId - errors', () => {
607
498
  it('should work if integrated or standalone with mockdata', (done) => {
608
- if (pronghorn.methodsByName.getIndicatorsVnfInstanceId.task) {
609
- try {
610
- a.getIndicatorsVnfInstanceId('fakedata', null, null, (data, error) => {
611
- try {
612
- if (stub) {
613
- runCommonAsserts(data, error);
614
- assert.equal('object', typeof data.response[0]);
615
- assert.equal('object', typeof data.response[1]);
616
- assert.equal('object', typeof data.response[2]);
617
- assert.equal('object', typeof data.response[3]);
618
- } else {
619
- runCommonAsserts(data, error);
620
- }
621
- saveMockData('Indicators', 'getIndicatorsVnfInstanceId', 'default', data);
622
- done();
623
- } catch (err) {
624
- log.error(`Test Failure: ${err}`);
625
- done(err);
499
+ try {
500
+ a.getIndicatorsVnfInstanceId('fakedata', null, null, (data, error) => {
501
+ try {
502
+ if (stub) {
503
+ runCommonAsserts(data, error);
504
+ assert.equal('object', typeof data.response[0]);
505
+ assert.equal('object', typeof data.response[1]);
506
+ assert.equal('object', typeof data.response[2]);
507
+ assert.equal('object', typeof data.response[3]);
508
+ } else {
509
+ runCommonAsserts(data, error);
626
510
  }
627
- });
628
- } catch (error) {
629
- log.error(`Adapter Exception: ${error}`);
630
- done(error);
631
- }
632
- } else {
633
- log.error('getIndicatorsVnfInstanceId task is false, skipping test');
634
- skipCount += 1;
635
- done();
636
- }// end if task
511
+ saveMockData('Indicators', 'getIndicatorsVnfInstanceId', 'default', data);
512
+ done();
513
+ } catch (err) {
514
+ log.error(`Test Failure: ${err}`);
515
+ done(err);
516
+ }
517
+ });
518
+ } catch (error) {
519
+ log.error(`Adapter Exception: ${error}`);
520
+ done(error);
521
+ }
637
522
  }).timeout(attemptTimeout);
638
523
  });
639
524
 
640
525
  describe('#getIndicatorsVnfInstanceIdIndicatorId - errors', () => {
641
526
  it('should work if integrated or standalone with mockdata', (done) => {
642
- if (pronghorn.methodsByName.getIndicatorsVnfInstanceIdIndicatorId.task) {
643
- try {
644
- a.getIndicatorsVnfInstanceIdIndicatorId('fakedata', 'fakedata', (data, error) => {
645
- try {
646
- if (stub) {
647
- runCommonAsserts(data, error);
648
- assert.equal('string', data.response.id);
649
- assert.equal('string', data.response.name);
650
- assert.equal('object', typeof data.response.value);
651
- assert.equal('string', data.response.vnfInstanceId);
652
- assert.equal('object', typeof data.response._links);
653
- } else {
654
- runCommonAsserts(data, error);
655
- }
656
- saveMockData('Indicators', 'getIndicatorsVnfInstanceIdIndicatorId', 'default', data);
657
- done();
658
- } catch (err) {
659
- log.error(`Test Failure: ${err}`);
660
- done(err);
527
+ try {
528
+ a.getIndicatorsVnfInstanceIdIndicatorId('fakedata', 'fakedata', (data, error) => {
529
+ try {
530
+ if (stub) {
531
+ runCommonAsserts(data, error);
532
+ assert.equal('string', data.response.id);
533
+ assert.equal('string', data.response.name);
534
+ assert.equal('object', typeof data.response.value);
535
+ assert.equal('string', data.response.vnfInstanceId);
536
+ assert.equal('object', typeof data.response._links);
537
+ } else {
538
+ runCommonAsserts(data, error);
661
539
  }
662
- });
663
- } catch (error) {
664
- log.error(`Adapter Exception: ${error}`);
665
- done(error);
666
- }
667
- } else {
668
- log.error('getIndicatorsVnfInstanceIdIndicatorId task is false, skipping test');
669
- skipCount += 1;
670
- done();
671
- }// end if task
540
+ saveMockData('Indicators', 'getIndicatorsVnfInstanceIdIndicatorId', 'default', data);
541
+ done();
542
+ } catch (err) {
543
+ log.error(`Test Failure: ${err}`);
544
+ done(err);
545
+ }
546
+ });
547
+ } catch (error) {
548
+ log.error(`Adapter Exception: ${error}`);
549
+ done(error);
550
+ }
672
551
  }).timeout(attemptTimeout);
673
552
  });
674
553
 
675
554
  describe('#getSubscriptions - errors', () => {
676
555
  it('should work if integrated or standalone with mockdata', (done) => {
677
- if (pronghorn.methodsByName.getSubscriptions.task) {
678
- try {
679
- a.getSubscriptions(null, null, (data, error) => {
680
- try {
681
- if (stub) {
682
- runCommonAsserts(data, error);
683
- assert.equal('object', typeof data.response[0]);
684
- } else {
685
- runCommonAsserts(data, error);
686
- }
687
- saveMockData('Subscriptions', 'getSubscriptions', 'default', data);
688
- done();
689
- } catch (err) {
690
- log.error(`Test Failure: ${err}`);
691
- done(err);
556
+ try {
557
+ a.getSubscriptions(null, null, (data, error) => {
558
+ try {
559
+ if (stub) {
560
+ runCommonAsserts(data, error);
561
+ assert.equal('object', typeof data.response[0]);
562
+ } else {
563
+ runCommonAsserts(data, error);
692
564
  }
693
- });
694
- } catch (error) {
695
- log.error(`Adapter Exception: ${error}`);
696
- done(error);
697
- }
698
- } else {
699
- log.error('getSubscriptions task is false, skipping test');
700
- skipCount += 1;
701
- done();
702
- }// end if task
565
+ saveMockData('Subscriptions', 'getSubscriptions', 'default', data);
566
+ done();
567
+ } catch (err) {
568
+ log.error(`Test Failure: ${err}`);
569
+ done(err);
570
+ }
571
+ });
572
+ } catch (error) {
573
+ log.error(`Adapter Exception: ${error}`);
574
+ done(error);
575
+ }
703
576
  }).timeout(attemptTimeout);
704
577
  });
705
578
 
@@ -708,194 +581,164 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
708
581
  };
709
582
  describe('#postSubscriptions - errors', () => {
710
583
  it('should work if integrated or standalone with mockdata', (done) => {
711
- if (pronghorn.methodsByName.postSubscriptions.task) {
712
- try {
713
- a.postSubscriptions(subscriptionsPostSubscriptionsBodyParam, (data, error) => {
714
- try {
715
- if (stub) {
716
- runCommonAsserts(data, error);
717
- assert.equal('object', typeof data.response[0]);
718
- assert.equal('object', typeof data.response[1]);
719
- } else {
720
- runCommonAsserts(data, error);
721
- }
722
- saveMockData('Subscriptions', 'postSubscriptions', 'default', data);
723
- done();
724
- } catch (err) {
725
- log.error(`Test Failure: ${err}`);
726
- done(err);
584
+ try {
585
+ a.postSubscriptions(subscriptionsPostSubscriptionsBodyParam, (data, error) => {
586
+ try {
587
+ if (stub) {
588
+ runCommonAsserts(data, error);
589
+ assert.equal('object', typeof data.response[0]);
590
+ assert.equal('object', typeof data.response[1]);
591
+ } else {
592
+ runCommonAsserts(data, error);
727
593
  }
728
- });
729
- } catch (error) {
730
- log.error(`Adapter Exception: ${error}`);
731
- done(error);
732
- }
733
- } else {
734
- log.error('postSubscriptions task is false, skipping test');
735
- skipCount += 1;
736
- done();
737
- }// end if task
594
+ saveMockData('Subscriptions', 'postSubscriptions', 'default', data);
595
+ done();
596
+ } catch (err) {
597
+ log.error(`Test Failure: ${err}`);
598
+ done(err);
599
+ }
600
+ });
601
+ } catch (error) {
602
+ log.error(`Adapter Exception: ${error}`);
603
+ done(error);
604
+ }
738
605
  }).timeout(attemptTimeout);
739
606
  });
740
607
 
741
608
  describe('#getSubscriptionsSubscriptionId - errors', () => {
742
609
  it('should work if integrated or standalone with mockdata', (done) => {
743
- if (pronghorn.methodsByName.getSubscriptionsSubscriptionId.task) {
744
- try {
745
- a.getSubscriptionsSubscriptionId('fakedata', (data, error) => {
746
- try {
747
- if (stub) {
748
- runCommonAsserts(data, error);
749
- assert.equal('string', data.response.id);
750
- assert.equal('object', typeof data.response.filter);
751
- assert.equal('string', data.response.callbackUri);
752
- assert.equal('object', typeof data.response._links);
753
- } else {
754
- runCommonAsserts(data, error);
755
- }
756
- saveMockData('Subscriptions', 'getSubscriptionsSubscriptionId', 'default', data);
757
- done();
758
- } catch (err) {
759
- log.error(`Test Failure: ${err}`);
760
- done(err);
610
+ try {
611
+ a.getSubscriptionsSubscriptionId('fakedata', (data, error) => {
612
+ try {
613
+ if (stub) {
614
+ runCommonAsserts(data, error);
615
+ assert.equal('string', data.response.id);
616
+ assert.equal('object', typeof data.response.filter);
617
+ assert.equal('string', data.response.callbackUri);
618
+ assert.equal('object', typeof data.response._links);
619
+ } else {
620
+ runCommonAsserts(data, error);
761
621
  }
762
- });
763
- } catch (error) {
764
- log.error(`Adapter Exception: ${error}`);
765
- done(error);
766
- }
767
- } else {
768
- log.error('getSubscriptionsSubscriptionId task is false, skipping test');
769
- skipCount += 1;
770
- done();
771
- }// end if task
622
+ saveMockData('Subscriptions', 'getSubscriptionsSubscriptionId', 'default', data);
623
+ done();
624
+ } catch (err) {
625
+ log.error(`Test Failure: ${err}`);
626
+ done(err);
627
+ }
628
+ });
629
+ } catch (error) {
630
+ log.error(`Adapter Exception: ${error}`);
631
+ done(error);
632
+ }
772
633
  }).timeout(attemptTimeout);
773
634
  });
774
635
 
775
636
  describe('#deleteSubscriptionsSubscriptionId - errors', () => {
776
637
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
777
- if (pronghorn.methodsByName.deleteSubscriptionsSubscriptionId.task) {
778
- try {
779
- a.deleteSubscriptionsSubscriptionId('fakedata', (data, error) => {
780
- try {
781
- if (stub) {
782
- const displayE = 'Error 400 received on request';
783
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
784
- } else {
785
- runCommonAsserts(data, error);
786
- }
787
- saveMockData('Subscriptions', 'deleteSubscriptionsSubscriptionId', 'default', data);
788
- done();
789
- } catch (err) {
790
- log.error(`Test Failure: ${err}`);
791
- done(err);
638
+ try {
639
+ a.deleteSubscriptionsSubscriptionId('fakedata', (data, error) => {
640
+ try {
641
+ if (stub) {
642
+ const displayE = 'Error 400 received on request';
643
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
644
+ } else {
645
+ runCommonAsserts(data, error);
792
646
  }
793
- });
794
- } catch (error) {
795
- log.error(`Adapter Exception: ${error}`);
796
- done(error);
797
- }
798
- } else {
799
- log.error('deleteSubscriptionsSubscriptionId task is false, skipping test');
800
- skipCount += 1;
801
- done();
802
- }// end if task
647
+ saveMockData('Subscriptions', 'deleteSubscriptionsSubscriptionId', 'default', data);
648
+ done();
649
+ } catch (err) {
650
+ log.error(`Test Failure: ${err}`);
651
+ done(err);
652
+ }
653
+ });
654
+ } catch (error) {
655
+ log.error(`Adapter Exception: ${error}`);
656
+ done(error);
657
+ }
803
658
  }).timeout(attemptTimeout);
804
659
  });
805
660
 
806
661
  describe('#getAlarms - errors', () => {
807
662
  it('should work if integrated or standalone with mockdata', (done) => {
808
- if (pronghorn.methodsByName.getAlarms.task) {
809
- try {
810
- a.getAlarms(null, null, (data, error) => {
811
- try {
812
- if (stub) {
813
- runCommonAsserts(data, error);
814
- assert.equal('string', data.response.id);
815
- assert.equal('string', data.response.managedObjectId);
816
- assert.equal(true, Array.isArray(data.response.vnfcInstanceIds));
817
- assert.equal('object', typeof data.response.rootCauseFaultyResource);
818
- assert.equal('string', data.response.alarmRaisedTime);
819
- assert.equal('string', data.response.alarmChangedTime);
820
- assert.equal('string', data.response.alarmClearedTime);
821
- assert.equal('string', data.response.alarmAcknowledgedTime);
822
- assert.equal('ACKNOWLEDGED', data.response.ackState);
823
- assert.equal('CLEARED', data.response.perceivedSeverity);
824
- assert.equal('string', data.response.eventTime);
825
- assert.equal('COMMUNICATIONS_ALARM', data.response.eventType);
826
- assert.equal('string', data.response.faultType);
827
- assert.equal('string', data.response.probableCause);
828
- assert.equal(false, data.response.isRootCause);
829
- assert.equal(true, Array.isArray(data.response.correlatedAlarmIds));
830
- assert.equal(true, Array.isArray(data.response.faultDetails));
831
- assert.equal('object', typeof data.response._links);
832
- } else {
833
- runCommonAsserts(data, error);
834
- }
835
- saveMockData('Alarms', 'getAlarms', 'default', data);
836
- done();
837
- } catch (err) {
838
- log.error(`Test Failure: ${err}`);
839
- done(err);
663
+ try {
664
+ a.getAlarms(null, null, (data, error) => {
665
+ try {
666
+ if (stub) {
667
+ runCommonAsserts(data, error);
668
+ assert.equal('string', data.response.id);
669
+ assert.equal('string', data.response.managedObjectId);
670
+ assert.equal(true, Array.isArray(data.response.vnfcInstanceIds));
671
+ assert.equal('object', typeof data.response.rootCauseFaultyResource);
672
+ assert.equal('string', data.response.alarmRaisedTime);
673
+ assert.equal('string', data.response.alarmChangedTime);
674
+ assert.equal('string', data.response.alarmClearedTime);
675
+ assert.equal('string', data.response.alarmAcknowledgedTime);
676
+ assert.equal('ACKNOWLEDGED', data.response.ackState);
677
+ assert.equal('CLEARED', data.response.perceivedSeverity);
678
+ assert.equal('string', data.response.eventTime);
679
+ assert.equal('COMMUNICATIONS_ALARM', data.response.eventType);
680
+ assert.equal('string', data.response.faultType);
681
+ assert.equal('string', data.response.probableCause);
682
+ assert.equal(false, data.response.isRootCause);
683
+ assert.equal(true, Array.isArray(data.response.correlatedAlarmIds));
684
+ assert.equal(true, Array.isArray(data.response.faultDetails));
685
+ assert.equal('object', typeof data.response._links);
686
+ } else {
687
+ runCommonAsserts(data, error);
840
688
  }
841
- });
842
- } catch (error) {
843
- log.error(`Adapter Exception: ${error}`);
844
- done(error);
845
- }
846
- } else {
847
- log.error('getAlarms task is false, skipping test');
848
- skipCount += 1;
849
- done();
850
- }// end if task
689
+ saveMockData('Alarms', 'getAlarms', 'default', data);
690
+ done();
691
+ } catch (err) {
692
+ log.error(`Test Failure: ${err}`);
693
+ done(err);
694
+ }
695
+ });
696
+ } catch (error) {
697
+ log.error(`Adapter Exception: ${error}`);
698
+ done(error);
699
+ }
851
700
  }).timeout(attemptTimeout);
852
701
  });
853
702
 
854
703
  describe('#getAlarmsAlarmId - errors', () => {
855
704
  it('should work if integrated or standalone with mockdata', (done) => {
856
- if (pronghorn.methodsByName.getAlarmsAlarmId.task) {
857
- try {
858
- a.getAlarmsAlarmId('fakedata', (data, error) => {
859
- try {
860
- if (stub) {
861
- runCommonAsserts(data, error);
862
- assert.equal('string', data.response.id);
863
- assert.equal('string', data.response.managedObjectId);
864
- assert.equal(true, Array.isArray(data.response.vnfcInstanceIds));
865
- assert.equal('object', typeof data.response.rootCauseFaultyResource);
866
- assert.equal('string', data.response.alarmRaisedTime);
867
- assert.equal('string', data.response.alarmChangedTime);
868
- assert.equal('string', data.response.alarmClearedTime);
869
- assert.equal('string', data.response.alarmAcknowledgedTime);
870
- assert.equal('ACKNOWLEDGED', data.response.ackState);
871
- assert.equal('MINOR', data.response.perceivedSeverity);
872
- assert.equal('string', data.response.eventTime);
873
- assert.equal('PROCESSING_ERROR_ALARM', data.response.eventType);
874
- assert.equal('string', data.response.faultType);
875
- assert.equal('string', data.response.probableCause);
876
- assert.equal(true, data.response.isRootCause);
877
- assert.equal(true, Array.isArray(data.response.correlatedAlarmIds));
878
- assert.equal(true, Array.isArray(data.response.faultDetails));
879
- assert.equal('object', typeof data.response._links);
880
- } else {
881
- runCommonAsserts(data, error);
882
- }
883
- saveMockData('Alarms', 'getAlarmsAlarmId', 'default', data);
884
- done();
885
- } catch (err) {
886
- log.error(`Test Failure: ${err}`);
887
- done(err);
705
+ try {
706
+ a.getAlarmsAlarmId('fakedata', (data, error) => {
707
+ try {
708
+ if (stub) {
709
+ runCommonAsserts(data, error);
710
+ assert.equal('string', data.response.id);
711
+ assert.equal('string', data.response.managedObjectId);
712
+ assert.equal(true, Array.isArray(data.response.vnfcInstanceIds));
713
+ assert.equal('object', typeof data.response.rootCauseFaultyResource);
714
+ assert.equal('string', data.response.alarmRaisedTime);
715
+ assert.equal('string', data.response.alarmChangedTime);
716
+ assert.equal('string', data.response.alarmClearedTime);
717
+ assert.equal('string', data.response.alarmAcknowledgedTime);
718
+ assert.equal('ACKNOWLEDGED', data.response.ackState);
719
+ assert.equal('MINOR', data.response.perceivedSeverity);
720
+ assert.equal('string', data.response.eventTime);
721
+ assert.equal('PROCESSING_ERROR_ALARM', data.response.eventType);
722
+ assert.equal('string', data.response.faultType);
723
+ assert.equal('string', data.response.probableCause);
724
+ assert.equal(true, data.response.isRootCause);
725
+ assert.equal(true, Array.isArray(data.response.correlatedAlarmIds));
726
+ assert.equal(true, Array.isArray(data.response.faultDetails));
727
+ assert.equal('object', typeof data.response._links);
728
+ } else {
729
+ runCommonAsserts(data, error);
888
730
  }
889
- });
890
- } catch (error) {
891
- log.error(`Adapter Exception: ${error}`);
892
- done(error);
893
- }
894
- } else {
895
- log.error('getAlarmsAlarmId task is false, skipping test');
896
- skipCount += 1;
897
- done();
898
- }// end if task
731
+ saveMockData('Alarms', 'getAlarmsAlarmId', 'default', data);
732
+ done();
733
+ } catch (err) {
734
+ log.error(`Test Failure: ${err}`);
735
+ done(err);
736
+ }
737
+ });
738
+ } catch (error) {
739
+ log.error(`Adapter Exception: ${error}`);
740
+ done(error);
741
+ }
899
742
  }).timeout(attemptTimeout);
900
743
  });
901
744
 
@@ -904,32 +747,26 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
904
747
  };
905
748
  describe('#patchAlarmsAlarmId - errors', () => {
906
749
  it('should work if integrated or standalone with mockdata', (done) => {
907
- if (pronghorn.methodsByName.patchAlarmsAlarmId.task) {
908
- try {
909
- a.patchAlarmsAlarmId('fakedata', alarmsPatchAlarmsAlarmIdBodyParam, (data, error) => {
910
- try {
911
- if (stub) {
912
- runCommonAsserts(data, error);
913
- assert.equal('success', data.response);
914
- } else {
915
- runCommonAsserts(data, error);
916
- }
917
- saveMockData('Alarms', 'patchAlarmsAlarmId', 'default', data);
918
- done();
919
- } catch (err) {
920
- log.error(`Test Failure: ${err}`);
921
- done(err);
750
+ try {
751
+ a.patchAlarmsAlarmId('fakedata', alarmsPatchAlarmsAlarmIdBodyParam, (data, error) => {
752
+ try {
753
+ if (stub) {
754
+ runCommonAsserts(data, error);
755
+ assert.equal('success', data.response);
756
+ } else {
757
+ runCommonAsserts(data, error);
922
758
  }
923
- });
924
- } catch (error) {
925
- log.error(`Adapter Exception: ${error}`);
926
- done(error);
927
- }
928
- } else {
929
- log.error('patchAlarmsAlarmId task is false, skipping test');
930
- skipCount += 1;
931
- done();
932
- }// end if task
759
+ saveMockData('Alarms', 'patchAlarmsAlarmId', 'default', data);
760
+ done();
761
+ } catch (err) {
762
+ log.error(`Test Failure: ${err}`);
763
+ done(err);
764
+ }
765
+ });
766
+ } catch (error) {
767
+ log.error(`Adapter Exception: ${error}`);
768
+ done(error);
769
+ }
933
770
  }).timeout(attemptTimeout);
934
771
  });
935
772
 
@@ -938,65 +775,53 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
938
775
  };
939
776
  describe('#postAlarmsAlarmIdEscalate - errors', () => {
940
777
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
941
- if (pronghorn.methodsByName.postAlarmsAlarmIdEscalate.task) {
942
- try {
943
- a.postAlarmsAlarmIdEscalate('fakedata', alarmsPostAlarmsAlarmIdEscalateBodyParam, (data, error) => {
944
- try {
945
- if (stub) {
946
- const displayE = 'Error 400 received on request';
947
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
948
- } else {
949
- runCommonAsserts(data, error);
950
- }
951
- saveMockData('Alarms', 'postAlarmsAlarmIdEscalate', 'default', data);
952
- done();
953
- } catch (err) {
954
- log.error(`Test Failure: ${err}`);
955
- done(err);
778
+ try {
779
+ a.postAlarmsAlarmIdEscalate('fakedata', alarmsPostAlarmsAlarmIdEscalateBodyParam, (data, error) => {
780
+ try {
781
+ if (stub) {
782
+ const displayE = 'Error 400 received on request';
783
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
784
+ } else {
785
+ runCommonAsserts(data, error);
956
786
  }
957
- });
958
- } catch (error) {
959
- log.error(`Adapter Exception: ${error}`);
960
- done(error);
961
- }
962
- } else {
963
- log.error('postAlarmsAlarmIdEscalate task is false, skipping test');
964
- skipCount += 1;
965
- done();
966
- }// end if task
787
+ saveMockData('Alarms', 'postAlarmsAlarmIdEscalate', 'default', data);
788
+ done();
789
+ } catch (err) {
790
+ log.error(`Test Failure: ${err}`);
791
+ done(err);
792
+ }
793
+ });
794
+ } catch (error) {
795
+ log.error(`Adapter Exception: ${error}`);
796
+ done(error);
797
+ }
967
798
  }).timeout(attemptTimeout);
968
799
  });
969
800
 
970
801
  describe('#getVnfInstances - errors', () => {
971
802
  it('should work if integrated or standalone with mockdata', (done) => {
972
- if (pronghorn.methodsByName.getVnfInstances.task) {
973
- try {
974
- a.getVnfInstances(null, null, null, null, null, null, (data, error) => {
975
- try {
976
- if (stub) {
977
- runCommonAsserts(data, error);
978
- assert.equal('object', typeof data.response[0]);
979
- assert.equal('object', typeof data.response[1]);
980
- assert.equal('object', typeof data.response[2]);
981
- } else {
982
- runCommonAsserts(data, error);
983
- }
984
- saveMockData('VnfInstances', 'getVnfInstances', 'default', data);
985
- done();
986
- } catch (err) {
987
- log.error(`Test Failure: ${err}`);
988
- done(err);
803
+ try {
804
+ a.getVnfInstances(null, null, null, null, null, null, (data, error) => {
805
+ try {
806
+ if (stub) {
807
+ runCommonAsserts(data, error);
808
+ assert.equal('object', typeof data.response[0]);
809
+ assert.equal('object', typeof data.response[1]);
810
+ assert.equal('object', typeof data.response[2]);
811
+ } else {
812
+ runCommonAsserts(data, error);
989
813
  }
990
- });
991
- } catch (error) {
992
- log.error(`Adapter Exception: ${error}`);
993
- done(error);
994
- }
995
- } else {
996
- log.error('getVnfInstances task is false, skipping test');
997
- skipCount += 1;
998
- done();
999
- }// end if task
814
+ saveMockData('VnfInstances', 'getVnfInstances', 'default', data);
815
+ done();
816
+ } catch (err) {
817
+ log.error(`Test Failure: ${err}`);
818
+ done(err);
819
+ }
820
+ });
821
+ } catch (error) {
822
+ log.error(`Adapter Exception: ${error}`);
823
+ done(error);
824
+ }
1000
825
  }).timeout(attemptTimeout);
1001
826
  });
1002
827
 
@@ -1005,120 +830,102 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
1005
830
  };
1006
831
  describe('#postVnfInstances - errors', () => {
1007
832
  it('should work if integrated or standalone with mockdata', (done) => {
1008
- if (pronghorn.methodsByName.postVnfInstances.task) {
1009
- try {
1010
- a.postVnfInstances(vnfInstancesPostVnfInstancesBodyParam, (data, error) => {
1011
- try {
1012
- if (stub) {
1013
- runCommonAsserts(data, error);
1014
- assert.equal('string', data.response.id);
1015
- assert.equal('string', data.response.vnfInstanceName);
1016
- assert.equal('string', data.response.vnfInstanceDescription);
1017
- assert.equal('string', data.response.vnfdId);
1018
- assert.equal('string', data.response.vnfProvider);
1019
- assert.equal('string', data.response.vnfProductName);
1020
- assert.equal('string', data.response.vnfSoftwareVersion);
1021
- assert.equal('string', data.response.vnfdVersion);
1022
- assert.equal('object', typeof data.response.vnfConfigurableProperties);
1023
- assert.equal('INSTANTIATED', data.response.instantiationState);
1024
- assert.equal('object', typeof data.response.instantiatedVnfInfo);
1025
- assert.equal('object', typeof data.response.metadata);
1026
- assert.equal('object', typeof data.response.extensions);
1027
- assert.equal('object', typeof data.response._links);
1028
- } else {
1029
- runCommonAsserts(data, error);
1030
- }
1031
- saveMockData('VnfInstances', 'postVnfInstances', 'default', data);
1032
- done();
1033
- } catch (err) {
1034
- log.error(`Test Failure: ${err}`);
1035
- done(err);
833
+ try {
834
+ a.postVnfInstances(vnfInstancesPostVnfInstancesBodyParam, (data, error) => {
835
+ try {
836
+ if (stub) {
837
+ runCommonAsserts(data, error);
838
+ assert.equal('string', data.response.id);
839
+ assert.equal('string', data.response.vnfInstanceName);
840
+ assert.equal('string', data.response.vnfInstanceDescription);
841
+ assert.equal('string', data.response.vnfdId);
842
+ assert.equal('string', data.response.vnfProvider);
843
+ assert.equal('string', data.response.vnfProductName);
844
+ assert.equal('string', data.response.vnfSoftwareVersion);
845
+ assert.equal('string', data.response.vnfdVersion);
846
+ assert.equal('object', typeof data.response.vnfConfigurableProperties);
847
+ assert.equal('INSTANTIATED', data.response.instantiationState);
848
+ assert.equal('object', typeof data.response.instantiatedVnfInfo);
849
+ assert.equal('object', typeof data.response.metadata);
850
+ assert.equal('object', typeof data.response.extensions);
851
+ assert.equal('object', typeof data.response._links);
852
+ } else {
853
+ runCommonAsserts(data, error);
1036
854
  }
1037
- });
1038
- } catch (error) {
1039
- log.error(`Adapter Exception: ${error}`);
1040
- done(error);
1041
- }
1042
- } else {
1043
- log.error('postVnfInstances task is false, skipping test');
1044
- skipCount += 1;
1045
- done();
1046
- }// end if task
855
+ saveMockData('VnfInstances', 'postVnfInstances', 'default', data);
856
+ done();
857
+ } catch (err) {
858
+ log.error(`Test Failure: ${err}`);
859
+ done(err);
860
+ }
861
+ });
862
+ } catch (error) {
863
+ log.error(`Adapter Exception: ${error}`);
864
+ done(error);
865
+ }
1047
866
  }).timeout(attemptTimeout);
1048
867
  });
1049
868
 
1050
869
  describe('#getVnfInstancesVnfInstanceId - errors', () => {
1051
870
  it('should work if integrated or standalone with mockdata', (done) => {
1052
- if (pronghorn.methodsByName.getVnfInstancesVnfInstanceId.task) {
1053
- try {
1054
- a.getVnfInstancesVnfInstanceId('fakedata', (data, error) => {
1055
- try {
1056
- if (stub) {
1057
- runCommonAsserts(data, error);
1058
- assert.equal('string', data.response.id);
1059
- assert.equal('string', data.response.vnfInstanceName);
1060
- assert.equal('string', data.response.vnfInstanceDescription);
1061
- assert.equal('string', data.response.vnfdId);
1062
- assert.equal('string', data.response.vnfProvider);
1063
- assert.equal('string', data.response.vnfProductName);
1064
- assert.equal('string', data.response.vnfSoftwareVersion);
1065
- assert.equal('string', data.response.vnfdVersion);
1066
- assert.equal('object', typeof data.response.vnfConfigurableProperties);
1067
- assert.equal('NOT_INSTANTIATED', data.response.instantiationState);
1068
- assert.equal('object', typeof data.response.instantiatedVnfInfo);
1069
- assert.equal('object', typeof data.response.metadata);
1070
- assert.equal('object', typeof data.response.extensions);
1071
- assert.equal('object', typeof data.response._links);
1072
- } else {
1073
- runCommonAsserts(data, error);
1074
- }
1075
- saveMockData('VnfInstances', 'getVnfInstancesVnfInstanceId', 'default', data);
1076
- done();
1077
- } catch (err) {
1078
- log.error(`Test Failure: ${err}`);
1079
- done(err);
871
+ try {
872
+ a.getVnfInstancesVnfInstanceId('fakedata', (data, error) => {
873
+ try {
874
+ if (stub) {
875
+ runCommonAsserts(data, error);
876
+ assert.equal('string', data.response.id);
877
+ assert.equal('string', data.response.vnfInstanceName);
878
+ assert.equal('string', data.response.vnfInstanceDescription);
879
+ assert.equal('string', data.response.vnfdId);
880
+ assert.equal('string', data.response.vnfProvider);
881
+ assert.equal('string', data.response.vnfProductName);
882
+ assert.equal('string', data.response.vnfSoftwareVersion);
883
+ assert.equal('string', data.response.vnfdVersion);
884
+ assert.equal('object', typeof data.response.vnfConfigurableProperties);
885
+ assert.equal('NOT_INSTANTIATED', data.response.instantiationState);
886
+ assert.equal('object', typeof data.response.instantiatedVnfInfo);
887
+ assert.equal('object', typeof data.response.metadata);
888
+ assert.equal('object', typeof data.response.extensions);
889
+ assert.equal('object', typeof data.response._links);
890
+ } else {
891
+ runCommonAsserts(data, error);
1080
892
  }
1081
- });
1082
- } catch (error) {
1083
- log.error(`Adapter Exception: ${error}`);
1084
- done(error);
1085
- }
1086
- } else {
1087
- log.error('getVnfInstancesVnfInstanceId task is false, skipping test');
1088
- skipCount += 1;
1089
- done();
1090
- }// end if task
893
+ saveMockData('VnfInstances', 'getVnfInstancesVnfInstanceId', 'default', data);
894
+ done();
895
+ } catch (err) {
896
+ log.error(`Test Failure: ${err}`);
897
+ done(err);
898
+ }
899
+ });
900
+ } catch (error) {
901
+ log.error(`Adapter Exception: ${error}`);
902
+ done(error);
903
+ }
1091
904
  }).timeout(attemptTimeout);
1092
905
  });
1093
906
 
1094
907
  describe('#deleteVnfInstancesVnfInstanceId - errors', () => {
1095
908
  it('should work if integrated or standalone with mockdata', (done) => {
1096
- if (pronghorn.methodsByName.deleteVnfInstancesVnfInstanceId.task) {
1097
- try {
1098
- a.deleteVnfInstancesVnfInstanceId('fakedata', (data, error) => {
1099
- try {
1100
- if (stub) {
1101
- runCommonAsserts(data, error);
1102
- assert.equal('success', data.response);
1103
- } else {
1104
- runCommonAsserts(data, error);
1105
- }
1106
- saveMockData('VnfInstances', 'deleteVnfInstancesVnfInstanceId', 'default', data);
1107
- done();
1108
- } catch (err) {
1109
- log.error(`Test Failure: ${err}`);
1110
- done(err);
909
+ try {
910
+ a.deleteVnfInstancesVnfInstanceId('fakedata', (data, error) => {
911
+ try {
912
+ if (stub) {
913
+ runCommonAsserts(data, error);
914
+ assert.equal('success', data.response);
915
+ } else {
916
+ runCommonAsserts(data, error);
1111
917
  }
1112
- });
1113
- } catch (error) {
1114
- log.error(`Adapter Exception: ${error}`);
1115
- done(error);
1116
- }
1117
- } else {
1118
- log.error('deleteVnfInstancesVnfInstanceId task is false, skipping test');
1119
- skipCount += 1;
1120
- done();
1121
- }// end if task
918
+ saveMockData('VnfInstances', 'deleteVnfInstancesVnfInstanceId', 'default', data);
919
+ done();
920
+ } catch (err) {
921
+ log.error(`Test Failure: ${err}`);
922
+ done(err);
923
+ }
924
+ });
925
+ } catch (error) {
926
+ log.error(`Adapter Exception: ${error}`);
927
+ done(error);
928
+ }
1122
929
  }).timeout(attemptTimeout);
1123
930
  });
1124
931
 
@@ -1141,32 +948,26 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
1141
948
  };
1142
949
  describe('#patchVnfInstancesVnfInstanceId - errors', () => {
1143
950
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1144
- if (pronghorn.methodsByName.patchVnfInstancesVnfInstanceId.task) {
1145
- try {
1146
- a.patchVnfInstancesVnfInstanceId('fakedata', vnfInstancesPatchVnfInstancesVnfInstanceIdBodyParam, (data, error) => {
1147
- try {
1148
- if (stub) {
1149
- const displayE = 'Error 400 received on request';
1150
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1151
- } else {
1152
- runCommonAsserts(data, error);
1153
- }
1154
- saveMockData('VnfInstances', 'patchVnfInstancesVnfInstanceId', 'default', data);
1155
- done();
1156
- } catch (err) {
1157
- log.error(`Test Failure: ${err}`);
1158
- done(err);
951
+ try {
952
+ a.patchVnfInstancesVnfInstanceId('fakedata', vnfInstancesPatchVnfInstancesVnfInstanceIdBodyParam, (data, error) => {
953
+ try {
954
+ if (stub) {
955
+ const displayE = 'Error 400 received on request';
956
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
957
+ } else {
958
+ runCommonAsserts(data, error);
1159
959
  }
1160
- });
1161
- } catch (error) {
1162
- log.error(`Adapter Exception: ${error}`);
1163
- done(error);
1164
- }
1165
- } else {
1166
- log.error('patchVnfInstancesVnfInstanceId task is false, skipping test');
1167
- skipCount += 1;
1168
- done();
1169
- }// end if task
960
+ saveMockData('VnfInstances', 'patchVnfInstancesVnfInstanceId', 'default', data);
961
+ done();
962
+ } catch (err) {
963
+ log.error(`Test Failure: ${err}`);
964
+ done(err);
965
+ }
966
+ });
967
+ } catch (error) {
968
+ log.error(`Adapter Exception: ${error}`);
969
+ done(error);
970
+ }
1170
971
  }).timeout(attemptTimeout);
1171
972
  });
1172
973
 
@@ -1175,32 +976,26 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
1175
976
  };
1176
977
  describe('#postVnfInstancesVnfInstanceIdInstantiate - errors', () => {
1177
978
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1178
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdInstantiate.task) {
1179
- try {
1180
- a.postVnfInstancesVnfInstanceIdInstantiate('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdInstantiateBodyParam, (data, error) => {
1181
- try {
1182
- if (stub) {
1183
- const displayE = 'Error 400 received on request';
1184
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1185
- } else {
1186
- runCommonAsserts(data, error);
1187
- }
1188
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdInstantiate', 'default', data);
1189
- done();
1190
- } catch (err) {
1191
- log.error(`Test Failure: ${err}`);
1192
- done(err);
979
+ try {
980
+ a.postVnfInstancesVnfInstanceIdInstantiate('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdInstantiateBodyParam, (data, error) => {
981
+ try {
982
+ if (stub) {
983
+ const displayE = 'Error 400 received on request';
984
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
985
+ } else {
986
+ runCommonAsserts(data, error);
1193
987
  }
1194
- });
1195
- } catch (error) {
1196
- log.error(`Adapter Exception: ${error}`);
1197
- done(error);
1198
- }
1199
- } else {
1200
- log.error('postVnfInstancesVnfInstanceIdInstantiate task is false, skipping test');
1201
- skipCount += 1;
1202
- done();
1203
- }// end if task
988
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdInstantiate', 'default', data);
989
+ done();
990
+ } catch (err) {
991
+ log.error(`Test Failure: ${err}`);
992
+ done(err);
993
+ }
994
+ });
995
+ } catch (error) {
996
+ log.error(`Adapter Exception: ${error}`);
997
+ done(error);
998
+ }
1204
999
  }).timeout(attemptTimeout);
1205
1000
  });
1206
1001
 
@@ -1210,32 +1005,26 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
1210
1005
  };
1211
1006
  describe('#postVnfInstancesVnfInstanceIdScale - errors', () => {
1212
1007
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1213
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdScale.task) {
1214
- try {
1215
- a.postVnfInstancesVnfInstanceIdScale('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdScaleBodyParam, (data, error) => {
1216
- try {
1217
- if (stub) {
1218
- const displayE = 'Error 400 received on request';
1219
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1220
- } else {
1221
- runCommonAsserts(data, error);
1222
- }
1223
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdScale', 'default', data);
1224
- done();
1225
- } catch (err) {
1226
- log.error(`Test Failure: ${err}`);
1227
- done(err);
1008
+ try {
1009
+ a.postVnfInstancesVnfInstanceIdScale('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdScaleBodyParam, (data, error) => {
1010
+ try {
1011
+ if (stub) {
1012
+ const displayE = 'Error 400 received on request';
1013
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1014
+ } else {
1015
+ runCommonAsserts(data, error);
1228
1016
  }
1229
- });
1230
- } catch (error) {
1231
- log.error(`Adapter Exception: ${error}`);
1232
- done(error);
1233
- }
1234
- } else {
1235
- log.error('postVnfInstancesVnfInstanceIdScale task is false, skipping test');
1236
- skipCount += 1;
1237
- done();
1238
- }// end if task
1017
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdScale', 'default', data);
1018
+ done();
1019
+ } catch (err) {
1020
+ log.error(`Test Failure: ${err}`);
1021
+ done(err);
1022
+ }
1023
+ });
1024
+ } catch (error) {
1025
+ log.error(`Adapter Exception: ${error}`);
1026
+ done(error);
1027
+ }
1239
1028
  }).timeout(attemptTimeout);
1240
1029
  });
1241
1030
 
@@ -1252,32 +1041,26 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
1252
1041
  };
1253
1042
  describe('#postVnfInstancesVnfInstanceIdScaleToLevel - errors', () => {
1254
1043
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1255
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdScaleToLevel.task) {
1256
- try {
1257
- a.postVnfInstancesVnfInstanceIdScaleToLevel('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdScaleToLevelBodyParam, (data, error) => {
1258
- try {
1259
- if (stub) {
1260
- const displayE = 'Error 400 received on request';
1261
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1262
- } else {
1263
- runCommonAsserts(data, error);
1264
- }
1265
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdScaleToLevel', 'default', data);
1266
- done();
1267
- } catch (err) {
1268
- log.error(`Test Failure: ${err}`);
1269
- done(err);
1044
+ try {
1045
+ a.postVnfInstancesVnfInstanceIdScaleToLevel('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdScaleToLevelBodyParam, (data, error) => {
1046
+ try {
1047
+ if (stub) {
1048
+ const displayE = 'Error 400 received on request';
1049
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1050
+ } else {
1051
+ runCommonAsserts(data, error);
1270
1052
  }
1271
- });
1272
- } catch (error) {
1273
- log.error(`Adapter Exception: ${error}`);
1274
- done(error);
1275
- }
1276
- } else {
1277
- log.error('postVnfInstancesVnfInstanceIdScaleToLevel task is false, skipping test');
1278
- skipCount += 1;
1279
- done();
1280
- }// end if task
1053
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdScaleToLevel', 'default', data);
1054
+ done();
1055
+ } catch (err) {
1056
+ log.error(`Test Failure: ${err}`);
1057
+ done(err);
1058
+ }
1059
+ });
1060
+ } catch (error) {
1061
+ log.error(`Adapter Exception: ${error}`);
1062
+ done(error);
1063
+ }
1281
1064
  }).timeout(attemptTimeout);
1282
1065
  });
1283
1066
 
@@ -1286,32 +1069,26 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
1286
1069
  };
1287
1070
  describe('#postVnfInstancesVnfInstanceIdChangeFlavour - errors', () => {
1288
1071
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1289
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdChangeFlavour.task) {
1290
- try {
1291
- a.postVnfInstancesVnfInstanceIdChangeFlavour('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdChangeFlavourBodyParam, (data, error) => {
1292
- try {
1293
- if (stub) {
1294
- const displayE = 'Error 400 received on request';
1295
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1296
- } else {
1297
- runCommonAsserts(data, error);
1298
- }
1299
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdChangeFlavour', 'default', data);
1300
- done();
1301
- } catch (err) {
1302
- log.error(`Test Failure: ${err}`);
1303
- done(err);
1072
+ try {
1073
+ a.postVnfInstancesVnfInstanceIdChangeFlavour('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdChangeFlavourBodyParam, (data, error) => {
1074
+ try {
1075
+ if (stub) {
1076
+ const displayE = 'Error 400 received on request';
1077
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1078
+ } else {
1079
+ runCommonAsserts(data, error);
1304
1080
  }
1305
- });
1306
- } catch (error) {
1307
- log.error(`Adapter Exception: ${error}`);
1308
- done(error);
1309
- }
1310
- } else {
1311
- log.error('postVnfInstancesVnfInstanceIdChangeFlavour task is false, skipping test');
1312
- skipCount += 1;
1313
- done();
1314
- }// end if task
1081
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdChangeFlavour', 'default', data);
1082
+ done();
1083
+ } catch (err) {
1084
+ log.error(`Test Failure: ${err}`);
1085
+ done(err);
1086
+ }
1087
+ });
1088
+ } catch (error) {
1089
+ log.error(`Adapter Exception: ${error}`);
1090
+ done(error);
1091
+ }
1315
1092
  }).timeout(attemptTimeout);
1316
1093
  });
1317
1094
 
@@ -1320,32 +1097,26 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
1320
1097
  };
1321
1098
  describe('#postVnfInstancesVnfInstanceIdTerminate - errors', () => {
1322
1099
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1323
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdTerminate.task) {
1324
- try {
1325
- a.postVnfInstancesVnfInstanceIdTerminate('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdTerminateBodyParam, (data, error) => {
1326
- try {
1327
- if (stub) {
1328
- const displayE = 'Error 400 received on request';
1329
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1330
- } else {
1331
- runCommonAsserts(data, error);
1332
- }
1333
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdTerminate', 'default', data);
1334
- done();
1335
- } catch (err) {
1336
- log.error(`Test Failure: ${err}`);
1337
- done(err);
1100
+ try {
1101
+ a.postVnfInstancesVnfInstanceIdTerminate('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdTerminateBodyParam, (data, error) => {
1102
+ try {
1103
+ if (stub) {
1104
+ const displayE = 'Error 400 received on request';
1105
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1106
+ } else {
1107
+ runCommonAsserts(data, error);
1338
1108
  }
1339
- });
1340
- } catch (error) {
1341
- log.error(`Adapter Exception: ${error}`);
1342
- done(error);
1343
- }
1344
- } else {
1345
- log.error('postVnfInstancesVnfInstanceIdTerminate task is false, skipping test');
1346
- skipCount += 1;
1347
- done();
1348
- }// end if task
1109
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdTerminate', 'default', data);
1110
+ done();
1111
+ } catch (err) {
1112
+ log.error(`Test Failure: ${err}`);
1113
+ done(err);
1114
+ }
1115
+ });
1116
+ } catch (error) {
1117
+ log.error(`Adapter Exception: ${error}`);
1118
+ done(error);
1119
+ }
1349
1120
  }).timeout(attemptTimeout);
1350
1121
  });
1351
1122
 
@@ -1359,32 +1130,26 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
1359
1130
  };
1360
1131
  describe('#postVnfInstancesVnfInstanceIdHeal - errors', () => {
1361
1132
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1362
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdHeal.task) {
1363
- try {
1364
- a.postVnfInstancesVnfInstanceIdHeal('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdHealBodyParam, (data, error) => {
1365
- try {
1366
- if (stub) {
1367
- const displayE = 'Error 400 received on request';
1368
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1369
- } else {
1370
- runCommonAsserts(data, error);
1371
- }
1372
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdHeal', 'default', data);
1373
- done();
1374
- } catch (err) {
1375
- log.error(`Test Failure: ${err}`);
1376
- done(err);
1133
+ try {
1134
+ a.postVnfInstancesVnfInstanceIdHeal('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdHealBodyParam, (data, error) => {
1135
+ try {
1136
+ if (stub) {
1137
+ const displayE = 'Error 400 received on request';
1138
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1139
+ } else {
1140
+ runCommonAsserts(data, error);
1377
1141
  }
1378
- });
1379
- } catch (error) {
1380
- log.error(`Adapter Exception: ${error}`);
1381
- done(error);
1382
- }
1383
- } else {
1384
- log.error('postVnfInstancesVnfInstanceIdHeal task is false, skipping test');
1385
- skipCount += 1;
1386
- done();
1387
- }// end if task
1142
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdHeal', 'default', data);
1143
+ done();
1144
+ } catch (err) {
1145
+ log.error(`Test Failure: ${err}`);
1146
+ done(err);
1147
+ }
1148
+ });
1149
+ } catch (error) {
1150
+ log.error(`Adapter Exception: ${error}`);
1151
+ done(error);
1152
+ }
1388
1153
  }).timeout(attemptTimeout);
1389
1154
  });
1390
1155
 
@@ -1393,32 +1158,26 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
1393
1158
  };
1394
1159
  describe('#postVnfInstancesVnfInstanceIdOperate - errors', () => {
1395
1160
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1396
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdOperate.task) {
1397
- try {
1398
- a.postVnfInstancesVnfInstanceIdOperate('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdOperateBodyParam, (data, error) => {
1399
- try {
1400
- if (stub) {
1401
- const displayE = 'Error 400 received on request';
1402
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1403
- } else {
1404
- runCommonAsserts(data, error);
1405
- }
1406
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdOperate', 'default', data);
1407
- done();
1408
- } catch (err) {
1409
- log.error(`Test Failure: ${err}`);
1410
- done(err);
1161
+ try {
1162
+ a.postVnfInstancesVnfInstanceIdOperate('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdOperateBodyParam, (data, error) => {
1163
+ try {
1164
+ if (stub) {
1165
+ const displayE = 'Error 400 received on request';
1166
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1167
+ } else {
1168
+ runCommonAsserts(data, error);
1411
1169
  }
1412
- });
1413
- } catch (error) {
1414
- log.error(`Adapter Exception: ${error}`);
1415
- done(error);
1416
- }
1417
- } else {
1418
- log.error('postVnfInstancesVnfInstanceIdOperate task is false, skipping test');
1419
- skipCount += 1;
1420
- done();
1421
- }// end if task
1170
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdOperate', 'default', data);
1171
+ done();
1172
+ } catch (err) {
1173
+ log.error(`Test Failure: ${err}`);
1174
+ done(err);
1175
+ }
1176
+ });
1177
+ } catch (error) {
1178
+ log.error(`Adapter Exception: ${error}`);
1179
+ done(error);
1180
+ }
1422
1181
  }).timeout(attemptTimeout);
1423
1182
  });
1424
1183
 
@@ -1429,32 +1188,26 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
1429
1188
  };
1430
1189
  describe('#postVnfInstancesVnfInstanceIdChangeExtConn - errors', () => {
1431
1190
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1432
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdChangeExtConn.task) {
1433
- try {
1434
- a.postVnfInstancesVnfInstanceIdChangeExtConn('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdChangeExtConnBodyParam, (data, error) => {
1435
- try {
1436
- if (stub) {
1437
- const displayE = 'Error 400 received on request';
1438
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1439
- } else {
1440
- runCommonAsserts(data, error);
1441
- }
1442
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdChangeExtConn', 'default', data);
1443
- done();
1444
- } catch (err) {
1445
- log.error(`Test Failure: ${err}`);
1446
- done(err);
1191
+ try {
1192
+ a.postVnfInstancesVnfInstanceIdChangeExtConn('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdChangeExtConnBodyParam, (data, error) => {
1193
+ try {
1194
+ if (stub) {
1195
+ const displayE = 'Error 400 received on request';
1196
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1197
+ } else {
1198
+ runCommonAsserts(data, error);
1447
1199
  }
1448
- });
1449
- } catch (error) {
1450
- log.error(`Adapter Exception: ${error}`);
1451
- done(error);
1452
- }
1453
- } else {
1454
- log.error('postVnfInstancesVnfInstanceIdChangeExtConn task is false, skipping test');
1455
- skipCount += 1;
1456
- done();
1457
- }// end if task
1200
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdChangeExtConn', 'default', data);
1201
+ done();
1202
+ } catch (err) {
1203
+ log.error(`Test Failure: ${err}`);
1204
+ done(err);
1205
+ }
1206
+ });
1207
+ } catch (error) {
1208
+ log.error(`Adapter Exception: ${error}`);
1209
+ done(error);
1210
+ }
1458
1211
  }).timeout(attemptTimeout);
1459
1212
  });
1460
1213
 
@@ -1463,64 +1216,52 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
1463
1216
  };
1464
1217
  describe('#postVnfInstancesVnfInstanceIdChangeVnfpkg - errors', () => {
1465
1218
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1466
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdChangeVnfpkg.task) {
1467
- try {
1468
- a.postVnfInstancesVnfInstanceIdChangeVnfpkg('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdChangeVnfpkgBodyParam, (data, error) => {
1469
- try {
1470
- if (stub) {
1471
- const displayE = 'Error 400 received on request';
1472
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1473
- } else {
1474
- runCommonAsserts(data, error);
1475
- }
1476
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdChangeVnfpkg', 'default', data);
1477
- done();
1478
- } catch (err) {
1479
- log.error(`Test Failure: ${err}`);
1480
- done(err);
1219
+ try {
1220
+ a.postVnfInstancesVnfInstanceIdChangeVnfpkg('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdChangeVnfpkgBodyParam, (data, error) => {
1221
+ try {
1222
+ if (stub) {
1223
+ const displayE = 'Error 400 received on request';
1224
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1225
+ } else {
1226
+ runCommonAsserts(data, error);
1481
1227
  }
1482
- });
1483
- } catch (error) {
1484
- log.error(`Adapter Exception: ${error}`);
1485
- done(error);
1486
- }
1487
- } else {
1488
- log.error('postVnfInstancesVnfInstanceIdChangeVnfpkg task is false, skipping test');
1489
- skipCount += 1;
1490
- done();
1491
- }// end if task
1492
- }).timeout(attemptTimeout);
1493
- });
1494
-
1228
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdChangeVnfpkg', 'default', data);
1229
+ done();
1230
+ } catch (err) {
1231
+ log.error(`Test Failure: ${err}`);
1232
+ done(err);
1233
+ }
1234
+ });
1235
+ } catch (error) {
1236
+ log.error(`Adapter Exception: ${error}`);
1237
+ done(error);
1238
+ }
1239
+ }).timeout(attemptTimeout);
1240
+ });
1241
+
1495
1242
  const vnfInstancesPostVnfInstancesVnfInstanceIdCreateSnapshotBodyParam = {};
1496
1243
  describe('#postVnfInstancesVnfInstanceIdCreateSnapshot - errors', () => {
1497
1244
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1498
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdCreateSnapshot.task) {
1499
- try {
1500
- a.postVnfInstancesVnfInstanceIdCreateSnapshot('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdCreateSnapshotBodyParam, (data, error) => {
1501
- try {
1502
- if (stub) {
1503
- const displayE = 'Error 400 received on request';
1504
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1505
- } else {
1506
- runCommonAsserts(data, error);
1507
- }
1508
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdCreateSnapshot', 'default', data);
1509
- done();
1510
- } catch (err) {
1511
- log.error(`Test Failure: ${err}`);
1512
- done(err);
1245
+ try {
1246
+ a.postVnfInstancesVnfInstanceIdCreateSnapshot('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdCreateSnapshotBodyParam, (data, error) => {
1247
+ try {
1248
+ if (stub) {
1249
+ const displayE = 'Error 400 received on request';
1250
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1251
+ } else {
1252
+ runCommonAsserts(data, error);
1513
1253
  }
1514
- });
1515
- } catch (error) {
1516
- log.error(`Adapter Exception: ${error}`);
1517
- done(error);
1518
- }
1519
- } else {
1520
- log.error('postVnfInstancesVnfInstanceIdCreateSnapshot task is false, skipping test');
1521
- skipCount += 1;
1522
- done();
1523
- }// end if task
1254
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdCreateSnapshot', 'default', data);
1255
+ done();
1256
+ } catch (err) {
1257
+ log.error(`Test Failure: ${err}`);
1258
+ done(err);
1259
+ }
1260
+ });
1261
+ } catch (error) {
1262
+ log.error(`Adapter Exception: ${error}`);
1263
+ done(error);
1264
+ }
1524
1265
  }).timeout(attemptTimeout);
1525
1266
  });
1526
1267
 
@@ -1532,269 +1273,227 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
1532
1273
  };
1533
1274
  describe('#postVnfInstancesVnfInstanceIdRevertToSnapshot - errors', () => {
1534
1275
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1535
- if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdRevertToSnapshot.task) {
1536
- try {
1537
- a.postVnfInstancesVnfInstanceIdRevertToSnapshot('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdRevertToSnapshotBodyParam, (data, error) => {
1538
- try {
1539
- if (stub) {
1540
- const displayE = 'Error 400 received on request';
1541
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1542
- } else {
1543
- runCommonAsserts(data, error);
1544
- }
1545
- saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdRevertToSnapshot', 'default', data);
1546
- done();
1547
- } catch (err) {
1548
- log.error(`Test Failure: ${err}`);
1549
- done(err);
1276
+ try {
1277
+ a.postVnfInstancesVnfInstanceIdRevertToSnapshot('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdRevertToSnapshotBodyParam, (data, error) => {
1278
+ try {
1279
+ if (stub) {
1280
+ const displayE = 'Error 400 received on request';
1281
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1282
+ } else {
1283
+ runCommonAsserts(data, error);
1550
1284
  }
1551
- });
1552
- } catch (error) {
1553
- log.error(`Adapter Exception: ${error}`);
1554
- done(error);
1555
- }
1556
- } else {
1557
- log.error('postVnfInstancesVnfInstanceIdRevertToSnapshot task is false, skipping test');
1558
- skipCount += 1;
1559
- done();
1560
- }// end if task
1285
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdRevertToSnapshot', 'default', data);
1286
+ done();
1287
+ } catch (err) {
1288
+ log.error(`Test Failure: ${err}`);
1289
+ done(err);
1290
+ }
1291
+ });
1292
+ } catch (error) {
1293
+ log.error(`Adapter Exception: ${error}`);
1294
+ done(error);
1295
+ }
1561
1296
  }).timeout(attemptTimeout);
1562
1297
  });
1563
1298
 
1564
1299
  describe('#getVnfLcmOpOccs - errors', () => {
1565
1300
  it('should work if integrated or standalone with mockdata', (done) => {
1566
- if (pronghorn.methodsByName.getVnfLcmOpOccs.task) {
1567
- try {
1568
- a.getVnfLcmOpOccs(null, null, null, null, null, null, (data, error) => {
1569
- try {
1570
- if (stub) {
1571
- runCommonAsserts(data, error);
1572
- assert.equal('string', data.response.id);
1573
- assert.equal('COMPLETED', data.response.operationState);
1574
- assert.equal('string', data.response.stateEnteredTime);
1575
- assert.equal('string', data.response.startTime);
1576
- assert.equal('string', data.response.vnfInstanceId);
1577
- assert.equal('string', data.response.grantId);
1578
- assert.equal('INSTANTIATE', data.response.operation);
1579
- assert.equal(false, data.response.isAutomaticInvocation);
1580
- assert.equal('object', typeof data.response.operationParams);
1581
- assert.equal(true, data.response.isCancelPending);
1582
- assert.equal('GRACEFUL', data.response.cancelMode);
1583
- assert.equal('object', typeof data.response.error);
1584
- assert.equal('object', typeof data.response.resourceChanges);
1585
- assert.equal('object', typeof data.response.changedInfo);
1586
- assert.equal(true, Array.isArray(data.response.changedExtConnectivity));
1587
- assert.equal('object', typeof data.response.modificationsTriggeredByVnfPkgChange);
1588
- assert.equal('string', data.response.vnfSnapshotInfoId);
1589
- assert.equal('object', typeof data.response._links);
1590
- } else {
1591
- runCommonAsserts(data, error);
1592
- }
1593
- saveMockData('VnfLcmOpOccs', 'getVnfLcmOpOccs', 'default', data);
1594
- done();
1595
- } catch (err) {
1596
- log.error(`Test Failure: ${err}`);
1597
- done(err);
1301
+ try {
1302
+ a.getVnfLcmOpOccs(null, null, null, null, null, null, (data, error) => {
1303
+ try {
1304
+ if (stub) {
1305
+ runCommonAsserts(data, error);
1306
+ assert.equal('string', data.response.id);
1307
+ assert.equal('COMPLETED', data.response.operationState);
1308
+ assert.equal('string', data.response.stateEnteredTime);
1309
+ assert.equal('string', data.response.startTime);
1310
+ assert.equal('string', data.response.vnfInstanceId);
1311
+ assert.equal('string', data.response.grantId);
1312
+ assert.equal('INSTANTIATE', data.response.operation);
1313
+ assert.equal(false, data.response.isAutomaticInvocation);
1314
+ assert.equal('object', typeof data.response.operationParams);
1315
+ assert.equal(true, data.response.isCancelPending);
1316
+ assert.equal('GRACEFUL', data.response.cancelMode);
1317
+ assert.equal('object', typeof data.response.error);
1318
+ assert.equal('object', typeof data.response.resourceChanges);
1319
+ assert.equal('object', typeof data.response.changedInfo);
1320
+ assert.equal(true, Array.isArray(data.response.changedExtConnectivity));
1321
+ assert.equal('object', typeof data.response.modificationsTriggeredByVnfPkgChange);
1322
+ assert.equal('string', data.response.vnfSnapshotInfoId);
1323
+ assert.equal('object', typeof data.response._links);
1324
+ } else {
1325
+ runCommonAsserts(data, error);
1598
1326
  }
1599
- });
1600
- } catch (error) {
1601
- log.error(`Adapter Exception: ${error}`);
1602
- done(error);
1603
- }
1604
- } else {
1605
- log.error('getVnfLcmOpOccs task is false, skipping test');
1606
- skipCount += 1;
1607
- done();
1608
- }// end if task
1327
+ saveMockData('VnfLcmOpOccs', 'getVnfLcmOpOccs', '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
+ }
1609
1338
  }).timeout(attemptTimeout);
1610
1339
  });
1611
1340
 
1612
1341
  describe('#getVnfLcmOpOccsVnfLcmOpOccId - errors', () => {
1613
1342
  it('should work if integrated or standalone with mockdata', (done) => {
1614
- if (pronghorn.methodsByName.getVnfLcmOpOccsVnfLcmOpOccId.task) {
1615
- try {
1616
- a.getVnfLcmOpOccsVnfLcmOpOccId('fakedata', (data, error) => {
1617
- try {
1618
- if (stub) {
1619
- runCommonAsserts(data, error);
1620
- assert.equal('string', data.response.id);
1621
- assert.equal('ROLLING_BACK', data.response.operationState);
1622
- assert.equal('string', data.response.stateEnteredTime);
1623
- assert.equal('string', data.response.startTime);
1624
- assert.equal('string', data.response.vnfInstanceId);
1625
- assert.equal('string', data.response.grantId);
1626
- assert.equal('SCALE_TO_LEVEL', data.response.operation);
1627
- assert.equal(true, data.response.isAutomaticInvocation);
1628
- assert.equal('object', typeof data.response.operationParams);
1629
- assert.equal(false, data.response.isCancelPending);
1630
- assert.equal('FORCEFUL', data.response.cancelMode);
1631
- assert.equal('object', typeof data.response.error);
1632
- assert.equal('object', typeof data.response.resourceChanges);
1633
- assert.equal('object', typeof data.response.changedInfo);
1634
- assert.equal(true, Array.isArray(data.response.changedExtConnectivity));
1635
- assert.equal('object', typeof data.response.modificationsTriggeredByVnfPkgChange);
1636
- assert.equal('string', data.response.vnfSnapshotInfoId);
1637
- assert.equal('object', typeof data.response._links);
1638
- } else {
1639
- runCommonAsserts(data, error);
1640
- }
1641
- saveMockData('VnfLcmOpOccs', 'getVnfLcmOpOccsVnfLcmOpOccId', 'default', data);
1642
- done();
1643
- } catch (err) {
1644
- log.error(`Test Failure: ${err}`);
1645
- done(err);
1343
+ try {
1344
+ a.getVnfLcmOpOccsVnfLcmOpOccId('fakedata', (data, error) => {
1345
+ try {
1346
+ if (stub) {
1347
+ runCommonAsserts(data, error);
1348
+ assert.equal('string', data.response.id);
1349
+ assert.equal('ROLLING_BACK', 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('SCALE_TO_LEVEL', data.response.operation);
1355
+ assert.equal(true, data.response.isAutomaticInvocation);
1356
+ assert.equal('object', typeof data.response.operationParams);
1357
+ assert.equal(false, data.response.isCancelPending);
1358
+ assert.equal('FORCEFUL', 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);
1646
1368
  }
1647
- });
1648
- } catch (error) {
1649
- log.error(`Adapter Exception: ${error}`);
1650
- done(error);
1651
- }
1652
- } else {
1653
- log.error('getVnfLcmOpOccsVnfLcmOpOccId task is false, skipping test');
1654
- skipCount += 1;
1655
- done();
1656
- }// end if task
1369
+ saveMockData('VnfLcmOpOccs', 'getVnfLcmOpOccsVnfLcmOpOccId', '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
+ }
1657
1380
  }).timeout(attemptTimeout);
1658
1381
  });
1659
1382
 
1660
1383
  describe('#postVnfLcmOpOccsVnfLcmOpOccIdRetry - errors', () => {
1661
1384
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1662
- if (pronghorn.methodsByName.postVnfLcmOpOccsVnfLcmOpOccIdRetry.task) {
1663
- try {
1664
- a.postVnfLcmOpOccsVnfLcmOpOccIdRetry('fakedata', (data, error) => {
1665
- try {
1666
- if (stub) {
1667
- const displayE = 'Error 400 received on request';
1668
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1669
- } else {
1670
- runCommonAsserts(data, error);
1671
- }
1672
- saveMockData('VnfLcmOpOccs', 'postVnfLcmOpOccsVnfLcmOpOccIdRetry', 'default', data);
1673
- done();
1674
- } catch (err) {
1675
- log.error(`Test Failure: ${err}`);
1676
- done(err);
1385
+ try {
1386
+ a.postVnfLcmOpOccsVnfLcmOpOccIdRetry('fakedata', (data, error) => {
1387
+ try {
1388
+ if (stub) {
1389
+ const displayE = 'Error 400 received on request';
1390
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1391
+ } else {
1392
+ runCommonAsserts(data, error);
1677
1393
  }
1678
- });
1679
- } catch (error) {
1680
- log.error(`Adapter Exception: ${error}`);
1681
- done(error);
1682
- }
1683
- } else {
1684
- log.error('postVnfLcmOpOccsVnfLcmOpOccIdRetry task is false, skipping test');
1685
- skipCount += 1;
1686
- done();
1687
- }// end if task
1394
+ saveMockData('VnfLcmOpOccs', 'postVnfLcmOpOccsVnfLcmOpOccIdRetry', 'default', data);
1395
+ done();
1396
+ } catch (err) {
1397
+ log.error(`Test Failure: ${err}`);
1398
+ done(err);
1399
+ }
1400
+ });
1401
+ } catch (error) {
1402
+ log.error(`Adapter Exception: ${error}`);
1403
+ done(error);
1404
+ }
1688
1405
  }).timeout(attemptTimeout);
1689
1406
  });
1690
1407
 
1691
1408
  describe('#postVnfLcmOpOccsVnfLcmOpOccIdRollback - errors', () => {
1692
1409
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1693
- if (pronghorn.methodsByName.postVnfLcmOpOccsVnfLcmOpOccIdRollback.task) {
1694
- try {
1695
- a.postVnfLcmOpOccsVnfLcmOpOccIdRollback('fakedata', (data, error) => {
1696
- try {
1697
- if (stub) {
1698
- const displayE = 'Error 400 received on request';
1699
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1700
- } else {
1701
- runCommonAsserts(data, error);
1702
- }
1703
- saveMockData('VnfLcmOpOccs', 'postVnfLcmOpOccsVnfLcmOpOccIdRollback', 'default', data);
1704
- done();
1705
- } catch (err) {
1706
- log.error(`Test Failure: ${err}`);
1707
- done(err);
1410
+ try {
1411
+ a.postVnfLcmOpOccsVnfLcmOpOccIdRollback('fakedata', (data, error) => {
1412
+ try {
1413
+ if (stub) {
1414
+ const displayE = 'Error 400 received on request';
1415
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1416
+ } else {
1417
+ runCommonAsserts(data, error);
1708
1418
  }
1709
- });
1710
- } catch (error) {
1711
- log.error(`Adapter Exception: ${error}`);
1712
- done(error);
1713
- }
1714
- } else {
1715
- log.error('postVnfLcmOpOccsVnfLcmOpOccIdRollback task is false, skipping test');
1716
- skipCount += 1;
1717
- done();
1718
- }// end if task
1419
+ saveMockData('VnfLcmOpOccs', 'postVnfLcmOpOccsVnfLcmOpOccIdRollback', 'default', data);
1420
+ done();
1421
+ } catch (err) {
1422
+ log.error(`Test Failure: ${err}`);
1423
+ done(err);
1424
+ }
1425
+ });
1426
+ } catch (error) {
1427
+ log.error(`Adapter Exception: ${error}`);
1428
+ done(error);
1429
+ }
1719
1430
  }).timeout(attemptTimeout);
1720
1431
  });
1721
1432
 
1722
1433
  describe('#postVnfLcmOpOccsVnfLcmOpOccIdFail - errors', () => {
1723
1434
  it('should work if integrated or standalone with mockdata', (done) => {
1724
- if (pronghorn.methodsByName.postVnfLcmOpOccsVnfLcmOpOccIdFail.task) {
1725
- try {
1726
- a.postVnfLcmOpOccsVnfLcmOpOccIdFail('fakedata', (data, error) => {
1727
- try {
1728
- if (stub) {
1729
- runCommonAsserts(data, error);
1730
- assert.equal('string', data.response.id);
1731
- assert.equal('STARTING', data.response.operationState);
1732
- assert.equal('string', data.response.stateEnteredTime);
1733
- assert.equal('string', data.response.startTime);
1734
- assert.equal('string', data.response.vnfInstanceId);
1735
- assert.equal('string', data.response.grantId);
1736
- assert.equal('REVERT_TO_SNAPSHOT', data.response.operation);
1737
- assert.equal(false, data.response.isAutomaticInvocation);
1738
- assert.equal('object', typeof data.response.operationParams);
1739
- assert.equal(false, data.response.isCancelPending);
1740
- assert.equal('GRACEFUL', data.response.cancelMode);
1741
- assert.equal('object', typeof data.response.error);
1742
- assert.equal('object', typeof data.response.resourceChanges);
1743
- assert.equal('object', typeof data.response.changedInfo);
1744
- assert.equal(true, Array.isArray(data.response.changedExtConnectivity));
1745
- assert.equal('object', typeof data.response.modificationsTriggeredByVnfPkgChange);
1746
- assert.equal('string', data.response.vnfSnapshotInfoId);
1747
- assert.equal('object', typeof data.response._links);
1748
- } else {
1749
- runCommonAsserts(data, error);
1750
- }
1751
- saveMockData('VnfLcmOpOccs', 'postVnfLcmOpOccsVnfLcmOpOccIdFail', 'default', data);
1752
- done();
1753
- } catch (err) {
1754
- log.error(`Test Failure: ${err}`);
1755
- done(err);
1435
+ try {
1436
+ a.postVnfLcmOpOccsVnfLcmOpOccIdFail('fakedata', (data, error) => {
1437
+ try {
1438
+ if (stub) {
1439
+ runCommonAsserts(data, error);
1440
+ assert.equal('string', data.response.id);
1441
+ assert.equal('STARTING', data.response.operationState);
1442
+ assert.equal('string', data.response.stateEnteredTime);
1443
+ assert.equal('string', data.response.startTime);
1444
+ assert.equal('string', data.response.vnfInstanceId);
1445
+ assert.equal('string', data.response.grantId);
1446
+ assert.equal('REVERT_TO_SNAPSHOT', data.response.operation);
1447
+ assert.equal(false, data.response.isAutomaticInvocation);
1448
+ assert.equal('object', typeof data.response.operationParams);
1449
+ assert.equal(false, data.response.isCancelPending);
1450
+ assert.equal('GRACEFUL', data.response.cancelMode);
1451
+ assert.equal('object', typeof data.response.error);
1452
+ assert.equal('object', typeof data.response.resourceChanges);
1453
+ assert.equal('object', typeof data.response.changedInfo);
1454
+ assert.equal(true, Array.isArray(data.response.changedExtConnectivity));
1455
+ assert.equal('object', typeof data.response.modificationsTriggeredByVnfPkgChange);
1456
+ assert.equal('string', data.response.vnfSnapshotInfoId);
1457
+ assert.equal('object', typeof data.response._links);
1458
+ } else {
1459
+ runCommonAsserts(data, error);
1756
1460
  }
1757
- });
1758
- } catch (error) {
1759
- log.error(`Adapter Exception: ${error}`);
1760
- done(error);
1761
- }
1762
- } else {
1763
- log.error('postVnfLcmOpOccsVnfLcmOpOccIdFail task is false, skipping test');
1764
- skipCount += 1;
1765
- done();
1766
- }// end if task
1461
+ saveMockData('VnfLcmOpOccs', 'postVnfLcmOpOccsVnfLcmOpOccIdFail', '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
+ }
1767
1472
  }).timeout(attemptTimeout);
1768
1473
  });
1769
1474
 
1770
1475
  describe('#postVnfLcmOpOccsVnfLcmOpOccIdCancel - errors', () => {
1771
1476
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1772
- if (pronghorn.methodsByName.postVnfLcmOpOccsVnfLcmOpOccIdCancel.task) {
1773
- try {
1774
- a.postVnfLcmOpOccsVnfLcmOpOccIdCancel('fakedata', (data, error) => {
1775
- try {
1776
- if (stub) {
1777
- const displayE = 'Error 400 received on request';
1778
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1779
- } else {
1780
- runCommonAsserts(data, error);
1781
- }
1782
- saveMockData('VnfLcmOpOccs', 'postVnfLcmOpOccsVnfLcmOpOccIdCancel', 'default', data);
1783
- done();
1784
- } catch (err) {
1785
- log.error(`Test Failure: ${err}`);
1786
- done(err);
1477
+ try {
1478
+ a.postVnfLcmOpOccsVnfLcmOpOccIdCancel('fakedata', (data, error) => {
1479
+ try {
1480
+ if (stub) {
1481
+ const displayE = 'Error 400 received on request';
1482
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1483
+ } else {
1484
+ runCommonAsserts(data, error);
1787
1485
  }
1788
- });
1789
- } catch (error) {
1790
- log.error(`Adapter Exception: ${error}`);
1791
- done(error);
1792
- }
1793
- } else {
1794
- log.error('postVnfLcmOpOccsVnfLcmOpOccIdCancel task is false, skipping test');
1795
- skipCount += 1;
1796
- done();
1797
- }// end if task
1486
+ saveMockData('VnfLcmOpOccs', 'postVnfLcmOpOccsVnfLcmOpOccIdCancel', 'default', data);
1487
+ done();
1488
+ } catch (err) {
1489
+ log.error(`Test Failure: ${err}`);
1490
+ done(err);
1491
+ }
1492
+ });
1493
+ } catch (error) {
1494
+ log.error(`Adapter Exception: ${error}`);
1495
+ done(error);
1496
+ }
1798
1497
  }).timeout(attemptTimeout);
1799
1498
  });
1800
1499
 
@@ -1803,168 +1502,138 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
1803
1502
  };
1804
1503
  describe('#postVnfSnapshots - errors', () => {
1805
1504
  it('should work if integrated or standalone with mockdata', (done) => {
1806
- if (pronghorn.methodsByName.postVnfSnapshots.task) {
1807
- try {
1808
- a.postVnfSnapshots(vnfSnapshotsPostVnfSnapshotsBodyParam, (data, error) => {
1809
- try {
1810
- if (stub) {
1811
- runCommonAsserts(data, error);
1812
- assert.equal('string', data.response.id);
1813
- assert.equal('string', data.response.vnfSnapshotPkgId);
1814
- assert.equal('object', typeof data.response.vnfSnapshot);
1815
- assert.equal('object', typeof data.response._links);
1816
- } else {
1817
- runCommonAsserts(data, error);
1818
- }
1819
- saveMockData('VnfSnapshots', 'postVnfSnapshots', 'default', data);
1820
- done();
1821
- } catch (err) {
1822
- log.error(`Test Failure: ${err}`);
1823
- done(err);
1505
+ try {
1506
+ a.postVnfSnapshots(vnfSnapshotsPostVnfSnapshotsBodyParam, (data, error) => {
1507
+ try {
1508
+ if (stub) {
1509
+ runCommonAsserts(data, error);
1510
+ assert.equal('string', data.response.id);
1511
+ assert.equal('string', data.response.vnfSnapshotPkgId);
1512
+ assert.equal('object', typeof data.response.vnfSnapshot);
1513
+ assert.equal('object', typeof data.response._links);
1514
+ } else {
1515
+ runCommonAsserts(data, error);
1824
1516
  }
1825
- });
1826
- } catch (error) {
1827
- log.error(`Adapter Exception: ${error}`);
1828
- done(error);
1829
- }
1830
- } else {
1831
- log.error('postVnfSnapshots task is false, skipping test');
1832
- skipCount += 1;
1833
- done();
1834
- }// end if task
1517
+ saveMockData('VnfSnapshots', 'postVnfSnapshots', 'default', data);
1518
+ done();
1519
+ } catch (err) {
1520
+ log.error(`Test Failure: ${err}`);
1521
+ done(err);
1522
+ }
1523
+ });
1524
+ } catch (error) {
1525
+ log.error(`Adapter Exception: ${error}`);
1526
+ done(error);
1527
+ }
1835
1528
  }).timeout(attemptTimeout);
1836
1529
  });
1837
1530
 
1838
1531
  describe('#getVnfSnapshots - errors', () => {
1839
1532
  it('should work if integrated or standalone with mockdata', (done) => {
1840
- if (pronghorn.methodsByName.getVnfSnapshots.task) {
1841
- try {
1842
- a.getVnfSnapshots(null, null, null, null, null, null, (data, error) => {
1843
- try {
1844
- if (stub) {
1845
- runCommonAsserts(data, error);
1846
- assert.equal('object', typeof data.response[0]);
1847
- assert.equal('object', typeof data.response[1]);
1848
- assert.equal('object', typeof data.response[2]);
1849
- assert.equal('object', typeof data.response[3]);
1850
- } else {
1851
- runCommonAsserts(data, error);
1852
- }
1853
- saveMockData('VnfSnapshots', 'getVnfSnapshots', 'default', data);
1854
- done();
1855
- } catch (err) {
1856
- log.error(`Test Failure: ${err}`);
1857
- done(err);
1533
+ try {
1534
+ a.getVnfSnapshots(null, null, null, null, null, null, (data, error) => {
1535
+ try {
1536
+ if (stub) {
1537
+ runCommonAsserts(data, error);
1538
+ assert.equal('object', typeof data.response[0]);
1539
+ assert.equal('object', typeof data.response[1]);
1540
+ assert.equal('object', typeof data.response[2]);
1541
+ assert.equal('object', typeof data.response[3]);
1542
+ } else {
1543
+ runCommonAsserts(data, error);
1858
1544
  }
1859
- });
1860
- } catch (error) {
1861
- log.error(`Adapter Exception: ${error}`);
1862
- done(error);
1863
- }
1864
- } else {
1865
- log.error('getVnfSnapshots task is false, skipping test');
1866
- skipCount += 1;
1867
- done();
1868
- }// end if task
1545
+ saveMockData('VnfSnapshots', 'getVnfSnapshots', 'default', data);
1546
+ done();
1547
+ } catch (err) {
1548
+ log.error(`Test Failure: ${err}`);
1549
+ done(err);
1550
+ }
1551
+ });
1552
+ } catch (error) {
1553
+ log.error(`Adapter Exception: ${error}`);
1554
+ done(error);
1555
+ }
1869
1556
  }).timeout(attemptTimeout);
1870
1557
  });
1871
1558
 
1872
1559
  describe('#getVnfSnapshotsVnfSnapshotInfoId - errors', () => {
1873
1560
  it('should work if integrated or standalone with mockdata', (done) => {
1874
- if (pronghorn.methodsByName.getVnfSnapshotsVnfSnapshotInfoId.task) {
1875
- try {
1876
- a.getVnfSnapshotsVnfSnapshotInfoId('fakedata', (data, error) => {
1877
- try {
1878
- if (stub) {
1879
- runCommonAsserts(data, error);
1880
- assert.equal('string', data.response.id);
1881
- assert.equal('string', data.response.vnfSnapshotPkgId);
1882
- assert.equal('object', typeof data.response.vnfSnapshot);
1883
- assert.equal('object', typeof data.response._links);
1884
- } else {
1885
- runCommonAsserts(data, error);
1886
- }
1887
- saveMockData('VnfSnapshots', 'getVnfSnapshotsVnfSnapshotInfoId', 'default', data);
1888
- done();
1889
- } catch (err) {
1890
- log.error(`Test Failure: ${err}`);
1891
- done(err);
1561
+ try {
1562
+ a.getVnfSnapshotsVnfSnapshotInfoId('fakedata', (data, error) => {
1563
+ try {
1564
+ if (stub) {
1565
+ runCommonAsserts(data, error);
1566
+ assert.equal('string', data.response.id);
1567
+ assert.equal('string', data.response.vnfSnapshotPkgId);
1568
+ assert.equal('object', typeof data.response.vnfSnapshot);
1569
+ assert.equal('object', typeof data.response._links);
1570
+ } else {
1571
+ runCommonAsserts(data, error);
1892
1572
  }
1893
- });
1894
- } catch (error) {
1895
- log.error(`Adapter Exception: ${error}`);
1896
- done(error);
1897
- }
1898
- } else {
1899
- log.error('getVnfSnapshotsVnfSnapshotInfoId task is false, skipping test');
1900
- skipCount += 1;
1901
- done();
1902
- }// end if task
1573
+ saveMockData('VnfSnapshots', 'getVnfSnapshotsVnfSnapshotInfoId', 'default', data);
1574
+ done();
1575
+ } catch (err) {
1576
+ log.error(`Test Failure: ${err}`);
1577
+ done(err);
1578
+ }
1579
+ });
1580
+ } catch (error) {
1581
+ log.error(`Adapter Exception: ${error}`);
1582
+ done(error);
1583
+ }
1903
1584
  }).timeout(attemptTimeout);
1904
1585
  });
1905
1586
 
1906
1587
  describe('#deleteVnfSnapshotsVnfSnapshotInfoId - errors', () => {
1907
1588
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1908
- if (pronghorn.methodsByName.deleteVnfSnapshotsVnfSnapshotInfoId.task) {
1909
- try {
1910
- a.deleteVnfSnapshotsVnfSnapshotInfoId('fakedata', (data, error) => {
1911
- try {
1912
- if (stub) {
1913
- const displayE = 'Error 400 received on request';
1914
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1915
- } else {
1916
- runCommonAsserts(data, error);
1917
- }
1918
- saveMockData('VnfSnapshots', 'deleteVnfSnapshotsVnfSnapshotInfoId', 'default', data);
1919
- done();
1920
- } catch (err) {
1921
- log.error(`Test Failure: ${err}`);
1922
- done(err);
1589
+ try {
1590
+ a.deleteVnfSnapshotsVnfSnapshotInfoId('fakedata', (data, error) => {
1591
+ try {
1592
+ if (stub) {
1593
+ const displayE = 'Error 400 received on request';
1594
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1595
+ } else {
1596
+ runCommonAsserts(data, error);
1923
1597
  }
1924
- });
1925
- } catch (error) {
1926
- log.error(`Adapter Exception: ${error}`);
1927
- done(error);
1928
- }
1929
- } else {
1930
- log.error('deleteVnfSnapshotsVnfSnapshotInfoId task is false, skipping test');
1931
- skipCount += 1;
1932
- done();
1933
- }// end if task
1598
+ saveMockData('VnfSnapshots', 'deleteVnfSnapshotsVnfSnapshotInfoId', 'default', data);
1599
+ done();
1600
+ } catch (err) {
1601
+ log.error(`Test Failure: ${err}`);
1602
+ done(err);
1603
+ }
1604
+ });
1605
+ } catch (error) {
1606
+ log.error(`Adapter Exception: ${error}`);
1607
+ done(error);
1608
+ }
1934
1609
  }).timeout(attemptTimeout);
1935
1610
  });
1936
1611
 
1937
1612
  describe('#getPmJobs - errors', () => {
1938
1613
  it('should work if integrated or standalone with mockdata', (done) => {
1939
- if (pronghorn.methodsByName.getPmJobs.task) {
1940
- try {
1941
- a.getPmJobs(null, null, null, null, null, null, (data, error) => {
1942
- try {
1943
- if (stub) {
1944
- runCommonAsserts(data, error);
1945
- assert.equal('object', typeof data.response[0]);
1946
- assert.equal('object', typeof data.response[1]);
1947
- assert.equal('object', typeof data.response[2]);
1948
- assert.equal('object', typeof data.response[3]);
1949
- } else {
1950
- runCommonAsserts(data, error);
1951
- }
1952
- saveMockData('PmJobs', 'getPmJobs', 'default', data);
1953
- done();
1954
- } catch (err) {
1955
- log.error(`Test Failure: ${err}`);
1956
- done(err);
1614
+ try {
1615
+ a.getPmJobs(null, null, null, null, null, null, (data, error) => {
1616
+ try {
1617
+ if (stub) {
1618
+ runCommonAsserts(data, error);
1619
+ assert.equal('object', typeof data.response[0]);
1620
+ assert.equal('object', typeof data.response[1]);
1621
+ assert.equal('object', typeof data.response[2]);
1622
+ assert.equal('object', typeof data.response[3]);
1623
+ } else {
1624
+ runCommonAsserts(data, error);
1957
1625
  }
1958
- });
1959
- } catch (error) {
1960
- log.error(`Adapter Exception: ${error}`);
1961
- done(error);
1962
- }
1963
- } else {
1964
- log.error('getPmJobs task is false, skipping test');
1965
- skipCount += 1;
1966
- done();
1967
- }// end if task
1626
+ saveMockData('PmJobs', 'getPmJobs', 'default', data);
1627
+ done();
1628
+ } catch (err) {
1629
+ log.error(`Test Failure: ${err}`);
1630
+ done(err);
1631
+ }
1632
+ });
1633
+ } catch (error) {
1634
+ log.error(`Adapter Exception: ${error}`);
1635
+ done(error);
1636
+ }
1968
1637
  }).timeout(attemptTimeout);
1969
1638
  });
1970
1639
 
@@ -1978,108 +1647,90 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
1978
1647
  };
1979
1648
  describe('#postPmJobs - errors', () => {
1980
1649
  it('should work if integrated or standalone with mockdata', (done) => {
1981
- if (pronghorn.methodsByName.postPmJobs.task) {
1982
- try {
1983
- a.postPmJobs(pmJobsPostPmJobsBodyParam, (data, error) => {
1984
- try {
1985
- if (stub) {
1986
- runCommonAsserts(data, error);
1987
- assert.equal('string', data.response.id);
1988
- assert.equal('string', data.response.objectType);
1989
- assert.equal(true, Array.isArray(data.response.objectInstanceIds));
1990
- assert.equal(true, Array.isArray(data.response.subObjectInstanceIds));
1991
- assert.equal('object', typeof data.response.criteria);
1992
- assert.equal('string', data.response.callbackUri);
1993
- assert.equal('object', typeof data.response.reports);
1994
- assert.equal('object', typeof data.response._links);
1995
- } else {
1996
- runCommonAsserts(data, error);
1997
- }
1998
- saveMockData('PmJobs', 'postPmJobs', 'default', data);
1999
- done();
2000
- } catch (err) {
2001
- log.error(`Test Failure: ${err}`);
2002
- done(err);
1650
+ try {
1651
+ a.postPmJobs(pmJobsPostPmJobsBodyParam, (data, error) => {
1652
+ try {
1653
+ if (stub) {
1654
+ runCommonAsserts(data, error);
1655
+ assert.equal('string', data.response.id);
1656
+ assert.equal('string', data.response.objectType);
1657
+ assert.equal(true, Array.isArray(data.response.objectInstanceIds));
1658
+ assert.equal(true, Array.isArray(data.response.subObjectInstanceIds));
1659
+ assert.equal('object', typeof data.response.criteria);
1660
+ assert.equal('string', data.response.callbackUri);
1661
+ assert.equal('object', typeof data.response.reports);
1662
+ assert.equal('object', typeof data.response._links);
1663
+ } else {
1664
+ runCommonAsserts(data, error);
2003
1665
  }
2004
- });
2005
- } catch (error) {
2006
- log.error(`Adapter Exception: ${error}`);
2007
- done(error);
2008
- }
2009
- } else {
2010
- log.error('postPmJobs task is false, skipping test');
2011
- skipCount += 1;
2012
- done();
2013
- }// end if task
1666
+ saveMockData('PmJobs', 'postPmJobs', 'default', data);
1667
+ done();
1668
+ } catch (err) {
1669
+ log.error(`Test Failure: ${err}`);
1670
+ done(err);
1671
+ }
1672
+ });
1673
+ } catch (error) {
1674
+ log.error(`Adapter Exception: ${error}`);
1675
+ done(error);
1676
+ }
2014
1677
  }).timeout(attemptTimeout);
2015
1678
  });
2016
1679
 
2017
1680
  describe('#getPmJobsPmJobId - errors', () => {
2018
1681
  it('should work if integrated or standalone with mockdata', (done) => {
2019
- if (pronghorn.methodsByName.getPmJobsPmJobId.task) {
2020
- try {
2021
- a.getPmJobsPmJobId('fakedata', (data, error) => {
2022
- try {
2023
- if (stub) {
2024
- runCommonAsserts(data, error);
2025
- assert.equal('string', data.response.id);
2026
- assert.equal('string', data.response.objectType);
2027
- assert.equal(true, Array.isArray(data.response.objectInstanceIds));
2028
- assert.equal(true, Array.isArray(data.response.subObjectInstanceIds));
2029
- assert.equal('object', typeof data.response.criteria);
2030
- assert.equal('string', data.response.callbackUri);
2031
- assert.equal('object', typeof data.response.reports);
2032
- assert.equal('object', typeof data.response._links);
2033
- } else {
2034
- runCommonAsserts(data, error);
2035
- }
2036
- saveMockData('PmJobs', 'getPmJobsPmJobId', 'default', data);
2037
- done();
2038
- } catch (err) {
2039
- log.error(`Test Failure: ${err}`);
2040
- done(err);
1682
+ try {
1683
+ a.getPmJobsPmJobId('fakedata', (data, error) => {
1684
+ try {
1685
+ if (stub) {
1686
+ runCommonAsserts(data, error);
1687
+ assert.equal('string', data.response.id);
1688
+ assert.equal('string', data.response.objectType);
1689
+ assert.equal(true, Array.isArray(data.response.objectInstanceIds));
1690
+ assert.equal(true, Array.isArray(data.response.subObjectInstanceIds));
1691
+ assert.equal('object', typeof data.response.criteria);
1692
+ assert.equal('string', data.response.callbackUri);
1693
+ assert.equal('object', typeof data.response.reports);
1694
+ assert.equal('object', typeof data.response._links);
1695
+ } else {
1696
+ runCommonAsserts(data, error);
2041
1697
  }
2042
- });
2043
- } catch (error) {
2044
- log.error(`Adapter Exception: ${error}`);
2045
- done(error);
2046
- }
2047
- } else {
2048
- log.error('getPmJobsPmJobId task is false, skipping test');
2049
- skipCount += 1;
2050
- done();
2051
- }// end if task
1698
+ saveMockData('PmJobs', 'getPmJobsPmJobId', 'default', data);
1699
+ done();
1700
+ } catch (err) {
1701
+ log.error(`Test Failure: ${err}`);
1702
+ done(err);
1703
+ }
1704
+ });
1705
+ } catch (error) {
1706
+ log.error(`Adapter Exception: ${error}`);
1707
+ done(error);
1708
+ }
2052
1709
  }).timeout(attemptTimeout);
2053
1710
  });
2054
1711
 
2055
1712
  describe('#deletePmJobsPmJobId - errors', () => {
2056
1713
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2057
- if (pronghorn.methodsByName.deletePmJobsPmJobId.task) {
2058
- try {
2059
- a.deletePmJobsPmJobId('fakedata', (data, error) => {
2060
- try {
2061
- if (stub) {
2062
- const displayE = 'Error 400 received on request';
2063
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
2064
- } else {
2065
- runCommonAsserts(data, error);
2066
- }
2067
- saveMockData('PmJobs', 'deletePmJobsPmJobId', 'default', data);
2068
- done();
2069
- } catch (err) {
2070
- log.error(`Test Failure: ${err}`);
2071
- done(err);
1714
+ try {
1715
+ a.deletePmJobsPmJobId('fakedata', (data, error) => {
1716
+ try {
1717
+ if (stub) {
1718
+ const displayE = 'Error 400 received on request';
1719
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1720
+ } else {
1721
+ runCommonAsserts(data, error);
2072
1722
  }
2073
- });
2074
- } catch (error) {
2075
- log.error(`Adapter Exception: ${error}`);
2076
- done(error);
2077
- }
2078
- } else {
2079
- log.error('deletePmJobsPmJobId task is false, skipping test');
2080
- skipCount += 1;
2081
- done();
2082
- }// end if task
1723
+ saveMockData('PmJobs', 'deletePmJobsPmJobId', 'default', data);
1724
+ done();
1725
+ } catch (err) {
1726
+ log.error(`Test Failure: ${err}`);
1727
+ done(err);
1728
+ }
1729
+ });
1730
+ } catch (error) {
1731
+ log.error(`Adapter Exception: ${error}`);
1732
+ done(error);
1733
+ }
2083
1734
  }).timeout(attemptTimeout);
2084
1735
  });
2085
1736
 
@@ -2102,94 +1753,76 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
2102
1753
  };
2103
1754
  describe('#patchPmJobsPmJobId - errors', () => {
2104
1755
  it('should work if integrated or standalone with mockdata', (done) => {
2105
- if (pronghorn.methodsByName.patchPmJobsPmJobId.task) {
2106
- try {
2107
- a.patchPmJobsPmJobId('fakedata', pmJobsPatchPmJobsPmJobIdBodyParam, (data, error) => {
2108
- try {
2109
- if (stub) {
2110
- runCommonAsserts(data, error);
2111
- assert.equal('success', data.response);
2112
- } else {
2113
- runCommonAsserts(data, error);
2114
- }
2115
- saveMockData('PmJobs', 'patchPmJobsPmJobId', 'default', data);
2116
- done();
2117
- } catch (err) {
2118
- log.error(`Test Failure: ${err}`);
2119
- done(err);
1756
+ try {
1757
+ a.patchPmJobsPmJobId('fakedata', pmJobsPatchPmJobsPmJobIdBodyParam, (data, error) => {
1758
+ try {
1759
+ if (stub) {
1760
+ runCommonAsserts(data, error);
1761
+ assert.equal('success', data.response);
1762
+ } else {
1763
+ runCommonAsserts(data, error);
2120
1764
  }
2121
- });
2122
- } catch (error) {
2123
- log.error(`Adapter Exception: ${error}`);
2124
- done(error);
2125
- }
2126
- } else {
2127
- log.error('patchPmJobsPmJobId task is false, skipping test');
2128
- skipCount += 1;
2129
- done();
2130
- }// end if task
1765
+ saveMockData('PmJobs', 'patchPmJobsPmJobId', 'default', data);
1766
+ done();
1767
+ } catch (err) {
1768
+ log.error(`Test Failure: ${err}`);
1769
+ done(err);
1770
+ }
1771
+ });
1772
+ } catch (error) {
1773
+ log.error(`Adapter Exception: ${error}`);
1774
+ done(error);
1775
+ }
2131
1776
  }).timeout(attemptTimeout);
2132
1777
  });
2133
1778
 
2134
1779
  describe('#getPmJobsPmJobIdReportsReportId - errors', () => {
2135
1780
  it('should work if integrated or standalone with mockdata', (done) => {
2136
- if (pronghorn.methodsByName.getPmJobsPmJobIdReportsReportId.task) {
2137
- try {
2138
- a.getPmJobsPmJobIdReportsReportId('fakedata', 'fakedata', (data, error) => {
2139
- try {
2140
- if (stub) {
2141
- runCommonAsserts(data, error);
2142
- assert.equal(true, Array.isArray(data.response.entries));
2143
- } else {
2144
- runCommonAsserts(data, error);
2145
- }
2146
- saveMockData('PmJobs', 'getPmJobsPmJobIdReportsReportId', 'default', data);
2147
- done();
2148
- } catch (err) {
2149
- log.error(`Test Failure: ${err}`);
2150
- done(err);
1781
+ try {
1782
+ a.getPmJobsPmJobIdReportsReportId('fakedata', 'fakedata', (data, error) => {
1783
+ try {
1784
+ if (stub) {
1785
+ runCommonAsserts(data, error);
1786
+ assert.equal(true, Array.isArray(data.response.entries));
1787
+ } else {
1788
+ runCommonAsserts(data, error);
2151
1789
  }
2152
- });
2153
- } catch (error) {
2154
- log.error(`Adapter Exception: ${error}`);
2155
- done(error);
2156
- }
2157
- } else {
2158
- log.error('getPmJobsPmJobIdReportsReportId task is false, skipping test');
2159
- skipCount += 1;
2160
- done();
2161
- }// end if task
1790
+ saveMockData('PmJobs', 'getPmJobsPmJobIdReportsReportId', 'default', data);
1791
+ done();
1792
+ } catch (err) {
1793
+ log.error(`Test Failure: ${err}`);
1794
+ done(err);
1795
+ }
1796
+ });
1797
+ } catch (error) {
1798
+ log.error(`Adapter Exception: ${error}`);
1799
+ done(error);
1800
+ }
2162
1801
  }).timeout(attemptTimeout);
2163
1802
  });
2164
1803
 
2165
1804
  describe('#getThresholds - errors', () => {
2166
1805
  it('should work if integrated or standalone with mockdata', (done) => {
2167
- if (pronghorn.methodsByName.getThresholds.task) {
2168
- try {
2169
- a.getThresholds(null, null, (data, error) => {
2170
- try {
2171
- if (stub) {
2172
- runCommonAsserts(data, error);
2173
- assert.equal('object', typeof data.response[0]);
2174
- } else {
2175
- runCommonAsserts(data, error);
2176
- }
2177
- saveMockData('Thresholds', 'getThresholds', 'default', data);
2178
- done();
2179
- } catch (err) {
2180
- log.error(`Test Failure: ${err}`);
2181
- done(err);
1806
+ try {
1807
+ a.getThresholds(null, null, (data, error) => {
1808
+ try {
1809
+ if (stub) {
1810
+ runCommonAsserts(data, error);
1811
+ assert.equal('object', typeof data.response[0]);
1812
+ } else {
1813
+ runCommonAsserts(data, error);
2182
1814
  }
2183
- });
2184
- } catch (error) {
2185
- log.error(`Adapter Exception: ${error}`);
2186
- done(error);
2187
- }
2188
- } else {
2189
- log.error('getThresholds task is false, skipping test');
2190
- skipCount += 1;
2191
- done();
2192
- }// end if task
1815
+ saveMockData('Thresholds', 'getThresholds', 'default', data);
1816
+ done();
1817
+ } catch (err) {
1818
+ log.error(`Test Failure: ${err}`);
1819
+ done(err);
1820
+ }
1821
+ });
1822
+ } catch (error) {
1823
+ log.error(`Adapter Exception: ${error}`);
1824
+ done(error);
1825
+ }
2193
1826
  }).timeout(attemptTimeout);
2194
1827
  });
2195
1828
 
@@ -2201,106 +1834,88 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
2201
1834
  };
2202
1835
  describe('#postThresholds - errors', () => {
2203
1836
  it('should work if integrated or standalone with mockdata', (done) => {
2204
- if (pronghorn.methodsByName.postThresholds.task) {
2205
- try {
2206
- a.postThresholds(thresholdsPostThresholdsBodyParam, (data, error) => {
2207
- try {
2208
- if (stub) {
2209
- runCommonAsserts(data, error);
2210
- assert.equal('string', data.response.id);
2211
- assert.equal('string', data.response.objectType);
2212
- assert.equal('string', data.response.objectInstanceId);
2213
- assert.equal(true, Array.isArray(data.response.subObjectInstanceIds));
2214
- assert.equal('object', typeof data.response.criteria);
2215
- assert.equal('string', data.response.callbackUri);
2216
- assert.equal('object', typeof data.response._links);
2217
- } else {
2218
- runCommonAsserts(data, error);
2219
- }
2220
- saveMockData('Thresholds', 'postThresholds', 'default', data);
2221
- done();
2222
- } catch (err) {
2223
- log.error(`Test Failure: ${err}`);
2224
- done(err);
1837
+ try {
1838
+ a.postThresholds(thresholdsPostThresholdsBodyParam, (data, error) => {
1839
+ try {
1840
+ if (stub) {
1841
+ runCommonAsserts(data, error);
1842
+ assert.equal('string', data.response.id);
1843
+ assert.equal('string', data.response.objectType);
1844
+ assert.equal('string', data.response.objectInstanceId);
1845
+ assert.equal(true, Array.isArray(data.response.subObjectInstanceIds));
1846
+ assert.equal('object', typeof data.response.criteria);
1847
+ assert.equal('string', data.response.callbackUri);
1848
+ assert.equal('object', typeof data.response._links);
1849
+ } else {
1850
+ runCommonAsserts(data, error);
2225
1851
  }
2226
- });
2227
- } catch (error) {
2228
- log.error(`Adapter Exception: ${error}`);
2229
- done(error);
2230
- }
2231
- } else {
2232
- log.error('postThresholds task is false, skipping test');
2233
- skipCount += 1;
2234
- done();
2235
- }// end if task
1852
+ saveMockData('Thresholds', 'postThresholds', 'default', data);
1853
+ done();
1854
+ } catch (err) {
1855
+ log.error(`Test Failure: ${err}`);
1856
+ done(err);
1857
+ }
1858
+ });
1859
+ } catch (error) {
1860
+ log.error(`Adapter Exception: ${error}`);
1861
+ done(error);
1862
+ }
2236
1863
  }).timeout(attemptTimeout);
2237
1864
  });
2238
1865
 
2239
1866
  describe('#getThresholdsThresholdId - errors', () => {
2240
1867
  it('should work if integrated or standalone with mockdata', (done) => {
2241
- if (pronghorn.methodsByName.getThresholdsThresholdId.task) {
2242
- try {
2243
- a.getThresholdsThresholdId('fakedata', (data, error) => {
2244
- try {
2245
- if (stub) {
2246
- runCommonAsserts(data, error);
2247
- assert.equal('string', data.response.id);
2248
- assert.equal('string', data.response.objectType);
2249
- assert.equal('string', data.response.objectInstanceId);
2250
- assert.equal(true, Array.isArray(data.response.subObjectInstanceIds));
2251
- assert.equal('object', typeof data.response.criteria);
2252
- assert.equal('string', data.response.callbackUri);
2253
- assert.equal('object', typeof data.response._links);
2254
- } else {
2255
- runCommonAsserts(data, error);
2256
- }
2257
- saveMockData('Thresholds', 'getThresholdsThresholdId', 'default', data);
2258
- done();
2259
- } catch (err) {
2260
- log.error(`Test Failure: ${err}`);
2261
- done(err);
1868
+ try {
1869
+ a.getThresholdsThresholdId('fakedata', (data, error) => {
1870
+ try {
1871
+ if (stub) {
1872
+ runCommonAsserts(data, error);
1873
+ assert.equal('string', data.response.id);
1874
+ assert.equal('string', data.response.objectType);
1875
+ assert.equal('string', data.response.objectInstanceId);
1876
+ assert.equal(true, Array.isArray(data.response.subObjectInstanceIds));
1877
+ assert.equal('object', typeof data.response.criteria);
1878
+ assert.equal('string', data.response.callbackUri);
1879
+ assert.equal('object', typeof data.response._links);
1880
+ } else {
1881
+ runCommonAsserts(data, error);
2262
1882
  }
2263
- });
2264
- } catch (error) {
2265
- log.error(`Adapter Exception: ${error}`);
2266
- done(error);
2267
- }
2268
- } else {
2269
- log.error('getThresholdsThresholdId task is false, skipping test');
2270
- skipCount += 1;
2271
- done();
2272
- }// end if task
1883
+ saveMockData('Thresholds', 'getThresholdsThresholdId', 'default', data);
1884
+ done();
1885
+ } catch (err) {
1886
+ log.error(`Test Failure: ${err}`);
1887
+ done(err);
1888
+ }
1889
+ });
1890
+ } catch (error) {
1891
+ log.error(`Adapter Exception: ${error}`);
1892
+ done(error);
1893
+ }
2273
1894
  }).timeout(attemptTimeout);
2274
1895
  });
2275
1896
 
2276
1897
  describe('#deleteThresholdsThresholdId - errors', () => {
2277
1898
  it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2278
- if (pronghorn.methodsByName.deleteThresholdsThresholdId.task) {
2279
- try {
2280
- a.deleteThresholdsThresholdId('fakedata', (data, error) => {
2281
- try {
2282
- if (stub) {
2283
- const displayE = 'Error 400 received on request';
2284
- runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
2285
- } else {
2286
- runCommonAsserts(data, error);
2287
- }
2288
- saveMockData('Thresholds', 'deleteThresholdsThresholdId', 'default', data);
2289
- done();
2290
- } catch (err) {
2291
- log.error(`Test Failure: ${err}`);
2292
- done(err);
1899
+ try {
1900
+ a.deleteThresholdsThresholdId('fakedata', (data, error) => {
1901
+ try {
1902
+ if (stub) {
1903
+ const displayE = 'Error 400 received on request';
1904
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol002-connectorRest-handleEndResponse', displayE);
1905
+ } else {
1906
+ runCommonAsserts(data, error);
2293
1907
  }
2294
- });
2295
- } catch (error) {
2296
- log.error(`Adapter Exception: ${error}`);
2297
- done(error);
2298
- }
2299
- } else {
2300
- log.error('deleteThresholdsThresholdId task is false, skipping test');
2301
- skipCount += 1;
2302
- done();
2303
- }// end if task
1908
+ saveMockData('Thresholds', 'deleteThresholdsThresholdId', 'default', data);
1909
+ done();
1910
+ } catch (err) {
1911
+ log.error(`Test Failure: ${err}`);
1912
+ done(err);
1913
+ }
1914
+ });
1915
+ } catch (error) {
1916
+ log.error(`Adapter Exception: ${error}`);
1917
+ done(error);
1918
+ }
2304
1919
  }).timeout(attemptTimeout);
2305
1920
  });
2306
1921
 
@@ -2323,40 +1938,27 @@ describe('[integration] Etsi_sol002 Adapter Test', () => {
2323
1938
  };
2324
1939
  describe('#patchThresholdsThresholdId - errors', () => {
2325
1940
  it('should work if integrated or standalone with mockdata', (done) => {
2326
- if (pronghorn.methodsByName.patchThresholdsThresholdId.task) {
2327
- try {
2328
- a.patchThresholdsThresholdId('fakedata', thresholdsPatchThresholdsThresholdIdBodyParam, (data, error) => {
2329
- try {
2330
- if (stub) {
2331
- runCommonAsserts(data, error);
2332
- assert.equal('success', data.response);
2333
- } else {
2334
- runCommonAsserts(data, error);
2335
- }
2336
- saveMockData('Thresholds', 'patchThresholdsThresholdId', 'default', data);
2337
- done();
2338
- } catch (err) {
2339
- log.error(`Test Failure: ${err}`);
2340
- done(err);
1941
+ try {
1942
+ a.patchThresholdsThresholdId('fakedata', thresholdsPatchThresholdsThresholdIdBodyParam, (data, error) => {
1943
+ try {
1944
+ if (stub) {
1945
+ runCommonAsserts(data, error);
1946
+ assert.equal('success', data.response);
1947
+ } else {
1948
+ runCommonAsserts(data, error);
2341
1949
  }
2342
- });
2343
- } catch (error) {
2344
- log.error(`Adapter Exception: ${error}`);
2345
- done(error);
2346
- }
2347
- } else {
2348
- log.error('patchThresholdsThresholdId task is false, skipping test');
2349
- skipCount += 1;
2350
- done();
2351
- }// end if task
1950
+ saveMockData('Thresholds', 'patchThresholdsThresholdId', 'default', data);
1951
+ done();
1952
+ } catch (err) {
1953
+ log.error(`Test Failure: ${err}`);
1954
+ done(err);
1955
+ }
1956
+ });
1957
+ } catch (error) {
1958
+ log.error(`Adapter Exception: ${error}`);
1959
+ done(error);
1960
+ }
2352
1961
  }).timeout(attemptTimeout);
2353
1962
  });
2354
-
2355
- describe('#Skipped test count', () => {
2356
- it('count skipped tests', (done) => {
2357
- console.log(`skipped ${skipCount} tests because \x1b[33mtask: false\x1b[0m`);
2358
- done();
2359
- });
2360
- });
2361
1963
  });
2362
1964
  });