@itentialopensource/adapter-etsi_sol003 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/.eslintignore +5 -0
  2. package/.eslintrc.js +18 -0
  3. package/.jshintrc +3 -0
  4. package/CHANGELOG.md +9 -0
  5. package/CODE_OF_CONDUCT.md +48 -0
  6. package/CONTRIBUTING.md +158 -0
  7. package/LICENSE +201 -0
  8. package/README.md +687 -0
  9. package/adapter.js +8178 -0
  10. package/adapterBase.js +1028 -0
  11. package/entities/.generic/action.json +109 -0
  12. package/entities/.generic/schema.json +23 -0
  13. package/entities/.system/action.json +50 -0
  14. package/entities/.system/mockdatafiles/getToken-default.json +3 -0
  15. package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
  16. package/entities/.system/schema.json +19 -0
  17. package/entities/.system/schemaTokenReq.json +53 -0
  18. package/entities/.system/schemaTokenResp.json +53 -0
  19. package/entities/Alarms/action.json +66 -0
  20. package/entities/Alarms/mockdatafiles/getAlarms-default.json +46 -0
  21. package/entities/Alarms/mockdatafiles/getAlarmsAlarmId-default.json +50 -0
  22. package/entities/Alarms/mockdatafiles/patchAlarmsAlarmId-default.json +3 -0
  23. package/entities/Alarms/schema.json +21 -0
  24. package/entities/ApiVersions/action.json +25 -0
  25. package/entities/ApiVersions/mockdatafiles/getApiVersions-default.json +10 -0
  26. package/entities/ApiVersions/schema.json +19 -0
  27. package/entities/Grants/action.json +45 -0
  28. package/entities/Grants/mockdatafiles/getGrantsGrantId-default.json +1041 -0
  29. package/entities/Grants/mockdatafiles/postGrants-default.json +1290 -0
  30. package/entities/Grants/schema.json +20 -0
  31. package/entities/Indicators/action.json +108 -0
  32. package/entities/Indicators/mockdatafiles/getIndicators-default.json +58 -0
  33. package/entities/Indicators/mockdatafiles/getIndicatorsSubscriptionsSubscriptionId-default.json +2038 -0
  34. package/entities/Indicators/mockdatafiles/getIndicatorsVnfInstanceId-default.json +16 -0
  35. package/entities/Indicators/mockdatafiles/getIndicatorsVnfInstanceIdIndicatorId-default.json +14 -0
  36. package/entities/Indicators/schema.json +23 -0
  37. package/entities/OnboardedVnfPackages/action.json +151 -0
  38. package/entities/OnboardedVnfPackages/mockdatafiles/getOnboardedVnfPackages-default.json +161 -0
  39. package/entities/OnboardedVnfPackages/mockdatafiles/getOnboardedVnfPackagesVnfdId-default.json +235 -0
  40. package/entities/OnboardedVnfPackages/schema.json +25 -0
  41. package/entities/PmJobs/action.json +127 -0
  42. package/entities/PmJobs/mockdatafiles/getPmJobs-default.json +217 -0
  43. package/entities/PmJobs/mockdatafiles/getPmJobsPmJobId-default.json +77 -0
  44. package/entities/PmJobs/mockdatafiles/getPmJobsPmJobIdReportsReportId-default.json +212 -0
  45. package/entities/PmJobs/mockdatafiles/patchPmJobsPmJobId-default.json +26 -0
  46. package/entities/PmJobs/mockdatafiles/postPmJobs-default.json +77 -0
  47. package/entities/PmJobs/schema.json +24 -0
  48. package/entities/Subscriptions/action.json +86 -0
  49. package/entities/Subscriptions/mockdatafiles/getSubscriptions-default.json +147 -0
  50. package/entities/Subscriptions/mockdatafiles/getSubscriptionsSubscriptionId-default.json +41 -0
  51. package/entities/Subscriptions/mockdatafiles/postSubscriptions-default.json +44 -0
  52. package/entities/Subscriptions/schema.json +33 -0
  53. package/entities/Thresholds/action.json +106 -0
  54. package/entities/Thresholds/mockdatafiles/getThresholds-default.json +62 -0
  55. package/entities/Thresholds/mockdatafiles/getThresholdsThresholdId-default.json +30 -0
  56. package/entities/Thresholds/mockdatafiles/patchThresholdsThresholdId-default.json +18 -0
  57. package/entities/Thresholds/mockdatafiles/postThresholds-default.json +31 -0
  58. package/entities/Thresholds/schema.json +23 -0
  59. package/entities/VnfInstances/action.json +326 -0
  60. package/entities/VnfInstances/mockdatafiles/getVnfInstances-default.json +76043 -0
  61. package/entities/VnfInstances/mockdatafiles/getVnfInstancesVnfInstanceId-default.json +16746 -0
  62. package/entities/VnfInstances/mockdatafiles/patchVnfInstancesVnfInstanceId-default.json +14159 -0
  63. package/entities/VnfInstances/mockdatafiles/postVnfInstances-default.json +24811 -0
  64. package/entities/VnfInstances/schema.json +34 -0
  65. package/entities/VnfLcmOpOccs/action.json +126 -0
  66. package/entities/VnfLcmOpOccs/mockdatafiles/getVnfLcmOpOccs-default.json +1098 -0
  67. package/entities/VnfLcmOpOccs/mockdatafiles/getVnfLcmOpOccsVnfLcmOpOccId-default.json +755 -0
  68. package/entities/VnfLcmOpOccs/mockdatafiles/postVnfLcmOpOccsVnfLcmOpOccIdFail-default.json +988 -0
  69. package/entities/VnfLcmOpOccs/schema.json +24 -0
  70. package/entities/VnfPackages/action.json +130 -0
  71. package/entities/VnfPackages/mockdatafiles/getVnfPackagesVnfPkgId-default.json +166 -0
  72. package/entities/VnfPackages/schema.json +24 -0
  73. package/entities/VnfSnapshotPackages/action.json +88 -0
  74. package/entities/VnfSnapshotPackages/mockdatafiles/getVnfSnapshotPackages-default.json +178 -0
  75. package/entities/VnfSnapshotPackages/mockdatafiles/getVnfSnapshotPackagesVnfSnapshotPkgId-default.json +44 -0
  76. package/entities/VnfSnapshotPackages/schema.json +22 -0
  77. package/entities/VnfSnapshots/action.json +127 -0
  78. package/entities/VnfSnapshots/mockdatafiles/getVnfSnapshots-default.json +3832 -0
  79. package/entities/VnfSnapshots/mockdatafiles/getVnfSnapshotsVnfSnapshotInfoId-default.json +97152 -0
  80. package/entities/VnfSnapshots/mockdatafiles/patchVnfSnapshotsVnfSnapshotInfoId-default.json +30772 -0
  81. package/entities/VnfSnapshots/mockdatafiles/postVnfSnapshots-default.json +13292 -0
  82. package/entities/VnfSnapshots/schema.json +24 -0
  83. package/error.json +184 -0
  84. package/package.json +85 -0
  85. package/pronghorn.json +27747 -0
  86. package/propertiesSchema.json +840 -0
  87. package/refs?service=git-upload-pack +0 -0
  88. package/report/creationReport.json +189 -0
  89. package/report/sol003_virtual_openapi.json +4328 -0
  90. package/report/updateReport1646242954642.json +95 -0
  91. package/sampleProperties.json +106 -0
  92. package/test/integration/adapterTestBasicGet.js +85 -0
  93. package/test/integration/adapterTestConnectivity.js +93 -0
  94. package/test/integration/adapterTestIntegration.js +3597 -0
  95. package/test/unit/adapterBaseTestUnit.js +944 -0
  96. package/test/unit/adapterTestUnit.js +3564 -0
  97. package/utils/addAuth.js +94 -0
  98. package/utils/artifactize.js +146 -0
  99. package/utils/basicGet.js +50 -0
  100. package/utils/checkMigrate.js +63 -0
  101. package/utils/entitiesToDB.js +224 -0
  102. package/utils/findPath.js +74 -0
  103. package/utils/modify.js +154 -0
  104. package/utils/packModificationScript.js +35 -0
  105. package/utils/patches2bundledDeps.js +90 -0
  106. package/utils/pre-commit.sh +27 -0
  107. package/utils/removeHooks.js +20 -0
  108. package/utils/setup.js +33 -0
  109. package/utils/tbScript.js +169 -0
  110. package/utils/tbUtils.js +451 -0
  111. package/utils/testRunner.js +298 -0
  112. package/utils/troubleshootingAdapter.js +190 -0
  113. package/workflows/README.md +3 -0
@@ -0,0 +1,3597 @@
1
+ /* @copyright Itential, LLC 2019 (pre-modifications) */
2
+
3
+ // Set globals
4
+ /* global describe it log pronghornProps */
5
+ /* eslint no-unused-vars: warn */
6
+ /* eslint no-underscore-dangle: warn */
7
+
8
+ // include required items for testing & logging
9
+ const assert = require('assert');
10
+ const fs = require('fs');
11
+ const mocha = require('mocha');
12
+ const path = require('path');
13
+ const winston = require('winston');
14
+ const { expect } = require('chai');
15
+ const { use } = require('chai');
16
+ const td = require('testdouble');
17
+ const util = require('util');
18
+ const pronghorn = require('../../pronghorn.json');
19
+
20
+ pronghorn.methodsByName = pronghorn.methods.reduce((result, meth) => ({ ...result, [meth.name]: meth }), {});
21
+ const anything = td.matchers.anything();
22
+
23
+ // stub and attemptTimeout are used throughout the code so set them here
24
+ let logLevel = 'none';
25
+ const stub = true;
26
+ const isRapidFail = false;
27
+ const isSaveMockData = false;
28
+ const attemptTimeout = 5000;
29
+
30
+ // these variables can be changed to run in integrated mode so easier to set them here
31
+ // always check these in with bogus data!!!
32
+ const host = 'replace.hostorip.here';
33
+ const username = 'username';
34
+ const password = 'password';
35
+ const protocol = 'http';
36
+ const port = 80;
37
+ const sslenable = false;
38
+ const sslinvalid = false;
39
+
40
+ // these are the adapter properties. You generally should not need to alter
41
+ // any of these after they are initially set up
42
+ global.pronghornProps = {
43
+ pathProps: {
44
+ encrypted: false
45
+ },
46
+ adapterProps: {
47
+ adapters: [{
48
+ id: 'Test-etsi_sol003',
49
+ type: 'EtsiSol003',
50
+ properties: {
51
+ host,
52
+ port,
53
+ base_path: '/',
54
+ version: '',
55
+ cache_location: 'none',
56
+ encode_pathvars: true,
57
+ save_metric: false,
58
+ stub,
59
+ protocol,
60
+ authentication: {
61
+ auth_method: 'request_token',
62
+ username,
63
+ password,
64
+ token: '',
65
+ invalid_token_error: 401,
66
+ token_timeout: 1800000,
67
+ token_cache: 'local',
68
+ auth_field: 'header.headers.Authorization',
69
+ auth_field_format: 'Bearer {token}',
70
+ auth_logging: false,
71
+ client_id: '',
72
+ client_secret: '',
73
+ grant_type: ''
74
+ },
75
+ healthcheck: {
76
+ type: 'none',
77
+ frequency: 60000,
78
+ query_object: {}
79
+ },
80
+ throttle: {
81
+ throttle_enabled: false,
82
+ number_pronghorns: 1,
83
+ sync_async: 'sync',
84
+ max_in_queue: 1000,
85
+ concurrent_max: 1,
86
+ expire_timeout: 0,
87
+ avg_runtime: 200,
88
+ priorities: [
89
+ {
90
+ value: 0,
91
+ percent: 100
92
+ }
93
+ ]
94
+ },
95
+ request: {
96
+ number_redirects: 0,
97
+ number_retries: 3,
98
+ limit_retry_error: [0],
99
+ failover_codes: [],
100
+ attempt_timeout: attemptTimeout,
101
+ global_request: {
102
+ payload: {},
103
+ uriOptions: {},
104
+ addlHeaders: {},
105
+ authData: {}
106
+ },
107
+ healthcheck_on_timeout: true,
108
+ return_raw: true,
109
+ archiving: false,
110
+ return_request: false
111
+ },
112
+ proxy: {
113
+ enabled: false,
114
+ host: '',
115
+ port: 1,
116
+ protocol: 'http',
117
+ username: '',
118
+ password: ''
119
+ },
120
+ ssl: {
121
+ ecdhCurve: '',
122
+ enabled: sslenable,
123
+ accept_invalid_cert: sslinvalid,
124
+ ca_file: '',
125
+ key_file: '',
126
+ cert_file: '',
127
+ secure_protocol: '',
128
+ ciphers: ''
129
+ },
130
+ mongo: {
131
+ host: '',
132
+ port: 0,
133
+ database: '',
134
+ username: '',
135
+ password: '',
136
+ replSet: '',
137
+ db_ssl: {
138
+ enabled: false,
139
+ accept_invalid_cert: false,
140
+ ca_file: '',
141
+ key_file: '',
142
+ cert_file: ''
143
+ }
144
+ }
145
+ }
146
+ }]
147
+ }
148
+ };
149
+
150
+ global.$HOME = `${__dirname}/../..`;
151
+
152
+ // set the log levels that Pronghorn uses, spam and trace are not defaulted in so without
153
+ // this you may error on log.trace calls.
154
+ const myCustomLevels = {
155
+ levels: {
156
+ spam: 6,
157
+ trace: 5,
158
+ debug: 4,
159
+ info: 3,
160
+ warn: 2,
161
+ error: 1,
162
+ none: 0
163
+ }
164
+ };
165
+
166
+ // need to see if there is a log level passed in
167
+ process.argv.forEach((val) => {
168
+ // is there a log level defined to be passed in?
169
+ if (val.indexOf('--LOG') === 0) {
170
+ // get the desired log level
171
+ const inputVal = val.split('=')[1];
172
+
173
+ // validate the log level is supported, if so set it
174
+ if (Object.hasOwnProperty.call(myCustomLevels.levels, inputVal)) {
175
+ logLevel = inputVal;
176
+ }
177
+ }
178
+ });
179
+
180
+ // need to set global logging
181
+ global.log = winston.createLogger({
182
+ level: logLevel,
183
+ levels: myCustomLevels.levels,
184
+ transports: [
185
+ new winston.transports.Console()
186
+ ]
187
+ });
188
+
189
+ /**
190
+ * Runs the common asserts for test
191
+ */
192
+ function runCommonAsserts(data, error) {
193
+ assert.equal(undefined, error);
194
+ assert.notEqual(undefined, data);
195
+ assert.notEqual(null, data);
196
+ assert.notEqual(undefined, data.response);
197
+ assert.notEqual(null, data.response);
198
+ }
199
+
200
+ /**
201
+ * Runs the error asserts for the test
202
+ */
203
+ function runErrorAsserts(data, error, code, origin, displayStr) {
204
+ assert.equal(null, data);
205
+ assert.notEqual(undefined, error);
206
+ assert.notEqual(null, error);
207
+ assert.notEqual(undefined, error.IAPerror);
208
+ assert.notEqual(null, error.IAPerror);
209
+ assert.notEqual(undefined, error.IAPerror.displayString);
210
+ assert.notEqual(null, error.IAPerror.displayString);
211
+ assert.equal(code, error.icode);
212
+ assert.equal(origin, error.IAPerror.origin);
213
+ assert.equal(displayStr, error.IAPerror.displayString);
214
+ }
215
+
216
+ /**
217
+ * @function saveMockData
218
+ * Attempts to take data from responses and place them in MockDataFiles to help create Mockdata.
219
+ * Note, this was built based on entity file structure for Adapter-Engine 1.6.x
220
+ * @param {string} entityName - Name of the entity saving mock data for
221
+ * @param {string} actionName - Name of the action saving mock data for
222
+ * @param {string} descriptor - Something to describe this test (used as a type)
223
+ * @param {string or object} responseData - The data to put in the mock file.
224
+ */
225
+ function saveMockData(entityName, actionName, descriptor, responseData) {
226
+ // do not need to save mockdata if we are running in stub mode (already has mock data) or if told not to save
227
+ if (stub || !isSaveMockData) {
228
+ return false;
229
+ }
230
+
231
+ // must have a response in order to store the response
232
+ if (responseData && responseData.response) {
233
+ let data = responseData.response;
234
+
235
+ // if there was a raw response that one is better as it is untranslated
236
+ if (responseData.raw) {
237
+ data = responseData.raw;
238
+
239
+ try {
240
+ const temp = JSON.parse(data);
241
+ data = temp;
242
+ } catch (pex) {
243
+ // do not care if it did not parse as we will just use data
244
+ }
245
+ }
246
+
247
+ try {
248
+ const base = path.join(__dirname, `../../entities/${entityName}/`);
249
+ const mockdatafolder = 'mockdatafiles';
250
+ const filename = `mockdatafiles/${actionName}-${descriptor}.json`;
251
+
252
+ if (!fs.existsSync(base + mockdatafolder)) {
253
+ fs.mkdirSync(base + mockdatafolder);
254
+ }
255
+
256
+ // write the data we retrieved
257
+ fs.writeFile(base + filename, JSON.stringify(data, null, 2), 'utf8', (errWritingMock) => {
258
+ if (errWritingMock) throw errWritingMock;
259
+
260
+ // update the action file to reflect the changes. Note: We're replacing the default object for now!
261
+ fs.readFile(`${base}action.json`, (errRead, content) => {
262
+ if (errRead) throw errRead;
263
+
264
+ // parse the action file into JSON
265
+ const parsedJson = JSON.parse(content);
266
+
267
+ // The object update we'll write in.
268
+ const responseObj = {
269
+ type: descriptor,
270
+ key: '',
271
+ mockFile: filename
272
+ };
273
+
274
+ // get the object for method we're trying to change.
275
+ const currentMethodAction = parsedJson.actions.find((obj) => obj.name === actionName);
276
+
277
+ // if the method was not found - should never happen but...
278
+ if (!currentMethodAction) {
279
+ throw Error('Can\'t find an action for this method in the provided entity.');
280
+ }
281
+
282
+ // if there is a response object, we want to replace the Response object. Otherwise we'll create one.
283
+ const actionResponseObj = currentMethodAction.responseObjects.find((obj) => obj.type === descriptor);
284
+
285
+ // Add the action responseObj back into the array of response objects.
286
+ if (!actionResponseObj) {
287
+ // if there is a default response object, we want to get the key.
288
+ const defaultResponseObj = currentMethodAction.responseObjects.find((obj) => obj.type === 'default');
289
+
290
+ // save the default key into the new response object
291
+ if (defaultResponseObj) {
292
+ responseObj.key = defaultResponseObj.key;
293
+ }
294
+
295
+ // save the new response object
296
+ currentMethodAction.responseObjects = [responseObj];
297
+ } else {
298
+ // update the location of the mock data file
299
+ actionResponseObj.mockFile = responseObj.mockFile;
300
+ }
301
+
302
+ // Save results
303
+ fs.writeFile(`${base}action.json`, JSON.stringify(parsedJson, null, 2), (err) => {
304
+ if (err) throw err;
305
+ });
306
+ });
307
+ });
308
+ } catch (e) {
309
+ log.debug(`Failed to save mock data for ${actionName}. ${e.message}`);
310
+ return false;
311
+ }
312
+ }
313
+
314
+ // no response to save
315
+ log.debug(`No data passed to save into mockdata for ${actionName}`);
316
+ return false;
317
+ }
318
+
319
+ // require the adapter that we are going to be using
320
+ const EtsiSol003 = require('../../adapter');
321
+
322
+ // begin the testing - these should be pretty well defined between the describe and the it!
323
+ describe('[integration] Etsi_sol003 Adapter Test', () => {
324
+ describe('EtsiSol003 Class Tests', () => {
325
+ const a = new EtsiSol003(
326
+ pronghornProps.adapterProps.adapters[0].id,
327
+ pronghornProps.adapterProps.adapters[0].properties
328
+ );
329
+
330
+ if (isRapidFail) {
331
+ const state = {};
332
+ state.passed = true;
333
+
334
+ mocha.afterEach(function x() {
335
+ state.passed = state.passed
336
+ && (this.currentTest.state === 'passed');
337
+ });
338
+ mocha.beforeEach(function x() {
339
+ if (!state.passed) {
340
+ return this.currentTest.skip();
341
+ }
342
+ return true;
343
+ });
344
+ }
345
+
346
+ describe('#class instance created', () => {
347
+ it('should be a class with properties', (done) => {
348
+ try {
349
+ assert.notEqual(null, a);
350
+ assert.notEqual(undefined, a);
351
+ const checkId = global.pronghornProps.adapterProps.adapters[0].id;
352
+ assert.equal(checkId, a.id);
353
+ assert.notEqual(null, a.allProps);
354
+ const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
355
+ assert.equal(check, a.healthcheckType);
356
+ done();
357
+ } catch (error) {
358
+ log.error(`Test Failure: ${error}`);
359
+ done(error);
360
+ }
361
+ }).timeout(attemptTimeout);
362
+ });
363
+
364
+ describe('#connect', () => {
365
+ it('should get connected - no healthcheck', (done) => {
366
+ try {
367
+ a.healthcheckType = 'none';
368
+ a.connect();
369
+
370
+ try {
371
+ assert.equal(true, a.alive);
372
+ done();
373
+ } catch (error) {
374
+ log.error(`Test Failure: ${error}`);
375
+ done(error);
376
+ }
377
+ } catch (error) {
378
+ log.error(`Adapter Exception: ${error}`);
379
+ done(error);
380
+ }
381
+ });
382
+ it('should get connected - startup healthcheck', (done) => {
383
+ try {
384
+ a.healthcheckType = 'startup';
385
+ a.connect();
386
+
387
+ try {
388
+ assert.equal(true, a.alive);
389
+ done();
390
+ } catch (error) {
391
+ log.error(`Test Failure: ${error}`);
392
+ done(error);
393
+ }
394
+ } catch (error) {
395
+ log.error(`Adapter Exception: ${error}`);
396
+ done(error);
397
+ }
398
+ });
399
+ });
400
+
401
+ describe('#healthCheck', () => {
402
+ it('should be healthy', (done) => {
403
+ try {
404
+ a.healthCheck(null, (data) => {
405
+ try {
406
+ assert.equal(true, a.healthy);
407
+ saveMockData('system', 'healthcheck', 'default', data);
408
+ done();
409
+ } catch (err) {
410
+ log.error(`Test Failure: ${err}`);
411
+ done(err);
412
+ }
413
+ });
414
+ } catch (error) {
415
+ log.error(`Adapter Exception: ${error}`);
416
+ done(error);
417
+ }
418
+ }).timeout(attemptTimeout);
419
+ });
420
+
421
+ /*
422
+ -----------------------------------------------------------------------
423
+ -----------------------------------------------------------------------
424
+ *** All code above this comment will be replaced during a migration ***
425
+ ******************* DO NOT REMOVE THIS COMMENT BLOCK ******************
426
+ -----------------------------------------------------------------------
427
+ -----------------------------------------------------------------------
428
+ */
429
+ let skipCount = 0;
430
+
431
+ describe('#getApiVersions - errors', () => {
432
+ it('should work if integrated or standalone with mockdata', (done) => {
433
+ if (pronghorn.methodsByName.getApiVersions.task) {
434
+ try {
435
+ a.getApiVersions((data, error) => {
436
+ try {
437
+ if (stub) {
438
+ runCommonAsserts(data, error);
439
+ assert.equal('string', data.response.uriPrefix);
440
+ assert.equal(true, Array.isArray(data.response.apiVersions));
441
+ } else {
442
+ runCommonAsserts(data, error);
443
+ }
444
+ saveMockData('ApiVersions', 'getApiVersions', 'default', data);
445
+ done();
446
+ } catch (err) {
447
+ log.error(`Test Failure: ${err}`);
448
+ done(err);
449
+ }
450
+ });
451
+ } catch (error) {
452
+ log.error(`Adapter Exception: ${error}`);
453
+ done(error);
454
+ }
455
+ } else {
456
+ log.error('getApiVersions task is false, skipping test');
457
+ skipCount += 1;
458
+ done();
459
+ }// end if task
460
+ }).timeout(attemptTimeout);
461
+ });
462
+
463
+ let subscriptionsSubscriptionId = 'fakedata';
464
+ const subscriptionsPostSubscriptionsBodyParam = {
465
+ callbackUri: 'string'
466
+ };
467
+ describe('#postSubscriptions - errors', () => {
468
+ it('should work if integrated or standalone with mockdata', (done) => {
469
+ if (pronghorn.methodsByName.postSubscriptions.task) {
470
+ try {
471
+ a.postSubscriptions(subscriptionsPostSubscriptionsBodyParam, (data, error) => {
472
+ try {
473
+ if (stub) {
474
+ runCommonAsserts(data, error);
475
+ assert.equal('string', data.response.id);
476
+ assert.equal('object', typeof data.response.filter);
477
+ assert.equal('string', data.response.callbackUri);
478
+ assert.equal('object', typeof data.response._links);
479
+ } else {
480
+ runCommonAsserts(data, error);
481
+ }
482
+ subscriptionsSubscriptionId = data.response.id;
483
+ saveMockData('Subscriptions', 'postSubscriptions', 'default', data);
484
+ done();
485
+ } catch (err) {
486
+ log.error(`Test Failure: ${err}`);
487
+ done(err);
488
+ }
489
+ });
490
+ } catch (error) {
491
+ log.error(`Adapter Exception: ${error}`);
492
+ done(error);
493
+ }
494
+ } else {
495
+ log.error('postSubscriptions task is false, skipping test');
496
+ skipCount += 1;
497
+ done();
498
+ }// end if task
499
+ }).timeout(attemptTimeout);
500
+ });
501
+
502
+ describe('#getSubscriptions - errors', () => {
503
+ it('should work if integrated or standalone with mockdata', (done) => {
504
+ if (pronghorn.methodsByName.getSubscriptions.task) {
505
+ try {
506
+ a.getSubscriptions(null, null, (data, error) => {
507
+ try {
508
+ if (stub) {
509
+ runCommonAsserts(data, error);
510
+ assert.equal('object', typeof data.response[0]);
511
+ assert.equal('object', typeof data.response[1]);
512
+ assert.equal('object', typeof data.response[2]);
513
+ } else {
514
+ runCommonAsserts(data, error);
515
+ }
516
+ saveMockData('Subscriptions', 'getSubscriptions', 'default', data);
517
+ done();
518
+ } catch (err) {
519
+ log.error(`Test Failure: ${err}`);
520
+ done(err);
521
+ }
522
+ });
523
+ } catch (error) {
524
+ log.error(`Adapter Exception: ${error}`);
525
+ done(error);
526
+ }
527
+ } else {
528
+ log.error('getSubscriptions task is false, skipping test');
529
+ skipCount += 1;
530
+ done();
531
+ }// end if task
532
+ }).timeout(attemptTimeout);
533
+ });
534
+
535
+ describe('#getSubscriptionsSubscriptionId - errors', () => {
536
+ it('should work if integrated or standalone with mockdata', (done) => {
537
+ if (pronghorn.methodsByName.getSubscriptionsSubscriptionId.task) {
538
+ try {
539
+ a.getSubscriptionsSubscriptionId(subscriptionsSubscriptionId, (data, error) => {
540
+ try {
541
+ if (stub) {
542
+ runCommonAsserts(data, error);
543
+ assert.equal('string', data.response.id);
544
+ assert.equal('object', typeof data.response.filter);
545
+ assert.equal('string', data.response.callbackUri);
546
+ assert.equal('object', typeof data.response._links);
547
+ } else {
548
+ runCommonAsserts(data, error);
549
+ }
550
+ saveMockData('Subscriptions', 'getSubscriptionsSubscriptionId', 'default', data);
551
+ done();
552
+ } catch (err) {
553
+ log.error(`Test Failure: ${err}`);
554
+ done(err);
555
+ }
556
+ });
557
+ } catch (error) {
558
+ log.error(`Adapter Exception: ${error}`);
559
+ done(error);
560
+ }
561
+ } else {
562
+ log.error('getSubscriptionsSubscriptionId task is false, skipping test');
563
+ skipCount += 1;
564
+ done();
565
+ }// end if task
566
+ }).timeout(attemptTimeout);
567
+ });
568
+
569
+ describe('#deleteSubscriptionsSubscriptionId - errors', () => {
570
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
571
+ if (pronghorn.methodsByName.deleteSubscriptionsSubscriptionId.task) {
572
+ try {
573
+ a.deleteSubscriptionsSubscriptionId(subscriptionsSubscriptionId, (data, error) => {
574
+ try {
575
+ if (stub) {
576
+ const displayE = 'Error 400 received on request';
577
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
578
+ } else {
579
+ runCommonAsserts(data, error);
580
+ }
581
+ saveMockData('Subscriptions', 'deleteSubscriptionsSubscriptionId', 'default', data);
582
+ done();
583
+ } catch (err) {
584
+ log.error(`Test Failure: ${err}`);
585
+ done(err);
586
+ }
587
+ });
588
+ } catch (error) {
589
+ log.error(`Adapter Exception: ${error}`);
590
+ done(error);
591
+ }
592
+ } else {
593
+ log.error('deleteSubscriptionsSubscriptionId task is false, skipping test');
594
+ skipCount += 1;
595
+ done();
596
+ }// end if task
597
+ }).timeout(attemptTimeout);
598
+ });
599
+
600
+ describe('#getAlarms - errors', () => {
601
+ it('should work if integrated or standalone with mockdata', (done) => {
602
+ if (pronghorn.methodsByName.getAlarms.task) {
603
+ try {
604
+ a.getAlarms(null, null, (data, error) => {
605
+ try {
606
+ if (stub) {
607
+ runCommonAsserts(data, error);
608
+ assert.equal('string', data.response.id);
609
+ assert.equal('string', data.response.managedObjectId);
610
+ assert.equal('object', typeof data.response.rootCauseFaultyResource);
611
+ assert.equal('string', data.response.alarmRaisedTime);
612
+ assert.equal('string', data.response.alarmChangedTime);
613
+ assert.equal('string', data.response.alarmClearedTime);
614
+ assert.equal('string', data.response.alarmAcknowledgedTime);
615
+ assert.equal('ACKNOWLEDGED', data.response.ackState);
616
+ assert.equal('WARNING', data.response.perceivedSeverity);
617
+ assert.equal('string', data.response.eventTime);
618
+ assert.equal('COMMUNICATIONS_ALARM', data.response.eventType);
619
+ assert.equal('string', data.response.faultType);
620
+ assert.equal('string', data.response.probableCause);
621
+ assert.equal(true, data.response.isRootCause);
622
+ assert.equal(true, Array.isArray(data.response.correlatedAlarmIds));
623
+ assert.equal(true, Array.isArray(data.response.faultDetails));
624
+ assert.equal('object', typeof data.response._links);
625
+ } else {
626
+ runCommonAsserts(data, error);
627
+ }
628
+ saveMockData('Alarms', 'getAlarms', 'default', data);
629
+ done();
630
+ } catch (err) {
631
+ log.error(`Test Failure: ${err}`);
632
+ done(err);
633
+ }
634
+ });
635
+ } catch (error) {
636
+ log.error(`Adapter Exception: ${error}`);
637
+ done(error);
638
+ }
639
+ } else {
640
+ log.error('getAlarms task is false, skipping test');
641
+ skipCount += 1;
642
+ done();
643
+ }// end if task
644
+ }).timeout(attemptTimeout);
645
+ });
646
+
647
+ describe('#getAlarmsAlarmId - errors', () => {
648
+ it('should work if integrated or standalone with mockdata', (done) => {
649
+ if (pronghorn.methodsByName.getAlarmsAlarmId.task) {
650
+ try {
651
+ a.getAlarmsAlarmId('fakedata', (data, error) => {
652
+ try {
653
+ if (stub) {
654
+ runCommonAsserts(data, error);
655
+ assert.equal('string', data.response.id);
656
+ assert.equal('string', data.response.managedObjectId);
657
+ assert.equal('object', typeof data.response.rootCauseFaultyResource);
658
+ assert.equal('string', data.response.alarmRaisedTime);
659
+ assert.equal('string', data.response.alarmChangedTime);
660
+ assert.equal('string', data.response.alarmClearedTime);
661
+ assert.equal('string', data.response.alarmAcknowledgedTime);
662
+ assert.equal('UNACKNOWLEDGED', data.response.ackState);
663
+ assert.equal('WARNING', data.response.perceivedSeverity);
664
+ assert.equal('string', data.response.eventTime);
665
+ assert.equal('ENVIRONMENTAL_ALARM', data.response.eventType);
666
+ assert.equal('string', data.response.faultType);
667
+ assert.equal('string', data.response.probableCause);
668
+ assert.equal(true, data.response.isRootCause);
669
+ assert.equal(true, Array.isArray(data.response.correlatedAlarmIds));
670
+ assert.equal(true, Array.isArray(data.response.faultDetails));
671
+ assert.equal('object', typeof data.response._links);
672
+ } else {
673
+ runCommonAsserts(data, error);
674
+ }
675
+ saveMockData('Alarms', 'getAlarmsAlarmId', 'default', data);
676
+ done();
677
+ } catch (err) {
678
+ log.error(`Test Failure: ${err}`);
679
+ done(err);
680
+ }
681
+ });
682
+ } catch (error) {
683
+ log.error(`Adapter Exception: ${error}`);
684
+ done(error);
685
+ }
686
+ } else {
687
+ log.error('getAlarmsAlarmId task is false, skipping test');
688
+ skipCount += 1;
689
+ done();
690
+ }// end if task
691
+ }).timeout(attemptTimeout);
692
+ });
693
+
694
+ const alarmsPatchAlarmsAlarmIdBodyParam = {
695
+ ackState: 'UNACKNOWLEDGED'
696
+ };
697
+ describe('#patchAlarmsAlarmId - errors', () => {
698
+ it('should work if integrated or standalone with mockdata', (done) => {
699
+ if (pronghorn.methodsByName.patchAlarmsAlarmId.task) {
700
+ try {
701
+ a.patchAlarmsAlarmId('fakedata', alarmsPatchAlarmsAlarmIdBodyParam, (data, error) => {
702
+ try {
703
+ if (stub) {
704
+ runCommonAsserts(data, error);
705
+ assert.equal('success', data.response);
706
+ } else {
707
+ runCommonAsserts(data, error);
708
+ }
709
+ saveMockData('Alarms', 'patchAlarmsAlarmId', 'default', data);
710
+ done();
711
+ } catch (err) {
712
+ log.error(`Test Failure: ${err}`);
713
+ done(err);
714
+ }
715
+ });
716
+ } catch (error) {
717
+ log.error(`Adapter Exception: ${error}`);
718
+ done(error);
719
+ }
720
+ } else {
721
+ log.error('patchAlarmsAlarmId task is false, skipping test');
722
+ skipCount += 1;
723
+ done();
724
+ }// end if task
725
+ }).timeout(attemptTimeout);
726
+ });
727
+
728
+ describe('#getIndicators - errors', () => {
729
+ it('should work if integrated or standalone with mockdata', (done) => {
730
+ if (pronghorn.methodsByName.getIndicators.task) {
731
+ try {
732
+ a.getIndicators(null, null, (data, error) => {
733
+ try {
734
+ if (stub) {
735
+ runCommonAsserts(data, error);
736
+ assert.equal('object', typeof data.response[0]);
737
+ assert.equal('object', typeof data.response[1]);
738
+ assert.equal('object', typeof data.response[2]);
739
+ assert.equal('object', typeof data.response[3]);
740
+ } else {
741
+ runCommonAsserts(data, error);
742
+ }
743
+ saveMockData('Indicators', 'getIndicators', 'default', data);
744
+ done();
745
+ } catch (err) {
746
+ log.error(`Test Failure: ${err}`);
747
+ done(err);
748
+ }
749
+ });
750
+ } catch (error) {
751
+ log.error(`Adapter Exception: ${error}`);
752
+ done(error);
753
+ }
754
+ } else {
755
+ log.error('getIndicators task is false, skipping test');
756
+ skipCount += 1;
757
+ done();
758
+ }// end if task
759
+ }).timeout(attemptTimeout);
760
+ });
761
+
762
+ describe('#getIndicatorsVnfInstanceId - errors', () => {
763
+ it('should work if integrated or standalone with mockdata', (done) => {
764
+ if (pronghorn.methodsByName.getIndicatorsVnfInstanceId.task) {
765
+ try {
766
+ a.getIndicatorsVnfInstanceId('fakedata', null, null, (data, error) => {
767
+ try {
768
+ if (stub) {
769
+ runCommonAsserts(data, error);
770
+ assert.equal('object', typeof data.response[0]);
771
+ } else {
772
+ runCommonAsserts(data, error);
773
+ }
774
+ saveMockData('Indicators', 'getIndicatorsVnfInstanceId', 'default', data);
775
+ done();
776
+ } catch (err) {
777
+ log.error(`Test Failure: ${err}`);
778
+ done(err);
779
+ }
780
+ });
781
+ } catch (error) {
782
+ log.error(`Adapter Exception: ${error}`);
783
+ done(error);
784
+ }
785
+ } else {
786
+ log.error('getIndicatorsVnfInstanceId task is false, skipping test');
787
+ skipCount += 1;
788
+ done();
789
+ }// end if task
790
+ }).timeout(attemptTimeout);
791
+ });
792
+
793
+ describe('#getIndicatorsVnfInstanceIdIndicatorId - errors', () => {
794
+ it('should work if integrated or standalone with mockdata', (done) => {
795
+ if (pronghorn.methodsByName.getIndicatorsVnfInstanceIdIndicatorId.task) {
796
+ try {
797
+ a.getIndicatorsVnfInstanceIdIndicatorId('fakedata', 'fakedata', (data, error) => {
798
+ try {
799
+ if (stub) {
800
+ runCommonAsserts(data, error);
801
+ assert.equal('string', data.response.id);
802
+ assert.equal('string', data.response.name);
803
+ assert.equal('object', typeof data.response.value);
804
+ assert.equal('string', data.response.vnfInstanceId);
805
+ assert.equal('object', typeof data.response._links);
806
+ } else {
807
+ runCommonAsserts(data, error);
808
+ }
809
+ saveMockData('Indicators', 'getIndicatorsVnfInstanceIdIndicatorId', 'default', data);
810
+ done();
811
+ } catch (err) {
812
+ log.error(`Test Failure: ${err}`);
813
+ done(err);
814
+ }
815
+ });
816
+ } catch (error) {
817
+ log.error(`Adapter Exception: ${error}`);
818
+ done(error);
819
+ }
820
+ } else {
821
+ log.error('getIndicatorsVnfInstanceIdIndicatorId task is false, skipping test');
822
+ skipCount += 1;
823
+ done();
824
+ }// end if task
825
+ }).timeout(attemptTimeout);
826
+ });
827
+
828
+ describe('#getIndicatorsSubscriptionsSubscriptionId - errors', () => {
829
+ it('should work if integrated or standalone with mockdata', (done) => {
830
+ if (pronghorn.methodsByName.getIndicatorsSubscriptionsSubscriptionId.task) {
831
+ try {
832
+ a.getIndicatorsSubscriptionsSubscriptionId('fakedata', (data, error) => {
833
+ try {
834
+ if (stub) {
835
+ runCommonAsserts(data, error);
836
+ assert.equal('string', data.response.id);
837
+ assert.equal('object', typeof data.response.filter);
838
+ assert.equal('string', data.response.callbackUri);
839
+ assert.equal('object', typeof data.response._links);
840
+ } else {
841
+ runCommonAsserts(data, error);
842
+ }
843
+ saveMockData('Indicators', 'getIndicatorsSubscriptionsSubscriptionId', 'default', data);
844
+ done();
845
+ } catch (err) {
846
+ log.error(`Test Failure: ${err}`);
847
+ done(err);
848
+ }
849
+ });
850
+ } catch (error) {
851
+ log.error(`Adapter Exception: ${error}`);
852
+ done(error);
853
+ }
854
+ } else {
855
+ log.error('getIndicatorsSubscriptionsSubscriptionId task is false, skipping test');
856
+ skipCount += 1;
857
+ done();
858
+ }// end if task
859
+ }).timeout(attemptTimeout);
860
+ });
861
+
862
+ describe('#deleteIndicatorsSubscriptionsSubscriptionId - errors', () => {
863
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
864
+ if (pronghorn.methodsByName.deleteIndicatorsSubscriptionsSubscriptionId.task) {
865
+ try {
866
+ a.deleteIndicatorsSubscriptionsSubscriptionId('fakedata', (data, error) => {
867
+ try {
868
+ if (stub) {
869
+ const displayE = 'Error 400 received on request';
870
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
871
+ } else {
872
+ runCommonAsserts(data, error);
873
+ }
874
+ saveMockData('Indicators', 'deleteIndicatorsSubscriptionsSubscriptionId', 'default', data);
875
+ done();
876
+ } catch (err) {
877
+ log.error(`Test Failure: ${err}`);
878
+ done(err);
879
+ }
880
+ });
881
+ } catch (error) {
882
+ log.error(`Adapter Exception: ${error}`);
883
+ done(error);
884
+ }
885
+ } else {
886
+ log.error('deleteIndicatorsSubscriptionsSubscriptionId task is false, skipping test');
887
+ skipCount += 1;
888
+ done();
889
+ }// end if task
890
+ }).timeout(attemptTimeout);
891
+ });
892
+
893
+ const vnfInstancesPostVnfInstancesBodyParam = {
894
+ vnfdId: 'string'
895
+ };
896
+ describe('#postVnfInstances - errors', () => {
897
+ it('should work if integrated or standalone with mockdata', (done) => {
898
+ if (pronghorn.methodsByName.postVnfInstances.task) {
899
+ try {
900
+ a.postVnfInstances(vnfInstancesPostVnfInstancesBodyParam, (data, error) => {
901
+ try {
902
+ if (stub) {
903
+ runCommonAsserts(data, error);
904
+ assert.equal('string', data.response.id);
905
+ assert.equal('string', data.response.vnfInstanceName);
906
+ assert.equal('string', data.response.vnfInstanceDescription);
907
+ assert.equal('string', data.response.vnfdId);
908
+ assert.equal('string', data.response.vnfProvider);
909
+ assert.equal('string', data.response.vnfProductName);
910
+ assert.equal('string', data.response.vnfSoftwareVersion);
911
+ assert.equal('string', data.response.vnfdVersion);
912
+ assert.equal('object', typeof data.response.vnfConfigurableProperties);
913
+ assert.equal('object', typeof data.response.vimConnectionInfo);
914
+ assert.equal('NOT_INSTANTIATED', data.response.instantiationState);
915
+ assert.equal('object', typeof data.response.instantiatedVnfInfo);
916
+ assert.equal('object', typeof data.response.metadata);
917
+ assert.equal('object', typeof data.response._links);
918
+ } else {
919
+ runCommonAsserts(data, error);
920
+ }
921
+ saveMockData('VnfInstances', 'postVnfInstances', 'default', data);
922
+ done();
923
+ } catch (err) {
924
+ log.error(`Test Failure: ${err}`);
925
+ done(err);
926
+ }
927
+ });
928
+ } catch (error) {
929
+ log.error(`Adapter Exception: ${error}`);
930
+ done(error);
931
+ }
932
+ } else {
933
+ log.error('postVnfInstances task is false, skipping test');
934
+ skipCount += 1;
935
+ done();
936
+ }// end if task
937
+ }).timeout(attemptTimeout);
938
+ });
939
+
940
+ describe('#getVnfInstances - errors', () => {
941
+ it('should work if integrated or standalone with mockdata', (done) => {
942
+ if (pronghorn.methodsByName.getVnfInstances.task) {
943
+ try {
944
+ a.getVnfInstances(null, null, null, null, null, null, (data, error) => {
945
+ try {
946
+ if (stub) {
947
+ runCommonAsserts(data, error);
948
+ assert.equal('object', typeof data.response[0]);
949
+ assert.equal('object', typeof data.response[1]);
950
+ assert.equal('object', typeof data.response[2]);
951
+ } else {
952
+ runCommonAsserts(data, error);
953
+ }
954
+ saveMockData('VnfInstances', 'getVnfInstances', 'default', data);
955
+ done();
956
+ } catch (err) {
957
+ log.error(`Test Failure: ${err}`);
958
+ done(err);
959
+ }
960
+ });
961
+ } catch (error) {
962
+ log.error(`Adapter Exception: ${error}`);
963
+ done(error);
964
+ }
965
+ } else {
966
+ log.error('getVnfInstances task is false, skipping test');
967
+ skipCount += 1;
968
+ done();
969
+ }// end if task
970
+ }).timeout(attemptTimeout);
971
+ });
972
+
973
+ describe('#getVnfInstancesVnfInstanceId - errors', () => {
974
+ it('should work if integrated or standalone with mockdata', (done) => {
975
+ if (pronghorn.methodsByName.getVnfInstancesVnfInstanceId.task) {
976
+ try {
977
+ a.getVnfInstancesVnfInstanceId('fakedata', (data, error) => {
978
+ try {
979
+ if (stub) {
980
+ runCommonAsserts(data, error);
981
+ assert.equal('string', data.response.id);
982
+ assert.equal('string', data.response.vnfInstanceName);
983
+ assert.equal('string', data.response.vnfInstanceDescription);
984
+ assert.equal('string', data.response.vnfdId);
985
+ assert.equal('string', data.response.vnfProvider);
986
+ assert.equal('string', data.response.vnfProductName);
987
+ assert.equal('string', data.response.vnfSoftwareVersion);
988
+ assert.equal('string', data.response.vnfdVersion);
989
+ assert.equal('object', typeof data.response.vnfConfigurableProperties);
990
+ assert.equal('object', typeof data.response.vimConnectionInfo);
991
+ assert.equal('INSTANTIATED', data.response.instantiationState);
992
+ assert.equal('object', typeof data.response.instantiatedVnfInfo);
993
+ assert.equal('object', typeof data.response.metadata);
994
+ assert.equal('object', typeof data.response._links);
995
+ } else {
996
+ runCommonAsserts(data, error);
997
+ }
998
+ saveMockData('VnfInstances', 'getVnfInstancesVnfInstanceId', 'default', data);
999
+ done();
1000
+ } catch (err) {
1001
+ log.error(`Test Failure: ${err}`);
1002
+ done(err);
1003
+ }
1004
+ });
1005
+ } catch (error) {
1006
+ log.error(`Adapter Exception: ${error}`);
1007
+ done(error);
1008
+ }
1009
+ } else {
1010
+ log.error('getVnfInstancesVnfInstanceId task is false, skipping test');
1011
+ skipCount += 1;
1012
+ done();
1013
+ }// end if task
1014
+ }).timeout(attemptTimeout);
1015
+ });
1016
+
1017
+ const vnfInstancesPatchVnfInstancesVnfInstanceIdBodyParam = {
1018
+ vnfInstanceName: 'string',
1019
+ vnfInstanceDescription: 'string',
1020
+ vnfPkgId: 'string',
1021
+ vnfConfigurableProperties: {},
1022
+ metadata: {},
1023
+ extensions: {},
1024
+ vimConnectionInfo: {}
1025
+ };
1026
+ describe('#patchVnfInstancesVnfInstanceId - errors', () => {
1027
+ it('should work if integrated or standalone with mockdata', (done) => {
1028
+ if (pronghorn.methodsByName.patchVnfInstancesVnfInstanceId.task) {
1029
+ try {
1030
+ a.patchVnfInstancesVnfInstanceId('fakedata', vnfInstancesPatchVnfInstancesVnfInstanceIdBodyParam, (data, error) => {
1031
+ try {
1032
+ if (stub) {
1033
+ runCommonAsserts(data, error);
1034
+ assert.equal('success', data.response);
1035
+ } else {
1036
+ runCommonAsserts(data, error);
1037
+ }
1038
+ saveMockData('VnfInstances', 'patchVnfInstancesVnfInstanceId', 'default', data);
1039
+ done();
1040
+ } catch (err) {
1041
+ log.error(`Test Failure: ${err}`);
1042
+ done(err);
1043
+ }
1044
+ });
1045
+ } catch (error) {
1046
+ log.error(`Adapter Exception: ${error}`);
1047
+ done(error);
1048
+ }
1049
+ } else {
1050
+ log.error('patchVnfInstancesVnfInstanceId task is false, skipping test');
1051
+ skipCount += 1;
1052
+ done();
1053
+ }// end if task
1054
+ }).timeout(attemptTimeout);
1055
+ });
1056
+
1057
+ describe('#deleteVnfInstancesVnfInstanceId - errors', () => {
1058
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1059
+ if (pronghorn.methodsByName.deleteVnfInstancesVnfInstanceId.task) {
1060
+ try {
1061
+ a.deleteVnfInstancesVnfInstanceId('fakedata', (data, error) => {
1062
+ try {
1063
+ if (stub) {
1064
+ const displayE = 'Error 400 received on request';
1065
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1066
+ } else {
1067
+ runCommonAsserts(data, error);
1068
+ }
1069
+ saveMockData('VnfInstances', 'deleteVnfInstancesVnfInstanceId', 'default', data);
1070
+ done();
1071
+ } catch (err) {
1072
+ log.error(`Test Failure: ${err}`);
1073
+ done(err);
1074
+ }
1075
+ });
1076
+ } catch (error) {
1077
+ log.error(`Adapter Exception: ${error}`);
1078
+ done(error);
1079
+ }
1080
+ } else {
1081
+ log.error('deleteVnfInstancesVnfInstanceId task is false, skipping test');
1082
+ skipCount += 1;
1083
+ done();
1084
+ }// end if task
1085
+ }).timeout(attemptTimeout);
1086
+ });
1087
+
1088
+ const vnfInstancesPostVnfInstancesVnfInstanceIdInstantiateBodyParam = {
1089
+ flavourId: 'string'
1090
+ };
1091
+ describe('#postVnfInstancesVnfInstanceIdInstantiate - errors', () => {
1092
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1093
+ if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdInstantiate.task) {
1094
+ try {
1095
+ a.postVnfInstancesVnfInstanceIdInstantiate('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdInstantiateBodyParam, (data, error) => {
1096
+ try {
1097
+ if (stub) {
1098
+ const displayE = 'Error 400 received on request';
1099
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1100
+ } else {
1101
+ runCommonAsserts(data, error);
1102
+ }
1103
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdInstantiate', 'default', data);
1104
+ done();
1105
+ } catch (err) {
1106
+ log.error(`Test Failure: ${err}`);
1107
+ done(err);
1108
+ }
1109
+ });
1110
+ } catch (error) {
1111
+ log.error(`Adapter Exception: ${error}`);
1112
+ done(error);
1113
+ }
1114
+ } else {
1115
+ log.error('postVnfInstancesVnfInstanceIdInstantiate task is false, skipping test');
1116
+ skipCount += 1;
1117
+ done();
1118
+ }// end if task
1119
+ }).timeout(attemptTimeout);
1120
+ });
1121
+
1122
+ const vnfInstancesPostVnfInstancesVnfInstanceIdScaleBodyParam = {
1123
+ type: 'SCALE_IN',
1124
+ aspectId: 'string'
1125
+ };
1126
+ describe('#postVnfInstancesVnfInstanceIdScale - errors', () => {
1127
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1128
+ if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdScale.task) {
1129
+ try {
1130
+ a.postVnfInstancesVnfInstanceIdScale('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdScaleBodyParam, (data, error) => {
1131
+ try {
1132
+ if (stub) {
1133
+ const displayE = 'Error 400 received on request';
1134
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1135
+ } else {
1136
+ runCommonAsserts(data, error);
1137
+ }
1138
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdScale', 'default', data);
1139
+ done();
1140
+ } catch (err) {
1141
+ log.error(`Test Failure: ${err}`);
1142
+ done(err);
1143
+ }
1144
+ });
1145
+ } catch (error) {
1146
+ log.error(`Adapter Exception: ${error}`);
1147
+ done(error);
1148
+ }
1149
+ } else {
1150
+ log.error('postVnfInstancesVnfInstanceIdScale task is false, skipping test');
1151
+ skipCount += 1;
1152
+ done();
1153
+ }// end if task
1154
+ }).timeout(attemptTimeout);
1155
+ });
1156
+
1157
+ const vnfInstancesPostVnfInstancesVnfInstanceIdScaleToLevelBodyParam = {
1158
+ instantiationLevelId: 'string',
1159
+ scaleInfo: [
1160
+ {
1161
+ aspectId: 'string',
1162
+ vnfdId: 'string',
1163
+ scaleLevel: 4
1164
+ }
1165
+ ],
1166
+ additionalParams: {}
1167
+ };
1168
+ describe('#postVnfInstancesVnfInstanceIdScaleToLevel - errors', () => {
1169
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1170
+ if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdScaleToLevel.task) {
1171
+ try {
1172
+ a.postVnfInstancesVnfInstanceIdScaleToLevel('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdScaleToLevelBodyParam, (data, error) => {
1173
+ try {
1174
+ if (stub) {
1175
+ const displayE = 'Error 400 received on request';
1176
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1177
+ } else {
1178
+ runCommonAsserts(data, error);
1179
+ }
1180
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdScaleToLevel', 'default', data);
1181
+ done();
1182
+ } catch (err) {
1183
+ log.error(`Test Failure: ${err}`);
1184
+ done(err);
1185
+ }
1186
+ });
1187
+ } catch (error) {
1188
+ log.error(`Adapter Exception: ${error}`);
1189
+ done(error);
1190
+ }
1191
+ } else {
1192
+ log.error('postVnfInstancesVnfInstanceIdScaleToLevel task is false, skipping test');
1193
+ skipCount += 1;
1194
+ done();
1195
+ }// end if task
1196
+ }).timeout(attemptTimeout);
1197
+ });
1198
+
1199
+ const vnfInstancesPostVnfInstancesVnfInstanceIdChangeFlavourBodyParam = {
1200
+ newFlavourId: 'string'
1201
+ };
1202
+ describe('#postVnfInstancesVnfInstanceIdChangeFlavour - errors', () => {
1203
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1204
+ if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdChangeFlavour.task) {
1205
+ try {
1206
+ a.postVnfInstancesVnfInstanceIdChangeFlavour('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdChangeFlavourBodyParam, (data, error) => {
1207
+ try {
1208
+ if (stub) {
1209
+ const displayE = 'Error 400 received on request';
1210
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1211
+ } else {
1212
+ runCommonAsserts(data, error);
1213
+ }
1214
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdChangeFlavour', 'default', data);
1215
+ done();
1216
+ } catch (err) {
1217
+ log.error(`Test Failure: ${err}`);
1218
+ done(err);
1219
+ }
1220
+ });
1221
+ } catch (error) {
1222
+ log.error(`Adapter Exception: ${error}`);
1223
+ done(error);
1224
+ }
1225
+ } else {
1226
+ log.error('postVnfInstancesVnfInstanceIdChangeFlavour task is false, skipping test');
1227
+ skipCount += 1;
1228
+ done();
1229
+ }// end if task
1230
+ }).timeout(attemptTimeout);
1231
+ });
1232
+
1233
+ const vnfInstancesPostVnfInstancesVnfInstanceIdTerminateBodyParam = {
1234
+ terminationType: 'GRACEFUL'
1235
+ };
1236
+ describe('#postVnfInstancesVnfInstanceIdTerminate - errors', () => {
1237
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1238
+ if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdTerminate.task) {
1239
+ try {
1240
+ a.postVnfInstancesVnfInstanceIdTerminate('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdTerminateBodyParam, (data, error) => {
1241
+ try {
1242
+ if (stub) {
1243
+ const displayE = 'Error 400 received on request';
1244
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1245
+ } else {
1246
+ runCommonAsserts(data, error);
1247
+ }
1248
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdTerminate', 'default', data);
1249
+ done();
1250
+ } catch (err) {
1251
+ log.error(`Test Failure: ${err}`);
1252
+ done(err);
1253
+ }
1254
+ });
1255
+ } catch (error) {
1256
+ log.error(`Adapter Exception: ${error}`);
1257
+ done(error);
1258
+ }
1259
+ } else {
1260
+ log.error('postVnfInstancesVnfInstanceIdTerminate task is false, skipping test');
1261
+ skipCount += 1;
1262
+ done();
1263
+ }// end if task
1264
+ }).timeout(attemptTimeout);
1265
+ });
1266
+
1267
+ const vnfInstancesPostVnfInstancesVnfInstanceIdHealBodyParam = {
1268
+ cause: 'string',
1269
+ additionalParams: {}
1270
+ };
1271
+ describe('#postVnfInstancesVnfInstanceIdHeal - errors', () => {
1272
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1273
+ if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdHeal.task) {
1274
+ try {
1275
+ a.postVnfInstancesVnfInstanceIdHeal('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdHealBodyParam, (data, error) => {
1276
+ try {
1277
+ if (stub) {
1278
+ const displayE = 'Error 400 received on request';
1279
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1280
+ } else {
1281
+ runCommonAsserts(data, error);
1282
+ }
1283
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdHeal', 'default', data);
1284
+ done();
1285
+ } catch (err) {
1286
+ log.error(`Test Failure: ${err}`);
1287
+ done(err);
1288
+ }
1289
+ });
1290
+ } catch (error) {
1291
+ log.error(`Adapter Exception: ${error}`);
1292
+ done(error);
1293
+ }
1294
+ } else {
1295
+ log.error('postVnfInstancesVnfInstanceIdHeal task is false, skipping test');
1296
+ skipCount += 1;
1297
+ done();
1298
+ }// end if task
1299
+ }).timeout(attemptTimeout);
1300
+ });
1301
+
1302
+ const vnfInstancesPostVnfInstancesVnfInstanceIdOperateBodyParam = {
1303
+ changeStateTo: 'STOPPED'
1304
+ };
1305
+ describe('#postVnfInstancesVnfInstanceIdOperate - errors', () => {
1306
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1307
+ if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdOperate.task) {
1308
+ try {
1309
+ a.postVnfInstancesVnfInstanceIdOperate('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdOperateBodyParam, (data, error) => {
1310
+ try {
1311
+ if (stub) {
1312
+ const displayE = 'Error 400 received on request';
1313
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1314
+ } else {
1315
+ runCommonAsserts(data, error);
1316
+ }
1317
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdOperate', 'default', data);
1318
+ done();
1319
+ } catch (err) {
1320
+ log.error(`Test Failure: ${err}`);
1321
+ done(err);
1322
+ }
1323
+ });
1324
+ } catch (error) {
1325
+ log.error(`Adapter Exception: ${error}`);
1326
+ done(error);
1327
+ }
1328
+ } else {
1329
+ log.error('postVnfInstancesVnfInstanceIdOperate task is false, skipping test');
1330
+ skipCount += 1;
1331
+ done();
1332
+ }// end if task
1333
+ }).timeout(attemptTimeout);
1334
+ });
1335
+
1336
+ const vnfInstancesPostVnfInstancesVnfInstanceIdChangeExtConnBodyParam = {
1337
+ extVirtualLinks: [
1338
+ {}
1339
+ ]
1340
+ };
1341
+ describe('#postVnfInstancesVnfInstanceIdChangeExtConn - errors', () => {
1342
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1343
+ if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdChangeExtConn.task) {
1344
+ try {
1345
+ a.postVnfInstancesVnfInstanceIdChangeExtConn('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdChangeExtConnBodyParam, (data, error) => {
1346
+ try {
1347
+ if (stub) {
1348
+ const displayE = 'Error 400 received on request';
1349
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1350
+ } else {
1351
+ runCommonAsserts(data, error);
1352
+ }
1353
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdChangeExtConn', 'default', data);
1354
+ done();
1355
+ } catch (err) {
1356
+ log.error(`Test Failure: ${err}`);
1357
+ done(err);
1358
+ }
1359
+ });
1360
+ } catch (error) {
1361
+ log.error(`Adapter Exception: ${error}`);
1362
+ done(error);
1363
+ }
1364
+ } else {
1365
+ log.error('postVnfInstancesVnfInstanceIdChangeExtConn task is false, skipping test');
1366
+ skipCount += 1;
1367
+ done();
1368
+ }// end if task
1369
+ }).timeout(attemptTimeout);
1370
+ });
1371
+
1372
+ const vnfInstancesPostVnfInstancesVnfInstanceIdChangeVnfpkgBodyParam = {
1373
+ vnfdId: 'string'
1374
+ };
1375
+ describe('#postVnfInstancesVnfInstanceIdChangeVnfpkg - errors', () => {
1376
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1377
+ if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdChangeVnfpkg.task) {
1378
+ try {
1379
+ a.postVnfInstancesVnfInstanceIdChangeVnfpkg('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdChangeVnfpkgBodyParam, (data, error) => {
1380
+ try {
1381
+ if (stub) {
1382
+ const displayE = 'Error 400 received on request';
1383
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1384
+ } else {
1385
+ runCommonAsserts(data, error);
1386
+ }
1387
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdChangeVnfpkg', 'default', data);
1388
+ done();
1389
+ } catch (err) {
1390
+ log.error(`Test Failure: ${err}`);
1391
+ done(err);
1392
+ }
1393
+ });
1394
+ } catch (error) {
1395
+ log.error(`Adapter Exception: ${error}`);
1396
+ done(error);
1397
+ }
1398
+ } else {
1399
+ log.error('postVnfInstancesVnfInstanceIdChangeVnfpkg task is false, skipping test');
1400
+ skipCount += 1;
1401
+ done();
1402
+ }// end if task
1403
+ }).timeout(attemptTimeout);
1404
+ });
1405
+
1406
+ const vnfInstancesPostVnfInstancesVnfInstanceIdCreateSnapshotBodyParam = {};
1407
+ describe('#postVnfInstancesVnfInstanceIdCreateSnapshot - errors', () => {
1408
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1409
+ if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdCreateSnapshot.task) {
1410
+ try {
1411
+ a.postVnfInstancesVnfInstanceIdCreateSnapshot('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdCreateSnapshotBodyParam, (data, error) => {
1412
+ try {
1413
+ if (stub) {
1414
+ const displayE = 'Error 400 received on request';
1415
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1416
+ } else {
1417
+ runCommonAsserts(data, error);
1418
+ }
1419
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdCreateSnapshot', 'default', data);
1420
+ done();
1421
+ } catch (err) {
1422
+ log.error(`Test Failure: ${err}`);
1423
+ done(err);
1424
+ }
1425
+ });
1426
+ } catch (error) {
1427
+ log.error(`Adapter Exception: ${error}`);
1428
+ done(error);
1429
+ }
1430
+ } else {
1431
+ log.error('postVnfInstancesVnfInstanceIdCreateSnapshot task is false, skipping test');
1432
+ skipCount += 1;
1433
+ done();
1434
+ }// end if task
1435
+ }).timeout(attemptTimeout);
1436
+ });
1437
+
1438
+ const vnfInstancesPostVnfInstancesVnfInstanceIdRevertToSnapshotBodyParam = {
1439
+ vnfSnapshotInfoId: 'string'
1440
+ };
1441
+ describe('#postVnfInstancesVnfInstanceIdRevertToSnapshot - errors', () => {
1442
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1443
+ if (pronghorn.methodsByName.postVnfInstancesVnfInstanceIdRevertToSnapshot.task) {
1444
+ try {
1445
+ a.postVnfInstancesVnfInstanceIdRevertToSnapshot('fakedata', vnfInstancesPostVnfInstancesVnfInstanceIdRevertToSnapshotBodyParam, (data, error) => {
1446
+ try {
1447
+ if (stub) {
1448
+ const displayE = 'Error 400 received on request';
1449
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1450
+ } else {
1451
+ runCommonAsserts(data, error);
1452
+ }
1453
+ saveMockData('VnfInstances', 'postVnfInstancesVnfInstanceIdRevertToSnapshot', 'default', data);
1454
+ done();
1455
+ } catch (err) {
1456
+ log.error(`Test Failure: ${err}`);
1457
+ done(err);
1458
+ }
1459
+ });
1460
+ } catch (error) {
1461
+ log.error(`Adapter Exception: ${error}`);
1462
+ done(error);
1463
+ }
1464
+ } else {
1465
+ log.error('postVnfInstancesVnfInstanceIdRevertToSnapshot task is false, skipping test');
1466
+ skipCount += 1;
1467
+ done();
1468
+ }// end if task
1469
+ }).timeout(attemptTimeout);
1470
+ });
1471
+
1472
+ describe('#getVnfLcmOpOccs - errors', () => {
1473
+ it('should work if integrated or standalone with mockdata', (done) => {
1474
+ if (pronghorn.methodsByName.getVnfLcmOpOccs.task) {
1475
+ try {
1476
+ a.getVnfLcmOpOccs(null, null, null, null, null, null, (data, error) => {
1477
+ try {
1478
+ if (stub) {
1479
+ runCommonAsserts(data, error);
1480
+ assert.equal('string', data.response.id);
1481
+ assert.equal('COMPLETED', data.response.operationState);
1482
+ assert.equal('string', data.response.stateEnteredTime);
1483
+ assert.equal('string', data.response.startTime);
1484
+ assert.equal('string', data.response.vnfInstanceId);
1485
+ assert.equal('string', data.response.grantId);
1486
+ assert.equal('OPERATE', data.response.operation);
1487
+ assert.equal(false, data.response.isAutomaticInvocation);
1488
+ assert.equal('object', typeof data.response.operationParams);
1489
+ assert.equal(false, data.response.isCancelPending);
1490
+ assert.equal('GRACEFUL', data.response.cancelMode);
1491
+ assert.equal('object', typeof data.response.error);
1492
+ assert.equal('object', typeof data.response.resourceChanges);
1493
+ assert.equal('object', typeof data.response.changedInfo);
1494
+ assert.equal(true, Array.isArray(data.response.changedExtConnectivity));
1495
+ assert.equal('object', typeof data.response.modificationsTriggeredByVnfPkgChange);
1496
+ assert.equal('string', data.response.vnfSnapshotInfoId);
1497
+ assert.equal('object', typeof data.response._links);
1498
+ } else {
1499
+ runCommonAsserts(data, error);
1500
+ }
1501
+ saveMockData('VnfLcmOpOccs', 'getVnfLcmOpOccs', 'default', data);
1502
+ done();
1503
+ } catch (err) {
1504
+ log.error(`Test Failure: ${err}`);
1505
+ done(err);
1506
+ }
1507
+ });
1508
+ } catch (error) {
1509
+ log.error(`Adapter Exception: ${error}`);
1510
+ done(error);
1511
+ }
1512
+ } else {
1513
+ log.error('getVnfLcmOpOccs task is false, skipping test');
1514
+ skipCount += 1;
1515
+ done();
1516
+ }// end if task
1517
+ }).timeout(attemptTimeout);
1518
+ });
1519
+
1520
+ describe('#getVnfLcmOpOccsVnfLcmOpOccId - errors', () => {
1521
+ it('should work if integrated or standalone with mockdata', (done) => {
1522
+ if (pronghorn.methodsByName.getVnfLcmOpOccsVnfLcmOpOccId.task) {
1523
+ try {
1524
+ a.getVnfLcmOpOccsVnfLcmOpOccId('fakedata', (data, error) => {
1525
+ try {
1526
+ if (stub) {
1527
+ runCommonAsserts(data, error);
1528
+ assert.equal('string', data.response.id);
1529
+ assert.equal('STARTING', data.response.operationState);
1530
+ assert.equal('string', data.response.stateEnteredTime);
1531
+ assert.equal('string', data.response.startTime);
1532
+ assert.equal('string', data.response.vnfInstanceId);
1533
+ assert.equal('string', data.response.grantId);
1534
+ assert.equal('REVERT_TO_SNAPSHOT', data.response.operation);
1535
+ assert.equal(true, data.response.isAutomaticInvocation);
1536
+ assert.equal('object', typeof data.response.operationParams);
1537
+ assert.equal(false, data.response.isCancelPending);
1538
+ assert.equal('GRACEFUL', data.response.cancelMode);
1539
+ assert.equal('object', typeof data.response.error);
1540
+ assert.equal('object', typeof data.response.resourceChanges);
1541
+ assert.equal('object', typeof data.response.changedInfo);
1542
+ assert.equal(true, Array.isArray(data.response.changedExtConnectivity));
1543
+ assert.equal('object', typeof data.response.modificationsTriggeredByVnfPkgChange);
1544
+ assert.equal('string', data.response.vnfSnapshotInfoId);
1545
+ assert.equal('object', typeof data.response._links);
1546
+ } else {
1547
+ runCommonAsserts(data, error);
1548
+ }
1549
+ saveMockData('VnfLcmOpOccs', 'getVnfLcmOpOccsVnfLcmOpOccId', 'default', data);
1550
+ done();
1551
+ } catch (err) {
1552
+ log.error(`Test Failure: ${err}`);
1553
+ done(err);
1554
+ }
1555
+ });
1556
+ } catch (error) {
1557
+ log.error(`Adapter Exception: ${error}`);
1558
+ done(error);
1559
+ }
1560
+ } else {
1561
+ log.error('getVnfLcmOpOccsVnfLcmOpOccId task is false, skipping test');
1562
+ skipCount += 1;
1563
+ done();
1564
+ }// end if task
1565
+ }).timeout(attemptTimeout);
1566
+ });
1567
+
1568
+ describe('#postVnfLcmOpOccsVnfLcmOpOccIdRetry - errors', () => {
1569
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1570
+ if (pronghorn.methodsByName.postVnfLcmOpOccsVnfLcmOpOccIdRetry.task) {
1571
+ try {
1572
+ a.postVnfLcmOpOccsVnfLcmOpOccIdRetry('fakedata', (data, error) => {
1573
+ try {
1574
+ if (stub) {
1575
+ const displayE = 'Error 400 received on request';
1576
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1577
+ } else {
1578
+ runCommonAsserts(data, error);
1579
+ }
1580
+ saveMockData('VnfLcmOpOccs', 'postVnfLcmOpOccsVnfLcmOpOccIdRetry', 'default', data);
1581
+ done();
1582
+ } catch (err) {
1583
+ log.error(`Test Failure: ${err}`);
1584
+ done(err);
1585
+ }
1586
+ });
1587
+ } catch (error) {
1588
+ log.error(`Adapter Exception: ${error}`);
1589
+ done(error);
1590
+ }
1591
+ } else {
1592
+ log.error('postVnfLcmOpOccsVnfLcmOpOccIdRetry task is false, skipping test');
1593
+ skipCount += 1;
1594
+ done();
1595
+ }// end if task
1596
+ }).timeout(attemptTimeout);
1597
+ });
1598
+
1599
+ describe('#postVnfLcmOpOccsVnfLcmOpOccIdRollback - errors', () => {
1600
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1601
+ if (pronghorn.methodsByName.postVnfLcmOpOccsVnfLcmOpOccIdRollback.task) {
1602
+ try {
1603
+ a.postVnfLcmOpOccsVnfLcmOpOccIdRollback('fakedata', (data, error) => {
1604
+ try {
1605
+ if (stub) {
1606
+ const displayE = 'Error 400 received on request';
1607
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1608
+ } else {
1609
+ runCommonAsserts(data, error);
1610
+ }
1611
+ saveMockData('VnfLcmOpOccs', 'postVnfLcmOpOccsVnfLcmOpOccIdRollback', 'default', data);
1612
+ done();
1613
+ } catch (err) {
1614
+ log.error(`Test Failure: ${err}`);
1615
+ done(err);
1616
+ }
1617
+ });
1618
+ } catch (error) {
1619
+ log.error(`Adapter Exception: ${error}`);
1620
+ done(error);
1621
+ }
1622
+ } else {
1623
+ log.error('postVnfLcmOpOccsVnfLcmOpOccIdRollback task is false, skipping test');
1624
+ skipCount += 1;
1625
+ done();
1626
+ }// end if task
1627
+ }).timeout(attemptTimeout);
1628
+ });
1629
+
1630
+ describe('#postVnfLcmOpOccsVnfLcmOpOccIdFail - errors', () => {
1631
+ it('should work if integrated or standalone with mockdata', (done) => {
1632
+ if (pronghorn.methodsByName.postVnfLcmOpOccsVnfLcmOpOccIdFail.task) {
1633
+ try {
1634
+ a.postVnfLcmOpOccsVnfLcmOpOccIdFail('fakedata', (data, error) => {
1635
+ try {
1636
+ if (stub) {
1637
+ runCommonAsserts(data, error);
1638
+ assert.equal('string', data.response.id);
1639
+ assert.equal('STARTING', data.response.operationState);
1640
+ assert.equal('string', data.response.stateEnteredTime);
1641
+ assert.equal('string', data.response.startTime);
1642
+ assert.equal('string', data.response.vnfInstanceId);
1643
+ assert.equal('string', data.response.grantId);
1644
+ assert.equal('SCALE', data.response.operation);
1645
+ assert.equal(false, data.response.isAutomaticInvocation);
1646
+ assert.equal('object', typeof data.response.operationParams);
1647
+ assert.equal(false, data.response.isCancelPending);
1648
+ assert.equal('FORCEFUL', data.response.cancelMode);
1649
+ assert.equal('object', typeof data.response.error);
1650
+ assert.equal('object', typeof data.response.resourceChanges);
1651
+ assert.equal('object', typeof data.response.changedInfo);
1652
+ assert.equal(true, Array.isArray(data.response.changedExtConnectivity));
1653
+ assert.equal('object', typeof data.response.modificationsTriggeredByVnfPkgChange);
1654
+ assert.equal('string', data.response.vnfSnapshotInfoId);
1655
+ assert.equal('object', typeof data.response._links);
1656
+ } else {
1657
+ runCommonAsserts(data, error);
1658
+ }
1659
+ saveMockData('VnfLcmOpOccs', 'postVnfLcmOpOccsVnfLcmOpOccIdFail', 'default', data);
1660
+ done();
1661
+ } catch (err) {
1662
+ log.error(`Test Failure: ${err}`);
1663
+ done(err);
1664
+ }
1665
+ });
1666
+ } catch (error) {
1667
+ log.error(`Adapter Exception: ${error}`);
1668
+ done(error);
1669
+ }
1670
+ } else {
1671
+ log.error('postVnfLcmOpOccsVnfLcmOpOccIdFail task is false, skipping test');
1672
+ skipCount += 1;
1673
+ done();
1674
+ }// end if task
1675
+ }).timeout(attemptTimeout);
1676
+ });
1677
+
1678
+ describe('#postVnfLcmOpOccsVnfLcmOpOccIdCancel - errors', () => {
1679
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1680
+ if (pronghorn.methodsByName.postVnfLcmOpOccsVnfLcmOpOccIdCancel.task) {
1681
+ try {
1682
+ a.postVnfLcmOpOccsVnfLcmOpOccIdCancel('fakedata', (data, error) => {
1683
+ try {
1684
+ if (stub) {
1685
+ const displayE = 'Error 400 received on request';
1686
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
1687
+ } else {
1688
+ runCommonAsserts(data, error);
1689
+ }
1690
+ saveMockData('VnfLcmOpOccs', 'postVnfLcmOpOccsVnfLcmOpOccIdCancel', 'default', data);
1691
+ done();
1692
+ } catch (err) {
1693
+ log.error(`Test Failure: ${err}`);
1694
+ done(err);
1695
+ }
1696
+ });
1697
+ } catch (error) {
1698
+ log.error(`Adapter Exception: ${error}`);
1699
+ done(error);
1700
+ }
1701
+ } else {
1702
+ log.error('postVnfLcmOpOccsVnfLcmOpOccIdCancel task is false, skipping test');
1703
+ skipCount += 1;
1704
+ done();
1705
+ }// end if task
1706
+ }).timeout(attemptTimeout);
1707
+ });
1708
+
1709
+ const vnfSnapshotsPostVnfSnapshotsBodyParam = {
1710
+ vnfSnapshotPkgId: 'string',
1711
+ vnfSnapshot: {
1712
+ id: 'string',
1713
+ vnfInstanceId: 'string',
1714
+ creationStartedAt: 'string',
1715
+ creationFinishedAt: 'string',
1716
+ vnfdId: 'string',
1717
+ vnfInstance: {
1718
+ id: 'string',
1719
+ vnfInstanceName: 'string',
1720
+ vnfInstanceDescription: 'string',
1721
+ vnfdId: 'string',
1722
+ vnfProvider: 'string',
1723
+ vnfProductName: 'string',
1724
+ vnfSoftwareVersion: 'string',
1725
+ vnfdVersion: 'string',
1726
+ vnfConfigurableProperties: {},
1727
+ vimConnectionInfo: {},
1728
+ instantiationState: 'INSTANTIATED',
1729
+ instantiatedVnfInfo: {
1730
+ flavourId: 'string',
1731
+ vnfState: 'STARTED',
1732
+ scaleStatus: [
1733
+ {
1734
+ aspectId: 'string',
1735
+ vnfdId: 'string',
1736
+ scaleLevel: 2
1737
+ }
1738
+ ],
1739
+ maxScaleLevels: [
1740
+ {
1741
+ aspectId: 'string',
1742
+ vnfdId: 'string',
1743
+ scaleLevel: 10
1744
+ }
1745
+ ],
1746
+ extCpInfo: [
1747
+ {
1748
+ id: 'string',
1749
+ cpdId: 'string',
1750
+ cpConfigId: 'string',
1751
+ vnfdId: 'string',
1752
+ cpProtocolInfo: [
1753
+ {
1754
+ layerProtocol: 'IP_OVER_ETHERNET',
1755
+ ipOverEthernet: {
1756
+ macAddress: 'string',
1757
+ segmentationId: 'string',
1758
+ ipAddresses: [
1759
+ {
1760
+ type: 'IPV6',
1761
+ addresses: [
1762
+ 'string'
1763
+ ],
1764
+ isDynamic: true,
1765
+ addressRange: {
1766
+ minAddress: 'string',
1767
+ maxAddress: 'string'
1768
+ },
1769
+ subnetId: 'string'
1770
+ }
1771
+ ]
1772
+ }
1773
+ }
1774
+ ],
1775
+ extLinkPortId: 'string',
1776
+ metadata: {},
1777
+ associatedVnfcCpId: 'string',
1778
+ associatedVnfVirtualLinkId: 'string'
1779
+ }
1780
+ ],
1781
+ extVirtualLinkInfo: [
1782
+ {
1783
+ id: 'string',
1784
+ resourceHandle: {
1785
+ vimConnectionId: 'string',
1786
+ resourceProviderId: 'string',
1787
+ resourceId: 'string',
1788
+ vimLevelResourceType: 'string'
1789
+ },
1790
+ extLinkPorts: [
1791
+ {
1792
+ id: 'string',
1793
+ resourceHandle: {
1794
+ vimConnectionId: 'string',
1795
+ resourceProviderId: 'string',
1796
+ resourceId: 'string',
1797
+ vimLevelResourceType: 'string'
1798
+ },
1799
+ cpInstanceId: 'string'
1800
+ }
1801
+ ],
1802
+ currentVnfExtCpData: [
1803
+ {
1804
+ cpdId: 'string',
1805
+ cpConfig: {}
1806
+ }
1807
+ ]
1808
+ }
1809
+ ],
1810
+ extManagedVirtualLinkInfo: [
1811
+ {
1812
+ id: 'string',
1813
+ vnfVirtualLinkDescId: 'string',
1814
+ vnfdId: 'string',
1815
+ networkResource: {
1816
+ vimConnectionId: 'string',
1817
+ resourceProviderId: 'string',
1818
+ resourceId: 'string',
1819
+ vimLevelResourceType: 'string'
1820
+ },
1821
+ vnfLinkPorts: [
1822
+ {
1823
+ id: 'string',
1824
+ resourceHandle: {
1825
+ vimConnectionId: 'string',
1826
+ resourceProviderId: 'string',
1827
+ resourceId: 'string',
1828
+ vimLevelResourceType: 'string'
1829
+ },
1830
+ cpInstanceId: 'string',
1831
+ cpInstanceType: 'VNFC_CP'
1832
+ }
1833
+ ],
1834
+ extManagedMultisiteVirtualLinkId: 'string'
1835
+ }
1836
+ ],
1837
+ monitoringParameters: [
1838
+ {
1839
+ id: 'string',
1840
+ vnfdId: 'string',
1841
+ name: 'string',
1842
+ performanceMetric: 'string'
1843
+ }
1844
+ ],
1845
+ localizationLanguage: 'string',
1846
+ vnfcResourceInfo: [
1847
+ {
1848
+ id: 'string',
1849
+ vduId: 'string',
1850
+ vnfdId: 'string',
1851
+ computeResource: {
1852
+ vimConnectionId: 'string',
1853
+ resourceProviderId: 'string',
1854
+ resourceId: 'string',
1855
+ vimLevelResourceType: 'string'
1856
+ },
1857
+ zoneId: 'string',
1858
+ storageResourceIds: [
1859
+ 'string'
1860
+ ],
1861
+ reservationId: 'string',
1862
+ vnfcCpInfo: [
1863
+ {
1864
+ id: 'string',
1865
+ cpdId: 'string',
1866
+ vnfExtCpId: 'string',
1867
+ cpProtocolInfo: [
1868
+ {
1869
+ layerProtocol: 'IP_OVER_ETHERNET',
1870
+ ipOverEthernet: {
1871
+ macAddress: 'string',
1872
+ segmentationId: 'string',
1873
+ ipAddresses: [
1874
+ {
1875
+ type: 'IPV6',
1876
+ addresses: [
1877
+ 'string'
1878
+ ],
1879
+ isDynamic: false,
1880
+ addressRange: {
1881
+ minAddress: 'string',
1882
+ maxAddress: 'string'
1883
+ },
1884
+ subnetId: 'string'
1885
+ }
1886
+ ]
1887
+ }
1888
+ }
1889
+ ],
1890
+ vnfLinkPortId: 'string',
1891
+ metadata: {}
1892
+ }
1893
+ ],
1894
+ metadata: {}
1895
+ }
1896
+ ],
1897
+ virtualLinkResourceInfo: [
1898
+ {
1899
+ id: 'string',
1900
+ vnfVirtualLinkDescId: 'string',
1901
+ vnfdId: 'string',
1902
+ networkResource: {
1903
+ vimConnectionId: 'string',
1904
+ resourceProviderId: 'string',
1905
+ resourceId: 'string',
1906
+ vimLevelResourceType: 'string'
1907
+ },
1908
+ zoneId: 'string',
1909
+ reservationId: 'string',
1910
+ vnfLinkPorts: [
1911
+ {
1912
+ id: 'string',
1913
+ resourceHandle: {
1914
+ vimConnectionId: 'string',
1915
+ resourceProviderId: 'string',
1916
+ resourceId: 'string',
1917
+ vimLevelResourceType: 'string'
1918
+ },
1919
+ cpInstanceId: 'string',
1920
+ cpInstanceType: 'EXT_CP'
1921
+ }
1922
+ ],
1923
+ metadata: {}
1924
+ }
1925
+ ],
1926
+ virtualStorageResourceInfo: [
1927
+ {
1928
+ id: 'string',
1929
+ virtualStorageDescId: 'string',
1930
+ vnfdId: 'string',
1931
+ storageResource: {
1932
+ vimConnectionId: 'string',
1933
+ resourceProviderId: 'string',
1934
+ resourceId: 'string',
1935
+ vimLevelResourceType: 'string'
1936
+ },
1937
+ zoneId: 'string',
1938
+ reservationId: 'string',
1939
+ metadata: {}
1940
+ }
1941
+ ]
1942
+ },
1943
+ metadata: {},
1944
+ extensions: null,
1945
+ _links: {
1946
+ self: {
1947
+ href: 'string'
1948
+ },
1949
+ indicators: {
1950
+ href: 'string'
1951
+ },
1952
+ instantiate: {
1953
+ href: 'string'
1954
+ },
1955
+ terminate: {
1956
+ href: 'string'
1957
+ },
1958
+ scale: {
1959
+ href: 'string'
1960
+ },
1961
+ scaleToLevel: {
1962
+ href: 'string'
1963
+ },
1964
+ changeFlavour: {
1965
+ href: 'string'
1966
+ },
1967
+ heal: {
1968
+ href: 'string'
1969
+ },
1970
+ operate: {
1971
+ href: 'string'
1972
+ },
1973
+ changeExtConn: {
1974
+ href: 'string'
1975
+ },
1976
+ createSnapshot: {
1977
+ href: 'string'
1978
+ },
1979
+ revertToSnapshot: {
1980
+ href: 'string'
1981
+ }
1982
+ }
1983
+ },
1984
+ vnfcSnapshots: [
1985
+ {
1986
+ id: 'string',
1987
+ vnfcInstanceId: 'string',
1988
+ creationStartedAt: 'string',
1989
+ creationFinishedAt: 'string',
1990
+ vnfcResourceInfoId: 'string',
1991
+ computeSnapshotResource: {
1992
+ vimConnectionId: 'string',
1993
+ resourceProviderId: 'string',
1994
+ resourceId: 'string',
1995
+ vimLevelResourceType: 'string'
1996
+ },
1997
+ storageSnapshotResources: [
1998
+ {
1999
+ storageResourceId: 'string',
2000
+ storageSnapshotResource: {}
2001
+ }
2002
+ ],
2003
+ userDefinedData: {}
2004
+ }
2005
+ ],
2006
+ vnfStateSnapshotInfo: {
2007
+ checksum: null,
2008
+ isEncrypted: null,
2009
+ metadata: null
2010
+ },
2011
+ userDefinedData: {},
2012
+ _links: {
2013
+ self: {
2014
+ href: 'string'
2015
+ },
2016
+ vnfStateSnapshot: {
2017
+ href: 'string'
2018
+ }
2019
+ }
2020
+ }
2021
+ };
2022
+ describe('#postVnfSnapshots - errors', () => {
2023
+ it('should work if integrated or standalone with mockdata', (done) => {
2024
+ if (pronghorn.methodsByName.postVnfSnapshots.task) {
2025
+ try {
2026
+ a.postVnfSnapshots(vnfSnapshotsPostVnfSnapshotsBodyParam, (data, error) => {
2027
+ try {
2028
+ if (stub) {
2029
+ runCommonAsserts(data, error);
2030
+ assert.equal('string', data.response.id);
2031
+ assert.equal('string', data.response.vnfSnapshotPkgId);
2032
+ assert.equal('object', typeof data.response.vnfSnapshot);
2033
+ assert.equal('object', typeof data.response._links);
2034
+ } else {
2035
+ runCommonAsserts(data, error);
2036
+ }
2037
+ saveMockData('VnfSnapshots', 'postVnfSnapshots', 'default', data);
2038
+ done();
2039
+ } catch (err) {
2040
+ log.error(`Test Failure: ${err}`);
2041
+ done(err);
2042
+ }
2043
+ });
2044
+ } catch (error) {
2045
+ log.error(`Adapter Exception: ${error}`);
2046
+ done(error);
2047
+ }
2048
+ } else {
2049
+ log.error('postVnfSnapshots task is false, skipping test');
2050
+ skipCount += 1;
2051
+ done();
2052
+ }// end if task
2053
+ }).timeout(attemptTimeout);
2054
+ });
2055
+
2056
+ describe('#getVnfSnapshots - errors', () => {
2057
+ it('should work if integrated or standalone with mockdata', (done) => {
2058
+ if (pronghorn.methodsByName.getVnfSnapshots.task) {
2059
+ try {
2060
+ a.getVnfSnapshots(null, null, null, null, null, null, (data, error) => {
2061
+ try {
2062
+ if (stub) {
2063
+ runCommonAsserts(data, error);
2064
+ assert.equal('object', typeof data.response[0]);
2065
+ } else {
2066
+ runCommonAsserts(data, error);
2067
+ }
2068
+ saveMockData('VnfSnapshots', 'getVnfSnapshots', 'default', data);
2069
+ done();
2070
+ } catch (err) {
2071
+ log.error(`Test Failure: ${err}`);
2072
+ done(err);
2073
+ }
2074
+ });
2075
+ } catch (error) {
2076
+ log.error(`Adapter Exception: ${error}`);
2077
+ done(error);
2078
+ }
2079
+ } else {
2080
+ log.error('getVnfSnapshots task is false, skipping test');
2081
+ skipCount += 1;
2082
+ done();
2083
+ }// end if task
2084
+ }).timeout(attemptTimeout);
2085
+ });
2086
+
2087
+ describe('#getVnfSnapshotsVnfSnapshotInfoId - errors', () => {
2088
+ it('should work if integrated or standalone with mockdata', (done) => {
2089
+ if (pronghorn.methodsByName.getVnfSnapshotsVnfSnapshotInfoId.task) {
2090
+ try {
2091
+ a.getVnfSnapshotsVnfSnapshotInfoId('fakedata', (data, error) => {
2092
+ try {
2093
+ if (stub) {
2094
+ runCommonAsserts(data, error);
2095
+ assert.equal('object', typeof data.response[0]);
2096
+ assert.equal('object', typeof data.response[1]);
2097
+ assert.equal('object', typeof data.response[2]);
2098
+ } else {
2099
+ runCommonAsserts(data, error);
2100
+ }
2101
+ saveMockData('VnfSnapshots', 'getVnfSnapshotsVnfSnapshotInfoId', 'default', data);
2102
+ done();
2103
+ } catch (err) {
2104
+ log.error(`Test Failure: ${err}`);
2105
+ done(err);
2106
+ }
2107
+ });
2108
+ } catch (error) {
2109
+ log.error(`Adapter Exception: ${error}`);
2110
+ done(error);
2111
+ }
2112
+ } else {
2113
+ log.error('getVnfSnapshotsVnfSnapshotInfoId task is false, skipping test');
2114
+ skipCount += 1;
2115
+ done();
2116
+ }// end if task
2117
+ }).timeout(attemptTimeout);
2118
+ });
2119
+
2120
+ const vnfSnapshotsPatchVnfSnapshotsVnfSnapshotInfoIdBodyParam = {
2121
+ vnfSnapshotPkgId: 'string',
2122
+ vnfSnapshot: {
2123
+ id: 'string',
2124
+ vnfInstanceId: 'string',
2125
+ creationStartedAt: 'string',
2126
+ creationFinishedAt: 'string',
2127
+ vnfdId: 'string',
2128
+ vnfInstance: {
2129
+ id: 'string',
2130
+ vnfInstanceName: 'string',
2131
+ vnfInstanceDescription: 'string',
2132
+ vnfdId: 'string',
2133
+ vnfProvider: 'string',
2134
+ vnfProductName: 'string',
2135
+ vnfSoftwareVersion: 'string',
2136
+ vnfdVersion: 'string',
2137
+ vnfConfigurableProperties: {},
2138
+ vimConnectionInfo: {},
2139
+ instantiationState: 'NOT_INSTANTIATED',
2140
+ instantiatedVnfInfo: {
2141
+ flavourId: 'string',
2142
+ vnfState: 'STOPPED',
2143
+ scaleStatus: [
2144
+ {
2145
+ aspectId: 'string',
2146
+ vnfdId: 'string',
2147
+ scaleLevel: 9
2148
+ }
2149
+ ],
2150
+ maxScaleLevels: [
2151
+ {
2152
+ aspectId: 'string',
2153
+ vnfdId: 'string',
2154
+ scaleLevel: 4
2155
+ }
2156
+ ],
2157
+ extCpInfo: [
2158
+ {
2159
+ id: 'string',
2160
+ cpdId: 'string',
2161
+ cpConfigId: 'string',
2162
+ vnfdId: 'string',
2163
+ cpProtocolInfo: [
2164
+ {
2165
+ layerProtocol: 'IP_OVER_ETHERNET',
2166
+ ipOverEthernet: {
2167
+ macAddress: 'string',
2168
+ segmentationId: 'string',
2169
+ ipAddresses: [
2170
+ {
2171
+ type: 'IPV4',
2172
+ addresses: [
2173
+ 'string'
2174
+ ],
2175
+ isDynamic: false,
2176
+ addressRange: {
2177
+ minAddress: 'string',
2178
+ maxAddress: 'string'
2179
+ },
2180
+ subnetId: 'string'
2181
+ }
2182
+ ]
2183
+ }
2184
+ }
2185
+ ],
2186
+ extLinkPortId: 'string',
2187
+ metadata: {},
2188
+ associatedVnfcCpId: 'string',
2189
+ associatedVnfVirtualLinkId: 'string'
2190
+ }
2191
+ ],
2192
+ extVirtualLinkInfo: [
2193
+ {
2194
+ id: 'string',
2195
+ resourceHandle: {
2196
+ vimConnectionId: 'string',
2197
+ resourceProviderId: 'string',
2198
+ resourceId: 'string',
2199
+ vimLevelResourceType: 'string'
2200
+ },
2201
+ extLinkPorts: [
2202
+ {
2203
+ id: 'string',
2204
+ resourceHandle: {
2205
+ vimConnectionId: 'string',
2206
+ resourceProviderId: 'string',
2207
+ resourceId: 'string',
2208
+ vimLevelResourceType: 'string'
2209
+ },
2210
+ cpInstanceId: 'string'
2211
+ }
2212
+ ],
2213
+ currentVnfExtCpData: [
2214
+ {
2215
+ cpdId: 'string',
2216
+ cpConfig: {}
2217
+ }
2218
+ ]
2219
+ }
2220
+ ],
2221
+ extManagedVirtualLinkInfo: [
2222
+ {
2223
+ id: 'string',
2224
+ vnfVirtualLinkDescId: 'string',
2225
+ vnfdId: 'string',
2226
+ networkResource: {
2227
+ vimConnectionId: 'string',
2228
+ resourceProviderId: 'string',
2229
+ resourceId: 'string',
2230
+ vimLevelResourceType: 'string'
2231
+ },
2232
+ vnfLinkPorts: [
2233
+ {
2234
+ id: 'string',
2235
+ resourceHandle: {
2236
+ vimConnectionId: 'string',
2237
+ resourceProviderId: 'string',
2238
+ resourceId: 'string',
2239
+ vimLevelResourceType: 'string'
2240
+ },
2241
+ cpInstanceId: 'string',
2242
+ cpInstanceType: 'VNFC_CP'
2243
+ }
2244
+ ],
2245
+ extManagedMultisiteVirtualLinkId: 'string'
2246
+ }
2247
+ ],
2248
+ monitoringParameters: [
2249
+ {
2250
+ id: 'string',
2251
+ vnfdId: 'string',
2252
+ name: 'string',
2253
+ performanceMetric: 'string'
2254
+ }
2255
+ ],
2256
+ localizationLanguage: 'string',
2257
+ vnfcResourceInfo: [
2258
+ {
2259
+ id: 'string',
2260
+ vduId: 'string',
2261
+ vnfdId: 'string',
2262
+ computeResource: {
2263
+ vimConnectionId: 'string',
2264
+ resourceProviderId: 'string',
2265
+ resourceId: 'string',
2266
+ vimLevelResourceType: 'string'
2267
+ },
2268
+ zoneId: 'string',
2269
+ storageResourceIds: [
2270
+ 'string'
2271
+ ],
2272
+ reservationId: 'string',
2273
+ vnfcCpInfo: [
2274
+ {
2275
+ id: 'string',
2276
+ cpdId: 'string',
2277
+ vnfExtCpId: 'string',
2278
+ cpProtocolInfo: [
2279
+ {
2280
+ layerProtocol: 'IP_OVER_ETHERNET',
2281
+ ipOverEthernet: {
2282
+ macAddress: 'string',
2283
+ segmentationId: 'string',
2284
+ ipAddresses: [
2285
+ {
2286
+ type: 'IPV6',
2287
+ addresses: [
2288
+ 'string'
2289
+ ],
2290
+ isDynamic: false,
2291
+ addressRange: {
2292
+ minAddress: 'string',
2293
+ maxAddress: 'string'
2294
+ },
2295
+ subnetId: 'string'
2296
+ }
2297
+ ]
2298
+ }
2299
+ }
2300
+ ],
2301
+ vnfLinkPortId: 'string',
2302
+ metadata: {}
2303
+ }
2304
+ ],
2305
+ metadata: {}
2306
+ }
2307
+ ],
2308
+ virtualLinkResourceInfo: [
2309
+ {
2310
+ id: 'string',
2311
+ vnfVirtualLinkDescId: 'string',
2312
+ vnfdId: 'string',
2313
+ networkResource: {
2314
+ vimConnectionId: 'string',
2315
+ resourceProviderId: 'string',
2316
+ resourceId: 'string',
2317
+ vimLevelResourceType: 'string'
2318
+ },
2319
+ zoneId: 'string',
2320
+ reservationId: 'string',
2321
+ vnfLinkPorts: [
2322
+ {
2323
+ id: 'string',
2324
+ resourceHandle: {
2325
+ vimConnectionId: 'string',
2326
+ resourceProviderId: 'string',
2327
+ resourceId: 'string',
2328
+ vimLevelResourceType: 'string'
2329
+ },
2330
+ cpInstanceId: 'string',
2331
+ cpInstanceType: 'EXT_CP'
2332
+ }
2333
+ ],
2334
+ metadata: {}
2335
+ }
2336
+ ],
2337
+ virtualStorageResourceInfo: [
2338
+ {
2339
+ id: 'string',
2340
+ virtualStorageDescId: 'string',
2341
+ vnfdId: 'string',
2342
+ storageResource: {
2343
+ vimConnectionId: 'string',
2344
+ resourceProviderId: 'string',
2345
+ resourceId: 'string',
2346
+ vimLevelResourceType: 'string'
2347
+ },
2348
+ zoneId: 'string',
2349
+ reservationId: 'string',
2350
+ metadata: {}
2351
+ }
2352
+ ]
2353
+ },
2354
+ metadata: {},
2355
+ extensions: null,
2356
+ _links: {
2357
+ self: {
2358
+ href: 'string'
2359
+ },
2360
+ indicators: {
2361
+ href: 'string'
2362
+ },
2363
+ instantiate: {
2364
+ href: 'string'
2365
+ },
2366
+ terminate: {
2367
+ href: 'string'
2368
+ },
2369
+ scale: {
2370
+ href: 'string'
2371
+ },
2372
+ scaleToLevel: {
2373
+ href: 'string'
2374
+ },
2375
+ changeFlavour: {
2376
+ href: 'string'
2377
+ },
2378
+ heal: {
2379
+ href: 'string'
2380
+ },
2381
+ operate: {
2382
+ href: 'string'
2383
+ },
2384
+ changeExtConn: {
2385
+ href: 'string'
2386
+ },
2387
+ createSnapshot: {
2388
+ href: 'string'
2389
+ },
2390
+ revertToSnapshot: {
2391
+ href: 'string'
2392
+ }
2393
+ }
2394
+ },
2395
+ vnfcSnapshots: [
2396
+ {
2397
+ id: 'string',
2398
+ vnfcInstanceId: 'string',
2399
+ creationStartedAt: 'string',
2400
+ creationFinishedAt: 'string',
2401
+ vnfcResourceInfoId: 'string',
2402
+ computeSnapshotResource: {
2403
+ vimConnectionId: 'string',
2404
+ resourceProviderId: 'string',
2405
+ resourceId: 'string',
2406
+ vimLevelResourceType: 'string'
2407
+ },
2408
+ storageSnapshotResources: [
2409
+ {
2410
+ storageResourceId: 'string',
2411
+ storageSnapshotResource: {}
2412
+ }
2413
+ ],
2414
+ userDefinedData: {}
2415
+ }
2416
+ ],
2417
+ vnfStateSnapshotInfo: {
2418
+ checksum: null,
2419
+ isEncrypted: null,
2420
+ metadata: null
2421
+ },
2422
+ userDefinedData: {},
2423
+ _links: {
2424
+ self: {
2425
+ href: 'string'
2426
+ },
2427
+ vnfStateSnapshot: {
2428
+ href: 'string'
2429
+ }
2430
+ }
2431
+ }
2432
+ };
2433
+ describe('#patchVnfSnapshotsVnfSnapshotInfoId - errors', () => {
2434
+ it('should work if integrated or standalone with mockdata', (done) => {
2435
+ if (pronghorn.methodsByName.patchVnfSnapshotsVnfSnapshotInfoId.task) {
2436
+ try {
2437
+ a.patchVnfSnapshotsVnfSnapshotInfoId('fakedata', vnfSnapshotsPatchVnfSnapshotsVnfSnapshotInfoIdBodyParam, (data, error) => {
2438
+ try {
2439
+ if (stub) {
2440
+ runCommonAsserts(data, error);
2441
+ assert.equal('success', data.response);
2442
+ } else {
2443
+ runCommonAsserts(data, error);
2444
+ }
2445
+ saveMockData('VnfSnapshots', 'patchVnfSnapshotsVnfSnapshotInfoId', 'default', data);
2446
+ done();
2447
+ } catch (err) {
2448
+ log.error(`Test Failure: ${err}`);
2449
+ done(err);
2450
+ }
2451
+ });
2452
+ } catch (error) {
2453
+ log.error(`Adapter Exception: ${error}`);
2454
+ done(error);
2455
+ }
2456
+ } else {
2457
+ log.error('patchVnfSnapshotsVnfSnapshotInfoId task is false, skipping test');
2458
+ skipCount += 1;
2459
+ done();
2460
+ }// end if task
2461
+ }).timeout(attemptTimeout);
2462
+ });
2463
+
2464
+ describe('#deleteVnfSnapshotsVnfSnapshotInfoId - errors', () => {
2465
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2466
+ if (pronghorn.methodsByName.deleteVnfSnapshotsVnfSnapshotInfoId.task) {
2467
+ try {
2468
+ a.deleteVnfSnapshotsVnfSnapshotInfoId('fakedata', (data, error) => {
2469
+ try {
2470
+ if (stub) {
2471
+ const displayE = 'Error 400 received on request';
2472
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2473
+ } else {
2474
+ runCommonAsserts(data, error);
2475
+ }
2476
+ saveMockData('VnfSnapshots', 'deleteVnfSnapshotsVnfSnapshotInfoId', 'default', data);
2477
+ done();
2478
+ } catch (err) {
2479
+ log.error(`Test Failure: ${err}`);
2480
+ done(err);
2481
+ }
2482
+ });
2483
+ } catch (error) {
2484
+ log.error(`Adapter Exception: ${error}`);
2485
+ done(error);
2486
+ }
2487
+ } else {
2488
+ log.error('deleteVnfSnapshotsVnfSnapshotInfoId task is false, skipping test');
2489
+ skipCount += 1;
2490
+ done();
2491
+ }// end if task
2492
+ }).timeout(attemptTimeout);
2493
+ });
2494
+
2495
+ describe('#getVnfSnapshotsVnfSnapshotInfoIdVnfStateSnapshot - errors', () => {
2496
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2497
+ if (pronghorn.methodsByName.getVnfSnapshotsVnfSnapshotInfoIdVnfStateSnapshot.task) {
2498
+ try {
2499
+ a.getVnfSnapshotsVnfSnapshotInfoIdVnfStateSnapshot('fakedata', (data, error) => {
2500
+ try {
2501
+ if (stub) {
2502
+ const displayE = 'Error 400 received on request';
2503
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2504
+ } else {
2505
+ runCommonAsserts(data, error);
2506
+ }
2507
+ saveMockData('VnfSnapshots', 'getVnfSnapshotsVnfSnapshotInfoIdVnfStateSnapshot', 'default', data);
2508
+ done();
2509
+ } catch (err) {
2510
+ log.error(`Test Failure: ${err}`);
2511
+ done(err);
2512
+ }
2513
+ });
2514
+ } catch (error) {
2515
+ log.error(`Adapter Exception: ${error}`);
2516
+ done(error);
2517
+ }
2518
+ } else {
2519
+ log.error('getVnfSnapshotsVnfSnapshotInfoIdVnfStateSnapshot task is false, skipping test');
2520
+ skipCount += 1;
2521
+ done();
2522
+ }// end if task
2523
+ }).timeout(attemptTimeout);
2524
+ });
2525
+
2526
+ const grantsPostGrantsBodyParam = {
2527
+ vnfInstanceId: 'string',
2528
+ vnfLcmOpOccId: 'string',
2529
+ vnfdId: 'string',
2530
+ operation: 'OPERATE',
2531
+ isAutomaticInvocation: true,
2532
+ _links: {}
2533
+ };
2534
+ describe('#postGrants - errors', () => {
2535
+ it('should work if integrated or standalone with mockdata', (done) => {
2536
+ if (pronghorn.methodsByName.postGrants.task) {
2537
+ try {
2538
+ a.postGrants(grantsPostGrantsBodyParam, (data, error) => {
2539
+ try {
2540
+ if (stub) {
2541
+ runCommonAsserts(data, error);
2542
+ assert.equal('string', data.response.id);
2543
+ assert.equal('string', data.response.vnfInstanceId);
2544
+ assert.equal('string', data.response.vnfLcmOpOccId);
2545
+ assert.equal('object', typeof data.response.vimConnectionInfo);
2546
+ assert.equal(true, Array.isArray(data.response.zones));
2547
+ assert.equal(true, Array.isArray(data.response.zoneGroups));
2548
+ assert.equal(true, Array.isArray(data.response.addResources));
2549
+ assert.equal(true, Array.isArray(data.response.tempResources));
2550
+ assert.equal(true, Array.isArray(data.response.removeResources));
2551
+ assert.equal(true, Array.isArray(data.response.updateResources));
2552
+ assert.equal('object', typeof data.response.vimAssets);
2553
+ assert.equal(true, Array.isArray(data.response.extVirtualLinks));
2554
+ assert.equal(true, Array.isArray(data.response.extManagedVirtualLinks));
2555
+ assert.equal('object', typeof data.response.additionalParams);
2556
+ assert.equal('object', typeof data.response._links);
2557
+ } else {
2558
+ runCommonAsserts(data, error);
2559
+ }
2560
+ saveMockData('Grants', 'postGrants', 'default', data);
2561
+ done();
2562
+ } catch (err) {
2563
+ log.error(`Test Failure: ${err}`);
2564
+ done(err);
2565
+ }
2566
+ });
2567
+ } catch (error) {
2568
+ log.error(`Adapter Exception: ${error}`);
2569
+ done(error);
2570
+ }
2571
+ } else {
2572
+ log.error('postGrants task is false, skipping test');
2573
+ skipCount += 1;
2574
+ done();
2575
+ }// end if task
2576
+ }).timeout(attemptTimeout);
2577
+ });
2578
+
2579
+ describe('#getGrantsGrantId - errors', () => {
2580
+ it('should work if integrated or standalone with mockdata', (done) => {
2581
+ if (pronghorn.methodsByName.getGrantsGrantId.task) {
2582
+ try {
2583
+ a.getGrantsGrantId('fakedata', (data, error) => {
2584
+ try {
2585
+ if (stub) {
2586
+ runCommonAsserts(data, error);
2587
+ assert.equal('string', data.response.id);
2588
+ assert.equal('string', data.response.vnfInstanceId);
2589
+ assert.equal('string', data.response.vnfLcmOpOccId);
2590
+ assert.equal('object', typeof data.response.vimConnectionInfo);
2591
+ assert.equal(true, Array.isArray(data.response.zones));
2592
+ assert.equal(true, Array.isArray(data.response.zoneGroups));
2593
+ assert.equal(true, Array.isArray(data.response.addResources));
2594
+ assert.equal(true, Array.isArray(data.response.tempResources));
2595
+ assert.equal(true, Array.isArray(data.response.removeResources));
2596
+ assert.equal(true, Array.isArray(data.response.updateResources));
2597
+ assert.equal('object', typeof data.response.vimAssets);
2598
+ assert.equal(true, Array.isArray(data.response.extVirtualLinks));
2599
+ assert.equal(true, Array.isArray(data.response.extManagedVirtualLinks));
2600
+ assert.equal('object', typeof data.response.additionalParams);
2601
+ assert.equal('object', typeof data.response._links);
2602
+ } else {
2603
+ runCommonAsserts(data, error);
2604
+ }
2605
+ saveMockData('Grants', 'getGrantsGrantId', 'default', data);
2606
+ done();
2607
+ } catch (err) {
2608
+ log.error(`Test Failure: ${err}`);
2609
+ done(err);
2610
+ }
2611
+ });
2612
+ } catch (error) {
2613
+ log.error(`Adapter Exception: ${error}`);
2614
+ done(error);
2615
+ }
2616
+ } else {
2617
+ log.error('getGrantsGrantId task is false, skipping test');
2618
+ skipCount += 1;
2619
+ done();
2620
+ }// end if task
2621
+ }).timeout(attemptTimeout);
2622
+ });
2623
+
2624
+ describe('#getOnboardedVnfPackages - errors', () => {
2625
+ it('should work if integrated or standalone with mockdata', (done) => {
2626
+ if (pronghorn.methodsByName.getOnboardedVnfPackages.task) {
2627
+ try {
2628
+ a.getOnboardedVnfPackages(null, null, null, null, null, null, (data, error) => {
2629
+ try {
2630
+ if (stub) {
2631
+ runCommonAsserts(data, error);
2632
+ assert.equal('object', typeof data.response[0]);
2633
+ } else {
2634
+ runCommonAsserts(data, error);
2635
+ }
2636
+ saveMockData('OnboardedVnfPackages', 'getOnboardedVnfPackages', 'default', data);
2637
+ done();
2638
+ } catch (err) {
2639
+ log.error(`Test Failure: ${err}`);
2640
+ done(err);
2641
+ }
2642
+ });
2643
+ } catch (error) {
2644
+ log.error(`Adapter Exception: ${error}`);
2645
+ done(error);
2646
+ }
2647
+ } else {
2648
+ log.error('getOnboardedVnfPackages task is false, skipping test');
2649
+ skipCount += 1;
2650
+ done();
2651
+ }// end if task
2652
+ }).timeout(attemptTimeout);
2653
+ });
2654
+
2655
+ describe('#getOnboardedVnfPackagesVnfdId - errors', () => {
2656
+ it('should work if integrated or standalone with mockdata', (done) => {
2657
+ if (pronghorn.methodsByName.getOnboardedVnfPackagesVnfdId.task) {
2658
+ try {
2659
+ a.getOnboardedVnfPackagesVnfdId('fakedata', (data, error) => {
2660
+ try {
2661
+ if (stub) {
2662
+ runCommonAsserts(data, error);
2663
+ assert.equal('string', data.response.id);
2664
+ assert.equal('string', data.response.vnfdId);
2665
+ assert.equal('string', data.response.vnfProvider);
2666
+ assert.equal('string', data.response.vnfProductName);
2667
+ assert.equal('string', data.response.vnfSoftwareVersion);
2668
+ assert.equal('string', data.response.vnfdVersion);
2669
+ assert.equal(true, Array.isArray(data.response.compatibleSpecificationVersions));
2670
+ assert.equal('string', data.response.checksum);
2671
+ assert.equal('OPTION_1', data.response.packageSecurityOption);
2672
+ assert.equal('string', data.response.signingCertificate);
2673
+ assert.equal(true, Array.isArray(data.response.softwareImages));
2674
+ assert.equal(true, Array.isArray(data.response.additionalArtifacts));
2675
+ assert.equal('UPLOADING', data.response.onboardingState);
2676
+ assert.equal('DISABLED', data.response.operationalState);
2677
+ assert.equal('IN_USE', data.response.usageState);
2678
+ assert.equal('string', data.response.vnfmInfo);
2679
+ assert.equal('object', typeof data.response.userDefinedData);
2680
+ assert.equal('object', typeof data.response.onboardingFailureDetails);
2681
+ assert.equal('object', typeof data.response._links);
2682
+ } else {
2683
+ runCommonAsserts(data, error);
2684
+ }
2685
+ saveMockData('OnboardedVnfPackages', 'getOnboardedVnfPackagesVnfdId', 'default', data);
2686
+ done();
2687
+ } catch (err) {
2688
+ log.error(`Test Failure: ${err}`);
2689
+ done(err);
2690
+ }
2691
+ });
2692
+ } catch (error) {
2693
+ log.error(`Adapter Exception: ${error}`);
2694
+ done(error);
2695
+ }
2696
+ } else {
2697
+ log.error('getOnboardedVnfPackagesVnfdId task is false, skipping test');
2698
+ skipCount += 1;
2699
+ done();
2700
+ }// end if task
2701
+ }).timeout(attemptTimeout);
2702
+ });
2703
+
2704
+ describe('#getOnboardedVnfPackagesVnfdIdVnfd - errors', () => {
2705
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2706
+ if (pronghorn.methodsByName.getOnboardedVnfPackagesVnfdIdVnfd.task) {
2707
+ try {
2708
+ a.getOnboardedVnfPackagesVnfdIdVnfd('fakedata', null, (data, error) => {
2709
+ try {
2710
+ if (stub) {
2711
+ const displayE = 'Error 400 received on request';
2712
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2713
+ } else {
2714
+ runCommonAsserts(data, error);
2715
+ }
2716
+ saveMockData('OnboardedVnfPackages', 'getOnboardedVnfPackagesVnfdIdVnfd', 'default', data);
2717
+ done();
2718
+ } catch (err) {
2719
+ log.error(`Test Failure: ${err}`);
2720
+ done(err);
2721
+ }
2722
+ });
2723
+ } catch (error) {
2724
+ log.error(`Adapter Exception: ${error}`);
2725
+ done(error);
2726
+ }
2727
+ } else {
2728
+ log.error('getOnboardedVnfPackagesVnfdIdVnfd task is false, skipping test');
2729
+ skipCount += 1;
2730
+ done();
2731
+ }// end if task
2732
+ }).timeout(attemptTimeout);
2733
+ });
2734
+
2735
+ describe('#getOnboardedVnfPackagesVnfdIdManifest - errors', () => {
2736
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2737
+ if (pronghorn.methodsByName.getOnboardedVnfPackagesVnfdIdManifest.task) {
2738
+ try {
2739
+ a.getOnboardedVnfPackagesVnfdIdManifest('fakedata', null, (data, error) => {
2740
+ try {
2741
+ if (stub) {
2742
+ const displayE = 'Error 400 received on request';
2743
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2744
+ } else {
2745
+ runCommonAsserts(data, error);
2746
+ }
2747
+ saveMockData('OnboardedVnfPackages', 'getOnboardedVnfPackagesVnfdIdManifest', 'default', data);
2748
+ done();
2749
+ } catch (err) {
2750
+ log.error(`Test Failure: ${err}`);
2751
+ done(err);
2752
+ }
2753
+ });
2754
+ } catch (error) {
2755
+ log.error(`Adapter Exception: ${error}`);
2756
+ done(error);
2757
+ }
2758
+ } else {
2759
+ log.error('getOnboardedVnfPackagesVnfdIdManifest task is false, skipping test');
2760
+ skipCount += 1;
2761
+ done();
2762
+ }// end if task
2763
+ }).timeout(attemptTimeout);
2764
+ });
2765
+
2766
+ describe('#getOnboardedVnfPackagesVnfdIdPackageContent - errors', () => {
2767
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2768
+ if (pronghorn.methodsByName.getOnboardedVnfPackagesVnfdIdPackageContent.task) {
2769
+ try {
2770
+ a.getOnboardedVnfPackagesVnfdIdPackageContent('fakedata', (data, error) => {
2771
+ try {
2772
+ if (stub) {
2773
+ const displayE = 'Error 400 received on request';
2774
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2775
+ } else {
2776
+ runCommonAsserts(data, error);
2777
+ }
2778
+ saveMockData('OnboardedVnfPackages', 'getOnboardedVnfPackagesVnfdIdPackageContent', 'default', data);
2779
+ done();
2780
+ } catch (err) {
2781
+ log.error(`Test Failure: ${err}`);
2782
+ done(err);
2783
+ }
2784
+ });
2785
+ } catch (error) {
2786
+ log.error(`Adapter Exception: ${error}`);
2787
+ done(error);
2788
+ }
2789
+ } else {
2790
+ log.error('getOnboardedVnfPackagesVnfdIdPackageContent task is false, skipping test');
2791
+ skipCount += 1;
2792
+ done();
2793
+ }// end if task
2794
+ }).timeout(attemptTimeout);
2795
+ });
2796
+
2797
+ describe('#getOnboardedVnfPackagesVnfdIdArtifacts - errors', () => {
2798
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2799
+ if (pronghorn.methodsByName.getOnboardedVnfPackagesVnfdIdArtifacts.task) {
2800
+ try {
2801
+ a.getOnboardedVnfPackagesVnfdIdArtifacts('fakedata', (data, error) => {
2802
+ try {
2803
+ if (stub) {
2804
+ const displayE = 'Error 400 received on request';
2805
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2806
+ } else {
2807
+ runCommonAsserts(data, error);
2808
+ }
2809
+ saveMockData('OnboardedVnfPackages', 'getOnboardedVnfPackagesVnfdIdArtifacts', 'default', data);
2810
+ done();
2811
+ } catch (err) {
2812
+ log.error(`Test Failure: ${err}`);
2813
+ done(err);
2814
+ }
2815
+ });
2816
+ } catch (error) {
2817
+ log.error(`Adapter Exception: ${error}`);
2818
+ done(error);
2819
+ }
2820
+ } else {
2821
+ log.error('getOnboardedVnfPackagesVnfdIdArtifacts task is false, skipping test');
2822
+ skipCount += 1;
2823
+ done();
2824
+ }// end if task
2825
+ }).timeout(attemptTimeout);
2826
+ });
2827
+
2828
+ describe('#getOnboardedVnfPackagesVnfdIdArtifactsArtifactPath - errors', () => {
2829
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2830
+ if (pronghorn.methodsByName.getOnboardedVnfPackagesVnfdIdArtifactsArtifactPath.task) {
2831
+ try {
2832
+ a.getOnboardedVnfPackagesVnfdIdArtifactsArtifactPath('fakedata', 'fakedata', null, (data, error) => {
2833
+ try {
2834
+ if (stub) {
2835
+ const displayE = 'Error 400 received on request';
2836
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2837
+ } else {
2838
+ runCommonAsserts(data, error);
2839
+ }
2840
+ saveMockData('OnboardedVnfPackages', 'getOnboardedVnfPackagesVnfdIdArtifactsArtifactPath', 'default', data);
2841
+ done();
2842
+ } catch (err) {
2843
+ log.error(`Test Failure: ${err}`);
2844
+ done(err);
2845
+ }
2846
+ });
2847
+ } catch (error) {
2848
+ log.error(`Adapter Exception: ${error}`);
2849
+ done(error);
2850
+ }
2851
+ } else {
2852
+ log.error('getOnboardedVnfPackagesVnfdIdArtifactsArtifactPath task is false, skipping test');
2853
+ skipCount += 1;
2854
+ done();
2855
+ }// end if task
2856
+ }).timeout(attemptTimeout);
2857
+ });
2858
+
2859
+ describe('#getVnfPackagesVnfPkgId - errors', () => {
2860
+ it('should work if integrated or standalone with mockdata', (done) => {
2861
+ if (pronghorn.methodsByName.getVnfPackagesVnfPkgId.task) {
2862
+ try {
2863
+ a.getVnfPackagesVnfPkgId('fakedata', null, (data, error) => {
2864
+ try {
2865
+ if (stub) {
2866
+ runCommonAsserts(data, error);
2867
+ assert.equal('string', data.response.id);
2868
+ assert.equal('string', data.response.vnfdId);
2869
+ assert.equal('string', data.response.vnfProvider);
2870
+ assert.equal('string', data.response.vnfProductName);
2871
+ assert.equal('string', data.response.vnfSoftwareVersion);
2872
+ assert.equal('string', data.response.vnfdVersion);
2873
+ assert.equal(true, Array.isArray(data.response.compatibleSpecificationVersions));
2874
+ assert.equal('string', data.response.checksum);
2875
+ assert.equal('OPTION_1', data.response.packageSecurityOption);
2876
+ assert.equal('string', data.response.signingCertificate);
2877
+ assert.equal(true, Array.isArray(data.response.softwareImages));
2878
+ assert.equal(true, Array.isArray(data.response.additionalArtifacts));
2879
+ assert.equal('UPLOADING', data.response.onboardingState);
2880
+ assert.equal('DISABLED', data.response.operationalState);
2881
+ assert.equal('NOT_IN_USE', data.response.usageState);
2882
+ assert.equal('string', data.response.vnfmInfo);
2883
+ assert.equal('object', typeof data.response.userDefinedData);
2884
+ assert.equal('object', typeof data.response.onboardingFailureDetails);
2885
+ assert.equal('object', typeof data.response._links);
2886
+ } else {
2887
+ runCommonAsserts(data, error);
2888
+ }
2889
+ saveMockData('VnfPackages', 'getVnfPackagesVnfPkgId', 'default', data);
2890
+ done();
2891
+ } catch (err) {
2892
+ log.error(`Test Failure: ${err}`);
2893
+ done(err);
2894
+ }
2895
+ });
2896
+ } catch (error) {
2897
+ log.error(`Adapter Exception: ${error}`);
2898
+ done(error);
2899
+ }
2900
+ } else {
2901
+ log.error('getVnfPackagesVnfPkgId task is false, skipping test');
2902
+ skipCount += 1;
2903
+ done();
2904
+ }// end if task
2905
+ }).timeout(attemptTimeout);
2906
+ });
2907
+
2908
+ describe('#getVnfPackagesVnfPkgIdVnfd - errors', () => {
2909
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2910
+ if (pronghorn.methodsByName.getVnfPackagesVnfPkgIdVnfd.task) {
2911
+ try {
2912
+ a.getVnfPackagesVnfPkgIdVnfd('fakedata', null, (data, error) => {
2913
+ try {
2914
+ if (stub) {
2915
+ const displayE = 'Error 400 received on request';
2916
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2917
+ } else {
2918
+ runCommonAsserts(data, error);
2919
+ }
2920
+ saveMockData('VnfPackages', 'getVnfPackagesVnfPkgIdVnfd', 'default', data);
2921
+ done();
2922
+ } catch (err) {
2923
+ log.error(`Test Failure: ${err}`);
2924
+ done(err);
2925
+ }
2926
+ });
2927
+ } catch (error) {
2928
+ log.error(`Adapter Exception: ${error}`);
2929
+ done(error);
2930
+ }
2931
+ } else {
2932
+ log.error('getVnfPackagesVnfPkgIdVnfd task is false, skipping test');
2933
+ skipCount += 1;
2934
+ done();
2935
+ }// end if task
2936
+ }).timeout(attemptTimeout);
2937
+ });
2938
+
2939
+ describe('#getVnfPackagesVnfPkgIdManifest - errors', () => {
2940
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2941
+ if (pronghorn.methodsByName.getVnfPackagesVnfPkgIdManifest.task) {
2942
+ try {
2943
+ a.getVnfPackagesVnfPkgIdManifest('fakedata', null, (data, error) => {
2944
+ try {
2945
+ if (stub) {
2946
+ const displayE = 'Error 400 received on request';
2947
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2948
+ } else {
2949
+ runCommonAsserts(data, error);
2950
+ }
2951
+ saveMockData('VnfPackages', 'getVnfPackagesVnfPkgIdManifest', 'default', data);
2952
+ done();
2953
+ } catch (err) {
2954
+ log.error(`Test Failure: ${err}`);
2955
+ done(err);
2956
+ }
2957
+ });
2958
+ } catch (error) {
2959
+ log.error(`Adapter Exception: ${error}`);
2960
+ done(error);
2961
+ }
2962
+ } else {
2963
+ log.error('getVnfPackagesVnfPkgIdManifest task is false, skipping test');
2964
+ skipCount += 1;
2965
+ done();
2966
+ }// end if task
2967
+ }).timeout(attemptTimeout);
2968
+ });
2969
+
2970
+ describe('#getVnfPackagesVnfPkgIdPackageContent - errors', () => {
2971
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2972
+ if (pronghorn.methodsByName.getVnfPackagesVnfPkgIdPackageContent.task) {
2973
+ try {
2974
+ a.getVnfPackagesVnfPkgIdPackageContent('fakedata', (data, error) => {
2975
+ try {
2976
+ if (stub) {
2977
+ const displayE = 'Error 400 received on request';
2978
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
2979
+ } else {
2980
+ runCommonAsserts(data, error);
2981
+ }
2982
+ saveMockData('VnfPackages', 'getVnfPackagesVnfPkgIdPackageContent', 'default', data);
2983
+ done();
2984
+ } catch (err) {
2985
+ log.error(`Test Failure: ${err}`);
2986
+ done(err);
2987
+ }
2988
+ });
2989
+ } catch (error) {
2990
+ log.error(`Adapter Exception: ${error}`);
2991
+ done(error);
2992
+ }
2993
+ } else {
2994
+ log.error('getVnfPackagesVnfPkgIdPackageContent task is false, skipping test');
2995
+ skipCount += 1;
2996
+ done();
2997
+ }// end if task
2998
+ }).timeout(attemptTimeout);
2999
+ });
3000
+
3001
+ describe('#getVnfPackagesVnfPkgIdArtifacts - errors', () => {
3002
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
3003
+ if (pronghorn.methodsByName.getVnfPackagesVnfPkgIdArtifacts.task) {
3004
+ try {
3005
+ a.getVnfPackagesVnfPkgIdArtifacts('fakedata', (data, error) => {
3006
+ try {
3007
+ if (stub) {
3008
+ const displayE = 'Error 400 received on request';
3009
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
3010
+ } else {
3011
+ runCommonAsserts(data, error);
3012
+ }
3013
+ saveMockData('VnfPackages', 'getVnfPackagesVnfPkgIdArtifacts', 'default', data);
3014
+ done();
3015
+ } catch (err) {
3016
+ log.error(`Test Failure: ${err}`);
3017
+ done(err);
3018
+ }
3019
+ });
3020
+ } catch (error) {
3021
+ log.error(`Adapter Exception: ${error}`);
3022
+ done(error);
3023
+ }
3024
+ } else {
3025
+ log.error('getVnfPackagesVnfPkgIdArtifacts task is false, skipping test');
3026
+ skipCount += 1;
3027
+ done();
3028
+ }// end if task
3029
+ }).timeout(attemptTimeout);
3030
+ });
3031
+
3032
+ describe('#getVnfPackagesVnfPkgIdArtifactsArtifactPath - errors', () => {
3033
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
3034
+ if (pronghorn.methodsByName.getVnfPackagesVnfPkgIdArtifactsArtifactPath.task) {
3035
+ try {
3036
+ a.getVnfPackagesVnfPkgIdArtifactsArtifactPath('fakedata', 'fakedata', null, (data, error) => {
3037
+ try {
3038
+ if (stub) {
3039
+ const displayE = 'Error 400 received on request';
3040
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
3041
+ } else {
3042
+ runCommonAsserts(data, error);
3043
+ }
3044
+ saveMockData('VnfPackages', 'getVnfPackagesVnfPkgIdArtifactsArtifactPath', 'default', data);
3045
+ done();
3046
+ } catch (err) {
3047
+ log.error(`Test Failure: ${err}`);
3048
+ done(err);
3049
+ }
3050
+ });
3051
+ } catch (error) {
3052
+ log.error(`Adapter Exception: ${error}`);
3053
+ done(error);
3054
+ }
3055
+ } else {
3056
+ log.error('getVnfPackagesVnfPkgIdArtifactsArtifactPath task is false, skipping test');
3057
+ skipCount += 1;
3058
+ done();
3059
+ }// end if task
3060
+ }).timeout(attemptTimeout);
3061
+ });
3062
+
3063
+ const pmJobsPostPmJobsBodyParam = {
3064
+ objectType: 'string',
3065
+ objectInstanceIds: [
3066
+ 'string'
3067
+ ],
3068
+ criteria: {},
3069
+ callbackUri: 'string'
3070
+ };
3071
+ describe('#postPmJobs - errors', () => {
3072
+ it('should work if integrated or standalone with mockdata', (done) => {
3073
+ if (pronghorn.methodsByName.postPmJobs.task) {
3074
+ try {
3075
+ a.postPmJobs(pmJobsPostPmJobsBodyParam, (data, error) => {
3076
+ try {
3077
+ if (stub) {
3078
+ runCommonAsserts(data, error);
3079
+ assert.equal('string', data.response.id);
3080
+ assert.equal('string', data.response.objectType);
3081
+ assert.equal(true, Array.isArray(data.response.objectInstanceIds));
3082
+ assert.equal(true, Array.isArray(data.response.subObjectInstanceIds));
3083
+ assert.equal('object', typeof data.response.criteria);
3084
+ assert.equal('string', data.response.callbackUri);
3085
+ assert.equal('object', typeof data.response.reports);
3086
+ assert.equal('object', typeof data.response._links);
3087
+ } else {
3088
+ runCommonAsserts(data, error);
3089
+ }
3090
+ saveMockData('PmJobs', 'postPmJobs', 'default', data);
3091
+ done();
3092
+ } catch (err) {
3093
+ log.error(`Test Failure: ${err}`);
3094
+ done(err);
3095
+ }
3096
+ });
3097
+ } catch (error) {
3098
+ log.error(`Adapter Exception: ${error}`);
3099
+ done(error);
3100
+ }
3101
+ } else {
3102
+ log.error('postPmJobs task is false, skipping test');
3103
+ skipCount += 1;
3104
+ done();
3105
+ }// end if task
3106
+ }).timeout(attemptTimeout);
3107
+ });
3108
+
3109
+ describe('#getPmJobs - errors', () => {
3110
+ it('should work if integrated or standalone with mockdata', (done) => {
3111
+ if (pronghorn.methodsByName.getPmJobs.task) {
3112
+ try {
3113
+ a.getPmJobs(null, null, null, null, null, null, (data, error) => {
3114
+ try {
3115
+ if (stub) {
3116
+ runCommonAsserts(data, error);
3117
+ assert.equal('object', typeof data.response[0]);
3118
+ assert.equal('object', typeof data.response[1]);
3119
+ assert.equal('object', typeof data.response[2]);
3120
+ } else {
3121
+ runCommonAsserts(data, error);
3122
+ }
3123
+ saveMockData('PmJobs', 'getPmJobs', 'default', data);
3124
+ done();
3125
+ } catch (err) {
3126
+ log.error(`Test Failure: ${err}`);
3127
+ done(err);
3128
+ }
3129
+ });
3130
+ } catch (error) {
3131
+ log.error(`Adapter Exception: ${error}`);
3132
+ done(error);
3133
+ }
3134
+ } else {
3135
+ log.error('getPmJobs task is false, skipping test');
3136
+ skipCount += 1;
3137
+ done();
3138
+ }// end if task
3139
+ }).timeout(attemptTimeout);
3140
+ });
3141
+
3142
+ describe('#getPmJobsPmJobId - errors', () => {
3143
+ it('should work if integrated or standalone with mockdata', (done) => {
3144
+ if (pronghorn.methodsByName.getPmJobsPmJobId.task) {
3145
+ try {
3146
+ a.getPmJobsPmJobId('fakedata', (data, error) => {
3147
+ try {
3148
+ if (stub) {
3149
+ runCommonAsserts(data, error);
3150
+ assert.equal('string', data.response.id);
3151
+ assert.equal('string', data.response.objectType);
3152
+ assert.equal(true, Array.isArray(data.response.objectInstanceIds));
3153
+ assert.equal(true, Array.isArray(data.response.subObjectInstanceIds));
3154
+ assert.equal('object', typeof data.response.criteria);
3155
+ assert.equal('string', data.response.callbackUri);
3156
+ assert.equal('object', typeof data.response.reports);
3157
+ assert.equal('object', typeof data.response._links);
3158
+ } else {
3159
+ runCommonAsserts(data, error);
3160
+ }
3161
+ saveMockData('PmJobs', 'getPmJobsPmJobId', 'default', data);
3162
+ done();
3163
+ } catch (err) {
3164
+ log.error(`Test Failure: ${err}`);
3165
+ done(err);
3166
+ }
3167
+ });
3168
+ } catch (error) {
3169
+ log.error(`Adapter Exception: ${error}`);
3170
+ done(error);
3171
+ }
3172
+ } else {
3173
+ log.error('getPmJobsPmJobId task is false, skipping test');
3174
+ skipCount += 1;
3175
+ done();
3176
+ }// end if task
3177
+ }).timeout(attemptTimeout);
3178
+ });
3179
+
3180
+ describe('#patchPmJobsPmJobId - errors', () => {
3181
+ it('should work if integrated or standalone with mockdata', (done) => {
3182
+ if (pronghorn.methodsByName.patchPmJobsPmJobId.task) {
3183
+ try {
3184
+ a.patchPmJobsPmJobId('fakedata', (data, error) => {
3185
+ try {
3186
+ if (stub) {
3187
+ runCommonAsserts(data, error);
3188
+ assert.equal('success', data.response);
3189
+ } else {
3190
+ runCommonAsserts(data, error);
3191
+ }
3192
+ saveMockData('PmJobs', 'patchPmJobsPmJobId', 'default', data);
3193
+ done();
3194
+ } catch (err) {
3195
+ log.error(`Test Failure: ${err}`);
3196
+ done(err);
3197
+ }
3198
+ });
3199
+ } catch (error) {
3200
+ log.error(`Adapter Exception: ${error}`);
3201
+ done(error);
3202
+ }
3203
+ } else {
3204
+ log.error('patchPmJobsPmJobId task is false, skipping test');
3205
+ skipCount += 1;
3206
+ done();
3207
+ }// end if task
3208
+ }).timeout(attemptTimeout);
3209
+ });
3210
+
3211
+ describe('#deletePmJobsPmJobId - errors', () => {
3212
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
3213
+ if (pronghorn.methodsByName.deletePmJobsPmJobId.task) {
3214
+ try {
3215
+ a.deletePmJobsPmJobId('fakedata', (data, error) => {
3216
+ try {
3217
+ if (stub) {
3218
+ const displayE = 'Error 400 received on request';
3219
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
3220
+ } else {
3221
+ runCommonAsserts(data, error);
3222
+ }
3223
+ saveMockData('PmJobs', 'deletePmJobsPmJobId', 'default', data);
3224
+ done();
3225
+ } catch (err) {
3226
+ log.error(`Test Failure: ${err}`);
3227
+ done(err);
3228
+ }
3229
+ });
3230
+ } catch (error) {
3231
+ log.error(`Adapter Exception: ${error}`);
3232
+ done(error);
3233
+ }
3234
+ } else {
3235
+ log.error('deletePmJobsPmJobId task is false, skipping test');
3236
+ skipCount += 1;
3237
+ done();
3238
+ }// end if task
3239
+ }).timeout(attemptTimeout);
3240
+ });
3241
+
3242
+ describe('#getPmJobsPmJobIdReportsReportId - errors', () => {
3243
+ it('should work if integrated or standalone with mockdata', (done) => {
3244
+ if (pronghorn.methodsByName.getPmJobsPmJobIdReportsReportId.task) {
3245
+ try {
3246
+ a.getPmJobsPmJobIdReportsReportId('fakedata', 'fakedata', (data, error) => {
3247
+ try {
3248
+ if (stub) {
3249
+ runCommonAsserts(data, error);
3250
+ assert.equal(true, Array.isArray(data.response.entries));
3251
+ } else {
3252
+ runCommonAsserts(data, error);
3253
+ }
3254
+ saveMockData('PmJobs', 'getPmJobsPmJobIdReportsReportId', 'default', data);
3255
+ done();
3256
+ } catch (err) {
3257
+ log.error(`Test Failure: ${err}`);
3258
+ done(err);
3259
+ }
3260
+ });
3261
+ } catch (error) {
3262
+ log.error(`Adapter Exception: ${error}`);
3263
+ done(error);
3264
+ }
3265
+ } else {
3266
+ log.error('getPmJobsPmJobIdReportsReportId task is false, skipping test');
3267
+ skipCount += 1;
3268
+ done();
3269
+ }// end if task
3270
+ }).timeout(attemptTimeout);
3271
+ });
3272
+
3273
+ const thresholdsPostThresholdsBodyParam = {
3274
+ objectType: 'string',
3275
+ objectInstanceId: 'string',
3276
+ criteria: {},
3277
+ callbackUri: 'string'
3278
+ };
3279
+ describe('#postThresholds - errors', () => {
3280
+ it('should work if integrated or standalone with mockdata', (done) => {
3281
+ if (pronghorn.methodsByName.postThresholds.task) {
3282
+ try {
3283
+ a.postThresholds(thresholdsPostThresholdsBodyParam, (data, error) => {
3284
+ try {
3285
+ if (stub) {
3286
+ runCommonAsserts(data, error);
3287
+ assert.equal('string', data.response.id);
3288
+ assert.equal('string', data.response.objectType);
3289
+ assert.equal('string', data.response.objectInstanceId);
3290
+ assert.equal(true, Array.isArray(data.response.subObjectInstanceIds));
3291
+ assert.equal('object', typeof data.response.criteria);
3292
+ assert.equal('string', data.response.callbackUri);
3293
+ assert.equal('object', typeof data.response._links);
3294
+ } else {
3295
+ runCommonAsserts(data, error);
3296
+ }
3297
+ saveMockData('Thresholds', 'postThresholds', 'default', data);
3298
+ done();
3299
+ } catch (err) {
3300
+ log.error(`Test Failure: ${err}`);
3301
+ done(err);
3302
+ }
3303
+ });
3304
+ } catch (error) {
3305
+ log.error(`Adapter Exception: ${error}`);
3306
+ done(error);
3307
+ }
3308
+ } else {
3309
+ log.error('postThresholds task is false, skipping test');
3310
+ skipCount += 1;
3311
+ done();
3312
+ }// end if task
3313
+ }).timeout(attemptTimeout);
3314
+ });
3315
+
3316
+ describe('#getThresholds - errors', () => {
3317
+ it('should work if integrated or standalone with mockdata', (done) => {
3318
+ if (pronghorn.methodsByName.getThresholds.task) {
3319
+ try {
3320
+ a.getThresholds(null, null, (data, error) => {
3321
+ try {
3322
+ if (stub) {
3323
+ runCommonAsserts(data, error);
3324
+ assert.equal('object', typeof data.response[0]);
3325
+ assert.equal('object', typeof data.response[1]);
3326
+ } else {
3327
+ runCommonAsserts(data, error);
3328
+ }
3329
+ saveMockData('Thresholds', 'getThresholds', 'default', data);
3330
+ done();
3331
+ } catch (err) {
3332
+ log.error(`Test Failure: ${err}`);
3333
+ done(err);
3334
+ }
3335
+ });
3336
+ } catch (error) {
3337
+ log.error(`Adapter Exception: ${error}`);
3338
+ done(error);
3339
+ }
3340
+ } else {
3341
+ log.error('getThresholds task is false, skipping test');
3342
+ skipCount += 1;
3343
+ done();
3344
+ }// end if task
3345
+ }).timeout(attemptTimeout);
3346
+ });
3347
+
3348
+ describe('#getThresholdsThresholdId - errors', () => {
3349
+ it('should work if integrated or standalone with mockdata', (done) => {
3350
+ if (pronghorn.methodsByName.getThresholdsThresholdId.task) {
3351
+ try {
3352
+ a.getThresholdsThresholdId('fakedata', (data, error) => {
3353
+ try {
3354
+ if (stub) {
3355
+ runCommonAsserts(data, error);
3356
+ assert.equal('string', data.response.id);
3357
+ assert.equal('string', data.response.objectType);
3358
+ assert.equal('string', data.response.objectInstanceId);
3359
+ assert.equal(true, Array.isArray(data.response.subObjectInstanceIds));
3360
+ assert.equal('object', typeof data.response.criteria);
3361
+ assert.equal('string', data.response.callbackUri);
3362
+ assert.equal('object', typeof data.response._links);
3363
+ } else {
3364
+ runCommonAsserts(data, error);
3365
+ }
3366
+ saveMockData('Thresholds', 'getThresholdsThresholdId', 'default', data);
3367
+ done();
3368
+ } catch (err) {
3369
+ log.error(`Test Failure: ${err}`);
3370
+ done(err);
3371
+ }
3372
+ });
3373
+ } catch (error) {
3374
+ log.error(`Adapter Exception: ${error}`);
3375
+ done(error);
3376
+ }
3377
+ } else {
3378
+ log.error('getThresholdsThresholdId task is false, skipping test');
3379
+ skipCount += 1;
3380
+ done();
3381
+ }// end if task
3382
+ }).timeout(attemptTimeout);
3383
+ });
3384
+
3385
+ describe('#patchThresholdsThresholdId - errors', () => {
3386
+ it('should work if integrated or standalone with mockdata', (done) => {
3387
+ if (pronghorn.methodsByName.patchThresholdsThresholdId.task) {
3388
+ try {
3389
+ a.patchThresholdsThresholdId('fakedata', (data, error) => {
3390
+ try {
3391
+ if (stub) {
3392
+ runCommonAsserts(data, error);
3393
+ assert.equal('success', data.response);
3394
+ } else {
3395
+ runCommonAsserts(data, error);
3396
+ }
3397
+ saveMockData('Thresholds', 'patchThresholdsThresholdId', 'default', data);
3398
+ done();
3399
+ } catch (err) {
3400
+ log.error(`Test Failure: ${err}`);
3401
+ done(err);
3402
+ }
3403
+ });
3404
+ } catch (error) {
3405
+ log.error(`Adapter Exception: ${error}`);
3406
+ done(error);
3407
+ }
3408
+ } else {
3409
+ log.error('patchThresholdsThresholdId task is false, skipping test');
3410
+ skipCount += 1;
3411
+ done();
3412
+ }// end if task
3413
+ }).timeout(attemptTimeout);
3414
+ });
3415
+
3416
+ describe('#deleteThresholdsThresholdId - errors', () => {
3417
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
3418
+ if (pronghorn.methodsByName.deleteThresholdsThresholdId.task) {
3419
+ try {
3420
+ a.deleteThresholdsThresholdId('fakedata', (data, error) => {
3421
+ try {
3422
+ if (stub) {
3423
+ const displayE = 'Error 400 received on request';
3424
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
3425
+ } else {
3426
+ runCommonAsserts(data, error);
3427
+ }
3428
+ saveMockData('Thresholds', 'deleteThresholdsThresholdId', 'default', data);
3429
+ done();
3430
+ } catch (err) {
3431
+ log.error(`Test Failure: ${err}`);
3432
+ done(err);
3433
+ }
3434
+ });
3435
+ } catch (error) {
3436
+ log.error(`Adapter Exception: ${error}`);
3437
+ done(error);
3438
+ }
3439
+ } else {
3440
+ log.error('deleteThresholdsThresholdId task is false, skipping test');
3441
+ skipCount += 1;
3442
+ done();
3443
+ }// end if task
3444
+ }).timeout(attemptTimeout);
3445
+ });
3446
+
3447
+ describe('#getVnfSnapshotPackages - errors', () => {
3448
+ it('should work if integrated or standalone with mockdata', (done) => {
3449
+ if (pronghorn.methodsByName.getVnfSnapshotPackages.task) {
3450
+ try {
3451
+ a.getVnfSnapshotPackages(null, null, (data, error) => {
3452
+ try {
3453
+ if (stub) {
3454
+ runCommonAsserts(data, error);
3455
+ assert.equal('object', typeof data.response[0]);
3456
+ assert.equal('object', typeof data.response[1]);
3457
+ assert.equal('object', typeof data.response[2]);
3458
+ assert.equal('object', typeof data.response[3]);
3459
+ } else {
3460
+ runCommonAsserts(data, error);
3461
+ }
3462
+ saveMockData('VnfSnapshotPackages', 'getVnfSnapshotPackages', 'default', data);
3463
+ done();
3464
+ } catch (err) {
3465
+ log.error(`Test Failure: ${err}`);
3466
+ done(err);
3467
+ }
3468
+ });
3469
+ } catch (error) {
3470
+ log.error(`Adapter Exception: ${error}`);
3471
+ done(error);
3472
+ }
3473
+ } else {
3474
+ log.error('getVnfSnapshotPackages task is false, skipping test');
3475
+ skipCount += 1;
3476
+ done();
3477
+ }// end if task
3478
+ }).timeout(attemptTimeout);
3479
+ });
3480
+
3481
+ describe('#getVnfSnapshotPackagesVnfSnapshotPkgId - errors', () => {
3482
+ it('should work if integrated or standalone with mockdata', (done) => {
3483
+ if (pronghorn.methodsByName.getVnfSnapshotPackagesVnfSnapshotPkgId.task) {
3484
+ try {
3485
+ a.getVnfSnapshotPackagesVnfSnapshotPkgId('fakedata', null, null, (data, error) => {
3486
+ try {
3487
+ if (stub) {
3488
+ runCommonAsserts(data, error);
3489
+ assert.equal('string', data.response.id);
3490
+ assert.equal('string', data.response.vnfSnapshotPkgUniqueId);
3491
+ assert.equal('string', data.response.name);
3492
+ assert.equal('string', data.response.checksum);
3493
+ assert.equal('string', data.response.createdAt);
3494
+ assert.equal('string', data.response.vnfSnapshotId);
3495
+ assert.equal('object', typeof data.response.vnfcSnapshotInfoIds);
3496
+ assert.equal(false, data.response.isFullSnapshot);
3497
+ assert.equal('object', typeof data.response.vnfdInfo);
3498
+ assert.equal('object', typeof data.response.vnfsr);
3499
+ assert.equal('object', typeof data.response.vnfcSnapshotImages);
3500
+ assert.equal('object', typeof data.response.additionalArtifacts);
3501
+ assert.equal('BUILDING', data.response.state);
3502
+ assert.equal(true, data.response.isCancelPending);
3503
+ assert.equal('object', typeof data.response.failureDetails);
3504
+ assert.equal('object', typeof data.response.userDefinedData);
3505
+ assert.equal('object', typeof data.response._links);
3506
+ } else {
3507
+ runCommonAsserts(data, error);
3508
+ }
3509
+ saveMockData('VnfSnapshotPackages', 'getVnfSnapshotPackagesVnfSnapshotPkgId', 'default', data);
3510
+ done();
3511
+ } catch (err) {
3512
+ log.error(`Test Failure: ${err}`);
3513
+ done(err);
3514
+ }
3515
+ });
3516
+ } catch (error) {
3517
+ log.error(`Adapter Exception: ${error}`);
3518
+ done(error);
3519
+ }
3520
+ } else {
3521
+ log.error('getVnfSnapshotPackagesVnfSnapshotPkgId task is false, skipping test');
3522
+ skipCount += 1;
3523
+ done();
3524
+ }// end if task
3525
+ }).timeout(attemptTimeout);
3526
+ });
3527
+
3528
+ describe('#getVnfSnapshotPackagesVnfSnapshotPkgIdPackageContent - errors', () => {
3529
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
3530
+ if (pronghorn.methodsByName.getVnfSnapshotPackagesVnfSnapshotPkgIdPackageContent.task) {
3531
+ try {
3532
+ a.getVnfSnapshotPackagesVnfSnapshotPkgIdPackageContent('fakedata', (data, error) => {
3533
+ try {
3534
+ if (stub) {
3535
+ const displayE = 'Error 400 received on request';
3536
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
3537
+ } else {
3538
+ runCommonAsserts(data, error);
3539
+ }
3540
+ saveMockData('VnfSnapshotPackages', 'getVnfSnapshotPackagesVnfSnapshotPkgIdPackageContent', 'default', data);
3541
+ done();
3542
+ } catch (err) {
3543
+ log.error(`Test Failure: ${err}`);
3544
+ done(err);
3545
+ }
3546
+ });
3547
+ } catch (error) {
3548
+ log.error(`Adapter Exception: ${error}`);
3549
+ done(error);
3550
+ }
3551
+ } else {
3552
+ log.error('getVnfSnapshotPackagesVnfSnapshotPkgIdPackageContent task is false, skipping test');
3553
+ skipCount += 1;
3554
+ done();
3555
+ }// end if task
3556
+ }).timeout(attemptTimeout);
3557
+ });
3558
+
3559
+ describe('#getVnfSnapshotPackagesVnfSnapshotPkgIdArtifactsArtifactPath - errors', () => {
3560
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
3561
+ if (pronghorn.methodsByName.getVnfSnapshotPackagesVnfSnapshotPkgIdArtifactsArtifactPath.task) {
3562
+ try {
3563
+ a.getVnfSnapshotPackagesVnfSnapshotPkgIdArtifactsArtifactPath('fakedata', 'fakedata', (data, error) => {
3564
+ try {
3565
+ if (stub) {
3566
+ const displayE = 'Error 400 received on request';
3567
+ runErrorAsserts(data, error, 'AD.500', 'Test-etsi_sol003-connectorRest-handleEndResponse', displayE);
3568
+ } else {
3569
+ runCommonAsserts(data, error);
3570
+ }
3571
+ saveMockData('VnfSnapshotPackages', 'getVnfSnapshotPackagesVnfSnapshotPkgIdArtifactsArtifactPath', 'default', data);
3572
+ done();
3573
+ } catch (err) {
3574
+ log.error(`Test Failure: ${err}`);
3575
+ done(err);
3576
+ }
3577
+ });
3578
+ } catch (error) {
3579
+ log.error(`Adapter Exception: ${error}`);
3580
+ done(error);
3581
+ }
3582
+ } else {
3583
+ log.error('getVnfSnapshotPackagesVnfSnapshotPkgIdArtifactsArtifactPath task is false, skipping test');
3584
+ skipCount += 1;
3585
+ done();
3586
+ }// end if task
3587
+ }).timeout(attemptTimeout);
3588
+ });
3589
+
3590
+ describe('#Skipped test count', () => {
3591
+ it('count skipped tests', (done) => {
3592
+ console.log(`skipped ${skipCount} tests because \x1b[33mtask: false\x1b[0m`);
3593
+ done();
3594
+ });
3595
+ });
3596
+ });
3597
+ });