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