@itentialopensource/adapter-opsramp 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 (65) hide show
  1. package/.eslintignore +5 -0
  2. package/.eslintrc.js +18 -0
  3. package/.jshintrc +3 -0
  4. package/AUTH.md +39 -0
  5. package/BROKER.md +211 -0
  6. package/CALLS.md +609 -0
  7. package/CHANGELOG.md +9 -0
  8. package/CODE_OF_CONDUCT.md +43 -0
  9. package/CONTRIBUTING.md +13 -0
  10. package/ENHANCE.md +69 -0
  11. package/LICENSE +201 -0
  12. package/PROPERTIES.md +646 -0
  13. package/README.md +343 -0
  14. package/SUMMARY.md +9 -0
  15. package/SYSTEMINFO.md +14 -0
  16. package/TROUBLESHOOT.md +47 -0
  17. package/adapter.js +8089 -0
  18. package/adapterBase.js +1452 -0
  19. package/entities/.generic/action.json +214 -0
  20. package/entities/.generic/schema.json +28 -0
  21. package/entities/.system/action.json +50 -0
  22. package/entities/.system/mockdatafiles/getToken-default.json +3 -0
  23. package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
  24. package/entities/.system/schema.json +19 -0
  25. package/entities/.system/schemaTokenReq.json +86 -0
  26. package/entities/.system/schemaTokenResp.json +53 -0
  27. package/entities/ResourceManagement/action.json +1358 -0
  28. package/entities/ResourceManagement/schema.json +95 -0
  29. package/entities/Tenants/action.json +25 -0
  30. package/entities/Tenants/schema.json +19 -0
  31. package/error.json +190 -0
  32. package/metadata.json +60 -0
  33. package/package.json +81 -0
  34. package/pronghorn.json +6180 -0
  35. package/propertiesDecorators.json +14 -0
  36. package/propertiesSchema.json +1574 -0
  37. package/refs?service=git-upload-pack +0 -0
  38. package/report/adapterInfo.json +10 -0
  39. package/report/creationReport.json +560 -0
  40. package/report/opsramp-resource-management.yaml-OpenApi3Json.json +18935 -0
  41. package/sampleProperties.json +257 -0
  42. package/test/integration/adapterTestBasicGet.js +83 -0
  43. package/test/integration/adapterTestConnectivity.js +118 -0
  44. package/test/integration/adapterTestIntegration.js +2217 -0
  45. package/test/unit/adapterBaseTestUnit.js +1024 -0
  46. package/test/unit/adapterTestUnit.js +4263 -0
  47. package/utils/adapterInfo.js +206 -0
  48. package/utils/addAuth.js +94 -0
  49. package/utils/artifactize.js +146 -0
  50. package/utils/basicGet.js +50 -0
  51. package/utils/checkMigrate.js +63 -0
  52. package/utils/entitiesToDB.js +179 -0
  53. package/utils/findPath.js +74 -0
  54. package/utils/methodDocumentor.js +273 -0
  55. package/utils/modify.js +152 -0
  56. package/utils/packModificationScript.js +35 -0
  57. package/utils/patches2bundledDeps.js +90 -0
  58. package/utils/pre-commit.sh +32 -0
  59. package/utils/removeHooks.js +20 -0
  60. package/utils/setup.js +33 -0
  61. package/utils/taskMover.js +309 -0
  62. package/utils/tbScript.js +239 -0
  63. package/utils/tbUtils.js +489 -0
  64. package/utils/testRunner.js +298 -0
  65. package/utils/troubleshootingAdapter.js +193 -0
@@ -0,0 +1,2217 @@
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-opsramp',
66
+ type: 'Opsramp',
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 Opsramp = require('../../adapter');
243
+
244
+ // begin the testing - these should be pretty well defined between the describe and the it!
245
+ describe('[integration] Opsramp Adapter Test', () => {
246
+ describe('Opsramp Class Tests', () => {
247
+ const a = new Opsramp(
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-opsramp-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-opsramp-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 resourceManagementClientId = 'fakedata';
481
+ const resourceManagementApiV2TenantsDeviceGroupsByClientIdPOSTBodyParam = [
482
+ {}
483
+ ];
484
+ describe('#apiV2TenantsDeviceGroupsByClientIdPOST - errors', () => {
485
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
486
+ try {
487
+ a.apiV2TenantsDeviceGroupsByClientIdPOST(resourceManagementClientId, resourceManagementApiV2TenantsDeviceGroupsByClientIdPOSTBodyParam, null, (data, error) => {
488
+ try {
489
+ if (stub) {
490
+ const displayE = 'Error 400 received on request';
491
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
492
+ } else {
493
+ runCommonAsserts(data, error);
494
+ }
495
+ saveMockData('ResourceManagement', 'apiV2TenantsDeviceGroupsByClientIdPOST', 'default', data);
496
+ done();
497
+ } catch (err) {
498
+ log.error(`Test Failure: ${err}`);
499
+ done(err);
500
+ }
501
+ });
502
+ } catch (error) {
503
+ log.error(`Adapter Exception: ${error}`);
504
+ done(error);
505
+ }
506
+ }).timeout(attemptTimeout);
507
+ });
508
+
509
+ const resourceManagementResourceGroupId = 'fakedata';
510
+ const resourceManagementApiV2TenantsDeviceGroupsChildsByClientIdPOSTBodyParam = [
511
+ {}
512
+ ];
513
+ describe('#apiV2TenantsDeviceGroupsChildsByClientIdPOST - errors', () => {
514
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
515
+ try {
516
+ a.apiV2TenantsDeviceGroupsChildsByClientIdPOST(resourceManagementClientId, resourceManagementResourceGroupId, resourceManagementApiV2TenantsDeviceGroupsChildsByClientIdPOSTBodyParam, null, (data, error) => {
517
+ try {
518
+ if (stub) {
519
+ const displayE = 'Error 400 received on request';
520
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
521
+ } else {
522
+ runCommonAsserts(data, error);
523
+ }
524
+ saveMockData('ResourceManagement', 'apiV2TenantsDeviceGroupsChildsByClientIdPOST', 'default', data);
525
+ done();
526
+ } catch (err) {
527
+ log.error(`Test Failure: ${err}`);
528
+ done(err);
529
+ }
530
+ });
531
+ } catch (error) {
532
+ log.error(`Adapter Exception: ${error}`);
533
+ done(error);
534
+ }
535
+ }).timeout(attemptTimeout);
536
+ });
537
+
538
+ const resourceManagementAction = 'fakedata';
539
+ const resourceManagementApiV2TenantsDevicesWsussettingsPOSTBodyParam = [
540
+ {}
541
+ ];
542
+ describe('#apiV2TenantsDevicesWsussettingsPOST - errors', () => {
543
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
544
+ try {
545
+ a.apiV2TenantsDevicesWsussettingsPOST(resourceManagementAction, resourceManagementClientId, resourceManagementApiV2TenantsDevicesWsussettingsPOSTBodyParam, null, (data, error) => {
546
+ try {
547
+ if (stub) {
548
+ const displayE = 'Error 400 received on request';
549
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
550
+ } else {
551
+ runCommonAsserts(data, error);
552
+ }
553
+ saveMockData('ResourceManagement', 'apiV2TenantsDevicesWsussettingsPOST', 'default', data);
554
+ done();
555
+ } catch (err) {
556
+ log.error(`Test Failure: ${err}`);
557
+ done(err);
558
+ }
559
+ });
560
+ } catch (error) {
561
+ log.error(`Adapter Exception: ${error}`);
562
+ done(error);
563
+ }
564
+ }).timeout(attemptTimeout);
565
+ });
566
+
567
+ const resourceManagementResourceId = 'fakedata';
568
+ const resourceManagementApiV2TenantsDevicesDeviceWarrantyPOSTBodyParam = {};
569
+ describe('#apiV2TenantsDevicesDeviceWarrantyPOST - errors', () => {
570
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
571
+ try {
572
+ a.apiV2TenantsDevicesDeviceWarrantyPOST(resourceManagementResourceId, resourceManagementClientId, resourceManagementApiV2TenantsDevicesDeviceWarrantyPOSTBodyParam, null, (data, error) => {
573
+ try {
574
+ if (stub) {
575
+ const displayE = 'Error 400 received on request';
576
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
577
+ } else {
578
+ runCommonAsserts(data, error);
579
+ }
580
+ saveMockData('ResourceManagement', 'apiV2TenantsDevicesDeviceWarrantyPOST', 'default', data);
581
+ done();
582
+ } catch (err) {
583
+ log.error(`Test Failure: ${err}`);
584
+ done(err);
585
+ }
586
+ });
587
+ } catch (error) {
588
+ log.error(`Adapter Exception: ${error}`);
589
+ done(error);
590
+ }
591
+ }).timeout(attemptTimeout);
592
+ });
593
+
594
+ const resourceManagementActions = 'fakedata';
595
+ describe('#getApiV2TenantsClientIdDevicesResourceIdActions - errors', () => {
596
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
597
+ try {
598
+ a.getApiV2TenantsClientIdDevicesResourceIdActions(resourceManagementClientId, resourceManagementResourceId, resourceManagementActions, null, (data, error) => {
599
+ try {
600
+ if (stub) {
601
+ const displayE = 'Error 400 received on request';
602
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
603
+ } else {
604
+ runCommonAsserts(data, error);
605
+ }
606
+ saveMockData('ResourceManagement', 'getApiV2TenantsClientIdDevicesResourceIdActions', 'default', data);
607
+ done();
608
+ } catch (err) {
609
+ log.error(`Test Failure: ${err}`);
610
+ done(err);
611
+ }
612
+ });
613
+ } catch (error) {
614
+ log.error(`Adapter Exception: ${error}`);
615
+ done(error);
616
+ }
617
+ }).timeout(attemptTimeout);
618
+ });
619
+
620
+ const resourceManagementApiV2TenantsPoliciesManagementByClientIdPOSTBodyParam = [
621
+ {}
622
+ ];
623
+ describe('#apiV2TenantsPoliciesManagementByClientIdPOST - errors', () => {
624
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
625
+ try {
626
+ a.apiV2TenantsPoliciesManagementByClientIdPOST(resourceManagementClientId, resourceManagementApiV2TenantsPoliciesManagementByClientIdPOSTBodyParam, null, (data, error) => {
627
+ try {
628
+ if (stub) {
629
+ const displayE = 'Error 400 received on request';
630
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
631
+ } else {
632
+ runCommonAsserts(data, error);
633
+ }
634
+ saveMockData('ResourceManagement', 'apiV2TenantsPoliciesManagementByClientIdPOST', 'default', data);
635
+ done();
636
+ } catch (err) {
637
+ log.error(`Test Failure: ${err}`);
638
+ done(err);
639
+ }
640
+ });
641
+ } catch (error) {
642
+ log.error(`Adapter Exception: ${error}`);
643
+ done(error);
644
+ }
645
+ }).timeout(attemptTimeout);
646
+ });
647
+
648
+ const resourceManagementApiV2TenantsResourcesByClientIdPOSTBodyParam = {};
649
+ describe('#apiV2TenantsResourcesByClientIdPOST - errors', () => {
650
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
651
+ try {
652
+ a.apiV2TenantsResourcesByClientIdPOST(resourceManagementClientId, resourceManagementApiV2TenantsResourcesByClientIdPOSTBodyParam, null, (data, error) => {
653
+ try {
654
+ if (stub) {
655
+ const displayE = 'Error 400 received on request';
656
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
657
+ } else {
658
+ runCommonAsserts(data, error);
659
+ }
660
+ saveMockData('ResourceManagement', 'apiV2TenantsResourcesByClientIdPOST', 'default', data);
661
+ done();
662
+ } catch (err) {
663
+ log.error(`Test Failure: ${err}`);
664
+ done(err);
665
+ }
666
+ });
667
+ } catch (error) {
668
+ log.error(`Adapter Exception: ${error}`);
669
+ done(error);
670
+ }
671
+ }).timeout(attemptTimeout);
672
+ });
673
+
674
+ const resourceManagementPostApiV2TenantsResourcesByClientIdPOSTBodyParam = {};
675
+ describe('#postApiV2TenantsResourcesByClientIdPOST - errors', () => {
676
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
677
+ try {
678
+ a.postApiV2TenantsResourcesByClientIdPOST(resourceManagementResourceId, resourceManagementClientId, resourceManagementPostApiV2TenantsResourcesByClientIdPOSTBodyParam, null, (data, error) => {
679
+ try {
680
+ if (stub) {
681
+ const displayE = 'Error 400 received on request';
682
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
683
+ } else {
684
+ runCommonAsserts(data, error);
685
+ }
686
+ saveMockData('ResourceManagement', 'postApiV2TenantsResourcesByClientIdPOST', 'default', data);
687
+ done();
688
+ } catch (err) {
689
+ log.error(`Test Failure: ${err}`);
690
+ done(err);
691
+ }
692
+ });
693
+ } catch (error) {
694
+ log.error(`Adapter Exception: ${error}`);
695
+ done(error);
696
+ }
697
+ }).timeout(attemptTimeout);
698
+ });
699
+
700
+ const resourceManagementApiV2TenantsResourcesAvailabilityRulePOSTBodyParam = {};
701
+ describe('#apiV2TenantsResourcesAvailabilityRulePOST - errors', () => {
702
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
703
+ try {
704
+ a.apiV2TenantsResourcesAvailabilityRulePOST(resourceManagementResourceId, resourceManagementClientId, resourceManagementApiV2TenantsResourcesAvailabilityRulePOSTBodyParam, null, (data, error) => {
705
+ try {
706
+ if (stub) {
707
+ const displayE = 'Error 400 received on request';
708
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
709
+ } else {
710
+ runCommonAsserts(data, error);
711
+ }
712
+ saveMockData('ResourceManagement', 'apiV2TenantsResourcesAvailabilityRulePOST', 'default', data);
713
+ done();
714
+ } catch (err) {
715
+ log.error(`Test Failure: ${err}`);
716
+ done(err);
717
+ }
718
+ });
719
+ } catch (error) {
720
+ log.error(`Adapter Exception: ${error}`);
721
+ done(error);
722
+ }
723
+ }).timeout(attemptTimeout);
724
+ });
725
+
726
+ const resourceManagementApiV2TenantsResourcesDecommissionPOSTBodyParam = {};
727
+ describe('#apiV2TenantsResourcesDecommissionPOST - errors', () => {
728
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
729
+ try {
730
+ a.apiV2TenantsResourcesDecommissionPOST(resourceManagementResourceId, resourceManagementClientId, resourceManagementApiV2TenantsResourcesDecommissionPOSTBodyParam, null, (data, error) => {
731
+ try {
732
+ if (stub) {
733
+ const displayE = 'Error 400 received on request';
734
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
735
+ } else {
736
+ runCommonAsserts(data, error);
737
+ }
738
+ saveMockData('ResourceManagement', 'apiV2TenantsResourcesDecommissionPOST', 'default', data);
739
+ done();
740
+ } catch (err) {
741
+ log.error(`Test Failure: ${err}`);
742
+ done(err);
743
+ }
744
+ });
745
+ } catch (error) {
746
+ log.error(`Adapter Exception: ${error}`);
747
+ done(error);
748
+ }
749
+ }).timeout(attemptTimeout);
750
+ });
751
+
752
+ const resourceManagementApiV2TenantsResourcesNotesByClientIdPOSTBodyParam = {};
753
+ describe('#apiV2TenantsResourcesNotesByClientIdPOST - errors', () => {
754
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
755
+ try {
756
+ a.apiV2TenantsResourcesNotesByClientIdPOST(resourceManagementResourceId, resourceManagementClientId, resourceManagementApiV2TenantsResourcesNotesByClientIdPOSTBodyParam, null, (data, error) => {
757
+ try {
758
+ if (stub) {
759
+ const displayE = 'Error 400 received on request';
760
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
761
+ } else {
762
+ runCommonAsserts(data, error);
763
+ }
764
+ saveMockData('ResourceManagement', 'apiV2TenantsResourcesNotesByClientIdPOST', 'default', data);
765
+ done();
766
+ } catch (err) {
767
+ log.error(`Test Failure: ${err}`);
768
+ done(err);
769
+ }
770
+ });
771
+ } catch (error) {
772
+ log.error(`Adapter Exception: ${error}`);
773
+ done(error);
774
+ }
775
+ }).timeout(attemptTimeout);
776
+ });
777
+
778
+ const resourceManagementNoteId = 'fakedata';
779
+ const resourceManagementApiV2TenantsResourcesNotesNoteIdPOSTBodyParam = {};
780
+ describe('#apiV2TenantsResourcesNotesNoteIdPOST - errors', () => {
781
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
782
+ try {
783
+ a.apiV2TenantsResourcesNotesNoteIdPOST(resourceManagementResourceId, resourceManagementNoteId, resourceManagementClientId, resourceManagementApiV2TenantsResourcesNotesNoteIdPOSTBodyParam, null, (data, error) => {
784
+ try {
785
+ if (stub) {
786
+ const displayE = 'Error 400 received on request';
787
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
788
+ } else {
789
+ runCommonAsserts(data, error);
790
+ }
791
+ saveMockData('ResourceManagement', 'apiV2TenantsResourcesNotesNoteIdPOST', 'default', data);
792
+ done();
793
+ } catch (err) {
794
+ log.error(`Test Failure: ${err}`);
795
+ done(err);
796
+ }
797
+ });
798
+ } catch (error) {
799
+ log.error(`Adapter Exception: ${error}`);
800
+ done(error);
801
+ }
802
+ }).timeout(attemptTimeout);
803
+ });
804
+
805
+ const resourceManagementCreateResourceConsoleBodyParam = [
806
+ {}
807
+ ];
808
+ describe('#createResourceConsole - errors', () => {
809
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
810
+ try {
811
+ a.createResourceConsole(resourceManagementResourceId, resourceManagementClientId, resourceManagementCreateResourceConsoleBodyParam, null, (data, error) => {
812
+ try {
813
+ if (stub) {
814
+ const displayE = 'Error 400 received on request';
815
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
816
+ } else {
817
+ runCommonAsserts(data, error);
818
+ }
819
+ saveMockData('ResourceManagement', 'createResourceConsole', 'default', data);
820
+ done();
821
+ } catch (err) {
822
+ log.error(`Test Failure: ${err}`);
823
+ done(err);
824
+ }
825
+ });
826
+ } catch (error) {
827
+ log.error(`Adapter Exception: ${error}`);
828
+ done(error);
829
+ }
830
+ }).timeout(attemptTimeout);
831
+ });
832
+
833
+ const resourceManagementApiV2TenantsServiceGroupsByClientIdPOSTBodyParam = [
834
+ {}
835
+ ];
836
+ describe('#apiV2TenantsServiceGroupsByClientIdPOST - errors', () => {
837
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
838
+ try {
839
+ a.apiV2TenantsServiceGroupsByClientIdPOST(resourceManagementClientId, resourceManagementApiV2TenantsServiceGroupsByClientIdPOSTBodyParam, null, (data, error) => {
840
+ try {
841
+ if (stub) {
842
+ const displayE = 'Error 400 received on request';
843
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
844
+ } else {
845
+ runCommonAsserts(data, error);
846
+ }
847
+ saveMockData('ResourceManagement', 'apiV2TenantsServiceGroupsByClientIdPOST', 'default', data);
848
+ done();
849
+ } catch (err) {
850
+ log.error(`Test Failure: ${err}`);
851
+ done(err);
852
+ }
853
+ });
854
+ } catch (error) {
855
+ log.error(`Adapter Exception: ${error}`);
856
+ done(error);
857
+ }
858
+ }).timeout(attemptTimeout);
859
+ });
860
+
861
+ const resourceManagementApiV2TenantsServiceGroupsLinkByClientIdPOSTBodyParam = [
862
+ {}
863
+ ];
864
+ describe('#apiV2TenantsServiceGroupsLinkByClientIdPOST - errors', () => {
865
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
866
+ try {
867
+ a.apiV2TenantsServiceGroupsLinkByClientIdPOST(resourceManagementClientId, resourceManagementApiV2TenantsServiceGroupsLinkByClientIdPOSTBodyParam, null, (data, error) => {
868
+ try {
869
+ if (stub) {
870
+ const displayE = 'Error 400 received on request';
871
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
872
+ } else {
873
+ runCommonAsserts(data, error);
874
+ }
875
+ saveMockData('ResourceManagement', 'apiV2TenantsServiceGroupsLinkByClientIdPOST', 'default', data);
876
+ done();
877
+ } catch (err) {
878
+ log.error(`Test Failure: ${err}`);
879
+ done(err);
880
+ }
881
+ });
882
+ } catch (error) {
883
+ log.error(`Adapter Exception: ${error}`);
884
+ done(error);
885
+ }
886
+ }).timeout(attemptTimeout);
887
+ });
888
+
889
+ const resourceManagementSgId = 'fakedata';
890
+ const resourceManagementApiV2TenantsServiceGroupsChildsPOSTBodyParam = [
891
+ {}
892
+ ];
893
+ describe('#apiV2TenantsServiceGroupsChildsPOST - errors', () => {
894
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
895
+ try {
896
+ a.apiV2TenantsServiceGroupsChildsPOST(resourceManagementSgId, resourceManagementClientId, resourceManagementApiV2TenantsServiceGroupsChildsPOSTBodyParam, null, (data, error) => {
897
+ try {
898
+ if (stub) {
899
+ const displayE = 'Error 400 received on request';
900
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
901
+ } else {
902
+ runCommonAsserts(data, error);
903
+ }
904
+ saveMockData('ResourceManagement', 'apiV2TenantsServiceGroupsChildsPOST', 'default', data);
905
+ done();
906
+ } catch (err) {
907
+ log.error(`Test Failure: ${err}`);
908
+ done(err);
909
+ }
910
+ });
911
+ } catch (error) {
912
+ log.error(`Adapter Exception: ${error}`);
913
+ done(error);
914
+ }
915
+ }).timeout(attemptTimeout);
916
+ });
917
+
918
+ const resourceManagementApiV2TenantsSitesByClientIdPOSTBodyParam = {};
919
+ describe('#apiV2TenantsSitesByClientIdPOST - errors', () => {
920
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
921
+ try {
922
+ a.apiV2TenantsSitesByClientIdPOST(resourceManagementClientId, resourceManagementApiV2TenantsSitesByClientIdPOSTBodyParam, null, (data, error) => {
923
+ try {
924
+ if (stub) {
925
+ const displayE = 'Error 400 received on request';
926
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
927
+ } else {
928
+ runCommonAsserts(data, error);
929
+ }
930
+ saveMockData('ResourceManagement', 'apiV2TenantsSitesByClientIdPOST', 'default', data);
931
+ done();
932
+ } catch (err) {
933
+ log.error(`Test Failure: ${err}`);
934
+ done(err);
935
+ }
936
+ });
937
+ } catch (error) {
938
+ log.error(`Adapter Exception: ${error}`);
939
+ done(error);
940
+ }
941
+ }).timeout(attemptTimeout);
942
+ });
943
+
944
+ const resourceManagementSiteId = 'fakedata';
945
+ const resourceManagementApiV2TenantsSitesByClientIdAndSiteIdPOSTBodyParam = {};
946
+ describe('#apiV2TenantsSitesByClientIdAndSiteIdPOST - errors', () => {
947
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
948
+ try {
949
+ a.apiV2TenantsSitesByClientIdAndSiteIdPOST(resourceManagementSiteId, resourceManagementClientId, resourceManagementApiV2TenantsSitesByClientIdAndSiteIdPOSTBodyParam, null, (data, error) => {
950
+ try {
951
+ if (stub) {
952
+ const displayE = 'Error 400 received on request';
953
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
954
+ } else {
955
+ runCommonAsserts(data, error);
956
+ }
957
+ saveMockData('ResourceManagement', 'apiV2TenantsSitesByClientIdAndSiteIdPOST', 'default', data);
958
+ done();
959
+ } catch (err) {
960
+ log.error(`Test Failure: ${err}`);
961
+ done(err);
962
+ }
963
+ });
964
+ } catch (error) {
965
+ log.error(`Adapter Exception: ${error}`);
966
+ done(error);
967
+ }
968
+ }).timeout(attemptTimeout);
969
+ });
970
+
971
+ const resourceManagementApiV2TenantsSitesChildsByClientIdPOSTBodyParam = [
972
+ {}
973
+ ];
974
+ describe('#apiV2TenantsSitesChildsByClientIdPOST - errors', () => {
975
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
976
+ try {
977
+ a.apiV2TenantsSitesChildsByClientIdPOST(resourceManagementSiteId, resourceManagementClientId, resourceManagementApiV2TenantsSitesChildsByClientIdPOSTBodyParam, null, (data, error) => {
978
+ try {
979
+ if (stub) {
980
+ const displayE = 'Error 400 received on request';
981
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
982
+ } else {
983
+ runCommonAsserts(data, error);
984
+ }
985
+ saveMockData('ResourceManagement', 'apiV2TenantsSitesChildsByClientIdPOST', 'default', data);
986
+ done();
987
+ } catch (err) {
988
+ log.error(`Test Failure: ${err}`);
989
+ done(err);
990
+ }
991
+ });
992
+ } catch (error) {
993
+ log.error(`Adapter Exception: ${error}`);
994
+ done(error);
995
+ }
996
+ }).timeout(attemptTimeout);
997
+ });
998
+
999
+ const resourceManagementPartnerId = 'fakedata';
1000
+ const resourceManagementApiV2TenantsDecommissionByPartnerIdPOSTBodyParam = {};
1001
+ describe('#apiV2TenantsDecommissionByPartnerIdPOST - errors', () => {
1002
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1003
+ try {
1004
+ a.apiV2TenantsDecommissionByPartnerIdPOST(resourceManagementAction, resourceManagementPartnerId, resourceManagementApiV2TenantsDecommissionByPartnerIdPOSTBodyParam, null, (data, error) => {
1005
+ try {
1006
+ if (stub) {
1007
+ const displayE = 'Error 400 received on request';
1008
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1009
+ } else {
1010
+ runCommonAsserts(data, error);
1011
+ }
1012
+ saveMockData('ResourceManagement', 'apiV2TenantsDecommissionByPartnerIdPOST', 'default', data);
1013
+ done();
1014
+ } catch (err) {
1015
+ log.error(`Test Failure: ${err}`);
1016
+ done(err);
1017
+ }
1018
+ });
1019
+ } catch (error) {
1020
+ log.error(`Adapter Exception: ${error}`);
1021
+ done(error);
1022
+ }
1023
+ }).timeout(attemptTimeout);
1024
+ });
1025
+
1026
+ const resourceManagementTenantId = 'fakedata';
1027
+ const resourceManagementCaContext = 'fakedata';
1028
+ const resourceManagementPostApiV2TenantsTenantIdCaContextCustomAttributesBodyParam = {};
1029
+ describe('#postApiV2TenantsTenantIdCaContextCustomAttributes - errors', () => {
1030
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1031
+ try {
1032
+ a.postApiV2TenantsTenantIdCaContextCustomAttributes(resourceManagementTenantId, resourceManagementCaContext, resourceManagementPostApiV2TenantsTenantIdCaContextCustomAttributesBodyParam, null, (data, error) => {
1033
+ try {
1034
+ if (stub) {
1035
+ const displayE = 'Error 400 received on request';
1036
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1037
+ } else {
1038
+ runCommonAsserts(data, error);
1039
+ }
1040
+ saveMockData('ResourceManagement', 'postApiV2TenantsTenantIdCaContextCustomAttributes', 'default', data);
1041
+ done();
1042
+ } catch (err) {
1043
+ log.error(`Test Failure: ${err}`);
1044
+ done(err);
1045
+ }
1046
+ });
1047
+ } catch (error) {
1048
+ log.error(`Adapter Exception: ${error}`);
1049
+ done(error);
1050
+ }
1051
+ }).timeout(attemptTimeout);
1052
+ });
1053
+
1054
+ describe('#apiV2CfgSyntheticsCheckpointsGET - errors', () => {
1055
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1056
+ try {
1057
+ a.apiV2CfgSyntheticsCheckpointsGET(null, null, null, (data, error) => {
1058
+ try {
1059
+ if (stub) {
1060
+ const displayE = 'Error 400 received on request';
1061
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1062
+ } else {
1063
+ runCommonAsserts(data, error);
1064
+ }
1065
+ saveMockData('ResourceManagement', 'apiV2CfgSyntheticsCheckpointsGET', 'default', data);
1066
+ done();
1067
+ } catch (err) {
1068
+ log.error(`Test Failure: ${err}`);
1069
+ done(err);
1070
+ }
1071
+ });
1072
+ } catch (error) {
1073
+ log.error(`Adapter Exception: ${error}`);
1074
+ done(error);
1075
+ }
1076
+ }).timeout(attemptTimeout);
1077
+ });
1078
+
1079
+ describe('#apiV2TenantsDeviceGroupsMinimalGET - errors', () => {
1080
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1081
+ try {
1082
+ a.apiV2TenantsDeviceGroupsMinimalGET(resourceManagementClientId, null, (data, error) => {
1083
+ try {
1084
+ if (stub) {
1085
+ const displayE = 'Error 400 received on request';
1086
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1087
+ } else {
1088
+ runCommonAsserts(data, error);
1089
+ }
1090
+ saveMockData('ResourceManagement', 'apiV2TenantsDeviceGroupsMinimalGET', 'default', data);
1091
+ done();
1092
+ } catch (err) {
1093
+ log.error(`Test Failure: ${err}`);
1094
+ done(err);
1095
+ }
1096
+ });
1097
+ } catch (error) {
1098
+ log.error(`Adapter Exception: ${error}`);
1099
+ done(error);
1100
+ }
1101
+ }).timeout(attemptTimeout);
1102
+ });
1103
+
1104
+ const resourceManagementPageNo = 555;
1105
+ const resourceManagementPageSize = 555;
1106
+ describe('#apiV2TenantsDeviceGroupsSearchByClientIdGET - errors', () => {
1107
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1108
+ try {
1109
+ a.apiV2TenantsDeviceGroupsSearchByClientIdGET(resourceManagementClientId, resourceManagementPageNo, resourceManagementPageSize, null, null, null, null, (data, error) => {
1110
+ try {
1111
+ if (stub) {
1112
+ const displayE = 'Error 400 received on request';
1113
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1114
+ } else {
1115
+ runCommonAsserts(data, error);
1116
+ }
1117
+ saveMockData('ResourceManagement', 'apiV2TenantsDeviceGroupsSearchByClientIdGET', 'default', data);
1118
+ done();
1119
+ } catch (err) {
1120
+ log.error(`Test Failure: ${err}`);
1121
+ done(err);
1122
+ }
1123
+ });
1124
+ } catch (error) {
1125
+ log.error(`Adapter Exception: ${error}`);
1126
+ done(error);
1127
+ }
1128
+ }).timeout(attemptTimeout);
1129
+ });
1130
+
1131
+ describe('#apiV2TenantsDeviceGroupsByClientIdGET - errors', () => {
1132
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1133
+ try {
1134
+ a.apiV2TenantsDeviceGroupsByClientIdGET(resourceManagementClientId, resourceManagementResourceGroupId, null, (data, error) => {
1135
+ try {
1136
+ if (stub) {
1137
+ const displayE = 'Error 400 received on request';
1138
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1139
+ } else {
1140
+ runCommonAsserts(data, error);
1141
+ }
1142
+ saveMockData('ResourceManagement', 'apiV2TenantsDeviceGroupsByClientIdGET', 'default', data);
1143
+ done();
1144
+ } catch (err) {
1145
+ log.error(`Test Failure: ${err}`);
1146
+ done(err);
1147
+ }
1148
+ });
1149
+ } catch (error) {
1150
+ log.error(`Adapter Exception: ${error}`);
1151
+ done(error);
1152
+ }
1153
+ }).timeout(attemptTimeout);
1154
+ });
1155
+
1156
+ describe('#apiV2TenantsDeviceGroupsChildsSearchGET - errors', () => {
1157
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1158
+ try {
1159
+ a.apiV2TenantsDeviceGroupsChildsSearchGET(resourceManagementClientId, resourceManagementResourceGroupId, resourceManagementPageNo, resourceManagementPageSize, null, null, null, null, (data, error) => {
1160
+ try {
1161
+ if (stub) {
1162
+ const displayE = 'Error 400 received on request';
1163
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1164
+ } else {
1165
+ runCommonAsserts(data, error);
1166
+ }
1167
+ saveMockData('ResourceManagement', 'apiV2TenantsDeviceGroupsChildsSearchGET', 'default', data);
1168
+ done();
1169
+ } catch (err) {
1170
+ log.error(`Test Failure: ${err}`);
1171
+ done(err);
1172
+ }
1173
+ });
1174
+ } catch (error) {
1175
+ log.error(`Adapter Exception: ${error}`);
1176
+ done(error);
1177
+ }
1178
+ }).timeout(attemptTimeout);
1179
+ });
1180
+
1181
+ describe('#apiV2TenantsDeviceWarrantiesByClientIdGET - errors', () => {
1182
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1183
+ try {
1184
+ a.apiV2TenantsDeviceWarrantiesByClientIdGET(resourceManagementClientId, null, (data, error) => {
1185
+ try {
1186
+ if (stub) {
1187
+ const displayE = 'Error 400 received on request';
1188
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1189
+ } else {
1190
+ runCommonAsserts(data, error);
1191
+ }
1192
+ saveMockData('ResourceManagement', 'apiV2TenantsDeviceWarrantiesByClientIdGET', 'default', data);
1193
+ done();
1194
+ } catch (err) {
1195
+ log.error(`Test Failure: ${err}`);
1196
+ done(err);
1197
+ }
1198
+ });
1199
+ } catch (error) {
1200
+ log.error(`Adapter Exception: ${error}`);
1201
+ done(error);
1202
+ }
1203
+ }).timeout(attemptTimeout);
1204
+ });
1205
+
1206
+ describe('#apiV2TenantsDevicesDeviceWarrantyGET - errors', () => {
1207
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1208
+ try {
1209
+ a.apiV2TenantsDevicesDeviceWarrantyGET(resourceManagementResourceId, resourceManagementClientId, null, (data, error) => {
1210
+ try {
1211
+ if (stub) {
1212
+ const displayE = 'Error 400 received on request';
1213
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1214
+ } else {
1215
+ runCommonAsserts(data, error);
1216
+ }
1217
+ saveMockData('ResourceManagement', 'apiV2TenantsDevicesDeviceWarrantyGET', 'default', data);
1218
+ done();
1219
+ } catch (err) {
1220
+ log.error(`Test Failure: ${err}`);
1221
+ done(err);
1222
+ }
1223
+ });
1224
+ } catch (error) {
1225
+ log.error(`Adapter Exception: ${error}`);
1226
+ done(error);
1227
+ }
1228
+ }).timeout(attemptTimeout);
1229
+ });
1230
+
1231
+ describe('#apiV2TenantsHistoryResourcesByClientIdGET - errors', () => {
1232
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1233
+ try {
1234
+ a.apiV2TenantsHistoryResourcesByClientIdGET(resourceManagementClientId, resourceManagementPageNo, resourceManagementPageSize, null, null, (data, error) => {
1235
+ try {
1236
+ if (stub) {
1237
+ const displayE = 'Error 400 received on request';
1238
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1239
+ } else {
1240
+ runCommonAsserts(data, error);
1241
+ }
1242
+ saveMockData('ResourceManagement', 'apiV2TenantsHistoryResourcesByClientIdGET', 'default', data);
1243
+ done();
1244
+ } catch (err) {
1245
+ log.error(`Test Failure: ${err}`);
1246
+ done(err);
1247
+ }
1248
+ });
1249
+ } catch (error) {
1250
+ log.error(`Adapter Exception: ${error}`);
1251
+ done(error);
1252
+ }
1253
+ }).timeout(attemptTimeout);
1254
+ });
1255
+
1256
+ describe('#getApiV2TenantsHistoryResourcesByClientIdGET - errors', () => {
1257
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1258
+ try {
1259
+ a.getApiV2TenantsHistoryResourcesByClientIdGET(resourceManagementResourceId, resourceManagementClientId, null, null, (data, error) => {
1260
+ try {
1261
+ if (stub) {
1262
+ const displayE = 'Error 400 received on request';
1263
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1264
+ } else {
1265
+ runCommonAsserts(data, error);
1266
+ }
1267
+ saveMockData('ResourceManagement', 'getApiV2TenantsHistoryResourcesByClientIdGET', 'default', data);
1268
+ done();
1269
+ } catch (err) {
1270
+ log.error(`Test Failure: ${err}`);
1271
+ done(err);
1272
+ }
1273
+ });
1274
+ } catch (error) {
1275
+ log.error(`Adapter Exception: ${error}`);
1276
+ done(error);
1277
+ }
1278
+ }).timeout(attemptTimeout);
1279
+ });
1280
+
1281
+ const resourceManagementApiV2TenantsPoliciesManagementByClientIdPUTBodyParam = [
1282
+ {}
1283
+ ];
1284
+ describe('#apiV2TenantsPoliciesManagementByClientIdPUT - errors', () => {
1285
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1286
+ try {
1287
+ a.apiV2TenantsPoliciesManagementByClientIdPUT(resourceManagementClientId, resourceManagementApiV2TenantsPoliciesManagementByClientIdPUTBodyParam, null, (data, error) => {
1288
+ try {
1289
+ if (stub) {
1290
+ const displayE = 'Error 400 received on request';
1291
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1292
+ } else {
1293
+ runCommonAsserts(data, error);
1294
+ }
1295
+ saveMockData('ResourceManagement', 'apiV2TenantsPoliciesManagementByClientIdPUT', 'default', data);
1296
+ done();
1297
+ } catch (err) {
1298
+ log.error(`Test Failure: ${err}`);
1299
+ done(err);
1300
+ }
1301
+ });
1302
+ } catch (error) {
1303
+ log.error(`Adapter Exception: ${error}`);
1304
+ done(error);
1305
+ }
1306
+ }).timeout(attemptTimeout);
1307
+ });
1308
+
1309
+ describe('#apiV2TenantsPoliciesManagementByClientIdGET - errors', () => {
1310
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1311
+ try {
1312
+ a.apiV2TenantsPoliciesManagementByClientIdGET(resourceManagementClientId, null, (data, error) => {
1313
+ try {
1314
+ if (stub) {
1315
+ const displayE = 'Error 400 received on request';
1316
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1317
+ } else {
1318
+ runCommonAsserts(data, error);
1319
+ }
1320
+ saveMockData('ResourceManagement', 'apiV2TenantsPoliciesManagementByClientIdGET', 'default', data);
1321
+ done();
1322
+ } catch (err) {
1323
+ log.error(`Test Failure: ${err}`);
1324
+ done(err);
1325
+ }
1326
+ });
1327
+ } catch (error) {
1328
+ log.error(`Adapter Exception: ${error}`);
1329
+ done(error);
1330
+ }
1331
+ }).timeout(attemptTimeout);
1332
+ });
1333
+
1334
+ describe('#apiV2TenantsPoliciesManagementSearchGET - errors', () => {
1335
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1336
+ try {
1337
+ a.apiV2TenantsPoliciesManagementSearchGET(resourceManagementClientId, null, null, (data, error) => {
1338
+ try {
1339
+ if (stub) {
1340
+ const displayE = 'Error 400 received on request';
1341
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1342
+ } else {
1343
+ runCommonAsserts(data, error);
1344
+ }
1345
+ saveMockData('ResourceManagement', 'apiV2TenantsPoliciesManagementSearchGET', 'default', data);
1346
+ done();
1347
+ } catch (err) {
1348
+ log.error(`Test Failure: ${err}`);
1349
+ done(err);
1350
+ }
1351
+ });
1352
+ } catch (error) {
1353
+ log.error(`Adapter Exception: ${error}`);
1354
+ done(error);
1355
+ }
1356
+ }).timeout(attemptTimeout);
1357
+ });
1358
+
1359
+ const resourceManagementId = 'fakedata';
1360
+ describe('#getApiV2TenantsPoliciesManagementByClientIdGET - errors', () => {
1361
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1362
+ try {
1363
+ a.getApiV2TenantsPoliciesManagementByClientIdGET(resourceManagementId, resourceManagementClientId, null, (data, error) => {
1364
+ try {
1365
+ if (stub) {
1366
+ const displayE = 'Error 400 received on request';
1367
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1368
+ } else {
1369
+ runCommonAsserts(data, error);
1370
+ }
1371
+ saveMockData('ResourceManagement', 'getApiV2TenantsPoliciesManagementByClientIdGET', 'default', data);
1372
+ done();
1373
+ } catch (err) {
1374
+ log.error(`Test Failure: ${err}`);
1375
+ done(err);
1376
+ }
1377
+ });
1378
+ } catch (error) {
1379
+ log.error(`Adapter Exception: ${error}`);
1380
+ done(error);
1381
+ }
1382
+ }).timeout(attemptTimeout);
1383
+ });
1384
+
1385
+ describe('#apiV2TenantsPoliciesManagementActionRunGET - errors', () => {
1386
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1387
+ try {
1388
+ a.apiV2TenantsPoliciesManagementActionRunGET(resourceManagementId, resourceManagementClientId, null, (data, error) => {
1389
+ try {
1390
+ if (stub) {
1391
+ const displayE = 'Error 400 received on request';
1392
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1393
+ } else {
1394
+ runCommonAsserts(data, error);
1395
+ }
1396
+ saveMockData('ResourceManagement', 'apiV2TenantsPoliciesManagementActionRunGET', 'default', data);
1397
+ done();
1398
+ } catch (err) {
1399
+ log.error(`Test Failure: ${err}`);
1400
+ done(err);
1401
+ }
1402
+ });
1403
+ } catch (error) {
1404
+ log.error(`Adapter Exception: ${error}`);
1405
+ done(error);
1406
+ }
1407
+ }).timeout(attemptTimeout);
1408
+ });
1409
+
1410
+ describe('#apiV2TenantsResourceTypeMinimalGET - errors', () => {
1411
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1412
+ try {
1413
+ a.apiV2TenantsResourceTypeMinimalGET(resourceManagementClientId, null, (data, error) => {
1414
+ try {
1415
+ if (stub) {
1416
+ const displayE = 'Error 400 received on request';
1417
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1418
+ } else {
1419
+ runCommonAsserts(data, error);
1420
+ }
1421
+ saveMockData('ResourceManagement', 'apiV2TenantsResourceTypeMinimalGET', 'default', data);
1422
+ done();
1423
+ } catch (err) {
1424
+ log.error(`Test Failure: ${err}`);
1425
+ done(err);
1426
+ }
1427
+ });
1428
+ } catch (error) {
1429
+ log.error(`Adapter Exception: ${error}`);
1430
+ done(error);
1431
+ }
1432
+ }).timeout(attemptTimeout);
1433
+ });
1434
+
1435
+ describe('#apiV2TenantsResourcesAntivirusSearchGET - errors', () => {
1436
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1437
+ try {
1438
+ a.apiV2TenantsResourcesAntivirusSearchGET(resourceManagementClientId, resourceManagementPageNo, resourceManagementPageSize, null, null, null, null, null, (data, error) => {
1439
+ try {
1440
+ if (stub) {
1441
+ const displayE = 'Error 400 received on request';
1442
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1443
+ } else {
1444
+ runCommonAsserts(data, error);
1445
+ }
1446
+ saveMockData('ResourceManagement', 'apiV2TenantsResourcesAntivirusSearchGET', 'default', data);
1447
+ done();
1448
+ } catch (err) {
1449
+ log.error(`Test Failure: ${err}`);
1450
+ done(err);
1451
+ }
1452
+ });
1453
+ } catch (error) {
1454
+ log.error(`Adapter Exception: ${error}`);
1455
+ done(error);
1456
+ }
1457
+ }).timeout(attemptTimeout);
1458
+ });
1459
+
1460
+ const resourceManagementResourceType = 'fakedata';
1461
+ describe('#apiV2TenantsResourcesMinimalByClientIdGET - errors', () => {
1462
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1463
+ try {
1464
+ a.apiV2TenantsResourcesMinimalByClientIdGET(resourceManagementClientId, null, null, null, null, null, null, null, null, resourceManagementId, null, null, null, null, null, null, resourceManagementResourceType, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
1465
+ try {
1466
+ if (stub) {
1467
+ const displayE = 'Error 400 received on request';
1468
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1469
+ } else {
1470
+ runCommonAsserts(data, error);
1471
+ }
1472
+ saveMockData('ResourceManagement', 'apiV2TenantsResourcesMinimalByClientIdGET', 'default', data);
1473
+ done();
1474
+ } catch (err) {
1475
+ log.error(`Test Failure: ${err}`);
1476
+ done(err);
1477
+ }
1478
+ });
1479
+ } catch (error) {
1480
+ log.error(`Adapter Exception: ${error}`);
1481
+ done(error);
1482
+ }
1483
+ }).timeout(attemptTimeout);
1484
+ });
1485
+
1486
+ describe('#apiV2TenantsResourcesByClientIdGET - errors', () => {
1487
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1488
+ try {
1489
+ a.apiV2TenantsResourcesByClientIdGET(resourceManagementResourceId, resourceManagementClientId, null, (data, error) => {
1490
+ try {
1491
+ if (stub) {
1492
+ const displayE = 'Error 400 received on request';
1493
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1494
+ } else {
1495
+ runCommonAsserts(data, error);
1496
+ }
1497
+ saveMockData('ResourceManagement', 'apiV2TenantsResourcesByClientIdGET', 'default', data);
1498
+ done();
1499
+ } catch (err) {
1500
+ log.error(`Test Failure: ${err}`);
1501
+ done(err);
1502
+ }
1503
+ });
1504
+ } catch (error) {
1505
+ log.error(`Adapter Exception: ${error}`);
1506
+ done(error);
1507
+ }
1508
+ }).timeout(attemptTimeout);
1509
+ });
1510
+
1511
+ describe('#apiV2TenantsResourcesApplicationsGET - errors', () => {
1512
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1513
+ try {
1514
+ a.apiV2TenantsResourcesApplicationsGET(resourceManagementResourceId, resourceManagementClientId, null, (data, error) => {
1515
+ try {
1516
+ if (stub) {
1517
+ const displayE = 'Error 400 received on request';
1518
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1519
+ } else {
1520
+ runCommonAsserts(data, error);
1521
+ }
1522
+ saveMockData('ResourceManagement', 'apiV2TenantsResourcesApplicationsGET', 'default', data);
1523
+ done();
1524
+ } catch (err) {
1525
+ log.error(`Test Failure: ${err}`);
1526
+ done(err);
1527
+ }
1528
+ });
1529
+ } catch (error) {
1530
+ log.error(`Adapter Exception: ${error}`);
1531
+ done(error);
1532
+ }
1533
+ }).timeout(attemptTimeout);
1534
+ });
1535
+
1536
+ describe('#apiV2TenantsResourcesAvailabilityGET - errors', () => {
1537
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1538
+ try {
1539
+ a.apiV2TenantsResourcesAvailabilityGET(resourceManagementResourceId, resourceManagementClientId, null, null, null, (data, error) => {
1540
+ try {
1541
+ if (stub) {
1542
+ const displayE = 'Error 400 received on request';
1543
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1544
+ } else {
1545
+ runCommonAsserts(data, error);
1546
+ }
1547
+ saveMockData('ResourceManagement', 'apiV2TenantsResourcesAvailabilityGET', 'default', data);
1548
+ done();
1549
+ } catch (err) {
1550
+ log.error(`Test Failure: ${err}`);
1551
+ done(err);
1552
+ }
1553
+ });
1554
+ } catch (error) {
1555
+ log.error(`Adapter Exception: ${error}`);
1556
+ done(error);
1557
+ }
1558
+ }).timeout(attemptTimeout);
1559
+ });
1560
+
1561
+ describe('#apiV2TenantsResourcesAvailabilityRuleGET - errors', () => {
1562
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1563
+ try {
1564
+ a.apiV2TenantsResourcesAvailabilityRuleGET(resourceManagementResourceId, resourceManagementClientId, null, (data, error) => {
1565
+ try {
1566
+ if (stub) {
1567
+ const displayE = 'Error 400 received on request';
1568
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1569
+ } else {
1570
+ runCommonAsserts(data, error);
1571
+ }
1572
+ saveMockData('ResourceManagement', 'apiV2TenantsResourcesAvailabilityRuleGET', 'default', data);
1573
+ done();
1574
+ } catch (err) {
1575
+ log.error(`Test Failure: ${err}`);
1576
+ done(err);
1577
+ }
1578
+ });
1579
+ } catch (error) {
1580
+ log.error(`Adapter Exception: ${error}`);
1581
+ done(error);
1582
+ }
1583
+ }).timeout(attemptTimeout);
1584
+ });
1585
+
1586
+ describe('#getApiV2TenantsTenantIdResourcesInstalledServicesSearch - errors', () => {
1587
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1588
+ try {
1589
+ a.getApiV2TenantsTenantIdResourcesInstalledServicesSearch(resourceManagementResourceId, resourceManagementClientId, resourceManagementPageNo, resourceManagementPageSize, null, null, (data, error) => {
1590
+ try {
1591
+ if (stub) {
1592
+ const displayE = 'Error 400 received on request';
1593
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1594
+ } else {
1595
+ runCommonAsserts(data, error);
1596
+ }
1597
+ saveMockData('ResourceManagement', 'getApiV2TenantsTenantIdResourcesInstalledServicesSearch', 'default', data);
1598
+ done();
1599
+ } catch (err) {
1600
+ log.error(`Test Failure: ${err}`);
1601
+ done(err);
1602
+ }
1603
+ });
1604
+ } catch (error) {
1605
+ log.error(`Adapter Exception: ${error}`);
1606
+ done(error);
1607
+ }
1608
+ }).timeout(attemptTimeout);
1609
+ });
1610
+
1611
+ describe('#apiV2TenantsResourcesNotesSearchGET - errors', () => {
1612
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1613
+ try {
1614
+ a.apiV2TenantsResourcesNotesSearchGET(resourceManagementResourceId, resourceManagementClientId, resourceManagementPageNo, resourceManagementPageSize, null, null, null, null, (data, error) => {
1615
+ try {
1616
+ if (stub) {
1617
+ const displayE = 'Error 400 received on request';
1618
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1619
+ } else {
1620
+ runCommonAsserts(data, error);
1621
+ }
1622
+ saveMockData('ResourceManagement', 'apiV2TenantsResourcesNotesSearchGET', 'default', data);
1623
+ done();
1624
+ } catch (err) {
1625
+ log.error(`Test Failure: ${err}`);
1626
+ done(err);
1627
+ }
1628
+ });
1629
+ } catch (error) {
1630
+ log.error(`Adapter Exception: ${error}`);
1631
+ done(error);
1632
+ }
1633
+ }).timeout(attemptTimeout);
1634
+ });
1635
+
1636
+ describe('#getRemoteConsoleDetails - errors', () => {
1637
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1638
+ try {
1639
+ a.getRemoteConsoleDetails(resourceManagementResourceId, resourceManagementClientId, null, (data, error) => {
1640
+ try {
1641
+ if (stub) {
1642
+ const displayE = 'Error 400 received on request';
1643
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1644
+ } else {
1645
+ runCommonAsserts(data, error);
1646
+ }
1647
+ saveMockData('ResourceManagement', 'getRemoteConsoleDetails', 'default', data);
1648
+ done();
1649
+ } catch (err) {
1650
+ log.error(`Test Failure: ${err}`);
1651
+ done(err);
1652
+ }
1653
+ });
1654
+ } catch (error) {
1655
+ log.error(`Adapter Exception: ${error}`);
1656
+ done(error);
1657
+ }
1658
+ }).timeout(attemptTimeout);
1659
+ });
1660
+
1661
+ describe('#apiV2TenantsServiceGroupsMinimalGET - errors', () => {
1662
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1663
+ try {
1664
+ a.apiV2TenantsServiceGroupsMinimalGET(resourceManagementClientId, null, (data, error) => {
1665
+ try {
1666
+ if (stub) {
1667
+ const displayE = 'Error 400 received on request';
1668
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1669
+ } else {
1670
+ runCommonAsserts(data, error);
1671
+ }
1672
+ saveMockData('ResourceManagement', 'apiV2TenantsServiceGroupsMinimalGET', 'default', data);
1673
+ done();
1674
+ } catch (err) {
1675
+ log.error(`Test Failure: ${err}`);
1676
+ done(err);
1677
+ }
1678
+ });
1679
+ } catch (error) {
1680
+ log.error(`Adapter Exception: ${error}`);
1681
+ done(error);
1682
+ }
1683
+ }).timeout(attemptTimeout);
1684
+ });
1685
+
1686
+ describe('#apiV2TenantsServiceGroupsSearchGET - errors', () => {
1687
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1688
+ try {
1689
+ a.apiV2TenantsServiceGroupsSearchGET(resourceManagementClientId, resourceManagementPageNo, resourceManagementPageSize, null, null, null, null, (data, error) => {
1690
+ try {
1691
+ if (stub) {
1692
+ const displayE = 'Error 400 received on request';
1693
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1694
+ } else {
1695
+ runCommonAsserts(data, error);
1696
+ }
1697
+ saveMockData('ResourceManagement', 'apiV2TenantsServiceGroupsSearchGET', 'default', data);
1698
+ done();
1699
+ } catch (err) {
1700
+ log.error(`Test Failure: ${err}`);
1701
+ done(err);
1702
+ }
1703
+ });
1704
+ } catch (error) {
1705
+ log.error(`Adapter Exception: ${error}`);
1706
+ done(error);
1707
+ }
1708
+ }).timeout(attemptTimeout);
1709
+ });
1710
+
1711
+ describe('#apiV2TenantsServiceGroupsByClientIdGET - errors', () => {
1712
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1713
+ try {
1714
+ a.apiV2TenantsServiceGroupsByClientIdGET(resourceManagementSgId, resourceManagementClientId, null, (data, error) => {
1715
+ try {
1716
+ if (stub) {
1717
+ const displayE = 'Error 400 received on request';
1718
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1719
+ } else {
1720
+ runCommonAsserts(data, error);
1721
+ }
1722
+ saveMockData('ResourceManagement', 'apiV2TenantsServiceGroupsByClientIdGET', 'default', data);
1723
+ done();
1724
+ } catch (err) {
1725
+ log.error(`Test Failure: ${err}`);
1726
+ done(err);
1727
+ }
1728
+ });
1729
+ } catch (error) {
1730
+ log.error(`Adapter Exception: ${error}`);
1731
+ done(error);
1732
+ }
1733
+ }).timeout(attemptTimeout);
1734
+ });
1735
+
1736
+ describe('#apiV2TenantsServiceGroupsChildsSearchGET - errors', () => {
1737
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1738
+ try {
1739
+ a.apiV2TenantsServiceGroupsChildsSearchGET(resourceManagementSgId, resourceManagementClientId, resourceManagementPageNo, resourceManagementPageSize, null, null, null, null, (data, error) => {
1740
+ try {
1741
+ if (stub) {
1742
+ const displayE = 'Error 400 received on request';
1743
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1744
+ } else {
1745
+ runCommonAsserts(data, error);
1746
+ }
1747
+ saveMockData('ResourceManagement', 'apiV2TenantsServiceGroupsChildsSearchGET', 'default', data);
1748
+ done();
1749
+ } catch (err) {
1750
+ log.error(`Test Failure: ${err}`);
1751
+ done(err);
1752
+ }
1753
+ });
1754
+ } catch (error) {
1755
+ log.error(`Adapter Exception: ${error}`);
1756
+ done(error);
1757
+ }
1758
+ }).timeout(attemptTimeout);
1759
+ });
1760
+
1761
+ const resourceManagementServiceId = 'fakedata';
1762
+ describe('#apiV2TenantsServicesAvailabilityGET - errors', () => {
1763
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1764
+ try {
1765
+ a.apiV2TenantsServicesAvailabilityGET(resourceManagementServiceId, resourceManagementClientId, null, null, null, (data, error) => {
1766
+ try {
1767
+ if (stub) {
1768
+ const displayE = 'Error 400 received on request';
1769
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1770
+ } else {
1771
+ runCommonAsserts(data, error);
1772
+ }
1773
+ saveMockData('ResourceManagement', 'apiV2TenantsServicesAvailabilityGET', 'default', data);
1774
+ done();
1775
+ } catch (err) {
1776
+ log.error(`Test Failure: ${err}`);
1777
+ done(err);
1778
+ }
1779
+ });
1780
+ } catch (error) {
1781
+ log.error(`Adapter Exception: ${error}`);
1782
+ done(error);
1783
+ }
1784
+ }).timeout(attemptTimeout);
1785
+ });
1786
+
1787
+ describe('#apiV2TenantsSitesMinimalByClientIdGET - errors', () => {
1788
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1789
+ try {
1790
+ a.apiV2TenantsSitesMinimalByClientIdGET(resourceManagementClientId, null, (data, error) => {
1791
+ try {
1792
+ if (stub) {
1793
+ const displayE = 'Error 400 received on request';
1794
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1795
+ } else {
1796
+ runCommonAsserts(data, error);
1797
+ }
1798
+ saveMockData('ResourceManagement', 'apiV2TenantsSitesMinimalByClientIdGET', 'default', data);
1799
+ done();
1800
+ } catch (err) {
1801
+ log.error(`Test Failure: ${err}`);
1802
+ done(err);
1803
+ }
1804
+ });
1805
+ } catch (error) {
1806
+ log.error(`Adapter Exception: ${error}`);
1807
+ done(error);
1808
+ }
1809
+ }).timeout(attemptTimeout);
1810
+ });
1811
+
1812
+ describe('#apiV2TenantsSitesByClientIdAndSiteIdGET - errors', () => {
1813
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1814
+ try {
1815
+ a.apiV2TenantsSitesByClientIdAndSiteIdGET(resourceManagementSiteId, resourceManagementClientId, null, (data, error) => {
1816
+ try {
1817
+ if (stub) {
1818
+ const displayE = 'Error 400 received on request';
1819
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1820
+ } else {
1821
+ runCommonAsserts(data, error);
1822
+ }
1823
+ saveMockData('ResourceManagement', 'apiV2TenantsSitesByClientIdAndSiteIdGET', 'default', data);
1824
+ done();
1825
+ } catch (err) {
1826
+ log.error(`Test Failure: ${err}`);
1827
+ done(err);
1828
+ }
1829
+ });
1830
+ } catch (error) {
1831
+ log.error(`Adapter Exception: ${error}`);
1832
+ done(error);
1833
+ }
1834
+ }).timeout(attemptTimeout);
1835
+ });
1836
+
1837
+ describe('#apiV2TenantsSyntheticsCheckpointsGET - errors', () => {
1838
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1839
+ try {
1840
+ a.apiV2TenantsSyntheticsCheckpointsGET(resourceManagementClientId, null, null, null, (data, error) => {
1841
+ try {
1842
+ if (stub) {
1843
+ const displayE = 'Error 400 received on request';
1844
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1845
+ } else {
1846
+ runCommonAsserts(data, error);
1847
+ }
1848
+ saveMockData('ResourceManagement', 'apiV2TenantsSyntheticsCheckpointsGET', 'default', data);
1849
+ done();
1850
+ } catch (err) {
1851
+ log.error(`Test Failure: ${err}`);
1852
+ done(err);
1853
+ }
1854
+ });
1855
+ } catch (error) {
1856
+ log.error(`Adapter Exception: ${error}`);
1857
+ done(error);
1858
+ }
1859
+ }).timeout(attemptTimeout);
1860
+ });
1861
+
1862
+ describe('#getConsoles - errors', () => {
1863
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1864
+ try {
1865
+ a.getConsoles(resourceManagementTenantId, resourceManagementPageNo, resourceManagementPageSize, null, null, null, null, resourceManagementResourceId, null, null, null, null, resourceManagementClientId, null, (data, error) => {
1866
+ try {
1867
+ if (stub) {
1868
+ const displayE = 'Error 400 received on request';
1869
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1870
+ } else {
1871
+ runCommonAsserts(data, error);
1872
+ }
1873
+ saveMockData('ResourceManagement', 'getConsoles', 'default', data);
1874
+ done();
1875
+ } catch (err) {
1876
+ log.error(`Test Failure: ${err}`);
1877
+ done(err);
1878
+ }
1879
+ });
1880
+ } catch (error) {
1881
+ log.error(`Adapter Exception: ${error}`);
1882
+ done(error);
1883
+ }
1884
+ }).timeout(attemptTimeout);
1885
+ });
1886
+
1887
+ describe('#apiV2TenantsResourcesSearchByTenantIdGET - errors', () => {
1888
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1889
+ try {
1890
+ a.apiV2TenantsResourcesSearchByTenantIdGET(resourceManagementTenantId, resourceManagementPageNo, resourceManagementPageSize, null, null, null, null, null, null, null, null, resourceManagementId, null, null, null, null, null, null, resourceManagementResourceType, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
1891
+ try {
1892
+ if (stub) {
1893
+ const displayE = 'Error 400 received on request';
1894
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1895
+ } else {
1896
+ runCommonAsserts(data, error);
1897
+ }
1898
+ saveMockData('ResourceManagement', 'apiV2TenantsResourcesSearchByTenantIdGET', 'default', data);
1899
+ done();
1900
+ } catch (err) {
1901
+ log.error(`Test Failure: ${err}`);
1902
+ done(err);
1903
+ }
1904
+ });
1905
+ } catch (error) {
1906
+ log.error(`Adapter Exception: ${error}`);
1907
+ done(error);
1908
+ }
1909
+ }).timeout(attemptTimeout);
1910
+ });
1911
+
1912
+ describe('#apiV2TenantsSitesSearchByTenantIdGET - errors', () => {
1913
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1914
+ try {
1915
+ a.apiV2TenantsSitesSearchByTenantIdGET(resourceManagementTenantId, resourceManagementPageNo, resourceManagementPageSize, null, null, null, null, (data, error) => {
1916
+ try {
1917
+ if (stub) {
1918
+ const displayE = 'Error 400 received on request';
1919
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1920
+ } else {
1921
+ runCommonAsserts(data, error);
1922
+ }
1923
+ saveMockData('ResourceManagement', 'apiV2TenantsSitesSearchByTenantIdGET', 'default', data);
1924
+ done();
1925
+ } catch (err) {
1926
+ log.error(`Test Failure: ${err}`);
1927
+ done(err);
1928
+ }
1929
+ });
1930
+ } catch (error) {
1931
+ log.error(`Adapter Exception: ${error}`);
1932
+ done(error);
1933
+ }
1934
+ }).timeout(attemptTimeout);
1935
+ });
1936
+
1937
+ const tenantsClientId = 'fakedata';
1938
+ const tenantsId = 'fakedata';
1939
+ describe('#getApiV2TenantsClientIdResourcesIdInventorycomponents - errors', () => {
1940
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1941
+ try {
1942
+ a.getApiV2TenantsClientIdResourcesIdInventorycomponents(tenantsClientId, tenantsId, null, (data, error) => {
1943
+ try {
1944
+ if (stub) {
1945
+ const displayE = 'Error 400 received on request';
1946
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1947
+ } else {
1948
+ runCommonAsserts(data, error);
1949
+ }
1950
+ saveMockData('Tenants', 'getApiV2TenantsClientIdResourcesIdInventorycomponents', 'default', data);
1951
+ done();
1952
+ } catch (err) {
1953
+ log.error(`Test Failure: ${err}`);
1954
+ done(err);
1955
+ }
1956
+ });
1957
+ } catch (error) {
1958
+ log.error(`Adapter Exception: ${error}`);
1959
+ done(error);
1960
+ }
1961
+ }).timeout(attemptTimeout);
1962
+ });
1963
+
1964
+ describe('#apiV2TenantsDeviceGroupsByClientIdDELETE - errors', () => {
1965
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1966
+ try {
1967
+ a.apiV2TenantsDeviceGroupsByClientIdDELETE(resourceManagementClientId, resourceManagementResourceGroupId, null, (data, error) => {
1968
+ try {
1969
+ if (stub) {
1970
+ const displayE = 'Error 400 received on request';
1971
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1972
+ } else {
1973
+ runCommonAsserts(data, error);
1974
+ }
1975
+ saveMockData('ResourceManagement', 'apiV2TenantsDeviceGroupsByClientIdDELETE', 'default', data);
1976
+ done();
1977
+ } catch (err) {
1978
+ log.error(`Test Failure: ${err}`);
1979
+ done(err);
1980
+ }
1981
+ });
1982
+ } catch (error) {
1983
+ log.error(`Adapter Exception: ${error}`);
1984
+ done(error);
1985
+ }
1986
+ }).timeout(attemptTimeout);
1987
+ });
1988
+
1989
+ describe('#apiV2TenantsDeviceGroupsChildsByClientIdDELETE - errors', () => {
1990
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1991
+ try {
1992
+ a.apiV2TenantsDeviceGroupsChildsByClientIdDELETE(resourceManagementClientId, resourceManagementResourceGroupId, null, (data, error) => {
1993
+ try {
1994
+ if (stub) {
1995
+ const displayE = 'Error 400 received on request';
1996
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
1997
+ } else {
1998
+ runCommonAsserts(data, error);
1999
+ }
2000
+ saveMockData('ResourceManagement', 'apiV2TenantsDeviceGroupsChildsByClientIdDELETE', 'default', data);
2001
+ done();
2002
+ } catch (err) {
2003
+ log.error(`Test Failure: ${err}`);
2004
+ done(err);
2005
+ }
2006
+ });
2007
+ } catch (error) {
2008
+ log.error(`Adapter Exception: ${error}`);
2009
+ done(error);
2010
+ }
2011
+ }).timeout(attemptTimeout);
2012
+ });
2013
+
2014
+ describe('#apiV2TenantsPoliciesManagementByClientIdDELETE - errors', () => {
2015
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2016
+ try {
2017
+ a.apiV2TenantsPoliciesManagementByClientIdDELETE(resourceManagementId, resourceManagementClientId, null, (data, error) => {
2018
+ try {
2019
+ if (stub) {
2020
+ const displayE = 'Error 400 received on request';
2021
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
2022
+ } else {
2023
+ runCommonAsserts(data, error);
2024
+ }
2025
+ saveMockData('ResourceManagement', 'apiV2TenantsPoliciesManagementByClientIdDELETE', 'default', data);
2026
+ done();
2027
+ } catch (err) {
2028
+ log.error(`Test Failure: ${err}`);
2029
+ done(err);
2030
+ }
2031
+ });
2032
+ } catch (error) {
2033
+ log.error(`Adapter Exception: ${error}`);
2034
+ done(error);
2035
+ }
2036
+ }).timeout(attemptTimeout);
2037
+ });
2038
+
2039
+ const resourceManagementIdentity = 'fakedata';
2040
+ describe('#apiV2TenantsResourcesResourcetypeIdentityDELETE - errors', () => {
2041
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2042
+ try {
2043
+ a.apiV2TenantsResourcesResourcetypeIdentityDELETE(resourceManagementResourceType, resourceManagementIdentity, resourceManagementClientId, null, (data, error) => {
2044
+ try {
2045
+ if (stub) {
2046
+ const displayE = 'Error 400 received on request';
2047
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
2048
+ } else {
2049
+ runCommonAsserts(data, error);
2050
+ }
2051
+ saveMockData('ResourceManagement', 'apiV2TenantsResourcesResourcetypeIdentityDELETE', 'default', data);
2052
+ done();
2053
+ } catch (err) {
2054
+ log.error(`Test Failure: ${err}`);
2055
+ done(err);
2056
+ }
2057
+ });
2058
+ } catch (error) {
2059
+ log.error(`Adapter Exception: ${error}`);
2060
+ done(error);
2061
+ }
2062
+ }).timeout(attemptTimeout);
2063
+ });
2064
+
2065
+ describe('#apiV2TenantsResourcesByClientIdDELETE - errors', () => {
2066
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2067
+ try {
2068
+ a.apiV2TenantsResourcesByClientIdDELETE(resourceManagementResourceId, resourceManagementClientId, null, (data, error) => {
2069
+ try {
2070
+ if (stub) {
2071
+ const displayE = 'Error 400 received on request';
2072
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
2073
+ } else {
2074
+ runCommonAsserts(data, error);
2075
+ }
2076
+ saveMockData('ResourceManagement', 'apiV2TenantsResourcesByClientIdDELETE', 'default', data);
2077
+ done();
2078
+ } catch (err) {
2079
+ log.error(`Test Failure: ${err}`);
2080
+ done(err);
2081
+ }
2082
+ });
2083
+ } catch (error) {
2084
+ log.error(`Adapter Exception: ${error}`);
2085
+ done(error);
2086
+ }
2087
+ }).timeout(attemptTimeout);
2088
+ });
2089
+
2090
+ const resourceManagementParentSgId = 'fakedata';
2091
+ const resourceManagementChildSgId = 'fakedata';
2092
+ describe('#apiV2TenantsServiceGroupsUnLinkChildSgIdDELETE - errors', () => {
2093
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2094
+ try {
2095
+ a.apiV2TenantsServiceGroupsUnLinkChildSgIdDELETE(resourceManagementParentSgId, resourceManagementChildSgId, resourceManagementClientId, null, (data, error) => {
2096
+ try {
2097
+ if (stub) {
2098
+ const displayE = 'Error 400 received on request';
2099
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
2100
+ } else {
2101
+ runCommonAsserts(data, error);
2102
+ }
2103
+ saveMockData('ResourceManagement', 'apiV2TenantsServiceGroupsUnLinkChildSgIdDELETE', 'default', data);
2104
+ done();
2105
+ } catch (err) {
2106
+ log.error(`Test Failure: ${err}`);
2107
+ done(err);
2108
+ }
2109
+ });
2110
+ } catch (error) {
2111
+ log.error(`Adapter Exception: ${error}`);
2112
+ done(error);
2113
+ }
2114
+ }).timeout(attemptTimeout);
2115
+ });
2116
+
2117
+ describe('#apiV2TenantsServiceGroupsByClientIdDELETE - errors', () => {
2118
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2119
+ try {
2120
+ a.apiV2TenantsServiceGroupsByClientIdDELETE(resourceManagementSgId, resourceManagementClientId, null, (data, error) => {
2121
+ try {
2122
+ if (stub) {
2123
+ const displayE = 'Error 400 received on request';
2124
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
2125
+ } else {
2126
+ runCommonAsserts(data, error);
2127
+ }
2128
+ saveMockData('ResourceManagement', 'apiV2TenantsServiceGroupsByClientIdDELETE', 'default', data);
2129
+ done();
2130
+ } catch (err) {
2131
+ log.error(`Test Failure: ${err}`);
2132
+ done(err);
2133
+ }
2134
+ });
2135
+ } catch (error) {
2136
+ log.error(`Adapter Exception: ${error}`);
2137
+ done(error);
2138
+ }
2139
+ }).timeout(attemptTimeout);
2140
+ });
2141
+
2142
+ describe('#apiV2TenantsServiceGroupsChildsDELETE - errors', () => {
2143
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2144
+ try {
2145
+ a.apiV2TenantsServiceGroupsChildsDELETE(resourceManagementSgId, resourceManagementClientId, null, (data, error) => {
2146
+ try {
2147
+ if (stub) {
2148
+ const displayE = 'Error 400 received on request';
2149
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
2150
+ } else {
2151
+ runCommonAsserts(data, error);
2152
+ }
2153
+ saveMockData('ResourceManagement', 'apiV2TenantsServiceGroupsChildsDELETE', 'default', data);
2154
+ done();
2155
+ } catch (err) {
2156
+ log.error(`Test Failure: ${err}`);
2157
+ done(err);
2158
+ }
2159
+ });
2160
+ } catch (error) {
2161
+ log.error(`Adapter Exception: ${error}`);
2162
+ done(error);
2163
+ }
2164
+ }).timeout(attemptTimeout);
2165
+ });
2166
+
2167
+ describe('#apiV2TenantsSitesByClientIdAndSiteIdDELETE - errors', () => {
2168
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2169
+ try {
2170
+ a.apiV2TenantsSitesByClientIdAndSiteIdDELETE(resourceManagementSiteId, resourceManagementClientId, null, (data, error) => {
2171
+ try {
2172
+ if (stub) {
2173
+ const displayE = 'Error 400 received on request';
2174
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
2175
+ } else {
2176
+ runCommonAsserts(data, error);
2177
+ }
2178
+ saveMockData('ResourceManagement', 'apiV2TenantsSitesByClientIdAndSiteIdDELETE', 'default', data);
2179
+ done();
2180
+ } catch (err) {
2181
+ log.error(`Test Failure: ${err}`);
2182
+ done(err);
2183
+ }
2184
+ });
2185
+ } catch (error) {
2186
+ log.error(`Adapter Exception: ${error}`);
2187
+ done(error);
2188
+ }
2189
+ }).timeout(attemptTimeout);
2190
+ });
2191
+
2192
+ describe('#apiV2TenantsSitesChildsByClientIdDELETE - errors', () => {
2193
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2194
+ try {
2195
+ a.apiV2TenantsSitesChildsByClientIdDELETE(resourceManagementSiteId, resourceManagementClientId, null, (data, error) => {
2196
+ try {
2197
+ if (stub) {
2198
+ const displayE = 'Error 400 received on request';
2199
+ runErrorAsserts(data, error, 'AD.500', 'Test-opsramp-connectorRest-handleEndResponse', displayE);
2200
+ } else {
2201
+ runCommonAsserts(data, error);
2202
+ }
2203
+ saveMockData('ResourceManagement', 'apiV2TenantsSitesChildsByClientIdDELETE', 'default', data);
2204
+ done();
2205
+ } catch (err) {
2206
+ log.error(`Test Failure: ${err}`);
2207
+ done(err);
2208
+ }
2209
+ });
2210
+ } catch (error) {
2211
+ log.error(`Adapter Exception: ${error}`);
2212
+ done(error);
2213
+ }
2214
+ }).timeout(attemptTimeout);
2215
+ });
2216
+ });
2217
+ });