@itentialopensource/adapter-nokia_netact 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 (73) hide show
  1. package/.eslintignore +5 -0
  2. package/.eslintrc.js +18 -0
  3. package/.jshintrc +3 -0
  4. package/AUTH.md +32 -0
  5. package/BROKER.md +211 -0
  6. package/CALLS.md +447 -0
  7. package/CODE_OF_CONDUCT.md +43 -0
  8. package/CONTRIBUTING.md +13 -0
  9. package/ENHANCE.md +69 -0
  10. package/LICENSE +201 -0
  11. package/PROPERTIES.md +646 -0
  12. package/README.md +343 -0
  13. package/SUMMARY.md +9 -0
  14. package/SYSTEMINFO.md +18 -0
  15. package/TAB1.md +11 -0
  16. package/TAB2.md +303 -0
  17. package/TROUBLESHOOT.md +47 -0
  18. package/adapter.js +4743 -0
  19. package/adapterBase.js +1452 -0
  20. package/changelogs/CHANGELOG.md +0 -0
  21. package/entities/.generic/action.json +214 -0
  22. package/entities/.generic/schema.json +28 -0
  23. package/entities/.system/action.json +50 -0
  24. package/entities/.system/mockdatafiles/getToken-default.json +3 -0
  25. package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
  26. package/entities/.system/schema.json +19 -0
  27. package/entities/.system/schemaTokenReq.json +53 -0
  28. package/entities/.system/schemaTokenResp.json +53 -0
  29. package/entities/OpenCmOperationsPortBinding/action.json +64 -0
  30. package/entities/OpenCmOperationsPortBinding/schema.json +21 -0
  31. package/entities/OpenCmPersistencyPortBinding/action.json +244 -0
  32. package/entities/OpenCmPersistencyPortBinding/schema.json +30 -0
  33. package/entities/Operations/action.json +169 -0
  34. package/entities/Operations/schema.json +26 -0
  35. package/entities/Persistency/action.json +348 -0
  36. package/entities/Persistency/schema.json +35 -0
  37. package/error.json +190 -0
  38. package/metadata.json +78 -0
  39. package/package.json +81 -0
  40. package/pronghorn.json +2889 -0
  41. package/propertiesDecorators.json +14 -0
  42. package/propertiesSchema.json +1574 -0
  43. package/report/Nokia-NetAct-REST-SOAP-OpenAPI3.v1.json +3014 -0
  44. package/report/adapter-openapi.json +3014 -0
  45. package/report/adapter-openapi.yaml +2396 -0
  46. package/report/adapterInfo.json +10 -0
  47. package/report/auto-adapter-openapi.json +1420 -0
  48. package/report/creationReport.json +455 -0
  49. package/sampleProperties.json +257 -0
  50. package/test/integration/adapterTestBasicGet.js +83 -0
  51. package/test/integration/adapterTestConnectivity.js +118 -0
  52. package/test/integration/adapterTestIntegration.js +1509 -0
  53. package/test/unit/adapterBaseTestUnit.js +1024 -0
  54. package/test/unit/adapterTestUnit.js +2477 -0
  55. package/utils/adapterInfo.js +206 -0
  56. package/utils/addAuth.js +94 -0
  57. package/utils/artifactize.js +146 -0
  58. package/utils/basicGet.js +50 -0
  59. package/utils/checkMigrate.js +63 -0
  60. package/utils/entitiesToDB.js +179 -0
  61. package/utils/findPath.js +74 -0
  62. package/utils/methodDocumentor.js +273 -0
  63. package/utils/modify.js +152 -0
  64. package/utils/packModificationScript.js +35 -0
  65. package/utils/patches2bundledDeps.js +90 -0
  66. package/utils/pre-commit.sh +32 -0
  67. package/utils/removeHooks.js +20 -0
  68. package/utils/setup.js +33 -0
  69. package/utils/taskMover.js +309 -0
  70. package/utils/tbScript.js +239 -0
  71. package/utils/tbUtils.js +489 -0
  72. package/utils/testRunner.js +298 -0
  73. package/utils/troubleshootingAdapter.js +193 -0
@@ -0,0 +1,1509 @@
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
+ /* eslint import/no-dynamic-require:warn */
8
+
9
+ // include required items for testing & logging
10
+ const assert = require('assert');
11
+ const fs = require('fs');
12
+ const path = require('path');
13
+ const util = require('util');
14
+ const mocha = require('mocha');
15
+ const winston = require('winston');
16
+ const { expect } = require('chai');
17
+ const { use } = require('chai');
18
+ const td = require('testdouble');
19
+
20
+ const anything = td.matchers.anything();
21
+
22
+ // stub and attemptTimeout are used throughout the code so set them here
23
+ let logLevel = 'none';
24
+ const isRapidFail = false;
25
+ const isSaveMockData = false;
26
+
27
+ // read in the properties from the sampleProperties files
28
+ let adaptdir = __dirname;
29
+ if (adaptdir.endsWith('/test/integration')) {
30
+ adaptdir = adaptdir.substring(0, adaptdir.length - 17);
31
+ } else if (adaptdir.endsWith('/test/unit')) {
32
+ adaptdir = adaptdir.substring(0, adaptdir.length - 10);
33
+ }
34
+ const samProps = require(`${adaptdir}/sampleProperties.json`).properties;
35
+
36
+ // these variables can be changed to run in integrated mode so easier to set them here
37
+ // always check these in with bogus data!!!
38
+ samProps.stub = true;
39
+
40
+ // uncomment if connecting
41
+ // samProps.host = 'replace.hostorip.here';
42
+ // samProps.authentication.username = 'username';
43
+ // samProps.authentication.password = 'password';
44
+ // samProps.authentication.token = 'password';
45
+ // samProps.protocol = 'http';
46
+ // samProps.port = 80;
47
+ // samProps.ssl.enabled = false;
48
+ // samProps.ssl.accept_invalid_cert = false;
49
+
50
+ if (samProps.request.attempt_timeout < 30000) {
51
+ samProps.request.attempt_timeout = 30000;
52
+ }
53
+ samProps.devicebroker.enabled = true;
54
+ const attemptTimeout = samProps.request.attempt_timeout;
55
+ const { stub } = samProps;
56
+
57
+ // these are the adapter properties. You generally should not need to alter
58
+ // any of these after they are initially set up
59
+ global.pronghornProps = {
60
+ pathProps: {
61
+ encrypted: false
62
+ },
63
+ adapterProps: {
64
+ adapters: [{
65
+ id: 'Test-nokia_netact',
66
+ type: 'NokiaNetact',
67
+ properties: samProps
68
+ }]
69
+ }
70
+ };
71
+
72
+ global.$HOME = `${__dirname}/../..`;
73
+
74
+ // set the log levels that Pronghorn uses, spam and trace are not defaulted in so without
75
+ // this you may error on log.trace calls.
76
+ const myCustomLevels = {
77
+ levels: {
78
+ spam: 6,
79
+ trace: 5,
80
+ debug: 4,
81
+ info: 3,
82
+ warn: 2,
83
+ error: 1,
84
+ none: 0
85
+ }
86
+ };
87
+
88
+ // need to see if there is a log level passed in
89
+ process.argv.forEach((val) => {
90
+ // is there a log level defined to be passed in?
91
+ if (val.indexOf('--LOG') === 0) {
92
+ // get the desired log level
93
+ const inputVal = val.split('=')[1];
94
+
95
+ // validate the log level is supported, if so set it
96
+ if (Object.hasOwnProperty.call(myCustomLevels.levels, inputVal)) {
97
+ logLevel = inputVal;
98
+ }
99
+ }
100
+ });
101
+
102
+ // need to set global logging
103
+ global.log = winston.createLogger({
104
+ level: logLevel,
105
+ levels: myCustomLevels.levels,
106
+ transports: [
107
+ new winston.transports.Console()
108
+ ]
109
+ });
110
+
111
+ /**
112
+ * Runs the common asserts for test
113
+ */
114
+ function runCommonAsserts(data, error) {
115
+ assert.equal(undefined, error);
116
+ assert.notEqual(undefined, data);
117
+ assert.notEqual(null, data);
118
+ assert.notEqual(undefined, data.response);
119
+ assert.notEqual(null, data.response);
120
+ }
121
+
122
+ /**
123
+ * Runs the error asserts for the test
124
+ */
125
+ function runErrorAsserts(data, error, code, origin, displayStr) {
126
+ assert.equal(null, data);
127
+ assert.notEqual(undefined, error);
128
+ assert.notEqual(null, error);
129
+ assert.notEqual(undefined, error.IAPerror);
130
+ assert.notEqual(null, error.IAPerror);
131
+ assert.notEqual(undefined, error.IAPerror.displayString);
132
+ assert.notEqual(null, error.IAPerror.displayString);
133
+ assert.equal(code, error.icode);
134
+ assert.equal(origin, error.IAPerror.origin);
135
+ assert.equal(displayStr, error.IAPerror.displayString);
136
+ }
137
+
138
+ /**
139
+ * @function saveMockData
140
+ * Attempts to take data from responses and place them in MockDataFiles to help create Mockdata.
141
+ * Note, this was built based on entity file structure for Adapter-Engine 1.6.x
142
+ * @param {string} entityName - Name of the entity saving mock data for
143
+ * @param {string} actionName - Name of the action saving mock data for
144
+ * @param {string} descriptor - Something to describe this test (used as a type)
145
+ * @param {string or object} responseData - The data to put in the mock file.
146
+ */
147
+ function saveMockData(entityName, actionName, descriptor, responseData) {
148
+ // do not need to save mockdata if we are running in stub mode (already has mock data) or if told not to save
149
+ if (stub || !isSaveMockData) {
150
+ return false;
151
+ }
152
+
153
+ // must have a response in order to store the response
154
+ if (responseData && responseData.response) {
155
+ let data = responseData.response;
156
+
157
+ // if there was a raw response that one is better as it is untranslated
158
+ if (responseData.raw) {
159
+ data = responseData.raw;
160
+
161
+ try {
162
+ const temp = JSON.parse(data);
163
+ data = temp;
164
+ } catch (pex) {
165
+ // do not care if it did not parse as we will just use data
166
+ }
167
+ }
168
+
169
+ try {
170
+ const base = path.join(__dirname, `../../entities/${entityName}/`);
171
+ const mockdatafolder = 'mockdatafiles';
172
+ const filename = `mockdatafiles/${actionName}-${descriptor}.json`;
173
+
174
+ if (!fs.existsSync(base + mockdatafolder)) {
175
+ fs.mkdirSync(base + mockdatafolder);
176
+ }
177
+
178
+ // write the data we retrieved
179
+ fs.writeFile(base + filename, JSON.stringify(data, null, 2), 'utf8', (errWritingMock) => {
180
+ if (errWritingMock) throw errWritingMock;
181
+
182
+ // update the action file to reflect the changes. Note: We're replacing the default object for now!
183
+ fs.readFile(`${base}action.json`, (errRead, content) => {
184
+ if (errRead) throw errRead;
185
+
186
+ // parse the action file into JSON
187
+ const parsedJson = JSON.parse(content);
188
+
189
+ // The object update we'll write in.
190
+ const responseObj = {
191
+ type: descriptor,
192
+ key: '',
193
+ mockFile: filename
194
+ };
195
+
196
+ // get the object for method we're trying to change.
197
+ const currentMethodAction = parsedJson.actions.find((obj) => obj.name === actionName);
198
+
199
+ // if the method was not found - should never happen but...
200
+ if (!currentMethodAction) {
201
+ throw Error('Can\'t find an action for this method in the provided entity.');
202
+ }
203
+
204
+ // if there is a response object, we want to replace the Response object. Otherwise we'll create one.
205
+ const actionResponseObj = currentMethodAction.responseObjects.find((obj) => obj.type === descriptor);
206
+
207
+ // Add the action responseObj back into the array of response objects.
208
+ if (!actionResponseObj) {
209
+ // if there is a default response object, we want to get the key.
210
+ const defaultResponseObj = currentMethodAction.responseObjects.find((obj) => obj.type === 'default');
211
+
212
+ // save the default key into the new response object
213
+ if (defaultResponseObj) {
214
+ responseObj.key = defaultResponseObj.key;
215
+ }
216
+
217
+ // save the new response object
218
+ currentMethodAction.responseObjects = [responseObj];
219
+ } else {
220
+ // update the location of the mock data file
221
+ actionResponseObj.mockFile = responseObj.mockFile;
222
+ }
223
+
224
+ // Save results
225
+ fs.writeFile(`${base}action.json`, JSON.stringify(parsedJson, null, 2), (err) => {
226
+ if (err) throw err;
227
+ });
228
+ });
229
+ });
230
+ } catch (e) {
231
+ log.debug(`Failed to save mock data for ${actionName}. ${e.message}`);
232
+ return false;
233
+ }
234
+ }
235
+
236
+ // no response to save
237
+ log.debug(`No data passed to save into mockdata for ${actionName}`);
238
+ return false;
239
+ }
240
+
241
+ // require the adapter that we are going to be using
242
+ const NokiaNetact = require('../../adapter');
243
+
244
+ // begin the testing - these should be pretty well defined between the describe and the it!
245
+ describe('[integration] Nokia_netact Adapter Test', () => {
246
+ describe('NokiaNetact Class Tests', () => {
247
+ const a = new NokiaNetact(
248
+ pronghornProps.adapterProps.adapters[0].id,
249
+ pronghornProps.adapterProps.adapters[0].properties
250
+ );
251
+
252
+ if (isRapidFail) {
253
+ const state = {};
254
+ state.passed = true;
255
+
256
+ mocha.afterEach(function x() {
257
+ state.passed = state.passed
258
+ && (this.currentTest.state === 'passed');
259
+ });
260
+ mocha.beforeEach(function x() {
261
+ if (!state.passed) {
262
+ return this.currentTest.skip();
263
+ }
264
+ return true;
265
+ });
266
+ }
267
+
268
+ describe('#class instance created', () => {
269
+ it('should be a class with properties', (done) => {
270
+ try {
271
+ assert.notEqual(null, a);
272
+ assert.notEqual(undefined, a);
273
+ const checkId = global.pronghornProps.adapterProps.adapters[0].id;
274
+ assert.equal(checkId, a.id);
275
+ assert.notEqual(null, a.allProps);
276
+ const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
277
+ assert.equal(check, a.healthcheckType);
278
+ done();
279
+ } catch (error) {
280
+ log.error(`Test Failure: ${error}`);
281
+ done(error);
282
+ }
283
+ }).timeout(attemptTimeout);
284
+ });
285
+
286
+ describe('#connect', () => {
287
+ it('should get connected - no healthcheck', (done) => {
288
+ try {
289
+ a.healthcheckType = 'none';
290
+ a.connect();
291
+
292
+ try {
293
+ assert.equal(true, a.alive);
294
+ done();
295
+ } catch (error) {
296
+ log.error(`Test Failure: ${error}`);
297
+ done(error);
298
+ }
299
+ } catch (error) {
300
+ log.error(`Adapter Exception: ${error}`);
301
+ done(error);
302
+ }
303
+ });
304
+ it('should get connected - startup healthcheck', (done) => {
305
+ try {
306
+ a.healthcheckType = 'startup';
307
+ a.connect();
308
+
309
+ try {
310
+ assert.equal(true, a.alive);
311
+ done();
312
+ } catch (error) {
313
+ log.error(`Test Failure: ${error}`);
314
+ done(error);
315
+ }
316
+ } catch (error) {
317
+ log.error(`Adapter Exception: ${error}`);
318
+ done(error);
319
+ }
320
+ });
321
+ });
322
+
323
+ describe('#healthCheck', () => {
324
+ it('should be healthy', (done) => {
325
+ try {
326
+ a.healthCheck(null, (data) => {
327
+ try {
328
+ assert.equal(true, a.healthy);
329
+ saveMockData('system', 'healthcheck', 'default', data);
330
+ done();
331
+ } catch (err) {
332
+ log.error(`Test Failure: ${err}`);
333
+ done(err);
334
+ }
335
+ });
336
+ } catch (error) {
337
+ log.error(`Adapter Exception: ${error}`);
338
+ done(error);
339
+ }
340
+ }).timeout(attemptTimeout);
341
+ });
342
+
343
+ // broker tests
344
+ describe('#getDevicesFiltered - errors', () => {
345
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
346
+ try {
347
+ const opts = {
348
+ filter: {
349
+ name: 'deviceName'
350
+ }
351
+ };
352
+ a.getDevicesFiltered(opts, (data, error) => {
353
+ try {
354
+ if (stub) {
355
+ if (samProps.devicebroker.getDevicesFiltered[0].handleFailure === 'ignore') {
356
+ assert.equal(null, error);
357
+ assert.notEqual(undefined, data);
358
+ assert.notEqual(null, data);
359
+ assert.equal(0, data.total);
360
+ assert.equal(0, data.list.length);
361
+ } else {
362
+ const displayE = 'Error 400 received on request';
363
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
364
+ }
365
+ } else {
366
+ runCommonAsserts(data, error);
367
+ }
368
+ done();
369
+ } catch (err) {
370
+ log.error(`Test Failure: ${err}`);
371
+ done(err);
372
+ }
373
+ });
374
+ } catch (error) {
375
+ log.error(`Adapter Exception: ${error}`);
376
+ done(error);
377
+ }
378
+ }).timeout(attemptTimeout);
379
+ });
380
+
381
+ describe('#iapGetDeviceCount - errors', () => {
382
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
383
+ try {
384
+ const opts = {
385
+ filter: {
386
+ name: 'deviceName'
387
+ }
388
+ };
389
+ a.iapGetDeviceCount((data, error) => {
390
+ try {
391
+ if (stub) {
392
+ if (samProps.devicebroker.getDevicesFiltered[0].handleFailure === 'ignore') {
393
+ assert.equal(null, error);
394
+ assert.notEqual(undefined, data);
395
+ assert.notEqual(null, data);
396
+ assert.equal(0, data.count);
397
+ } else {
398
+ const displayE = 'Error 400 received on request';
399
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
400
+ }
401
+ } else {
402
+ runCommonAsserts(data, error);
403
+ }
404
+ done();
405
+ } catch (err) {
406
+ log.error(`Test Failure: ${err}`);
407
+ done(err);
408
+ }
409
+ });
410
+ } catch (error) {
411
+ log.error(`Adapter Exception: ${error}`);
412
+ done(error);
413
+ }
414
+ }).timeout(attemptTimeout);
415
+ });
416
+
417
+ // exposed cache tests
418
+ describe('#iapPopulateEntityCache - errors', () => {
419
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
420
+ try {
421
+ a.iapPopulateEntityCache('Device', (data, error) => {
422
+ try {
423
+ if (stub) {
424
+ assert.equal(null, data);
425
+ assert.notEqual(undefined, error);
426
+ assert.notEqual(null, error);
427
+ done();
428
+ } else {
429
+ assert.equal(undefined, error);
430
+ assert.equal('success', data[0]);
431
+ done();
432
+ }
433
+ } catch (err) {
434
+ log.error(`Test Failure: ${err}`);
435
+ done(err);
436
+ }
437
+ });
438
+ } catch (error) {
439
+ log.error(`Adapter Exception: ${error}`);
440
+ done(error);
441
+ }
442
+ }).timeout(attemptTimeout);
443
+ });
444
+
445
+ describe('#iapRetrieveEntitiesCache - errors', () => {
446
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
447
+ try {
448
+ a.iapRetrieveEntitiesCache('Device', {}, (data, error) => {
449
+ try {
450
+ if (stub) {
451
+ assert.equal(null, data);
452
+ assert.notEqual(null, error);
453
+ assert.notEqual(undefined, error);
454
+ } else {
455
+ assert.equal(undefined, error);
456
+ assert.notEqual(null, data);
457
+ assert.notEqual(undefined, data);
458
+ }
459
+ done();
460
+ } catch (err) {
461
+ log.error(`Test Failure: ${err}`);
462
+ done(err);
463
+ }
464
+ });
465
+ } catch (error) {
466
+ log.error(`Adapter Exception: ${error}`);
467
+ done(error);
468
+ }
469
+ }).timeout(attemptTimeout);
470
+ });
471
+ /*
472
+ -----------------------------------------------------------------------
473
+ -----------------------------------------------------------------------
474
+ *** All code above this comment will be replaced during a migration ***
475
+ ******************* DO NOT REMOVE THIS COMMENT BLOCK ******************
476
+ -----------------------------------------------------------------------
477
+ -----------------------------------------------------------------------
478
+ */
479
+
480
+ const persistencyCreateConfigurationBodyParam = {};
481
+ describe('#createConfiguration - errors', () => {
482
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
483
+ try {
484
+ a.createConfiguration(persistencyCreateConfigurationBodyParam, null, (data, error) => {
485
+ try {
486
+ if (stub) {
487
+ const displayE = 'Error 400 received on request';
488
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
489
+ } else {
490
+ runCommonAsserts(data, error);
491
+ }
492
+ saveMockData('Persistency', 'createConfiguration', 'default', data);
493
+ done();
494
+ } catch (err) {
495
+ log.error(`Test Failure: ${err}`);
496
+ done(err);
497
+ }
498
+ });
499
+ } catch (error) {
500
+ log.error(`Adapter Exception: ${error}`);
501
+ done(error);
502
+ }
503
+ }).timeout(attemptTimeout);
504
+ });
505
+
506
+ const persistencyGetDescendantMOLitesBodyParam = {};
507
+ describe('#getDescendantMOLites - errors', () => {
508
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
509
+ try {
510
+ a.getDescendantMOLites(persistencyGetDescendantMOLitesBodyParam, null, (data, error) => {
511
+ try {
512
+ if (stub) {
513
+ const displayE = 'Error 400 received on request';
514
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
515
+ } else {
516
+ runCommonAsserts(data, error);
517
+ }
518
+ saveMockData('Persistency', 'getDescendantMOLites', 'default', data);
519
+ done();
520
+ } catch (err) {
521
+ log.error(`Test Failure: ${err}`);
522
+ done(err);
523
+ }
524
+ });
525
+ } catch (error) {
526
+ log.error(`Adapter Exception: ${error}`);
527
+ done(error);
528
+ }
529
+ }).timeout(attemptTimeout);
530
+ });
531
+
532
+ const persistencyGetManagedObjectsBodyParam = {};
533
+ describe('#getManagedObjects - errors', () => {
534
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
535
+ try {
536
+ a.getManagedObjects(persistencyGetManagedObjectsBodyParam, null, (data, error) => {
537
+ try {
538
+ if (stub) {
539
+ const displayE = 'Error 400 received on request';
540
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
541
+ } else {
542
+ runCommonAsserts(data, error);
543
+ }
544
+ saveMockData('Persistency', 'getManagedObjects', 'default', data);
545
+ done();
546
+ } catch (err) {
547
+ log.error(`Test Failure: ${err}`);
548
+ done(err);
549
+ }
550
+ });
551
+ } catch (error) {
552
+ log.error(`Adapter Exception: ${error}`);
553
+ done(error);
554
+ }
555
+ }).timeout(attemptTimeout);
556
+ });
557
+
558
+ const persistencyAddManagedObjectsBodyParam = {};
559
+ describe('#addManagedObjects - errors', () => {
560
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
561
+ try {
562
+ a.addManagedObjects(persistencyAddManagedObjectsBodyParam, null, (data, error) => {
563
+ try {
564
+ if (stub) {
565
+ const displayE = 'Error 400 received on request';
566
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
567
+ } else {
568
+ runCommonAsserts(data, error);
569
+ }
570
+ saveMockData('Persistency', 'addManagedObjects', 'default', data);
571
+ done();
572
+ } catch (err) {
573
+ log.error(`Test Failure: ${err}`);
574
+ done(err);
575
+ }
576
+ });
577
+ } catch (error) {
578
+ log.error(`Adapter Exception: ${error}`);
579
+ done(error);
580
+ }
581
+ }).timeout(attemptTimeout);
582
+ });
583
+
584
+ const persistencyGetMetaParametersBodyParam = {};
585
+ describe('#getMetaParameters - errors', () => {
586
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
587
+ try {
588
+ a.getMetaParameters(persistencyGetMetaParametersBodyParam, null, (data, error) => {
589
+ try {
590
+ if (stub) {
591
+ const displayE = 'Error 400 received on request';
592
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
593
+ } else {
594
+ runCommonAsserts(data, error);
595
+ }
596
+ saveMockData('Persistency', 'getMetaParameters', 'default', data);
597
+ done();
598
+ } catch (err) {
599
+ log.error(`Test Failure: ${err}`);
600
+ done(err);
601
+ }
602
+ });
603
+ } catch (error) {
604
+ log.error(`Adapter Exception: ${error}`);
605
+ done(error);
606
+ }
607
+ }).timeout(attemptTimeout);
608
+ });
609
+
610
+ const persistencyGetMOLitesBodyParam = {};
611
+ describe('#getMOLites - errors', () => {
612
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
613
+ try {
614
+ a.getMOLites(persistencyGetMOLitesBodyParam, null, (data, error) => {
615
+ try {
616
+ if (stub) {
617
+ const displayE = 'Error 400 received on request';
618
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
619
+ } else {
620
+ runCommonAsserts(data, error);
621
+ }
622
+ saveMockData('Persistency', 'getMOLites', 'default', data);
623
+ done();
624
+ } catch (err) {
625
+ log.error(`Test Failure: ${err}`);
626
+ done(err);
627
+ }
628
+ });
629
+ } catch (error) {
630
+ log.error(`Adapter Exception: ${error}`);
631
+ done(error);
632
+ }
633
+ }).timeout(attemptTimeout);
634
+ });
635
+
636
+ const persistencyQueryBodyParam = {};
637
+ describe('#query - errors', () => {
638
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
639
+ try {
640
+ a.query(persistencyQueryBodyParam, null, (data, error) => {
641
+ try {
642
+ if (stub) {
643
+ const displayE = 'Error 400 received on request';
644
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
645
+ } else {
646
+ runCommonAsserts(data, error);
647
+ }
648
+ saveMockData('Persistency', 'query', 'default', data);
649
+ done();
650
+ } catch (err) {
651
+ log.error(`Test Failure: ${err}`);
652
+ done(err);
653
+ }
654
+ });
655
+ } catch (error) {
656
+ log.error(`Adapter Exception: ${error}`);
657
+ done(error);
658
+ }
659
+ }).timeout(attemptTimeout);
660
+ });
661
+
662
+ const persistencyQueryMOLitesBodyParam = {};
663
+ describe('#queryMOLites - errors', () => {
664
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
665
+ try {
666
+ a.queryMOLites(persistencyQueryMOLitesBodyParam, null, (data, error) => {
667
+ try {
668
+ if (stub) {
669
+ const displayE = 'Error 400 received on request';
670
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
671
+ } else {
672
+ runCommonAsserts(data, error);
673
+ }
674
+ saveMockData('Persistency', 'queryMOLites', 'default', data);
675
+ done();
676
+ } catch (err) {
677
+ log.error(`Test Failure: ${err}`);
678
+ done(err);
679
+ }
680
+ });
681
+ } catch (error) {
682
+ log.error(`Adapter Exception: ${error}`);
683
+ done(error);
684
+ }
685
+ }).timeout(attemptTimeout);
686
+ });
687
+
688
+ const persistencyGetRelatedMOLitesBodyParam = {};
689
+ describe('#getRelatedMOLites - errors', () => {
690
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
691
+ try {
692
+ a.getRelatedMOLites(persistencyGetRelatedMOLitesBodyParam, null, (data, error) => {
693
+ try {
694
+ if (stub) {
695
+ const displayE = 'Error 400 received on request';
696
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
697
+ } else {
698
+ runCommonAsserts(data, error);
699
+ }
700
+ saveMockData('Persistency', 'getRelatedMOLites', 'default', data);
701
+ done();
702
+ } catch (err) {
703
+ log.error(`Test Failure: ${err}`);
704
+ done(err);
705
+ }
706
+ });
707
+ } catch (error) {
708
+ log.error(`Adapter Exception: ${error}`);
709
+ done(error);
710
+ }
711
+ }).timeout(attemptTimeout);
712
+ });
713
+
714
+ const persistencyUpdateConfigurationBodyParam = {};
715
+ describe('#updateConfiguration - errors', () => {
716
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
717
+ try {
718
+ a.updateConfiguration(persistencyUpdateConfigurationBodyParam, null, (data, error) => {
719
+ try {
720
+ if (stub) {
721
+ const displayE = 'Error 400 received on request';
722
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
723
+ } else {
724
+ runCommonAsserts(data, error);
725
+ }
726
+ saveMockData('Persistency', 'updateConfiguration', 'default', data);
727
+ done();
728
+ } catch (err) {
729
+ log.error(`Test Failure: ${err}`);
730
+ done(err);
731
+ }
732
+ });
733
+ } catch (error) {
734
+ log.error(`Adapter Exception: ${error}`);
735
+ done(error);
736
+ }
737
+ }).timeout(attemptTimeout);
738
+ });
739
+
740
+ const persistencyConfId = 'fakedata';
741
+ describe('#getConfigurations - errors', () => {
742
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
743
+ try {
744
+ a.getConfigurations(null, persistencyConfId, null, null, (data, error) => {
745
+ try {
746
+ if (stub) {
747
+ const displayE = 'Error 400 received on request';
748
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
749
+ } else {
750
+ runCommonAsserts(data, error);
751
+ }
752
+ saveMockData('Persistency', 'getConfigurations', 'default', data);
753
+ done();
754
+ } catch (err) {
755
+ log.error(`Test Failure: ${err}`);
756
+ done(err);
757
+ }
758
+ });
759
+ } catch (error) {
760
+ log.error(`Adapter Exception: ${error}`);
761
+ done(error);
762
+ }
763
+ }).timeout(attemptTimeout);
764
+ });
765
+
766
+ const persistencyUpdateManagedObjectsBodyParam = {};
767
+ describe('#updateManagedObjects - errors', () => {
768
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
769
+ try {
770
+ a.updateManagedObjects(persistencyUpdateManagedObjectsBodyParam, null, (data, error) => {
771
+ try {
772
+ if (stub) {
773
+ const displayE = 'Error 400 received on request';
774
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
775
+ } else {
776
+ runCommonAsserts(data, error);
777
+ }
778
+ saveMockData('Persistency', 'updateManagedObjects', 'default', data);
779
+ done();
780
+ } catch (err) {
781
+ log.error(`Test Failure: ${err}`);
782
+ done(err);
783
+ }
784
+ });
785
+ } catch (error) {
786
+ log.error(`Adapter Exception: ${error}`);
787
+ done(error);
788
+ }
789
+ }).timeout(attemptTimeout);
790
+ });
791
+
792
+ describe('#getMetaAdaptations - errors', () => {
793
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
794
+ try {
795
+ a.getMetaAdaptations(null, null, (data, error) => {
796
+ try {
797
+ if (stub) {
798
+ const displayE = 'Error 400 received on request';
799
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
800
+ } else {
801
+ runCommonAsserts(data, error);
802
+ }
803
+ saveMockData('Persistency', 'getMetaAdaptations', 'default', data);
804
+ done();
805
+ } catch (err) {
806
+ log.error(`Test Failure: ${err}`);
807
+ done(err);
808
+ }
809
+ });
810
+ } catch (error) {
811
+ log.error(`Adapter Exception: ${error}`);
812
+ done(error);
813
+ }
814
+ }).timeout(attemptTimeout);
815
+ });
816
+
817
+ describe('#getMetaClasses - errors', () => {
818
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
819
+ try {
820
+ a.getMetaClasses(null, null, (data, error) => {
821
+ try {
822
+ if (stub) {
823
+ const displayE = 'Error 400 received on request';
824
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
825
+ } else {
826
+ runCommonAsserts(data, error);
827
+ }
828
+ saveMockData('Persistency', 'getMetaClasses', 'default', data);
829
+ done();
830
+ } catch (err) {
831
+ log.error(`Test Failure: ${err}`);
832
+ done(err);
833
+ }
834
+ });
835
+ } catch (error) {
836
+ log.error(`Adapter Exception: ${error}`);
837
+ done(error);
838
+ }
839
+ }).timeout(attemptTimeout);
840
+ });
841
+
842
+ describe('#getRootMOLites - errors', () => {
843
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
844
+ try {
845
+ a.getRootMOLites(persistencyConfId, null, (data, error) => {
846
+ try {
847
+ if (stub) {
848
+ const displayE = 'Error 400 received on request';
849
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
850
+ } else {
851
+ runCommonAsserts(data, error);
852
+ }
853
+ saveMockData('Persistency', 'getRootMOLites', 'default', data);
854
+ done();
855
+ } catch (err) {
856
+ log.error(`Test Failure: ${err}`);
857
+ done(err);
858
+ }
859
+ });
860
+ } catch (error) {
861
+ log.error(`Adapter Exception: ${error}`);
862
+ done(error);
863
+ }
864
+ }).timeout(attemptTimeout);
865
+ });
866
+
867
+ describe('#scheduleOperation - errors', () => {
868
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
869
+ try {
870
+ a.scheduleOperation(null, (data, error) => {
871
+ try {
872
+ if (stub) {
873
+ const displayE = 'Error 400 received on request';
874
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
875
+ } else {
876
+ runCommonAsserts(data, error);
877
+ }
878
+ saveMockData('Operations', 'scheduleOperation', 'default', data);
879
+ done();
880
+ } catch (err) {
881
+ log.error(`Test Failure: ${err}`);
882
+ done(err);
883
+ }
884
+ });
885
+ } catch (error) {
886
+ log.error(`Adapter Exception: ${error}`);
887
+ done(error);
888
+ }
889
+ }).timeout(attemptTimeout);
890
+ });
891
+
892
+ describe('#startOperation - errors', () => {
893
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
894
+ try {
895
+ a.startOperation(null, (data, error) => {
896
+ try {
897
+ if (stub) {
898
+ const displayE = 'Error 400 received on request';
899
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
900
+ } else {
901
+ runCommonAsserts(data, error);
902
+ }
903
+ saveMockData('Operations', 'startOperation', 'default', data);
904
+ done();
905
+ } catch (err) {
906
+ log.error(`Test Failure: ${err}`);
907
+ done(err);
908
+ }
909
+ });
910
+ } catch (error) {
911
+ log.error(`Adapter Exception: ${error}`);
912
+ done(error);
913
+ }
914
+ }).timeout(attemptTimeout);
915
+ });
916
+
917
+ describe('#readOperationAttributes - errors', () => {
918
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
919
+ try {
920
+ a.readOperationAttributes(null, null, (data, error) => {
921
+ try {
922
+ if (stub) {
923
+ const displayE = 'Error 400 received on request';
924
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
925
+ } else {
926
+ runCommonAsserts(data, error);
927
+ }
928
+ saveMockData('Operations', 'readOperationAttributes', 'default', data);
929
+ done();
930
+ } catch (err) {
931
+ log.error(`Test Failure: ${err}`);
932
+ done(err);
933
+ }
934
+ });
935
+ } catch (error) {
936
+ log.error(`Adapter Exception: ${error}`);
937
+ done(error);
938
+ }
939
+ }).timeout(attemptTimeout);
940
+ });
941
+
942
+ describe('#readOperationDefinitions - errors', () => {
943
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
944
+ try {
945
+ a.readOperationDefinitions(null, (data, error) => {
946
+ try {
947
+ if (stub) {
948
+ const displayE = 'Error 400 received on request';
949
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
950
+ } else {
951
+ runCommonAsserts(data, error);
952
+ }
953
+ saveMockData('Operations', 'readOperationDefinitions', 'default', data);
954
+ done();
955
+ } catch (err) {
956
+ log.error(`Test Failure: ${err}`);
957
+ done(err);
958
+ }
959
+ });
960
+ } catch (error) {
961
+ log.error(`Adapter Exception: ${error}`);
962
+ done(error);
963
+ }
964
+ }).timeout(attemptTimeout);
965
+ });
966
+
967
+ describe('#readOperationExecutions - errors', () => {
968
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
969
+ try {
970
+ a.readOperationExecutions(null, null, null, null, (data, error) => {
971
+ try {
972
+ if (stub) {
973
+ const displayE = 'Error 400 received on request';
974
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
975
+ } else {
976
+ runCommonAsserts(data, error);
977
+ }
978
+ saveMockData('Operations', 'readOperationExecutions', 'default', data);
979
+ done();
980
+ } catch (err) {
981
+ log.error(`Test Failure: ${err}`);
982
+ done(err);
983
+ }
984
+ });
985
+ } catch (error) {
986
+ log.error(`Adapter Exception: ${error}`);
987
+ done(error);
988
+ }
989
+ }).timeout(attemptTimeout);
990
+ });
991
+
992
+ describe('#readOperationFeedbacks - errors', () => {
993
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
994
+ try {
995
+ a.readOperationFeedbacks(null, null, null, null, (data, error) => {
996
+ try {
997
+ if (stub) {
998
+ const displayE = 'Error 400 received on request';
999
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
1000
+ } else {
1001
+ runCommonAsserts(data, error);
1002
+ }
1003
+ saveMockData('Operations', 'readOperationFeedbacks', 'default', data);
1004
+ done();
1005
+ } catch (err) {
1006
+ log.error(`Test Failure: ${err}`);
1007
+ done(err);
1008
+ }
1009
+ });
1010
+ } catch (error) {
1011
+ log.error(`Adapter Exception: ${error}`);
1012
+ done(error);
1013
+ }
1014
+ }).timeout(attemptTimeout);
1015
+ });
1016
+
1017
+ const operationsInterruptOperationBodyParam = {};
1018
+ describe('#interruptOperation - errors', () => {
1019
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1020
+ try {
1021
+ a.interruptOperation(operationsInterruptOperationBodyParam, null, (data, error) => {
1022
+ try {
1023
+ if (stub) {
1024
+ const displayE = 'Error 400 received on request';
1025
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
1026
+ } else {
1027
+ runCommonAsserts(data, error);
1028
+ }
1029
+ saveMockData('Operations', 'interruptOperation', 'default', data);
1030
+ done();
1031
+ } catch (err) {
1032
+ log.error(`Test Failure: ${err}`);
1033
+ done(err);
1034
+ }
1035
+ });
1036
+ } catch (error) {
1037
+ log.error(`Adapter Exception: ${error}`);
1038
+ done(error);
1039
+ }
1040
+ }).timeout(attemptTimeout);
1041
+ });
1042
+
1043
+ describe('#readOperationStatuses - errors', () => {
1044
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1045
+ try {
1046
+ a.readOperationStatuses(null, null, (data, error) => {
1047
+ try {
1048
+ if (stub) {
1049
+ const displayE = 'Error 400 received on request';
1050
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
1051
+ } else {
1052
+ runCommonAsserts(data, error);
1053
+ }
1054
+ saveMockData('Operations', 'readOperationStatuses', 'default', data);
1055
+ done();
1056
+ } catch (err) {
1057
+ log.error(`Test Failure: ${err}`);
1058
+ done(err);
1059
+ }
1060
+ });
1061
+ } catch (error) {
1062
+ log.error(`Adapter Exception: ${error}`);
1063
+ done(error);
1064
+ }
1065
+ }).timeout(attemptTimeout);
1066
+ });
1067
+
1068
+ const openCmPersistencyPortBindingCreateOpenCmConfigurationBodyParam = {};
1069
+ describe('#createOpenCmConfiguration - errors', () => {
1070
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1071
+ try {
1072
+ a.createOpenCmConfiguration(openCmPersistencyPortBindingCreateOpenCmConfigurationBodyParam, null, (data, error) => {
1073
+ try {
1074
+ if (stub) {
1075
+ const displayE = 'Error 400 received on request';
1076
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
1077
+ } else {
1078
+ runCommonAsserts(data, error);
1079
+ }
1080
+ saveMockData('OpenCmPersistencyPortBinding', 'createOpenCmConfiguration', 'default', data);
1081
+ done();
1082
+ } catch (err) {
1083
+ log.error(`Test Failure: ${err}`);
1084
+ done(err);
1085
+ }
1086
+ });
1087
+ } catch (error) {
1088
+ log.error(`Adapter Exception: ${error}`);
1089
+ done(error);
1090
+ }
1091
+ }).timeout(attemptTimeout);
1092
+ });
1093
+
1094
+ const openCmPersistencyPortBindingCreateManagedObjectsBodyParam = {};
1095
+ describe('#createManagedObjects - errors', () => {
1096
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1097
+ try {
1098
+ a.createManagedObjects(openCmPersistencyPortBindingCreateManagedObjectsBodyParam, null, (data, error) => {
1099
+ try {
1100
+ if (stub) {
1101
+ const displayE = 'Error 400 received on request';
1102
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
1103
+ } else {
1104
+ runCommonAsserts(data, error);
1105
+ }
1106
+ saveMockData('OpenCmPersistencyPortBinding', 'createManagedObjects', 'default', data);
1107
+ done();
1108
+ } catch (err) {
1109
+ log.error(`Test Failure: ${err}`);
1110
+ done(err);
1111
+ }
1112
+ });
1113
+ } catch (error) {
1114
+ log.error(`Adapter Exception: ${error}`);
1115
+ done(error);
1116
+ }
1117
+ }).timeout(attemptTimeout);
1118
+ });
1119
+
1120
+ const openCmPersistencyPortBindingDeleteOpenCmConfigurationBodyParam = {};
1121
+ describe('#deleteOpenCmConfiguration - errors', () => {
1122
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1123
+ try {
1124
+ a.deleteOpenCmConfiguration(openCmPersistencyPortBindingDeleteOpenCmConfigurationBodyParam, null, (data, error) => {
1125
+ try {
1126
+ if (stub) {
1127
+ const displayE = 'Error 400 received on request';
1128
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
1129
+ } else {
1130
+ runCommonAsserts(data, error);
1131
+ }
1132
+ saveMockData('OpenCmPersistencyPortBinding', 'deleteOpenCmConfiguration', 'default', data);
1133
+ done();
1134
+ } catch (err) {
1135
+ log.error(`Test Failure: ${err}`);
1136
+ done(err);
1137
+ }
1138
+ });
1139
+ } catch (error) {
1140
+ log.error(`Adapter Exception: ${error}`);
1141
+ done(error);
1142
+ }
1143
+ }).timeout(attemptTimeout);
1144
+ });
1145
+
1146
+ const openCmPersistencyPortBindingDeleteManagedObjectsBodyParam = {};
1147
+ describe('#deleteManagedObjects - errors', () => {
1148
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1149
+ try {
1150
+ a.deleteManagedObjects(openCmPersistencyPortBindingDeleteManagedObjectsBodyParam, null, (data, error) => {
1151
+ try {
1152
+ if (stub) {
1153
+ const displayE = 'Error 400 received on request';
1154
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
1155
+ } else {
1156
+ runCommonAsserts(data, error);
1157
+ }
1158
+ saveMockData('OpenCmPersistencyPortBinding', 'deleteManagedObjects', 'default', data);
1159
+ done();
1160
+ } catch (err) {
1161
+ log.error(`Test Failure: ${err}`);
1162
+ done(err);
1163
+ }
1164
+ });
1165
+ } catch (error) {
1166
+ log.error(`Adapter Exception: ${error}`);
1167
+ done(error);
1168
+ }
1169
+ }).timeout(attemptTimeout);
1170
+ });
1171
+
1172
+ const openCmPersistencyPortBindingGetOpenCmConfigurationsBodyParam = {};
1173
+ describe('#getOpenCmConfigurations - errors', () => {
1174
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1175
+ try {
1176
+ a.getOpenCmConfigurations(openCmPersistencyPortBindingGetOpenCmConfigurationsBodyParam, null, (data, error) => {
1177
+ try {
1178
+ if (stub) {
1179
+ const displayE = 'Error 400 received on request';
1180
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
1181
+ } else {
1182
+ runCommonAsserts(data, error);
1183
+ }
1184
+ saveMockData('OpenCmPersistencyPortBinding', 'getOpenCmConfigurations', 'default', data);
1185
+ done();
1186
+ } catch (err) {
1187
+ log.error(`Test Failure: ${err}`);
1188
+ done(err);
1189
+ }
1190
+ });
1191
+ } catch (error) {
1192
+ log.error(`Adapter Exception: ${error}`);
1193
+ done(error);
1194
+ }
1195
+ }).timeout(attemptTimeout);
1196
+ });
1197
+
1198
+ const openCmPersistencyPortBindingGetOpenCmMOLitesBodyParam = {};
1199
+ describe('#getOpenCmMOLites - errors', () => {
1200
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1201
+ try {
1202
+ a.getOpenCmMOLites(openCmPersistencyPortBindingGetOpenCmMOLitesBodyParam, null, (data, error) => {
1203
+ try {
1204
+ if (stub) {
1205
+ const displayE = 'Error 400 received on request';
1206
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
1207
+ } else {
1208
+ runCommonAsserts(data, error);
1209
+ }
1210
+ saveMockData('OpenCmPersistencyPortBinding', 'getOpenCmMOLites', 'default', data);
1211
+ done();
1212
+ } catch (err) {
1213
+ log.error(`Test Failure: ${err}`);
1214
+ done(err);
1215
+ }
1216
+ });
1217
+ } catch (error) {
1218
+ log.error(`Adapter Exception: ${error}`);
1219
+ done(error);
1220
+ }
1221
+ }).timeout(attemptTimeout);
1222
+ });
1223
+
1224
+ const openCmPersistencyPortBindingGetOpenCmManagedObjectsBodyParam = {};
1225
+ describe('#getOpenCmManagedObjects - errors', () => {
1226
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1227
+ try {
1228
+ a.getOpenCmManagedObjects(openCmPersistencyPortBindingGetOpenCmManagedObjectsBodyParam, null, (data, error) => {
1229
+ try {
1230
+ if (stub) {
1231
+ const displayE = 'Error 400 received on request';
1232
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
1233
+ } else {
1234
+ runCommonAsserts(data, error);
1235
+ }
1236
+ saveMockData('OpenCmPersistencyPortBinding', 'getOpenCmManagedObjects', 'default', data);
1237
+ done();
1238
+ } catch (err) {
1239
+ log.error(`Test Failure: ${err}`);
1240
+ done(err);
1241
+ }
1242
+ });
1243
+ } catch (error) {
1244
+ log.error(`Adapter Exception: ${error}`);
1245
+ done(error);
1246
+ }
1247
+ }).timeout(attemptTimeout);
1248
+ });
1249
+
1250
+ const openCmPersistencyPortBindingGetPersistencyMetadataBodyParam = {};
1251
+ describe('#getPersistencyMetadata - errors', () => {
1252
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1253
+ try {
1254
+ a.getPersistencyMetadata(openCmPersistencyPortBindingGetPersistencyMetadataBodyParam, null, (data, error) => {
1255
+ try {
1256
+ if (stub) {
1257
+ const displayE = 'Error 400 received on request';
1258
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
1259
+ } else {
1260
+ runCommonAsserts(data, error);
1261
+ }
1262
+ saveMockData('OpenCmPersistencyPortBinding', 'getPersistencyMetadata', 'default', data);
1263
+ done();
1264
+ } catch (err) {
1265
+ log.error(`Test Failure: ${err}`);
1266
+ done(err);
1267
+ }
1268
+ });
1269
+ } catch (error) {
1270
+ log.error(`Adapter Exception: ${error}`);
1271
+ done(error);
1272
+ }
1273
+ }).timeout(attemptTimeout);
1274
+ });
1275
+
1276
+ const openCmPersistencyPortBindingGetOpenCmRelatedMOLitesBodyParam = {};
1277
+ describe('#getOpenCmRelatedMOLites - errors', () => {
1278
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1279
+ try {
1280
+ a.getOpenCmRelatedMOLites(openCmPersistencyPortBindingGetOpenCmRelatedMOLitesBodyParam, null, (data, error) => {
1281
+ try {
1282
+ if (stub) {
1283
+ const displayE = 'Error 400 received on request';
1284
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
1285
+ } else {
1286
+ runCommonAsserts(data, error);
1287
+ }
1288
+ saveMockData('OpenCmPersistencyPortBinding', 'getOpenCmRelatedMOLites', 'default', data);
1289
+ done();
1290
+ } catch (err) {
1291
+ log.error(`Test Failure: ${err}`);
1292
+ done(err);
1293
+ }
1294
+ });
1295
+ } catch (error) {
1296
+ log.error(`Adapter Exception: ${error}`);
1297
+ done(error);
1298
+ }
1299
+ }).timeout(attemptTimeout);
1300
+ });
1301
+
1302
+ const openCmPersistencyPortBindingQueryOpenCmMOLitesBodyParam = {};
1303
+ describe('#queryOpenCmMOLites - errors', () => {
1304
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1305
+ try {
1306
+ a.queryOpenCmMOLites(openCmPersistencyPortBindingQueryOpenCmMOLitesBodyParam, null, (data, error) => {
1307
+ try {
1308
+ if (stub) {
1309
+ const displayE = 'Error 400 received on request';
1310
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
1311
+ } else {
1312
+ runCommonAsserts(data, error);
1313
+ }
1314
+ saveMockData('OpenCmPersistencyPortBinding', 'queryOpenCmMOLites', 'default', data);
1315
+ done();
1316
+ } catch (err) {
1317
+ log.error(`Test Failure: ${err}`);
1318
+ done(err);
1319
+ }
1320
+ });
1321
+ } catch (error) {
1322
+ log.error(`Adapter Exception: ${error}`);
1323
+ done(error);
1324
+ }
1325
+ }).timeout(attemptTimeout);
1326
+ });
1327
+
1328
+ const openCmPersistencyPortBindingPostPersistencyOpenCmPersistencyServiceSOAPUpdateConfigurationBodyParam = {};
1329
+ describe('#postPersistencyOpenCmPersistencyServiceSOAPUpdateConfiguration - errors', () => {
1330
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1331
+ try {
1332
+ a.postPersistencyOpenCmPersistencyServiceSOAPUpdateConfiguration(openCmPersistencyPortBindingPostPersistencyOpenCmPersistencyServiceSOAPUpdateConfigurationBodyParam, null, (data, error) => {
1333
+ try {
1334
+ if (stub) {
1335
+ const displayE = 'Error 400 received on request';
1336
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
1337
+ } else {
1338
+ runCommonAsserts(data, error);
1339
+ }
1340
+ saveMockData('OpenCmPersistencyPortBinding', 'postPersistencyOpenCmPersistencyServiceSOAPUpdateConfiguration', 'default', data);
1341
+ done();
1342
+ } catch (err) {
1343
+ log.error(`Test Failure: ${err}`);
1344
+ done(err);
1345
+ }
1346
+ });
1347
+ } catch (error) {
1348
+ log.error(`Adapter Exception: ${error}`);
1349
+ done(error);
1350
+ }
1351
+ }).timeout(attemptTimeout);
1352
+ });
1353
+
1354
+ const openCmPersistencyPortBindingUpdateOpenCmManagedObjectsBodyParam = {};
1355
+ describe('#updateOpenCmManagedObjects - errors', () => {
1356
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1357
+ try {
1358
+ a.updateOpenCmManagedObjects(openCmPersistencyPortBindingUpdateOpenCmManagedObjectsBodyParam, null, (data, error) => {
1359
+ try {
1360
+ if (stub) {
1361
+ const displayE = 'Error 400 received on request';
1362
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
1363
+ } else {
1364
+ runCommonAsserts(data, error);
1365
+ }
1366
+ saveMockData('OpenCmPersistencyPortBinding', 'updateOpenCmManagedObjects', 'default', data);
1367
+ done();
1368
+ } catch (err) {
1369
+ log.error(`Test Failure: ${err}`);
1370
+ done(err);
1371
+ }
1372
+ });
1373
+ } catch (error) {
1374
+ log.error(`Adapter Exception: ${error}`);
1375
+ done(error);
1376
+ }
1377
+ }).timeout(attemptTimeout);
1378
+ });
1379
+
1380
+ const openCmOperationsPortBindingGetOperationsMetadataBodyParam = {};
1381
+ describe('#getOperationsMetadata - errors', () => {
1382
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1383
+ try {
1384
+ a.getOperationsMetadata(openCmOperationsPortBindingGetOperationsMetadataBodyParam, null, (data, error) => {
1385
+ try {
1386
+ if (stub) {
1387
+ const displayE = 'Error 400 received on request';
1388
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
1389
+ } else {
1390
+ runCommonAsserts(data, error);
1391
+ }
1392
+ saveMockData('OpenCmOperationsPortBinding', 'getOperationsMetadata', 'default', data);
1393
+ done();
1394
+ } catch (err) {
1395
+ log.error(`Test Failure: ${err}`);
1396
+ done(err);
1397
+ }
1398
+ });
1399
+ } catch (error) {
1400
+ log.error(`Adapter Exception: ${error}`);
1401
+ done(error);
1402
+ }
1403
+ }).timeout(attemptTimeout);
1404
+ });
1405
+
1406
+ const openCmOperationsPortBindingInterruptOperationOpenCmBodyParam = {};
1407
+ describe('#interruptOperationOpenCm - errors', () => {
1408
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1409
+ try {
1410
+ a.interruptOperationOpenCm(openCmOperationsPortBindingInterruptOperationOpenCmBodyParam, null, (data, error) => {
1411
+ try {
1412
+ if (stub) {
1413
+ const displayE = 'Error 400 received on request';
1414
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
1415
+ } else {
1416
+ runCommonAsserts(data, error);
1417
+ }
1418
+ saveMockData('OpenCmOperationsPortBinding', 'interruptOperationOpenCm', 'default', data);
1419
+ done();
1420
+ } catch (err) {
1421
+ log.error(`Test Failure: ${err}`);
1422
+ done(err);
1423
+ }
1424
+ });
1425
+ } catch (error) {
1426
+ log.error(`Adapter Exception: ${error}`);
1427
+ done(error);
1428
+ }
1429
+ }).timeout(attemptTimeout);
1430
+ });
1431
+
1432
+ const openCmOperationsPortBindingStartOpenCmOperationBodyParam = {};
1433
+ describe('#startOpenCmOperation - errors', () => {
1434
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1435
+ try {
1436
+ a.startOpenCmOperation(openCmOperationsPortBindingStartOpenCmOperationBodyParam, null, (data, error) => {
1437
+ try {
1438
+ if (stub) {
1439
+ const displayE = 'Error 400 received on request';
1440
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
1441
+ } else {
1442
+ runCommonAsserts(data, error);
1443
+ }
1444
+ saveMockData('OpenCmOperationsPortBinding', 'startOpenCmOperation', 'default', data);
1445
+ done();
1446
+ } catch (err) {
1447
+ log.error(`Test Failure: ${err}`);
1448
+ done(err);
1449
+ }
1450
+ });
1451
+ } catch (error) {
1452
+ log.error(`Adapter Exception: ${error}`);
1453
+ done(error);
1454
+ }
1455
+ }).timeout(attemptTimeout);
1456
+ });
1457
+
1458
+ describe('#deleteConfiguration - errors', () => {
1459
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1460
+ try {
1461
+ a.deleteConfiguration(persistencyConfId, null, (data, error) => {
1462
+ try {
1463
+ if (stub) {
1464
+ const displayE = 'Error 400 received on request';
1465
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
1466
+ } else {
1467
+ runCommonAsserts(data, error);
1468
+ }
1469
+ saveMockData('Persistency', 'deleteConfiguration', 'default', data);
1470
+ done();
1471
+ } catch (err) {
1472
+ log.error(`Test Failure: ${err}`);
1473
+ done(err);
1474
+ }
1475
+ });
1476
+ } catch (error) {
1477
+ log.error(`Adapter Exception: ${error}`);
1478
+ done(error);
1479
+ }
1480
+ }).timeout(attemptTimeout);
1481
+ });
1482
+
1483
+ const persistencyRemoveManagedObjectsBodyParam = {};
1484
+ describe('#removeManagedObjects - errors', () => {
1485
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1486
+ try {
1487
+ a.removeManagedObjects(persistencyRemoveManagedObjectsBodyParam, null, (data, error) => {
1488
+ try {
1489
+ if (stub) {
1490
+ const displayE = 'Error 400 received on request';
1491
+ runErrorAsserts(data, error, 'AD.500', 'Test-nokia_netact-connectorRest-handleEndResponse', displayE);
1492
+ } else {
1493
+ runCommonAsserts(data, error);
1494
+ }
1495
+ saveMockData('Persistency', 'removeManagedObjects', 'default', data);
1496
+ done();
1497
+ } catch (err) {
1498
+ log.error(`Test Failure: ${err}`);
1499
+ done(err);
1500
+ }
1501
+ });
1502
+ } catch (error) {
1503
+ log.error(`Adapter Exception: ${error}`);
1504
+ done(error);
1505
+ }
1506
+ }).timeout(attemptTimeout);
1507
+ });
1508
+ });
1509
+ });