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