@itentialopensource/adapter-paragon_dpm 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 (68) hide show
  1. package/.eslintignore +6 -0
  2. package/.eslintrc.js +18 -0
  3. package/.gitlab/.gitkeep +0 -0
  4. package/.gitlab/issue_templates/.gitkeep +0 -0
  5. package/.gitlab/issue_templates/Default.md +17 -0
  6. package/.gitlab/issue_templates/bugReportTemplate.md +76 -0
  7. package/.gitlab/issue_templates/featureRequestTemplate.md +14 -0
  8. package/.jshintrc +0 -0
  9. package/AUTH.md +39 -0
  10. package/BROKER.md +199 -0
  11. package/CALLS.md +170 -0
  12. package/CHANGELOG.md +9 -0
  13. package/CODE_OF_CONDUCT.md +43 -0
  14. package/CONTRIBUTING.md +172 -0
  15. package/ENHANCE.md +69 -0
  16. package/LICENSE +201 -0
  17. package/PROPERTIES.md +641 -0
  18. package/README.md +337 -0
  19. package/SUMMARY.md +9 -0
  20. package/SYSTEMINFO.md +11 -0
  21. package/TROUBLESHOOT.md +47 -0
  22. package/adapter.js +4665 -0
  23. package/adapterBase.js +1787 -0
  24. package/entities/.generic/action.json +214 -0
  25. package/entities/.generic/schema.json +28 -0
  26. package/entities/.system/action.json +50 -0
  27. package/entities/.system/mockdatafiles/getToken-default.json +3 -0
  28. package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
  29. package/entities/.system/schema.json +19 -0
  30. package/entities/.system/schemaTokenReq.json +53 -0
  31. package/entities/.system/schemaTokenResp.json +53 -0
  32. package/entities/DpmService/action.json +714 -0
  33. package/entities/DpmService/schema.json +306 -0
  34. package/entities/ImageManager/action.json +204 -0
  35. package/entities/ImageManager/schema.json +28 -0
  36. package/error.json +190 -0
  37. package/package.json +88 -0
  38. package/pronghorn.json +6810 -0
  39. package/propertiesDecorators.json +14 -0
  40. package/propertiesSchema.json +1248 -0
  41. package/refs?service=git-upload-pack +0 -0
  42. package/report/creationReport.json +450 -0
  43. package/report/paragon-dpm.json +5089 -0
  44. package/sampleProperties.json +195 -0
  45. package/test/integration/adapterTestBasicGet.js +83 -0
  46. package/test/integration/adapterTestConnectivity.js +93 -0
  47. package/test/integration/adapterTestIntegration.js +2615 -0
  48. package/test/unit/adapterBaseTestUnit.js +949 -0
  49. package/test/unit/adapterTestUnit.js +2616 -0
  50. package/utils/adapterInfo.js +206 -0
  51. package/utils/addAuth.js +94 -0
  52. package/utils/artifactize.js +146 -0
  53. package/utils/basicGet.js +50 -0
  54. package/utils/checkMigrate.js +63 -0
  55. package/utils/entitiesToDB.js +178 -0
  56. package/utils/findPath.js +74 -0
  57. package/utils/methodDocumentor.js +225 -0
  58. package/utils/modify.js +154 -0
  59. package/utils/packModificationScript.js +35 -0
  60. package/utils/patches2bundledDeps.js +90 -0
  61. package/utils/pre-commit.sh +32 -0
  62. package/utils/removeHooks.js +20 -0
  63. package/utils/setup.js +33 -0
  64. package/utils/tbScript.js +246 -0
  65. package/utils/tbUtils.js +490 -0
  66. package/utils/testRunner.js +298 -0
  67. package/utils/troubleshootingAdapter.js +195 -0
  68. package/workflows/README.md +3 -0
@@ -0,0 +1,2615 @@
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 mocha = require('mocha');
13
+ const path = require('path');
14
+ const winston = require('winston');
15
+ const { expect } = require('chai');
16
+ const { use } = require('chai');
17
+ const td = require('testdouble');
18
+ const util = require('util');
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
+ samProps.host = 'replace.hostorip.here';
40
+ samProps.authentication.username = 'username';
41
+ samProps.authentication.password = 'password';
42
+ samProps.protocol = 'http';
43
+ samProps.port = 80;
44
+ samProps.ssl.enabled = false;
45
+ samProps.ssl.accept_invalid_cert = false;
46
+ if (samProps.request.attempt_timeout < 30000) {
47
+ samProps.request.attempt_timeout = 30000;
48
+ }
49
+ const attemptTimeout = samProps.request.attempt_timeout;
50
+ const { stub } = samProps;
51
+
52
+ // these are the adapter properties. You generally should not need to alter
53
+ // any of these after they are initially set up
54
+ global.pronghornProps = {
55
+ pathProps: {
56
+ encrypted: false
57
+ },
58
+ adapterProps: {
59
+ adapters: [{
60
+ id: 'Test-paragon_dpm',
61
+ type: 'ParagonDpm',
62
+ properties: samProps
63
+ }]
64
+ }
65
+ };
66
+
67
+ global.$HOME = `${__dirname}/../..`;
68
+
69
+ // set the log levels that Pronghorn uses, spam and trace are not defaulted in so without
70
+ // this you may error on log.trace calls.
71
+ const myCustomLevels = {
72
+ levels: {
73
+ spam: 6,
74
+ trace: 5,
75
+ debug: 4,
76
+ info: 3,
77
+ warn: 2,
78
+ error: 1,
79
+ none: 0
80
+ }
81
+ };
82
+
83
+ // need to see if there is a log level passed in
84
+ process.argv.forEach((val) => {
85
+ // is there a log level defined to be passed in?
86
+ if (val.indexOf('--LOG') === 0) {
87
+ // get the desired log level
88
+ const inputVal = val.split('=')[1];
89
+
90
+ // validate the log level is supported, if so set it
91
+ if (Object.hasOwnProperty.call(myCustomLevels.levels, inputVal)) {
92
+ logLevel = inputVal;
93
+ }
94
+ }
95
+ });
96
+
97
+ // need to set global logging
98
+ global.log = winston.createLogger({
99
+ level: logLevel,
100
+ levels: myCustomLevels.levels,
101
+ transports: [
102
+ new winston.transports.Console()
103
+ ]
104
+ });
105
+
106
+ /**
107
+ * Runs the common asserts for test
108
+ */
109
+ function runCommonAsserts(data, error) {
110
+ assert.equal(undefined, error);
111
+ assert.notEqual(undefined, data);
112
+ assert.notEqual(null, data);
113
+ assert.notEqual(undefined, data.response);
114
+ assert.notEqual(null, data.response);
115
+ }
116
+
117
+ /**
118
+ * Runs the error asserts for the test
119
+ */
120
+ function runErrorAsserts(data, error, code, origin, displayStr) {
121
+ assert.equal(null, data);
122
+ assert.notEqual(undefined, error);
123
+ assert.notEqual(null, error);
124
+ assert.notEqual(undefined, error.IAPerror);
125
+ assert.notEqual(null, error.IAPerror);
126
+ assert.notEqual(undefined, error.IAPerror.displayString);
127
+ assert.notEqual(null, error.IAPerror.displayString);
128
+ assert.equal(code, error.icode);
129
+ assert.equal(origin, error.IAPerror.origin);
130
+ assert.equal(displayStr, error.IAPerror.displayString);
131
+ }
132
+
133
+ /**
134
+ * @function saveMockData
135
+ * Attempts to take data from responses and place them in MockDataFiles to help create Mockdata.
136
+ * Note, this was built based on entity file structure for Adapter-Engine 1.6.x
137
+ * @param {string} entityName - Name of the entity saving mock data for
138
+ * @param {string} actionName - Name of the action saving mock data for
139
+ * @param {string} descriptor - Something to describe this test (used as a type)
140
+ * @param {string or object} responseData - The data to put in the mock file.
141
+ */
142
+ function saveMockData(entityName, actionName, descriptor, responseData) {
143
+ // do not need to save mockdata if we are running in stub mode (already has mock data) or if told not to save
144
+ if (stub || !isSaveMockData) {
145
+ return false;
146
+ }
147
+
148
+ // must have a response in order to store the response
149
+ if (responseData && responseData.response) {
150
+ let data = responseData.response;
151
+
152
+ // if there was a raw response that one is better as it is untranslated
153
+ if (responseData.raw) {
154
+ data = responseData.raw;
155
+
156
+ try {
157
+ const temp = JSON.parse(data);
158
+ data = temp;
159
+ } catch (pex) {
160
+ // do not care if it did not parse as we will just use data
161
+ }
162
+ }
163
+
164
+ try {
165
+ const base = path.join(__dirname, `../../entities/${entityName}/`);
166
+ const mockdatafolder = 'mockdatafiles';
167
+ const filename = `mockdatafiles/${actionName}-${descriptor}.json`;
168
+
169
+ if (!fs.existsSync(base + mockdatafolder)) {
170
+ fs.mkdirSync(base + mockdatafolder);
171
+ }
172
+
173
+ // write the data we retrieved
174
+ fs.writeFile(base + filename, JSON.stringify(data, null, 2), 'utf8', (errWritingMock) => {
175
+ if (errWritingMock) throw errWritingMock;
176
+
177
+ // update the action file to reflect the changes. Note: We're replacing the default object for now!
178
+ fs.readFile(`${base}action.json`, (errRead, content) => {
179
+ if (errRead) throw errRead;
180
+
181
+ // parse the action file into JSON
182
+ const parsedJson = JSON.parse(content);
183
+
184
+ // The object update we'll write in.
185
+ const responseObj = {
186
+ type: descriptor,
187
+ key: '',
188
+ mockFile: filename
189
+ };
190
+
191
+ // get the object for method we're trying to change.
192
+ const currentMethodAction = parsedJson.actions.find((obj) => obj.name === actionName);
193
+
194
+ // if the method was not found - should never happen but...
195
+ if (!currentMethodAction) {
196
+ throw Error('Can\'t find an action for this method in the provided entity.');
197
+ }
198
+
199
+ // if there is a response object, we want to replace the Response object. Otherwise we'll create one.
200
+ const actionResponseObj = currentMethodAction.responseObjects.find((obj) => obj.type === descriptor);
201
+
202
+ // Add the action responseObj back into the array of response objects.
203
+ if (!actionResponseObj) {
204
+ // if there is a default response object, we want to get the key.
205
+ const defaultResponseObj = currentMethodAction.responseObjects.find((obj) => obj.type === 'default');
206
+
207
+ // save the default key into the new response object
208
+ if (defaultResponseObj) {
209
+ responseObj.key = defaultResponseObj.key;
210
+ }
211
+
212
+ // save the new response object
213
+ currentMethodAction.responseObjects = [responseObj];
214
+ } else {
215
+ // update the location of the mock data file
216
+ actionResponseObj.mockFile = responseObj.mockFile;
217
+ }
218
+
219
+ // Save results
220
+ fs.writeFile(`${base}action.json`, JSON.stringify(parsedJson, null, 2), (err) => {
221
+ if (err) throw err;
222
+ });
223
+ });
224
+ });
225
+ } catch (e) {
226
+ log.debug(`Failed to save mock data for ${actionName}. ${e.message}`);
227
+ return false;
228
+ }
229
+ }
230
+
231
+ // no response to save
232
+ log.debug(`No data passed to save into mockdata for ${actionName}`);
233
+ return false;
234
+ }
235
+
236
+ // require the adapter that we are going to be using
237
+ const ParagonDpm = require('../../adapter');
238
+
239
+ // begin the testing - these should be pretty well defined between the describe and the it!
240
+ describe('[integration] Paragon_dpm Adapter Test', () => {
241
+ describe('ParagonDpm Class Tests', () => {
242
+ const a = new ParagonDpm(
243
+ pronghornProps.adapterProps.adapters[0].id,
244
+ pronghornProps.adapterProps.adapters[0].properties
245
+ );
246
+
247
+ if (isRapidFail) {
248
+ const state = {};
249
+ state.passed = true;
250
+
251
+ mocha.afterEach(function x() {
252
+ state.passed = state.passed
253
+ && (this.currentTest.state === 'passed');
254
+ });
255
+ mocha.beforeEach(function x() {
256
+ if (!state.passed) {
257
+ return this.currentTest.skip();
258
+ }
259
+ return true;
260
+ });
261
+ }
262
+
263
+ describe('#class instance created', () => {
264
+ it('should be a class with properties', (done) => {
265
+ try {
266
+ assert.notEqual(null, a);
267
+ assert.notEqual(undefined, a);
268
+ const checkId = global.pronghornProps.adapterProps.adapters[0].id;
269
+ assert.equal(checkId, a.id);
270
+ assert.notEqual(null, a.allProps);
271
+ const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
272
+ assert.equal(check, a.healthcheckType);
273
+ done();
274
+ } catch (error) {
275
+ log.error(`Test Failure: ${error}`);
276
+ done(error);
277
+ }
278
+ }).timeout(attemptTimeout);
279
+ });
280
+
281
+ describe('#connect', () => {
282
+ it('should get connected - no healthcheck', (done) => {
283
+ try {
284
+ a.healthcheckType = 'none';
285
+ a.connect();
286
+
287
+ try {
288
+ assert.equal(true, a.alive);
289
+ done();
290
+ } catch (error) {
291
+ log.error(`Test Failure: ${error}`);
292
+ done(error);
293
+ }
294
+ } catch (error) {
295
+ log.error(`Adapter Exception: ${error}`);
296
+ done(error);
297
+ }
298
+ });
299
+ it('should get connected - startup healthcheck', (done) => {
300
+ try {
301
+ a.healthcheckType = 'startup';
302
+ a.connect();
303
+
304
+ try {
305
+ assert.equal(true, a.alive);
306
+ done();
307
+ } catch (error) {
308
+ log.error(`Test Failure: ${error}`);
309
+ done(error);
310
+ }
311
+ } catch (error) {
312
+ log.error(`Adapter Exception: ${error}`);
313
+ done(error);
314
+ }
315
+ });
316
+ });
317
+
318
+ describe('#healthCheck', () => {
319
+ it('should be healthy', (done) => {
320
+ try {
321
+ a.healthCheck(null, (data) => {
322
+ try {
323
+ assert.equal(true, a.healthy);
324
+ saveMockData('system', 'healthcheck', 'default', data);
325
+ done();
326
+ } catch (err) {
327
+ log.error(`Test Failure: ${err}`);
328
+ done(err);
329
+ }
330
+ });
331
+ } catch (error) {
332
+ log.error(`Adapter Exception: ${error}`);
333
+ done(error);
334
+ }
335
+ }).timeout(attemptTimeout);
336
+ });
337
+
338
+ /*
339
+ -----------------------------------------------------------------------
340
+ -----------------------------------------------------------------------
341
+ *** All code above this comment will be replaced during a migration ***
342
+ ******************* DO NOT REMOVE THIS COMMENT BLOCK ******************
343
+ -----------------------------------------------------------------------
344
+ -----------------------------------------------------------------------
345
+ */
346
+
347
+ const dpmServiceDpmServiceBulkExtRefUpdateBodyParam = {
348
+ items: [
349
+ {
350
+ 'ref-from-type': 'string',
351
+ 'ref-from-uuid': 'string',
352
+ operation: 'string',
353
+ 'ref-to-uuid': 'string',
354
+ 'ref-to-type': 'string'
355
+ }
356
+ ]
357
+ };
358
+ describe('#dpmServiceBulkExtRefUpdate - errors', () => {
359
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
360
+ try {
361
+ a.dpmServiceBulkExtRefUpdate(dpmServiceDpmServiceBulkExtRefUpdateBodyParam, (data, error) => {
362
+ try {
363
+ if (stub) {
364
+ const displayE = 'Error 400 received on request';
365
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
366
+ } else {
367
+ runCommonAsserts(data, error);
368
+ }
369
+ saveMockData('DpmService', 'dpmServiceBulkExtRefUpdate', 'default', data);
370
+ done();
371
+ } catch (err) {
372
+ log.error(`Test Failure: ${err}`);
373
+ done(err);
374
+ }
375
+ });
376
+ } catch (error) {
377
+ log.error(`Adapter Exception: ${error}`);
378
+ done(error);
379
+ }
380
+ }).timeout(attemptTimeout);
381
+ });
382
+
383
+ const dpmServiceDpmServiceBulkListCaCertificateBlobBodyParam = {
384
+ spec: {
385
+ ref_fields: [
386
+ 'string'
387
+ ],
388
+ parent_type: 'string',
389
+ filters: [
390
+ 'string'
391
+ ],
392
+ operation: 'AND',
393
+ json_filters: [
394
+ {
395
+ values: [
396
+ 'string'
397
+ ],
398
+ key: 'string'
399
+ }
400
+ ],
401
+ size: 'string',
402
+ from: 'string',
403
+ page_marker: 'string',
404
+ obj_uuids: [
405
+ 'string'
406
+ ],
407
+ ref_uuids_map: {},
408
+ detail: false,
409
+ parent_id: [
410
+ 'string'
411
+ ],
412
+ ext_ref_uuids: [
413
+ 'string'
414
+ ],
415
+ back_ref_id: [
416
+ 'string'
417
+ ],
418
+ exclude_shared: true,
419
+ exclude_hrefs: false,
420
+ tag_detail: false,
421
+ count: false,
422
+ fields: [
423
+ 'string'
424
+ ],
425
+ parent_fq_name_str: [
426
+ 'string'
427
+ ],
428
+ ref_uuids: [
429
+ 'string'
430
+ ],
431
+ sortby: 'string',
432
+ tag_filters: [
433
+ 'string'
434
+ ]
435
+ }
436
+ };
437
+ describe('#dpmServiceBulkListCaCertificateBlob - errors', () => {
438
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
439
+ try {
440
+ a.dpmServiceBulkListCaCertificateBlob(dpmServiceDpmServiceBulkListCaCertificateBlobBodyParam, (data, error) => {
441
+ try {
442
+ if (stub) {
443
+ const displayE = 'Error 400 received on request';
444
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
445
+ } else {
446
+ runCommonAsserts(data, error);
447
+ }
448
+ saveMockData('DpmService', 'dpmServiceBulkListCaCertificateBlob', 'default', data);
449
+ done();
450
+ } catch (err) {
451
+ log.error(`Test Failure: ${err}`);
452
+ done(err);
453
+ }
454
+ });
455
+ } catch (error) {
456
+ log.error(`Adapter Exception: ${error}`);
457
+ done(error);
458
+ }
459
+ }).timeout(attemptTimeout);
460
+ });
461
+
462
+ const dpmServiceDpmServiceBulkListCertificateBlobBodyParam = {
463
+ spec: {
464
+ ref_fields: [
465
+ 'string'
466
+ ],
467
+ parent_type: 'string',
468
+ filters: [
469
+ 'string'
470
+ ],
471
+ operation: 'AND',
472
+ json_filters: [
473
+ {
474
+ values: [
475
+ 'string'
476
+ ],
477
+ key: 'string'
478
+ }
479
+ ],
480
+ size: 'string',
481
+ from: 'string',
482
+ page_marker: 'string',
483
+ obj_uuids: [
484
+ 'string'
485
+ ],
486
+ ref_uuids_map: {},
487
+ detail: true,
488
+ parent_id: [
489
+ 'string'
490
+ ],
491
+ ext_ref_uuids: [
492
+ 'string'
493
+ ],
494
+ back_ref_id: [
495
+ 'string'
496
+ ],
497
+ exclude_shared: false,
498
+ exclude_hrefs: true,
499
+ tag_detail: true,
500
+ count: false,
501
+ fields: [
502
+ 'string'
503
+ ],
504
+ parent_fq_name_str: [
505
+ 'string'
506
+ ],
507
+ ref_uuids: [
508
+ 'string'
509
+ ],
510
+ sortby: 'string',
511
+ tag_filters: [
512
+ 'string'
513
+ ]
514
+ }
515
+ };
516
+ describe('#dpmServiceBulkListCertificateBlob - errors', () => {
517
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
518
+ try {
519
+ a.dpmServiceBulkListCertificateBlob(dpmServiceDpmServiceBulkListCertificateBlobBodyParam, (data, error) => {
520
+ try {
521
+ if (stub) {
522
+ const displayE = 'Error 400 received on request';
523
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
524
+ } else {
525
+ runCommonAsserts(data, error);
526
+ }
527
+ saveMockData('DpmService', 'dpmServiceBulkListCertificateBlob', 'default', data);
528
+ done();
529
+ } catch (err) {
530
+ log.error(`Test Failure: ${err}`);
531
+ done(err);
532
+ }
533
+ });
534
+ } catch (error) {
535
+ log.error(`Adapter Exception: ${error}`);
536
+ done(error);
537
+ }
538
+ }).timeout(attemptTimeout);
539
+ });
540
+
541
+ const dpmServiceDpmServiceBulkListDeletedResourceBodyParam = {
542
+ spec: {
543
+ ref_fields: [
544
+ 'string'
545
+ ],
546
+ parent_type: 'string',
547
+ filters: [
548
+ 'string'
549
+ ],
550
+ operation: 'AND',
551
+ json_filters: [
552
+ {
553
+ values: [
554
+ 'string'
555
+ ],
556
+ key: 'string'
557
+ }
558
+ ],
559
+ size: 'string',
560
+ from: 'string',
561
+ page_marker: 'string',
562
+ obj_uuids: [
563
+ 'string'
564
+ ],
565
+ ref_uuids_map: {},
566
+ detail: true,
567
+ parent_id: [
568
+ 'string'
569
+ ],
570
+ ext_ref_uuids: [
571
+ 'string'
572
+ ],
573
+ back_ref_id: [
574
+ 'string'
575
+ ],
576
+ exclude_shared: true,
577
+ exclude_hrefs: true,
578
+ tag_detail: false,
579
+ count: true,
580
+ fields: [
581
+ 'string'
582
+ ],
583
+ parent_fq_name_str: [
584
+ 'string'
585
+ ],
586
+ ref_uuids: [
587
+ 'string'
588
+ ],
589
+ sortby: 'string',
590
+ tag_filters: [
591
+ 'string'
592
+ ]
593
+ }
594
+ };
595
+ describe('#dpmServiceBulkListDeletedResource - errors', () => {
596
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
597
+ try {
598
+ a.dpmServiceBulkListDeletedResource(dpmServiceDpmServiceBulkListDeletedResourceBodyParam, (data, error) => {
599
+ try {
600
+ if (stub) {
601
+ const displayE = 'Error 400 received on request';
602
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
603
+ } else {
604
+ runCommonAsserts(data, error);
605
+ }
606
+ saveMockData('DpmService', 'dpmServiceBulkListDeletedResource', '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 dpmServiceDpmServiceBulkListImageBodyParam = {
621
+ spec: {
622
+ ref_fields: [
623
+ 'string'
624
+ ],
625
+ parent_type: 'string',
626
+ filters: [
627
+ 'string'
628
+ ],
629
+ operation: 'AND',
630
+ json_filters: [
631
+ {
632
+ values: [
633
+ 'string'
634
+ ],
635
+ key: 'string'
636
+ }
637
+ ],
638
+ size: 'string',
639
+ from: 'string',
640
+ page_marker: 'string',
641
+ obj_uuids: [
642
+ 'string'
643
+ ],
644
+ ref_uuids_map: {},
645
+ detail: true,
646
+ parent_id: [
647
+ 'string'
648
+ ],
649
+ ext_ref_uuids: [
650
+ 'string'
651
+ ],
652
+ back_ref_id: [
653
+ 'string'
654
+ ],
655
+ exclude_shared: true,
656
+ exclude_hrefs: false,
657
+ tag_detail: true,
658
+ count: true,
659
+ fields: [
660
+ 'string'
661
+ ],
662
+ parent_fq_name_str: [
663
+ 'string'
664
+ ],
665
+ ref_uuids: [
666
+ 'string'
667
+ ],
668
+ sortby: 'string',
669
+ tag_filters: [
670
+ 'string'
671
+ ]
672
+ }
673
+ };
674
+ describe('#dpmServiceBulkListImage - errors', () => {
675
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
676
+ try {
677
+ a.dpmServiceBulkListImage(dpmServiceDpmServiceBulkListImageBodyParam, (data, error) => {
678
+ try {
679
+ if (stub) {
680
+ const displayE = 'Error 400 received on request';
681
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
682
+ } else {
683
+ runCommonAsserts(data, error);
684
+ }
685
+ saveMockData('DpmService', 'dpmServiceBulkListImage', 'default', data);
686
+ done();
687
+ } catch (err) {
688
+ log.error(`Test Failure: ${err}`);
689
+ done(err);
690
+ }
691
+ });
692
+ } catch (error) {
693
+ log.error(`Adapter Exception: ${error}`);
694
+ done(error);
695
+ }
696
+ }).timeout(attemptTimeout);
697
+ });
698
+
699
+ const dpmServiceDpmServiceBulkListLastPublishedNotificationBodyParam = {
700
+ spec: {
701
+ ref_fields: [
702
+ 'string'
703
+ ],
704
+ parent_type: 'string',
705
+ filters: [
706
+ 'string'
707
+ ],
708
+ operation: 'AND',
709
+ json_filters: [
710
+ {
711
+ values: [
712
+ 'string'
713
+ ],
714
+ key: 'string'
715
+ }
716
+ ],
717
+ size: 'string',
718
+ from: 'string',
719
+ page_marker: 'string',
720
+ obj_uuids: [
721
+ 'string'
722
+ ],
723
+ ref_uuids_map: {},
724
+ detail: true,
725
+ parent_id: [
726
+ 'string'
727
+ ],
728
+ ext_ref_uuids: [
729
+ 'string'
730
+ ],
731
+ back_ref_id: [
732
+ 'string'
733
+ ],
734
+ exclude_shared: true,
735
+ exclude_hrefs: false,
736
+ tag_detail: true,
737
+ count: true,
738
+ fields: [
739
+ 'string'
740
+ ],
741
+ parent_fq_name_str: [
742
+ 'string'
743
+ ],
744
+ ref_uuids: [
745
+ 'string'
746
+ ],
747
+ sortby: 'string',
748
+ tag_filters: [
749
+ 'string'
750
+ ]
751
+ }
752
+ };
753
+ describe('#dpmServiceBulkListLastPublishedNotification - errors', () => {
754
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
755
+ try {
756
+ a.dpmServiceBulkListLastPublishedNotification(dpmServiceDpmServiceBulkListLastPublishedNotificationBodyParam, (data, error) => {
757
+ try {
758
+ if (stub) {
759
+ const displayE = 'Error 400 received on request';
760
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
761
+ } else {
762
+ runCommonAsserts(data, error);
763
+ }
764
+ saveMockData('DpmService', 'dpmServiceBulkListLastPublishedNotification', '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 dpmServiceDpmServiceBulkRefUpdateBodyParam = {
779
+ refs: [
780
+ {
781
+ 'ref-type': 'string',
782
+ 'ref-uuid': 'string',
783
+ operation: 'string',
784
+ type: 'string',
785
+ uuid: 'string'
786
+ }
787
+ ],
788
+ type: 'string',
789
+ uuid: 'string'
790
+ };
791
+ describe('#dpmServiceBulkRefUpdate - errors', () => {
792
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
793
+ try {
794
+ a.dpmServiceBulkRefUpdate(dpmServiceDpmServiceBulkRefUpdateBodyParam, (data, error) => {
795
+ try {
796
+ if (stub) {
797
+ const displayE = 'Error 400 received on request';
798
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
799
+ } else {
800
+ runCommonAsserts(data, error);
801
+ }
802
+ saveMockData('DpmService', 'dpmServiceBulkRefUpdate', 'default', data);
803
+ done();
804
+ } catch (err) {
805
+ log.error(`Test Failure: ${err}`);
806
+ done(err);
807
+ }
808
+ });
809
+ } catch (error) {
810
+ log.error(`Adapter Exception: ${error}`);
811
+ done(error);
812
+ }
813
+ }).timeout(attemptTimeout);
814
+ });
815
+
816
+ const dpmServiceDpmServiceCreateCaCertificateBlobBodyParam = {
817
+ 'ca-certificate-blob': {
818
+ updated_timestamp: 'string',
819
+ description: 'string',
820
+ configuration_version: 'string',
821
+ device_uuid: 'string',
822
+ href: 'string',
823
+ certificate_contents: 'string',
824
+ parent_type: 'string',
825
+ uuid: 'string',
826
+ perms2: {
827
+ owner: 'string',
828
+ global_access: 'string',
829
+ share: [
830
+ {
831
+ access: 'string',
832
+ scope: 'string',
833
+ levels: 'string',
834
+ scope_types: [
835
+ 'string'
836
+ ]
837
+ }
838
+ ]
839
+ },
840
+ name: 'string',
841
+ meta: {
842
+ enable: true,
843
+ user_visible: true
844
+ },
845
+ created_by: 'string',
846
+ updated_by: 'string',
847
+ created_timestamp: 'string',
848
+ annotations: {
849
+ key_value_pair: [
850
+ {
851
+ key: 'string',
852
+ value: 'string'
853
+ }
854
+ ]
855
+ },
856
+ parent_uuid: 'string'
857
+ }
858
+ };
859
+ describe('#dpmServiceCreateCaCertificateBlob - errors', () => {
860
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
861
+ try {
862
+ a.dpmServiceCreateCaCertificateBlob(dpmServiceDpmServiceCreateCaCertificateBlobBodyParam, (data, error) => {
863
+ try {
864
+ if (stub) {
865
+ const displayE = 'Error 400 received on request';
866
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
867
+ } else {
868
+ runCommonAsserts(data, error);
869
+ }
870
+ saveMockData('DpmService', 'dpmServiceCreateCaCertificateBlob', 'default', data);
871
+ done();
872
+ } catch (err) {
873
+ log.error(`Test Failure: ${err}`);
874
+ done(err);
875
+ }
876
+ });
877
+ } catch (error) {
878
+ log.error(`Adapter Exception: ${error}`);
879
+ done(error);
880
+ }
881
+ }).timeout(attemptTimeout);
882
+ });
883
+
884
+ const dpmServiceDpmServiceCreateCertificateBlobBodyParam = {
885
+ 'certificate-blob': {
886
+ updated_timestamp: 'string',
887
+ description: 'string',
888
+ configuration_version: 'string',
889
+ device_uuid: 'string',
890
+ href: 'string',
891
+ certificate_contents: 'string',
892
+ parent_type: 'string',
893
+ uuid: 'string',
894
+ perms2: {
895
+ owner: 'string',
896
+ global_access: 'string',
897
+ share: [
898
+ {
899
+ access: 'string',
900
+ scope: 'string',
901
+ levels: 'string',
902
+ scope_types: [
903
+ 'string'
904
+ ]
905
+ }
906
+ ]
907
+ },
908
+ name: 'string',
909
+ meta: {
910
+ enable: true,
911
+ user_visible: true
912
+ },
913
+ created_by: 'string',
914
+ certificate_key_contents: 'string',
915
+ updated_by: 'string',
916
+ created_timestamp: 'string',
917
+ annotations: {
918
+ key_value_pair: [
919
+ {
920
+ key: 'string',
921
+ value: 'string'
922
+ }
923
+ ]
924
+ },
925
+ parent_uuid: 'string'
926
+ }
927
+ };
928
+ describe('#dpmServiceCreateCertificateBlob - errors', () => {
929
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
930
+ try {
931
+ a.dpmServiceCreateCertificateBlob(dpmServiceDpmServiceCreateCertificateBlobBodyParam, (data, error) => {
932
+ try {
933
+ if (stub) {
934
+ const displayE = 'Error 400 received on request';
935
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
936
+ } else {
937
+ runCommonAsserts(data, error);
938
+ }
939
+ saveMockData('DpmService', 'dpmServiceCreateCertificateBlob', 'default', data);
940
+ done();
941
+ } catch (err) {
942
+ log.error(`Test Failure: ${err}`);
943
+ done(err);
944
+ }
945
+ });
946
+ } catch (error) {
947
+ log.error(`Adapter Exception: ${error}`);
948
+ done(error);
949
+ }
950
+ }).timeout(attemptTimeout);
951
+ });
952
+
953
+ const dpmServiceDpmServiceCreateDeletedResourceBodyParam = {
954
+ 'deleted-resource': {
955
+ updated_timestamp: 'string',
956
+ description: 'string',
957
+ configuration_version: 'string',
958
+ href: 'string',
959
+ parent_type: 'string',
960
+ uuid: 'string',
961
+ perms2: {
962
+ owner: 'string',
963
+ global_access: 'string',
964
+ share: [
965
+ {
966
+ access: 'string',
967
+ scope: 'string',
968
+ levels: 'string',
969
+ scope_types: [
970
+ 'string'
971
+ ]
972
+ }
973
+ ]
974
+ },
975
+ name: 'string',
976
+ meta: {
977
+ enable: false,
978
+ user_visible: false
979
+ },
980
+ created_by: 'string',
981
+ updated_by: 'string',
982
+ created_timestamp: 'string',
983
+ data: 'string',
984
+ annotations: {
985
+ key_value_pair: [
986
+ {
987
+ key: 'string',
988
+ value: 'string'
989
+ }
990
+ ]
991
+ },
992
+ resource_type: 'string',
993
+ parent_uuid: 'string'
994
+ }
995
+ };
996
+ describe('#dpmServiceCreateDeletedResource - errors', () => {
997
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
998
+ try {
999
+ a.dpmServiceCreateDeletedResource(dpmServiceDpmServiceCreateDeletedResourceBodyParam, (data, error) => {
1000
+ try {
1001
+ if (stub) {
1002
+ const displayE = 'Error 400 received on request';
1003
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
1004
+ } else {
1005
+ runCommonAsserts(data, error);
1006
+ }
1007
+ saveMockData('DpmService', 'dpmServiceCreateDeletedResource', 'default', data);
1008
+ done();
1009
+ } catch (err) {
1010
+ log.error(`Test Failure: ${err}`);
1011
+ done(err);
1012
+ }
1013
+ });
1014
+ } catch (error) {
1015
+ log.error(`Adapter Exception: ${error}`);
1016
+ done(error);
1017
+ }
1018
+ }).timeout(attemptTimeout);
1019
+ });
1020
+
1021
+ const dpmServiceDpmServiceExtRefUpdateBodyParam = {
1022
+ 'ref-from-type': 'string',
1023
+ 'ref-from-uuid': 'string',
1024
+ operation: 'string',
1025
+ 'ref-to-uuid': 'string',
1026
+ 'ref-to-type': 'string'
1027
+ };
1028
+ describe('#dpmServiceExtRefUpdate - errors', () => {
1029
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1030
+ try {
1031
+ a.dpmServiceExtRefUpdate(dpmServiceDpmServiceExtRefUpdateBodyParam, (data, error) => {
1032
+ try {
1033
+ if (stub) {
1034
+ const displayE = 'Error 400 received on request';
1035
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
1036
+ } else {
1037
+ runCommonAsserts(data, error);
1038
+ }
1039
+ saveMockData('DpmService', 'dpmServiceExtRefUpdate', 'default', data);
1040
+ done();
1041
+ } catch (err) {
1042
+ log.error(`Test Failure: ${err}`);
1043
+ done(err);
1044
+ }
1045
+ });
1046
+ } catch (error) {
1047
+ log.error(`Adapter Exception: ${error}`);
1048
+ done(error);
1049
+ }
1050
+ }).timeout(attemptTimeout);
1051
+ });
1052
+
1053
+ const dpmServiceDpmServiceCreateImageBodyParam = {
1054
+ image: {
1055
+ parent_uuid: 'string',
1056
+ parent_type: 'string',
1057
+ href: 'string',
1058
+ created_timestamp: 'string',
1059
+ updated_by: 'string',
1060
+ updated_timestamp: 'string',
1061
+ uuid: 'string',
1062
+ configuration_version: 'string',
1063
+ image_type: 'string',
1064
+ created_by: 'string',
1065
+ version: 'string',
1066
+ supported_platforms: [
1067
+ 'string'
1068
+ ],
1069
+ annotations: {
1070
+ key_value_pair: [
1071
+ {
1072
+ key: 'string',
1073
+ value: 'string'
1074
+ }
1075
+ ]
1076
+ },
1077
+ vendor: 'string',
1078
+ description: 'string',
1079
+ perms2: {
1080
+ owner: 'string',
1081
+ global_access: 'string',
1082
+ share: [
1083
+ {
1084
+ access: 'string',
1085
+ scope: 'string',
1086
+ levels: 'string',
1087
+ scope_types: [
1088
+ 'string'
1089
+ ]
1090
+ }
1091
+ ]
1092
+ },
1093
+ file_id: 'string',
1094
+ image_size: 'string',
1095
+ device: [
1096
+ {
1097
+ component: 'string',
1098
+ device_uuid: 'string'
1099
+ }
1100
+ ],
1101
+ name: 'string',
1102
+ upload_timestamp: 'string',
1103
+ file_uri: 'string',
1104
+ sha1_hash: 'string',
1105
+ device_family: [
1106
+ 'string'
1107
+ ],
1108
+ meta: {
1109
+ enable: true,
1110
+ user_visible: false
1111
+ }
1112
+ }
1113
+ };
1114
+ describe('#dpmServiceCreateImage - errors', () => {
1115
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1116
+ try {
1117
+ a.dpmServiceCreateImage(dpmServiceDpmServiceCreateImageBodyParam, (data, error) => {
1118
+ try {
1119
+ if (stub) {
1120
+ const displayE = 'Error 400 received on request';
1121
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
1122
+ } else {
1123
+ runCommonAsserts(data, error);
1124
+ }
1125
+ saveMockData('DpmService', 'dpmServiceCreateImage', 'default', data);
1126
+ done();
1127
+ } catch (err) {
1128
+ log.error(`Test Failure: ${err}`);
1129
+ done(err);
1130
+ }
1131
+ });
1132
+ } catch (error) {
1133
+ log.error(`Adapter Exception: ${error}`);
1134
+ done(error);
1135
+ }
1136
+ }).timeout(attemptTimeout);
1137
+ });
1138
+
1139
+ const dpmServiceDpmServiceCreateLastPublishedNotificationBodyParam = {
1140
+ 'last-published-notification': {
1141
+ updated_timestamp: 'string',
1142
+ last_published_timestamp: 'string',
1143
+ description: 'string',
1144
+ configuration_version: 'string',
1145
+ href: 'string',
1146
+ parent_type: 'string',
1147
+ uuid: 'string',
1148
+ perms2: {
1149
+ owner: 'string',
1150
+ global_access: 'string',
1151
+ share: [
1152
+ {
1153
+ access: 'string',
1154
+ scope: 'string',
1155
+ levels: 'string',
1156
+ scope_types: [
1157
+ 'string'
1158
+ ]
1159
+ }
1160
+ ]
1161
+ },
1162
+ name: 'string',
1163
+ meta: {
1164
+ enable: true,
1165
+ user_visible: false
1166
+ },
1167
+ created_by: 'string',
1168
+ updated_by: 'string',
1169
+ created_timestamp: 'string',
1170
+ annotations: {
1171
+ key_value_pair: [
1172
+ {
1173
+ key: 'string',
1174
+ value: 'string'
1175
+ }
1176
+ ]
1177
+ },
1178
+ resource_type: 'string',
1179
+ parent_uuid: 'string'
1180
+ }
1181
+ };
1182
+ describe('#dpmServiceCreateLastPublishedNotification - errors', () => {
1183
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1184
+ try {
1185
+ a.dpmServiceCreateLastPublishedNotification(dpmServiceDpmServiceCreateLastPublishedNotificationBodyParam, (data, error) => {
1186
+ try {
1187
+ if (stub) {
1188
+ const displayE = 'Error 400 received on request';
1189
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
1190
+ } else {
1191
+ runCommonAsserts(data, error);
1192
+ }
1193
+ saveMockData('DpmService', 'dpmServiceCreateLastPublishedNotification', 'default', data);
1194
+ done();
1195
+ } catch (err) {
1196
+ log.error(`Test Failure: ${err}`);
1197
+ done(err);
1198
+ }
1199
+ });
1200
+ } catch (error) {
1201
+ log.error(`Adapter Exception: ${error}`);
1202
+ done(error);
1203
+ }
1204
+ }).timeout(attemptTimeout);
1205
+ });
1206
+
1207
+ const dpmServiceDpmServiceRefUpdateBodyParam = {
1208
+ 'ref-type': 'string',
1209
+ 'ref-uuid': 'string',
1210
+ operation: 'string',
1211
+ type: 'string',
1212
+ uuid: 'string'
1213
+ };
1214
+ describe('#dpmServiceRefUpdate - errors', () => {
1215
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1216
+ try {
1217
+ a.dpmServiceRefUpdate(dpmServiceDpmServiceRefUpdateBodyParam, (data, error) => {
1218
+ try {
1219
+ if (stub) {
1220
+ const displayE = 'Error 400 received on request';
1221
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
1222
+ } else {
1223
+ runCommonAsserts(data, error);
1224
+ }
1225
+ saveMockData('DpmService', 'dpmServiceRefUpdate', 'default', data);
1226
+ done();
1227
+ } catch (err) {
1228
+ log.error(`Test Failure: ${err}`);
1229
+ done(err);
1230
+ }
1231
+ });
1232
+ } catch (error) {
1233
+ log.error(`Adapter Exception: ${error}`);
1234
+ done(error);
1235
+ }
1236
+ }).timeout(attemptTimeout);
1237
+ });
1238
+
1239
+ const dpmServiceDpmServiceSyncBodyParam = {
1240
+ 'last-published-notification': {
1241
+ resources: [
1242
+ {
1243
+ updated_timestamp: 'string',
1244
+ last_published_timestamp: 'string',
1245
+ description: 'string',
1246
+ configuration_version: 'string',
1247
+ href: 'string',
1248
+ parent_type: 'string',
1249
+ uuid: 'string',
1250
+ perms2: {
1251
+ owner: 'string',
1252
+ global_access: 'string',
1253
+ share: [
1254
+ {
1255
+ access: 'string',
1256
+ scope: 'string',
1257
+ levels: 'string',
1258
+ scope_types: [
1259
+ 'string'
1260
+ ]
1261
+ }
1262
+ ]
1263
+ },
1264
+ name: 'string',
1265
+ meta: {
1266
+ enable: false,
1267
+ user_visible: true
1268
+ },
1269
+ created_by: 'string',
1270
+ updated_by: 'string',
1271
+ created_timestamp: 'string',
1272
+ annotations: {
1273
+ key_value_pair: [
1274
+ {
1275
+ key: 'string',
1276
+ value: 'string'
1277
+ }
1278
+ ]
1279
+ },
1280
+ resource_type: 'string',
1281
+ parent_uuid: 'string'
1282
+ }
1283
+ ]
1284
+ },
1285
+ 'certificate-blob': {
1286
+ resources: [
1287
+ {
1288
+ updated_timestamp: 'string',
1289
+ description: 'string',
1290
+ configuration_version: 'string',
1291
+ device_uuid: 'string',
1292
+ href: 'string',
1293
+ certificate_contents: 'string',
1294
+ parent_type: 'string',
1295
+ uuid: 'string',
1296
+ perms2: {
1297
+ owner: 'string',
1298
+ global_access: 'string',
1299
+ share: [
1300
+ {
1301
+ access: 'string',
1302
+ scope: 'string',
1303
+ levels: 'string',
1304
+ scope_types: [
1305
+ 'string'
1306
+ ]
1307
+ }
1308
+ ]
1309
+ },
1310
+ name: 'string',
1311
+ meta: {
1312
+ enable: true,
1313
+ user_visible: false
1314
+ },
1315
+ created_by: 'string',
1316
+ certificate_key_contents: 'string',
1317
+ updated_by: 'string',
1318
+ created_timestamp: 'string',
1319
+ annotations: {
1320
+ key_value_pair: [
1321
+ {
1322
+ key: 'string',
1323
+ value: 'string'
1324
+ }
1325
+ ]
1326
+ },
1327
+ parent_uuid: 'string'
1328
+ }
1329
+ ]
1330
+ },
1331
+ 'ca-certificate-blob': {
1332
+ resources: [
1333
+ {
1334
+ updated_timestamp: 'string',
1335
+ description: 'string',
1336
+ configuration_version: 'string',
1337
+ device_uuid: 'string',
1338
+ href: 'string',
1339
+ certificate_contents: 'string',
1340
+ parent_type: 'string',
1341
+ uuid: 'string',
1342
+ perms2: {
1343
+ owner: 'string',
1344
+ global_access: 'string',
1345
+ share: [
1346
+ {
1347
+ access: 'string',
1348
+ scope: 'string',
1349
+ levels: 'string',
1350
+ scope_types: [
1351
+ 'string'
1352
+ ]
1353
+ }
1354
+ ]
1355
+ },
1356
+ name: 'string',
1357
+ meta: {
1358
+ enable: true,
1359
+ user_visible: true
1360
+ },
1361
+ created_by: 'string',
1362
+ updated_by: 'string',
1363
+ created_timestamp: 'string',
1364
+ annotations: {
1365
+ key_value_pair: [
1366
+ {
1367
+ key: 'string',
1368
+ value: 'string'
1369
+ }
1370
+ ]
1371
+ },
1372
+ parent_uuid: 'string'
1373
+ }
1374
+ ]
1375
+ },
1376
+ image: {
1377
+ resources: [
1378
+ {
1379
+ parent_uuid: 'string',
1380
+ parent_type: 'string',
1381
+ href: 'string',
1382
+ created_timestamp: 'string',
1383
+ updated_by: 'string',
1384
+ updated_timestamp: 'string',
1385
+ uuid: 'string',
1386
+ configuration_version: 'string',
1387
+ image_type: 'string',
1388
+ created_by: 'string',
1389
+ version: 'string',
1390
+ supported_platforms: [
1391
+ 'string'
1392
+ ],
1393
+ annotations: {
1394
+ key_value_pair: [
1395
+ {
1396
+ key: 'string',
1397
+ value: 'string'
1398
+ }
1399
+ ]
1400
+ },
1401
+ vendor: 'string',
1402
+ description: 'string',
1403
+ perms2: {
1404
+ owner: 'string',
1405
+ global_access: 'string',
1406
+ share: [
1407
+ {
1408
+ access: 'string',
1409
+ scope: 'string',
1410
+ levels: 'string',
1411
+ scope_types: [
1412
+ 'string'
1413
+ ]
1414
+ }
1415
+ ]
1416
+ },
1417
+ file_id: 'string',
1418
+ image_size: 'string',
1419
+ device: [
1420
+ {
1421
+ component: 'string',
1422
+ device_uuid: 'string'
1423
+ }
1424
+ ],
1425
+ name: 'string',
1426
+ upload_timestamp: 'string',
1427
+ file_uri: 'string',
1428
+ sha1_hash: 'string',
1429
+ device_family: [
1430
+ 'string'
1431
+ ],
1432
+ meta: {
1433
+ enable: false,
1434
+ user_visible: true
1435
+ }
1436
+ }
1437
+ ]
1438
+ },
1439
+ ignore_optimistic_lock: false,
1440
+ operation: 'string',
1441
+ 'deleted-resource': {
1442
+ resources: [
1443
+ {
1444
+ updated_timestamp: 'string',
1445
+ description: 'string',
1446
+ configuration_version: 'string',
1447
+ href: 'string',
1448
+ parent_type: 'string',
1449
+ uuid: 'string',
1450
+ perms2: {
1451
+ owner: 'string',
1452
+ global_access: 'string',
1453
+ share: [
1454
+ {
1455
+ access: 'string',
1456
+ scope: 'string',
1457
+ levels: 'string',
1458
+ scope_types: [
1459
+ 'string'
1460
+ ]
1461
+ }
1462
+ ]
1463
+ },
1464
+ name: 'string',
1465
+ meta: {
1466
+ enable: true,
1467
+ user_visible: true
1468
+ },
1469
+ created_by: 'string',
1470
+ updated_by: 'string',
1471
+ created_timestamp: 'string',
1472
+ data: 'string',
1473
+ annotations: {
1474
+ key_value_pair: [
1475
+ {
1476
+ key: 'string',
1477
+ value: 'string'
1478
+ }
1479
+ ]
1480
+ },
1481
+ resource_type: 'string',
1482
+ parent_uuid: 'string'
1483
+ }
1484
+ ]
1485
+ },
1486
+ field_mask: {
1487
+ paths: [
1488
+ 'string'
1489
+ ]
1490
+ }
1491
+ };
1492
+ describe('#dpmServiceSync - errors', () => {
1493
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1494
+ try {
1495
+ a.dpmServiceSync(dpmServiceDpmServiceSyncBodyParam, (data, error) => {
1496
+ try {
1497
+ if (stub) {
1498
+ const displayE = 'Error 400 received on request';
1499
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
1500
+ } else {
1501
+ runCommonAsserts(data, error);
1502
+ }
1503
+ saveMockData('DpmService', 'dpmServiceSync', 'default', data);
1504
+ done();
1505
+ } catch (err) {
1506
+ log.error(`Test Failure: ${err}`);
1507
+ done(err);
1508
+ }
1509
+ });
1510
+ } catch (error) {
1511
+ log.error(`Adapter Exception: ${error}`);
1512
+ done(error);
1513
+ }
1514
+ }).timeout(attemptTimeout);
1515
+ });
1516
+
1517
+ describe('#dpmServiceListCaCertificateBlob - errors', () => {
1518
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1519
+ try {
1520
+ a.dpmServiceListCaCertificateBlob(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
1521
+ try {
1522
+ if (stub) {
1523
+ const displayE = 'Error 400 received on request';
1524
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
1525
+ } else {
1526
+ runCommonAsserts(data, error);
1527
+ }
1528
+ saveMockData('DpmService', 'dpmServiceListCaCertificateBlob', 'default', data);
1529
+ done();
1530
+ } catch (err) {
1531
+ log.error(`Test Failure: ${err}`);
1532
+ done(err);
1533
+ }
1534
+ });
1535
+ } catch (error) {
1536
+ log.error(`Adapter Exception: ${error}`);
1537
+ done(error);
1538
+ }
1539
+ }).timeout(attemptTimeout);
1540
+ });
1541
+
1542
+ const dpmServiceID = 'fakedata';
1543
+ const dpmServiceDpmServiceUpdateCaCertificateBlobBodyParam = {
1544
+ 'ca-certificate-blob': {
1545
+ updated_timestamp: 'string',
1546
+ description: 'string',
1547
+ configuration_version: 'string',
1548
+ device_uuid: 'string',
1549
+ href: 'string',
1550
+ certificate_contents: 'string',
1551
+ parent_type: 'string',
1552
+ uuid: 'string',
1553
+ perms2: {
1554
+ owner: 'string',
1555
+ global_access: 'string',
1556
+ share: [
1557
+ {
1558
+ access: 'string',
1559
+ scope: 'string',
1560
+ levels: 'string',
1561
+ scope_types: [
1562
+ 'string'
1563
+ ]
1564
+ }
1565
+ ]
1566
+ },
1567
+ name: 'string',
1568
+ meta: {
1569
+ enable: false,
1570
+ user_visible: false
1571
+ },
1572
+ created_by: 'string',
1573
+ updated_by: 'string',
1574
+ created_timestamp: 'string',
1575
+ annotations: {
1576
+ key_value_pair: [
1577
+ {
1578
+ key: 'string',
1579
+ value: 'string'
1580
+ }
1581
+ ]
1582
+ },
1583
+ parent_uuid: 'string'
1584
+ },
1585
+ ignore_optimistic_lock: false,
1586
+ ID: 'string',
1587
+ fieldMask: {
1588
+ paths: [
1589
+ 'string'
1590
+ ]
1591
+ }
1592
+ };
1593
+ describe('#dpmServiceUpdateCaCertificateBlob - errors', () => {
1594
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1595
+ try {
1596
+ a.dpmServiceUpdateCaCertificateBlob(dpmServiceID, dpmServiceDpmServiceUpdateCaCertificateBlobBodyParam, (data, error) => {
1597
+ try {
1598
+ if (stub) {
1599
+ const displayE = 'Error 400 received on request';
1600
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
1601
+ } else {
1602
+ runCommonAsserts(data, error);
1603
+ }
1604
+ saveMockData('DpmService', 'dpmServiceUpdateCaCertificateBlob', 'default', data);
1605
+ done();
1606
+ } catch (err) {
1607
+ log.error(`Test Failure: ${err}`);
1608
+ done(err);
1609
+ }
1610
+ });
1611
+ } catch (error) {
1612
+ log.error(`Adapter Exception: ${error}`);
1613
+ done(error);
1614
+ }
1615
+ }).timeout(attemptTimeout);
1616
+ });
1617
+
1618
+ describe('#dpmServiceGetCaCertificateBlob - errors', () => {
1619
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1620
+ try {
1621
+ a.dpmServiceGetCaCertificateBlob(dpmServiceID, null, null, null, (data, error) => {
1622
+ try {
1623
+ if (stub) {
1624
+ const displayE = 'Error 400 received on request';
1625
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
1626
+ } else {
1627
+ runCommonAsserts(data, error);
1628
+ }
1629
+ saveMockData('DpmService', 'dpmServiceGetCaCertificateBlob', 'default', data);
1630
+ done();
1631
+ } catch (err) {
1632
+ log.error(`Test Failure: ${err}`);
1633
+ done(err);
1634
+ }
1635
+ });
1636
+ } catch (error) {
1637
+ log.error(`Adapter Exception: ${error}`);
1638
+ done(error);
1639
+ }
1640
+ }).timeout(attemptTimeout);
1641
+ });
1642
+
1643
+ describe('#dpmServiceListCertificateBlob - errors', () => {
1644
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1645
+ try {
1646
+ a.dpmServiceListCertificateBlob(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
1647
+ try {
1648
+ if (stub) {
1649
+ const displayE = 'Error 400 received on request';
1650
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
1651
+ } else {
1652
+ runCommonAsserts(data, error);
1653
+ }
1654
+ saveMockData('DpmService', 'dpmServiceListCertificateBlob', 'default', data);
1655
+ done();
1656
+ } catch (err) {
1657
+ log.error(`Test Failure: ${err}`);
1658
+ done(err);
1659
+ }
1660
+ });
1661
+ } catch (error) {
1662
+ log.error(`Adapter Exception: ${error}`);
1663
+ done(error);
1664
+ }
1665
+ }).timeout(attemptTimeout);
1666
+ });
1667
+
1668
+ const dpmServiceDpmServiceUpdateCertificateBlobBodyParam = {
1669
+ ignore_optimistic_lock: false,
1670
+ ID: 'string',
1671
+ fieldMask: {
1672
+ paths: [
1673
+ 'string'
1674
+ ]
1675
+ },
1676
+ 'certificate-blob': {
1677
+ updated_timestamp: 'string',
1678
+ description: 'string',
1679
+ configuration_version: 'string',
1680
+ device_uuid: 'string',
1681
+ href: 'string',
1682
+ certificate_contents: 'string',
1683
+ parent_type: 'string',
1684
+ uuid: 'string',
1685
+ perms2: {
1686
+ owner: 'string',
1687
+ global_access: 'string',
1688
+ share: [
1689
+ {
1690
+ access: 'string',
1691
+ scope: 'string',
1692
+ levels: 'string',
1693
+ scope_types: [
1694
+ 'string'
1695
+ ]
1696
+ }
1697
+ ]
1698
+ },
1699
+ name: 'string',
1700
+ meta: {
1701
+ enable: false,
1702
+ user_visible: true
1703
+ },
1704
+ created_by: 'string',
1705
+ certificate_key_contents: 'string',
1706
+ updated_by: 'string',
1707
+ created_timestamp: 'string',
1708
+ annotations: {
1709
+ key_value_pair: [
1710
+ {
1711
+ key: 'string',
1712
+ value: 'string'
1713
+ }
1714
+ ]
1715
+ },
1716
+ parent_uuid: 'string'
1717
+ }
1718
+ };
1719
+ describe('#dpmServiceUpdateCertificateBlob - errors', () => {
1720
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1721
+ try {
1722
+ a.dpmServiceUpdateCertificateBlob(dpmServiceID, dpmServiceDpmServiceUpdateCertificateBlobBodyParam, (data, error) => {
1723
+ try {
1724
+ if (stub) {
1725
+ const displayE = 'Error 400 received on request';
1726
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
1727
+ } else {
1728
+ runCommonAsserts(data, error);
1729
+ }
1730
+ saveMockData('DpmService', 'dpmServiceUpdateCertificateBlob', 'default', data);
1731
+ done();
1732
+ } catch (err) {
1733
+ log.error(`Test Failure: ${err}`);
1734
+ done(err);
1735
+ }
1736
+ });
1737
+ } catch (error) {
1738
+ log.error(`Adapter Exception: ${error}`);
1739
+ done(error);
1740
+ }
1741
+ }).timeout(attemptTimeout);
1742
+ });
1743
+
1744
+ describe('#dpmServiceGetCertificateBlob - errors', () => {
1745
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1746
+ try {
1747
+ a.dpmServiceGetCertificateBlob(dpmServiceID, null, null, null, (data, error) => {
1748
+ try {
1749
+ if (stub) {
1750
+ const displayE = 'Error 400 received on request';
1751
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
1752
+ } else {
1753
+ runCommonAsserts(data, error);
1754
+ }
1755
+ saveMockData('DpmService', 'dpmServiceGetCertificateBlob', 'default', data);
1756
+ done();
1757
+ } catch (err) {
1758
+ log.error(`Test Failure: ${err}`);
1759
+ done(err);
1760
+ }
1761
+ });
1762
+ } catch (error) {
1763
+ log.error(`Adapter Exception: ${error}`);
1764
+ done(error);
1765
+ }
1766
+ }).timeout(attemptTimeout);
1767
+ });
1768
+
1769
+ describe('#dpmServiceListDeletedResource - errors', () => {
1770
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1771
+ try {
1772
+ a.dpmServiceListDeletedResource(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
1773
+ try {
1774
+ if (stub) {
1775
+ const displayE = 'Error 400 received on request';
1776
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
1777
+ } else {
1778
+ runCommonAsserts(data, error);
1779
+ }
1780
+ saveMockData('DpmService', 'dpmServiceListDeletedResource', 'default', data);
1781
+ done();
1782
+ } catch (err) {
1783
+ log.error(`Test Failure: ${err}`);
1784
+ done(err);
1785
+ }
1786
+ });
1787
+ } catch (error) {
1788
+ log.error(`Adapter Exception: ${error}`);
1789
+ done(error);
1790
+ }
1791
+ }).timeout(attemptTimeout);
1792
+ });
1793
+
1794
+ const dpmServiceDpmServiceUpdateDeletedResourceBodyParam = {
1795
+ ignore_optimistic_lock: true,
1796
+ 'deleted-resource': {
1797
+ updated_timestamp: 'string',
1798
+ description: 'string',
1799
+ configuration_version: 'string',
1800
+ href: 'string',
1801
+ parent_type: 'string',
1802
+ uuid: 'string',
1803
+ perms2: {
1804
+ owner: 'string',
1805
+ global_access: 'string',
1806
+ share: [
1807
+ {
1808
+ access: 'string',
1809
+ scope: 'string',
1810
+ levels: 'string',
1811
+ scope_types: [
1812
+ 'string'
1813
+ ]
1814
+ }
1815
+ ]
1816
+ },
1817
+ name: 'string',
1818
+ meta: {
1819
+ enable: false,
1820
+ user_visible: true
1821
+ },
1822
+ created_by: 'string',
1823
+ updated_by: 'string',
1824
+ created_timestamp: 'string',
1825
+ data: 'string',
1826
+ annotations: {
1827
+ key_value_pair: [
1828
+ {
1829
+ key: 'string',
1830
+ value: 'string'
1831
+ }
1832
+ ]
1833
+ },
1834
+ resource_type: 'string',
1835
+ parent_uuid: 'string'
1836
+ },
1837
+ ID: 'string',
1838
+ fieldMask: {
1839
+ paths: [
1840
+ 'string'
1841
+ ]
1842
+ }
1843
+ };
1844
+ describe('#dpmServiceUpdateDeletedResource - errors', () => {
1845
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1846
+ try {
1847
+ a.dpmServiceUpdateDeletedResource(dpmServiceID, dpmServiceDpmServiceUpdateDeletedResourceBodyParam, (data, error) => {
1848
+ try {
1849
+ if (stub) {
1850
+ const displayE = 'Error 400 received on request';
1851
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
1852
+ } else {
1853
+ runCommonAsserts(data, error);
1854
+ }
1855
+ saveMockData('DpmService', 'dpmServiceUpdateDeletedResource', 'default', data);
1856
+ done();
1857
+ } catch (err) {
1858
+ log.error(`Test Failure: ${err}`);
1859
+ done(err);
1860
+ }
1861
+ });
1862
+ } catch (error) {
1863
+ log.error(`Adapter Exception: ${error}`);
1864
+ done(error);
1865
+ }
1866
+ }).timeout(attemptTimeout);
1867
+ });
1868
+
1869
+ describe('#dpmServiceGetDeletedResource - errors', () => {
1870
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1871
+ try {
1872
+ a.dpmServiceGetDeletedResource(dpmServiceID, null, null, null, (data, error) => {
1873
+ try {
1874
+ if (stub) {
1875
+ const displayE = 'Error 400 received on request';
1876
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
1877
+ } else {
1878
+ runCommonAsserts(data, error);
1879
+ }
1880
+ saveMockData('DpmService', 'dpmServiceGetDeletedResource', 'default', data);
1881
+ done();
1882
+ } catch (err) {
1883
+ log.error(`Test Failure: ${err}`);
1884
+ done(err);
1885
+ }
1886
+ });
1887
+ } catch (error) {
1888
+ log.error(`Adapter Exception: ${error}`);
1889
+ done(error);
1890
+ }
1891
+ }).timeout(attemptTimeout);
1892
+ });
1893
+
1894
+ describe('#dpmServiceListImage - errors', () => {
1895
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1896
+ try {
1897
+ a.dpmServiceListImage(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
1898
+ try {
1899
+ if (stub) {
1900
+ const displayE = 'Error 400 received on request';
1901
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
1902
+ } else {
1903
+ runCommonAsserts(data, error);
1904
+ }
1905
+ saveMockData('DpmService', 'dpmServiceListImage', 'default', data);
1906
+ done();
1907
+ } catch (err) {
1908
+ log.error(`Test Failure: ${err}`);
1909
+ done(err);
1910
+ }
1911
+ });
1912
+ } catch (error) {
1913
+ log.error(`Adapter Exception: ${error}`);
1914
+ done(error);
1915
+ }
1916
+ }).timeout(attemptTimeout);
1917
+ });
1918
+
1919
+ const dpmServiceDpmServiceUpdateImageBodyParam = {
1920
+ image: {
1921
+ parent_uuid: 'string',
1922
+ parent_type: 'string',
1923
+ href: 'string',
1924
+ created_timestamp: 'string',
1925
+ updated_by: 'string',
1926
+ updated_timestamp: 'string',
1927
+ uuid: 'string',
1928
+ configuration_version: 'string',
1929
+ image_type: 'string',
1930
+ created_by: 'string',
1931
+ version: 'string',
1932
+ supported_platforms: [
1933
+ 'string'
1934
+ ],
1935
+ annotations: {
1936
+ key_value_pair: [
1937
+ {
1938
+ key: 'string',
1939
+ value: 'string'
1940
+ }
1941
+ ]
1942
+ },
1943
+ vendor: 'string',
1944
+ description: 'string',
1945
+ perms2: {
1946
+ owner: 'string',
1947
+ global_access: 'string',
1948
+ share: [
1949
+ {
1950
+ access: 'string',
1951
+ scope: 'string',
1952
+ levels: 'string',
1953
+ scope_types: [
1954
+ 'string'
1955
+ ]
1956
+ }
1957
+ ]
1958
+ },
1959
+ file_id: 'string',
1960
+ image_size: 'string',
1961
+ device: [
1962
+ {
1963
+ component: 'string',
1964
+ device_uuid: 'string'
1965
+ }
1966
+ ],
1967
+ name: 'string',
1968
+ upload_timestamp: 'string',
1969
+ file_uri: 'string',
1970
+ sha1_hash: 'string',
1971
+ device_family: [
1972
+ 'string'
1973
+ ],
1974
+ meta: {
1975
+ enable: false,
1976
+ user_visible: true
1977
+ }
1978
+ },
1979
+ ID: 'string',
1980
+ ignore_optimistic_lock: false,
1981
+ fieldMask: {
1982
+ paths: [
1983
+ 'string'
1984
+ ]
1985
+ }
1986
+ };
1987
+ describe('#dpmServiceUpdateImage - errors', () => {
1988
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1989
+ try {
1990
+ a.dpmServiceUpdateImage(dpmServiceID, dpmServiceDpmServiceUpdateImageBodyParam, (data, error) => {
1991
+ try {
1992
+ if (stub) {
1993
+ const displayE = 'Error 400 received on request';
1994
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
1995
+ } else {
1996
+ runCommonAsserts(data, error);
1997
+ }
1998
+ saveMockData('DpmService', 'dpmServiceUpdateImage', 'default', data);
1999
+ done();
2000
+ } catch (err) {
2001
+ log.error(`Test Failure: ${err}`);
2002
+ done(err);
2003
+ }
2004
+ });
2005
+ } catch (error) {
2006
+ log.error(`Adapter Exception: ${error}`);
2007
+ done(error);
2008
+ }
2009
+ }).timeout(attemptTimeout);
2010
+ });
2011
+
2012
+ describe('#dpmServiceGetImage - errors', () => {
2013
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2014
+ try {
2015
+ a.dpmServiceGetImage(dpmServiceID, null, null, null, (data, error) => {
2016
+ try {
2017
+ if (stub) {
2018
+ const displayE = 'Error 400 received on request';
2019
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
2020
+ } else {
2021
+ runCommonAsserts(data, error);
2022
+ }
2023
+ saveMockData('DpmService', 'dpmServiceGetImage', 'default', data);
2024
+ done();
2025
+ } catch (err) {
2026
+ log.error(`Test Failure: ${err}`);
2027
+ done(err);
2028
+ }
2029
+ });
2030
+ } catch (error) {
2031
+ log.error(`Adapter Exception: ${error}`);
2032
+ done(error);
2033
+ }
2034
+ }).timeout(attemptTimeout);
2035
+ });
2036
+
2037
+ describe('#dpmServiceListLastPublishedNotification - errors', () => {
2038
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2039
+ try {
2040
+ a.dpmServiceListLastPublishedNotification(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
2041
+ try {
2042
+ if (stub) {
2043
+ const displayE = 'Error 400 received on request';
2044
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
2045
+ } else {
2046
+ runCommonAsserts(data, error);
2047
+ }
2048
+ saveMockData('DpmService', 'dpmServiceListLastPublishedNotification', 'default', data);
2049
+ done();
2050
+ } catch (err) {
2051
+ log.error(`Test Failure: ${err}`);
2052
+ done(err);
2053
+ }
2054
+ });
2055
+ } catch (error) {
2056
+ log.error(`Adapter Exception: ${error}`);
2057
+ done(error);
2058
+ }
2059
+ }).timeout(attemptTimeout);
2060
+ });
2061
+
2062
+ const dpmServiceDpmServiceUpdateLastPublishedNotificationBodyParam = {
2063
+ ignore_optimistic_lock: true,
2064
+ 'last-published-notification': {
2065
+ updated_timestamp: 'string',
2066
+ last_published_timestamp: 'string',
2067
+ description: 'string',
2068
+ configuration_version: 'string',
2069
+ href: 'string',
2070
+ parent_type: 'string',
2071
+ uuid: 'string',
2072
+ perms2: {
2073
+ owner: 'string',
2074
+ global_access: 'string',
2075
+ share: [
2076
+ {
2077
+ access: 'string',
2078
+ scope: 'string',
2079
+ levels: 'string',
2080
+ scope_types: [
2081
+ 'string'
2082
+ ]
2083
+ }
2084
+ ]
2085
+ },
2086
+ name: 'string',
2087
+ meta: {
2088
+ enable: false,
2089
+ user_visible: true
2090
+ },
2091
+ created_by: 'string',
2092
+ updated_by: 'string',
2093
+ created_timestamp: 'string',
2094
+ annotations: {
2095
+ key_value_pair: [
2096
+ {
2097
+ key: 'string',
2098
+ value: 'string'
2099
+ }
2100
+ ]
2101
+ },
2102
+ resource_type: 'string',
2103
+ parent_uuid: 'string'
2104
+ },
2105
+ ID: 'string',
2106
+ fieldMask: {
2107
+ paths: [
2108
+ 'string'
2109
+ ]
2110
+ }
2111
+ };
2112
+ describe('#dpmServiceUpdateLastPublishedNotification - errors', () => {
2113
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2114
+ try {
2115
+ a.dpmServiceUpdateLastPublishedNotification(dpmServiceID, dpmServiceDpmServiceUpdateLastPublishedNotificationBodyParam, (data, error) => {
2116
+ try {
2117
+ if (stub) {
2118
+ const displayE = 'Error 400 received on request';
2119
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
2120
+ } else {
2121
+ runCommonAsserts(data, error);
2122
+ }
2123
+ saveMockData('DpmService', 'dpmServiceUpdateLastPublishedNotification', 'default', data);
2124
+ done();
2125
+ } catch (err) {
2126
+ log.error(`Test Failure: ${err}`);
2127
+ done(err);
2128
+ }
2129
+ });
2130
+ } catch (error) {
2131
+ log.error(`Adapter Exception: ${error}`);
2132
+ done(error);
2133
+ }
2134
+ }).timeout(attemptTimeout);
2135
+ });
2136
+
2137
+ describe('#dpmServiceGetLastPublishedNotification - errors', () => {
2138
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2139
+ try {
2140
+ a.dpmServiceGetLastPublishedNotification(dpmServiceID, null, null, null, (data, error) => {
2141
+ try {
2142
+ if (stub) {
2143
+ const displayE = 'Error 400 received on request';
2144
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
2145
+ } else {
2146
+ runCommonAsserts(data, error);
2147
+ }
2148
+ saveMockData('DpmService', 'dpmServiceGetLastPublishedNotification', 'default', data);
2149
+ done();
2150
+ } catch (err) {
2151
+ log.error(`Test Failure: ${err}`);
2152
+ done(err);
2153
+ }
2154
+ });
2155
+ } catch (error) {
2156
+ log.error(`Adapter Exception: ${error}`);
2157
+ done(error);
2158
+ }
2159
+ }).timeout(attemptTimeout);
2160
+ });
2161
+
2162
+ const imageManagerImageManagerAddImageBodyParam = {
2163
+ vendor: 'string',
2164
+ name: 'string',
2165
+ image_type: 'string',
2166
+ image_file_uri: 'string',
2167
+ supported_platform: [
2168
+ 'string'
2169
+ ],
2170
+ sha1_hash: 'string',
2171
+ device_family: [
2172
+ 'string'
2173
+ ],
2174
+ version: 'string',
2175
+ description: 'string'
2176
+ };
2177
+ describe('#imageManagerAddImage - errors', () => {
2178
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2179
+ try {
2180
+ a.imageManagerAddImage(imageManagerImageManagerAddImageBodyParam, (data, error) => {
2181
+ try {
2182
+ if (stub) {
2183
+ const displayE = 'Error 400 received on request';
2184
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
2185
+ } else {
2186
+ runCommonAsserts(data, error);
2187
+ }
2188
+ saveMockData('ImageManager', 'imageManagerAddImage', 'default', data);
2189
+ done();
2190
+ } catch (err) {
2191
+ log.error(`Test Failure: ${err}`);
2192
+ done(err);
2193
+ }
2194
+ });
2195
+ } catch (error) {
2196
+ log.error(`Adapter Exception: ${error}`);
2197
+ done(error);
2198
+ }
2199
+ }).timeout(attemptTimeout);
2200
+ });
2201
+
2202
+ const imageManagerImageManagerDeleteCertificateBodyParam = {
2203
+ certificate_type: 'string',
2204
+ certificate_id: 'string',
2205
+ next_run_time: 'string',
2206
+ device_uuid: 'string'
2207
+ };
2208
+ describe('#imageManagerDeleteCertificate - errors', () => {
2209
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2210
+ try {
2211
+ a.imageManagerDeleteCertificate(imageManagerImageManagerDeleteCertificateBodyParam, (data, error) => {
2212
+ try {
2213
+ if (stub) {
2214
+ const displayE = 'Error 400 received on request';
2215
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
2216
+ } else {
2217
+ runCommonAsserts(data, error);
2218
+ }
2219
+ saveMockData('ImageManager', 'imageManagerDeleteCertificate', 'default', data);
2220
+ done();
2221
+ } catch (err) {
2222
+ log.error(`Test Failure: ${err}`);
2223
+ done(err);
2224
+ }
2225
+ });
2226
+ } catch (error) {
2227
+ log.error(`Adapter Exception: ${error}`);
2228
+ done(error);
2229
+ }
2230
+ }).timeout(attemptTimeout);
2231
+ });
2232
+
2233
+ const imageManagerImageManagerDeleteImagesBodyParam = {
2234
+ image_uuids: [
2235
+ 'string'
2236
+ ]
2237
+ };
2238
+ describe('#imageManagerDeleteImages - errors', () => {
2239
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2240
+ try {
2241
+ a.imageManagerDeleteImages(imageManagerImageManagerDeleteImagesBodyParam, (data, error) => {
2242
+ try {
2243
+ if (stub) {
2244
+ const displayE = 'Error 400 received on request';
2245
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
2246
+ } else {
2247
+ runCommonAsserts(data, error);
2248
+ }
2249
+ saveMockData('ImageManager', 'imageManagerDeleteImages', 'default', data);
2250
+ done();
2251
+ } catch (err) {
2252
+ log.error(`Test Failure: ${err}`);
2253
+ done(err);
2254
+ }
2255
+ });
2256
+ } catch (error) {
2257
+ log.error(`Adapter Exception: ${error}`);
2258
+ done(error);
2259
+ }
2260
+ }).timeout(attemptTimeout);
2261
+ });
2262
+
2263
+ const imageManagerImageManagerDeployCACertificateBodyParam = {
2264
+ certificate_contents: 'string',
2265
+ device_uuid: 'string',
2266
+ next_run_time: 'string',
2267
+ ca_profile_id: 'string'
2268
+ };
2269
+ describe('#imageManagerDeployCACertificate - errors', () => {
2270
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2271
+ try {
2272
+ a.imageManagerDeployCACertificate(imageManagerImageManagerDeployCACertificateBodyParam, (data, error) => {
2273
+ try {
2274
+ if (stub) {
2275
+ const displayE = 'Error 400 received on request';
2276
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
2277
+ } else {
2278
+ runCommonAsserts(data, error);
2279
+ }
2280
+ saveMockData('ImageManager', 'imageManagerDeployCACertificate', 'default', data);
2281
+ done();
2282
+ } catch (err) {
2283
+ log.error(`Test Failure: ${err}`);
2284
+ done(err);
2285
+ }
2286
+ });
2287
+ } catch (error) {
2288
+ log.error(`Adapter Exception: ${error}`);
2289
+ done(error);
2290
+ }
2291
+ }).timeout(attemptTimeout);
2292
+ });
2293
+
2294
+ const imageManagerImageManagerDeployImageBodyParam = {
2295
+ device: [
2296
+ {
2297
+ image_uuid: 'string',
2298
+ device_uuid: 'string',
2299
+ device_component_name: 'string'
2300
+ }
2301
+ ],
2302
+ next_run_time: 'string'
2303
+ };
2304
+ describe('#imageManagerDeployImage - errors', () => {
2305
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2306
+ try {
2307
+ a.imageManagerDeployImage(imageManagerImageManagerDeployImageBodyParam, (data, error) => {
2308
+ try {
2309
+ if (stub) {
2310
+ const displayE = 'Error 400 received on request';
2311
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
2312
+ } else {
2313
+ runCommonAsserts(data, error);
2314
+ }
2315
+ saveMockData('ImageManager', 'imageManagerDeployImage', 'default', data);
2316
+ done();
2317
+ } catch (err) {
2318
+ log.error(`Test Failure: ${err}`);
2319
+ done(err);
2320
+ }
2321
+ });
2322
+ } catch (error) {
2323
+ log.error(`Adapter Exception: ${error}`);
2324
+ done(error);
2325
+ }
2326
+ }).timeout(attemptTimeout);
2327
+ });
2328
+
2329
+ const imageManagerImageManagerDeployLicenseBodyParam = {
2330
+ next_run_time: 'string',
2331
+ primary_license_contents: 'string',
2332
+ device_uuid: 'string',
2333
+ license_contents: 'string',
2334
+ secondary_license_contents: 'string'
2335
+ };
2336
+ describe('#imageManagerDeployLicense - errors', () => {
2337
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2338
+ try {
2339
+ a.imageManagerDeployLicense(imageManagerImageManagerDeployLicenseBodyParam, (data, error) => {
2340
+ try {
2341
+ if (stub) {
2342
+ const displayE = 'Error 400 received on request';
2343
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
2344
+ } else {
2345
+ runCommonAsserts(data, error);
2346
+ }
2347
+ saveMockData('ImageManager', 'imageManagerDeployLicense', 'default', data);
2348
+ done();
2349
+ } catch (err) {
2350
+ log.error(`Test Failure: ${err}`);
2351
+ done(err);
2352
+ }
2353
+ });
2354
+ } catch (error) {
2355
+ log.error(`Adapter Exception: ${error}`);
2356
+ done(error);
2357
+ }
2358
+ }).timeout(attemptTimeout);
2359
+ });
2360
+
2361
+ const imageManagerImageManagerDeployLocalCertificateBodyParam = {
2362
+ next_run_time: 'string',
2363
+ certificate_key_contents: 'string',
2364
+ device_uuid: 'string',
2365
+ certificate_id: 'string',
2366
+ cert_file: 'string',
2367
+ pass_phrase: 'string',
2368
+ 'key-file': 'string',
2369
+ certificate_contents: 'string'
2370
+ };
2371
+ describe('#imageManagerDeployLocalCertificate - errors', () => {
2372
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2373
+ try {
2374
+ a.imageManagerDeployLocalCertificate(imageManagerImageManagerDeployLocalCertificateBodyParam, (data, error) => {
2375
+ try {
2376
+ if (stub) {
2377
+ const displayE = 'Error 400 received on request';
2378
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
2379
+ } else {
2380
+ runCommonAsserts(data, error);
2381
+ }
2382
+ saveMockData('ImageManager', 'imageManagerDeployLocalCertificate', 'default', data);
2383
+ done();
2384
+ } catch (err) {
2385
+ log.error(`Test Failure: ${err}`);
2386
+ done(err);
2387
+ }
2388
+ });
2389
+ } catch (error) {
2390
+ log.error(`Adapter Exception: ${error}`);
2391
+ done(error);
2392
+ }
2393
+ }).timeout(attemptTimeout);
2394
+ });
2395
+
2396
+ const imageManagerImageManagerEnableDefaultCAProfileBodyParam = {
2397
+ ca_group_name: 'string',
2398
+ device_uuids: [
2399
+ 'string'
2400
+ ]
2401
+ };
2402
+ describe('#imageManagerEnableDefaultCAProfile - errors', () => {
2403
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2404
+ try {
2405
+ a.imageManagerEnableDefaultCAProfile(imageManagerImageManagerEnableDefaultCAProfileBodyParam, (data, error) => {
2406
+ try {
2407
+ if (stub) {
2408
+ const displayE = 'Error 400 received on request';
2409
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
2410
+ } else {
2411
+ runCommonAsserts(data, error);
2412
+ }
2413
+ saveMockData('ImageManager', 'imageManagerEnableDefaultCAProfile', 'default', data);
2414
+ done();
2415
+ } catch (err) {
2416
+ log.error(`Test Failure: ${err}`);
2417
+ done(err);
2418
+ }
2419
+ });
2420
+ } catch (error) {
2421
+ log.error(`Adapter Exception: ${error}`);
2422
+ done(error);
2423
+ }
2424
+ }).timeout(attemptTimeout);
2425
+ });
2426
+
2427
+ const imageManagerImageManagerStageImageBodyParam = {
2428
+ device: [
2429
+ {
2430
+ image_uuid: 'string',
2431
+ device_uuid: 'string',
2432
+ device_component_name: 'string'
2433
+ }
2434
+ ],
2435
+ next_run_time: 'string'
2436
+ };
2437
+ describe('#imageManagerStageImage - errors', () => {
2438
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2439
+ try {
2440
+ a.imageManagerStageImage(imageManagerImageManagerStageImageBodyParam, (data, error) => {
2441
+ try {
2442
+ if (stub) {
2443
+ const displayE = 'Error 400 received on request';
2444
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
2445
+ } else {
2446
+ runCommonAsserts(data, error);
2447
+ }
2448
+ saveMockData('ImageManager', 'imageManagerStageImage', 'default', data);
2449
+ done();
2450
+ } catch (err) {
2451
+ log.error(`Test Failure: ${err}`);
2452
+ done(err);
2453
+ }
2454
+ });
2455
+ } catch (error) {
2456
+ log.error(`Adapter Exception: ${error}`);
2457
+ done(error);
2458
+ }
2459
+ }).timeout(attemptTimeout);
2460
+ });
2461
+
2462
+ const imageManagerImageManagerUploadImageURLBodyParam = {
2463
+ url: 'string'
2464
+ };
2465
+ describe('#imageManagerUploadImageURL - errors', () => {
2466
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2467
+ try {
2468
+ a.imageManagerUploadImageURL(imageManagerImageManagerUploadImageURLBodyParam, (data, error) => {
2469
+ try {
2470
+ if (stub) {
2471
+ const displayE = 'Error 400 received on request';
2472
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
2473
+ } else {
2474
+ runCommonAsserts(data, error);
2475
+ }
2476
+ saveMockData('ImageManager', 'imageManagerUploadImageURL', 'default', data);
2477
+ done();
2478
+ } catch (err) {
2479
+ log.error(`Test Failure: ${err}`);
2480
+ done(err);
2481
+ }
2482
+ });
2483
+ } catch (error) {
2484
+ log.error(`Adapter Exception: ${error}`);
2485
+ done(error);
2486
+ }
2487
+ }).timeout(attemptTimeout);
2488
+ });
2489
+
2490
+ describe('#dpmServiceDeleteCaCertificateBlob - errors', () => {
2491
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2492
+ try {
2493
+ a.dpmServiceDeleteCaCertificateBlob(dpmServiceID, (data, error) => {
2494
+ try {
2495
+ if (stub) {
2496
+ const displayE = 'Error 400 received on request';
2497
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
2498
+ } else {
2499
+ runCommonAsserts(data, error);
2500
+ }
2501
+ saveMockData('DpmService', 'dpmServiceDeleteCaCertificateBlob', 'default', data);
2502
+ done();
2503
+ } catch (err) {
2504
+ log.error(`Test Failure: ${err}`);
2505
+ done(err);
2506
+ }
2507
+ });
2508
+ } catch (error) {
2509
+ log.error(`Adapter Exception: ${error}`);
2510
+ done(error);
2511
+ }
2512
+ }).timeout(attemptTimeout);
2513
+ });
2514
+
2515
+ describe('#dpmServiceDeleteCertificateBlob - errors', () => {
2516
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2517
+ try {
2518
+ a.dpmServiceDeleteCertificateBlob(dpmServiceID, (data, error) => {
2519
+ try {
2520
+ if (stub) {
2521
+ const displayE = 'Error 400 received on request';
2522
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
2523
+ } else {
2524
+ runCommonAsserts(data, error);
2525
+ }
2526
+ saveMockData('DpmService', 'dpmServiceDeleteCertificateBlob', 'default', data);
2527
+ done();
2528
+ } catch (err) {
2529
+ log.error(`Test Failure: ${err}`);
2530
+ done(err);
2531
+ }
2532
+ });
2533
+ } catch (error) {
2534
+ log.error(`Adapter Exception: ${error}`);
2535
+ done(error);
2536
+ }
2537
+ }).timeout(attemptTimeout);
2538
+ });
2539
+
2540
+ describe('#dpmServiceDeleteDeletedResource - errors', () => {
2541
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2542
+ try {
2543
+ a.dpmServiceDeleteDeletedResource(dpmServiceID, (data, error) => {
2544
+ try {
2545
+ if (stub) {
2546
+ const displayE = 'Error 400 received on request';
2547
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
2548
+ } else {
2549
+ runCommonAsserts(data, error);
2550
+ }
2551
+ saveMockData('DpmService', 'dpmServiceDeleteDeletedResource', 'default', data);
2552
+ done();
2553
+ } catch (err) {
2554
+ log.error(`Test Failure: ${err}`);
2555
+ done(err);
2556
+ }
2557
+ });
2558
+ } catch (error) {
2559
+ log.error(`Adapter Exception: ${error}`);
2560
+ done(error);
2561
+ }
2562
+ }).timeout(attemptTimeout);
2563
+ });
2564
+
2565
+ describe('#dpmServiceDeleteImage - errors', () => {
2566
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2567
+ try {
2568
+ a.dpmServiceDeleteImage(dpmServiceID, (data, error) => {
2569
+ try {
2570
+ if (stub) {
2571
+ const displayE = 'Error 400 received on request';
2572
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
2573
+ } else {
2574
+ runCommonAsserts(data, error);
2575
+ }
2576
+ saveMockData('DpmService', 'dpmServiceDeleteImage', 'default', data);
2577
+ done();
2578
+ } catch (err) {
2579
+ log.error(`Test Failure: ${err}`);
2580
+ done(err);
2581
+ }
2582
+ });
2583
+ } catch (error) {
2584
+ log.error(`Adapter Exception: ${error}`);
2585
+ done(error);
2586
+ }
2587
+ }).timeout(attemptTimeout);
2588
+ });
2589
+
2590
+ describe('#dpmServiceDeleteLastPublishedNotification - errors', () => {
2591
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2592
+ try {
2593
+ a.dpmServiceDeleteLastPublishedNotification(dpmServiceID, (data, error) => {
2594
+ try {
2595
+ if (stub) {
2596
+ const displayE = 'Error 400 received on request';
2597
+ runErrorAsserts(data, error, 'AD.500', 'Test-paragon_dpm-connectorRest-handleEndResponse', displayE);
2598
+ } else {
2599
+ runCommonAsserts(data, error);
2600
+ }
2601
+ saveMockData('DpmService', 'dpmServiceDeleteLastPublishedNotification', 'default', data);
2602
+ done();
2603
+ } catch (err) {
2604
+ log.error(`Test Failure: ${err}`);
2605
+ done(err);
2606
+ }
2607
+ });
2608
+ } catch (error) {
2609
+ log.error(`Adapter Exception: ${error}`);
2610
+ done(error);
2611
+ }
2612
+ }).timeout(attemptTimeout);
2613
+ });
2614
+ });
2615
+ });