@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.
- package/AUTH.md +39 -0
- package/BROKER.md +199 -0
- package/CALLS.md +169 -0
- package/CHANGELOG.md +5 -5
- package/CODE_OF_CONDUCT.md +12 -17
- package/CONTRIBUTING.md +88 -74
- package/ENHANCE.md +69 -0
- package/PROPERTIES.md +641 -0
- package/README.md +221 -571
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +11 -0
- package/TROUBLESHOOT.md +47 -0
- package/adapter.js +292 -469
- package/adapterBase.js +1006 -252
- package/entities/.generic/action.json +105 -0
- package/entities/.generic/schema.json +6 -1
- package/error.json +6 -0
- package/package.json +5 -3
- package/pronghorn.json +642 -570
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +421 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +10 -0
- package/report/updateReport1653138357676.json +120 -0
- package/sampleProperties.json +90 -1
- package/test/integration/adapterTestBasicGet.js +1 -1
- package/test/integration/adapterTestIntegration.js +1699 -2217
- package/test/unit/adapterBaseTestUnit.js +30 -25
- package/test/unit/adapterTestUnit.js +90 -177
- package/utils/adapterInfo.js +206 -0
- package/utils/entitiesToDB.js +12 -57
- package/utils/pre-commit.sh +3 -0
- package/utils/tbScript.js +35 -20
- package/utils/tbUtils.js +49 -31
- package/utils/testRunner.js +16 -16
|
@@ -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
|
-
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
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
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
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
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
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
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
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
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
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
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
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
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
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
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
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
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
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
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
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
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
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
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
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
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
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
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
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
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
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
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
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
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
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
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
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
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
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
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
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
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
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
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
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
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
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
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
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
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
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
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
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
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
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
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
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
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
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
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
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
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
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
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
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
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
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
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
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
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
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
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
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
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
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
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
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
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
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
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
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
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
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
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
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
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
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
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
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
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
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
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
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
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
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
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
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
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
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
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
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
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
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
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
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
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
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
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
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
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
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
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
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
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
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
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
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
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
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
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
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
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
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
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
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
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
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
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
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
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
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
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
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
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
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
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
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
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
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
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
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
|
});
|