@itentialopensource/adapter-aws_cloudformation 0.1.4 → 0.2.3

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 (84) hide show
  1. package/AUTH.md +53 -0
  2. package/BROKER.md +199 -0
  3. package/CALLS.md +620 -0
  4. package/CHANGELOG.md +6 -22
  5. package/CODE_OF_CONDUCT.md +12 -17
  6. package/CONTRIBUTING.md +3 -148
  7. package/ENHANCE.md +69 -0
  8. package/PROPERTIES.md +641 -0
  9. package/README.md +239 -507
  10. package/SUMMARY.md +9 -0
  11. package/TROUBLESHOOT.md +47 -0
  12. package/adapter.js +4031 -1143
  13. package/adapterBase.js +843 -397
  14. package/changelogs/CHANGELOG.md +48 -0
  15. package/entities/.generic/action.json +110 -5
  16. package/entities/.generic/schema.json +6 -1
  17. package/entities/.system/action.json +1 -1
  18. package/entities/Account/action.json +42 -0
  19. package/entities/Account/mockdatafiles/describePublisher-default.xml +6 -0
  20. package/entities/Account/mockdatafiles/registerPublisher-default.xml +6 -0
  21. package/entities/Account/schema.json +3 -1
  22. package/entities/ChangeSet/action.json +21 -0
  23. package/entities/ChangeSet/mockdatafiles/describeChangeSetHooks-default.xml +6 -0
  24. package/entities/ChangeSet/schema.json +2 -1
  25. package/entities/Organization/action.json +67 -0
  26. package/entities/Organization/mockdatafiles/activateOrganizationsAccess-default.xml +6 -0
  27. package/entities/Organization/mockdatafiles/deactivateOrganizationsAccess-default.xml +6 -0
  28. package/entities/Organization/mockdatafiles/describeOrganizationsAccess-default.xml +8 -0
  29. package/entities/Organization/schema.json +21 -0
  30. package/entities/Resource/action.json +21 -0
  31. package/entities/Resource/mockdatafiles/recordHandlerProgress-default.xml +6 -0
  32. package/entities/Resource/schema.json +2 -1
  33. package/entities/Stack/action.json +42 -0
  34. package/entities/Stack/mockdatafiles/importStacksToStackSet-default.xml +6 -0
  35. package/entities/Stack/mockdatafiles/rollbackStack-default.xml +6 -0
  36. package/entities/Stack/schema.json +3 -1
  37. package/entities/Type/action.json +126 -0
  38. package/entities/Type/mockdatafiles/activateType-default.xml +6 -0
  39. package/entities/Type/mockdatafiles/batchDescribeTypeConfigurations-default.xml +6 -0
  40. package/entities/Type/mockdatafiles/deactivateType-default.xml +6 -0
  41. package/entities/Type/mockdatafiles/publishType-default.xml +6 -0
  42. package/entities/Type/mockdatafiles/setTypeConfiguration-default.xml +6 -0
  43. package/entities/Type/mockdatafiles/testType-default.xml +6 -0
  44. package/entities/Type/schema.json +7 -1
  45. package/error.json +12 -0
  46. package/metadata.json +44 -0
  47. package/package.json +28 -23
  48. package/pronghorn.json +8808 -1451
  49. package/propertiesDecorators.json +14 -0
  50. package/propertiesSchema.json +844 -8
  51. package/refs?service=git-upload-pack +0 -0
  52. package/report/adapter-openapi.json +25034 -0
  53. package/report/adapter-openapi.yaml +22498 -0
  54. package/report/adapterInfo.json +10 -0
  55. package/report/updateReport1691507502657.json +120 -0
  56. package/report/updateReport1692202523445.json +120 -0
  57. package/report/updateReport1694461395239.json +120 -0
  58. package/report/updateReport1698420779793.json +120 -0
  59. package/sampleProperties.json +158 -6
  60. package/storage/metrics.json +1141 -0
  61. package/test/integration/adapterTestBasicGet.js +4 -6
  62. package/test/integration/adapterTestConnectivity.js +91 -42
  63. package/test/integration/adapterTestIntegration.js +541 -108
  64. package/test/unit/adapterBaseTestUnit.js +393 -310
  65. package/test/unit/adapterTestUnit.js +1272 -222
  66. package/utils/adapterInfo.js +206 -0
  67. package/utils/addAuth.js +94 -0
  68. package/utils/artifactize.js +1 -1
  69. package/utils/basicGet.js +1 -14
  70. package/utils/checkMigrate.js +1 -1
  71. package/utils/entitiesToDB.js +179 -0
  72. package/utils/findPath.js +1 -1
  73. package/utils/methodDocumentor.js +273 -0
  74. package/utils/modify.js +14 -16
  75. package/utils/packModificationScript.js +2 -2
  76. package/utils/patches2bundledDeps.js +90 -0
  77. package/utils/pre-commit.sh +5 -0
  78. package/utils/removeHooks.js +20 -0
  79. package/utils/taskMover.js +309 -0
  80. package/utils/tbScript.js +129 -53
  81. package/utils/tbUtils.js +152 -35
  82. package/utils/testRunner.js +17 -17
  83. package/utils/troubleshootingAdapter.js +10 -31
  84. package/workflows/README.md +0 -3
@@ -3,12 +3,15 @@
3
3
  // Set globals
4
4
  /* global describe it log pronghornProps */
5
5
  /* eslint no-unused-vars: warn */
6
+ /* eslint no-underscore-dangle: warn */
7
+ /* eslint import/no-dynamic-require:warn */
6
8
 
7
9
  // include required items for testing & logging
8
10
  const assert = require('assert');
9
11
  const fs = require('fs');
10
- const mocha = require('mocha');
11
12
  const path = require('path');
13
+ const util = require('util');
14
+ const mocha = require('mocha');
12
15
  const winston = require('winston');
13
16
  const { expect } = require('chai');
14
17
  const { use } = require('chai');
@@ -18,20 +21,33 @@ const anything = td.matchers.anything();
18
21
 
19
22
  // stub and attemptTimeout are used throughout the code so set them here
20
23
  let logLevel = 'none';
21
- const stub = true;
22
24
  const isRapidFail = false;
23
25
  const isSaveMockData = false;
24
- const attemptTimeout = 5000;
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;
25
35
 
26
36
  // these variables can be changed to run in integrated mode so easier to set them here
27
37
  // always check these in with bogus data!!!
28
- const host = 'replace.hostorip.here';
29
- const username = 'username';
30
- const password = 'password';
31
- const protocol = 'http';
32
- const port = 80;
33
- const sslenable = false;
34
- const sslinvalid = false;
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;
35
51
 
36
52
  // these are the adapter properties. You generally should not need to alter
37
53
  // any of these after they are initially set up
@@ -41,104 +57,9 @@ global.pronghornProps = {
41
57
  },
42
58
  adapterProps: {
43
59
  adapters: [{
44
- id: 'Test-awscloudFormation',
60
+ id: 'Test-aws_cloudformation',
45
61
  type: 'AwsCloudFormation',
46
- properties: {
47
- host,
48
- region: 'us-east-1',
49
- port,
50
- base_path: '/api',
51
- version: 'v2016-11-15',
52
- cache_location: 'none',
53
- encode_pathvars: true,
54
- save_metric: false,
55
- stub,
56
- protocol,
57
- authentication: {
58
- auth_method: 'no_authentication',
59
- username,
60
- password,
61
- token: '',
62
- invalid_token_error: 401,
63
- token_timeout: -1,
64
- token_cache: 'local',
65
- auth_field: 'header.headers.Authorization',
66
- auth_field_format: 'Basic {b64}{username}:{password}{/b64}',
67
- auth_logging: false,
68
- access_key: 'access',
69
- secret_key: 'secret'
70
- },
71
- healthcheck: {
72
- type: 'none',
73
- frequency: 60000,
74
- query_object: {}
75
- },
76
- throttle: {
77
- throttle_enabled: false,
78
- number_pronghorns: 1,
79
- sync_async: 'sync',
80
- max_in_queue: 1000,
81
- concurrent_max: 1,
82
- expire_timeout: 0,
83
- avg_runtime: 200,
84
- priorities: [
85
- {
86
- value: 0,
87
- percent: 100
88
- }
89
- ]
90
- },
91
- request: {
92
- number_redirects: 0,
93
- number_retries: 3,
94
- limit_retry_error: 0,
95
- failover_codes: [],
96
- attempt_timeout: attemptTimeout,
97
- global_request: {
98
- payload: {},
99
- uriOptions: {},
100
- addlHeaders: {},
101
- authData: {}
102
- },
103
- healthcheck_on_timeout: true,
104
- return_raw: true,
105
- archiving: false,
106
- return_request: false
107
- },
108
- proxy: {
109
- enabled: false,
110
- host: '',
111
- port: 1,
112
- protocol: 'http',
113
- username: '',
114
- password: ''
115
- },
116
- ssl: {
117
- ecdhCurve: '',
118
- enabled: sslenable,
119
- accept_invalid_cert: sslinvalid,
120
- ca_file: '',
121
- key_file: '',
122
- cert_file: '',
123
- secure_protocol: '',
124
- ciphers: ''
125
- },
126
- mongo: {
127
- host: '',
128
- port: 0,
129
- database: '',
130
- username: '',
131
- password: '',
132
- replSet: '',
133
- db_ssl: {
134
- enabled: sslenable,
135
- accept_invalid_cert: false,
136
- ca_file: '',
137
- key_file: '',
138
- cert_file: ''
139
- }
140
- }
141
- }
62
+ properties: samProps
142
63
  }]
143
64
  }
144
65
  };
@@ -313,7 +234,7 @@ function saveMockData(entityName, actionName, descriptor, responseData) {
313
234
  }
314
235
 
315
236
  // require the adapter that we are going to be using
316
- const AwsCloudFormation = require('../../adapter.js');
237
+ const AwsCloudFormation = require('../../adapter');
317
238
 
318
239
  // begin the testing - these should be pretty well defined between the describe and the it!
319
240
  describe('[integration] AwsCloudFormation Adapter Test', () => {
@@ -344,6 +265,8 @@ describe('[integration] AwsCloudFormation Adapter Test', () => {
344
265
  try {
345
266
  assert.notEqual(null, a);
346
267
  assert.notEqual(undefined, a);
268
+ const checkId = global.pronghornProps.adapterProps.adapters[0].id;
269
+ assert.equal(checkId, a.id);
347
270
  assert.notEqual(null, a.allProps);
348
271
  const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
349
272
  assert.equal(check, a.healthcheckType);
@@ -412,6 +335,134 @@ describe('[integration] AwsCloudFormation Adapter Test', () => {
412
335
  }).timeout(attemptTimeout);
413
336
  });
414
337
 
338
+ // broker tests
339
+ describe('#getDevicesFiltered - errors', () => {
340
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
341
+ try {
342
+ const opts = {
343
+ filter: {
344
+ name: 'deviceName'
345
+ }
346
+ };
347
+ a.getDevicesFiltered(opts, (data, error) => {
348
+ try {
349
+ if (stub) {
350
+ if (samProps.devicebroker.getDevicesFiltered[0].handleFailure === 'ignore') {
351
+ assert.equal(null, error);
352
+ assert.notEqual(undefined, data);
353
+ assert.notEqual(null, data);
354
+ assert.equal(0, data.total);
355
+ assert.equal(0, data.list.length);
356
+ } else {
357
+ const displayE = 'Error 400 received on request';
358
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_cloudformation-connectorRest-handleEndResponse', displayE);
359
+ }
360
+ } else {
361
+ runCommonAsserts(data, error);
362
+ }
363
+ done();
364
+ } catch (err) {
365
+ log.error(`Test Failure: ${err}`);
366
+ done(err);
367
+ }
368
+ });
369
+ } catch (error) {
370
+ log.error(`Adapter Exception: ${error}`);
371
+ done(error);
372
+ }
373
+ }).timeout(attemptTimeout);
374
+ });
375
+
376
+ describe('#iapGetDeviceCount - errors', () => {
377
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
378
+ try {
379
+ const opts = {
380
+ filter: {
381
+ name: 'deviceName'
382
+ }
383
+ };
384
+ a.iapGetDeviceCount((data, error) => {
385
+ try {
386
+ if (stub) {
387
+ if (samProps.devicebroker.getDevicesFiltered[0].handleFailure === 'ignore') {
388
+ assert.equal(null, error);
389
+ assert.notEqual(undefined, data);
390
+ assert.notEqual(null, data);
391
+ assert.equal(0, data.count);
392
+ } else {
393
+ const displayE = 'Error 400 received on request';
394
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_cloudformation-connectorRest-handleEndResponse', displayE);
395
+ }
396
+ } else {
397
+ runCommonAsserts(data, error);
398
+ }
399
+ done();
400
+ } catch (err) {
401
+ log.error(`Test Failure: ${err}`);
402
+ done(err);
403
+ }
404
+ });
405
+ } catch (error) {
406
+ log.error(`Adapter Exception: ${error}`);
407
+ done(error);
408
+ }
409
+ }).timeout(attemptTimeout);
410
+ });
411
+
412
+ // exposed cache tests
413
+ describe('#iapPopulateEntityCache - errors', () => {
414
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
415
+ try {
416
+ a.iapPopulateEntityCache('Device', (data, error) => {
417
+ try {
418
+ if (stub) {
419
+ assert.equal(null, data);
420
+ assert.notEqual(undefined, error);
421
+ assert.notEqual(null, error);
422
+ done();
423
+ } else {
424
+ assert.equal(undefined, error);
425
+ assert.equal('success', data[0]);
426
+ done();
427
+ }
428
+ } catch (err) {
429
+ log.error(`Test Failure: ${err}`);
430
+ done(err);
431
+ }
432
+ });
433
+ } catch (error) {
434
+ log.error(`Adapter Exception: ${error}`);
435
+ done(error);
436
+ }
437
+ }).timeout(attemptTimeout);
438
+ });
439
+
440
+ describe('#iapRetrieveEntitiesCache - errors', () => {
441
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
442
+ try {
443
+ a.iapRetrieveEntitiesCache('Device', {}, (data, error) => {
444
+ try {
445
+ if (stub) {
446
+ assert.equal(null, data);
447
+ assert.notEqual(null, error);
448
+ assert.notEqual(undefined, error);
449
+ } else {
450
+ assert.equal(undefined, error);
451
+ assert.notEqual(null, data);
452
+ assert.notEqual(undefined, data);
453
+ }
454
+ done();
455
+ } catch (err) {
456
+ log.error(`Test Failure: ${err}`);
457
+ done(err);
458
+ }
459
+ });
460
+ } catch (error) {
461
+ log.error(`Adapter Exception: ${error}`);
462
+ done(error);
463
+ }
464
+ }).timeout(attemptTimeout);
465
+ });
415
466
  /*
416
467
  -----------------------------------------------------------------------
417
468
  -----------------------------------------------------------------------
@@ -2136,5 +2187,387 @@ describe('[integration] AwsCloudFormation Adapter Test', () => {
2136
2187
  }
2137
2188
  }).timeout(attemptTimeout);
2138
2189
  });
2190
+
2191
+ describe('#activateOrganizationsAccess', () => {
2192
+ it('should work if integrated or standalone with mockdata', (done) => {
2193
+ try {
2194
+ a.activateOrganizationsAccess((data, error) => {
2195
+ try {
2196
+ runCommonAsserts(data, error);
2197
+ if (stub) {
2198
+ assert.equal('success', data.response);
2199
+ } else {
2200
+ assert.equal('success', data.response);
2201
+ }
2202
+ saveMockData('Organization', 'activateOrganizationsAccess', 'default', data);
2203
+ done();
2204
+ } catch (err) {
2205
+ log.error(`Test Failure: ${err}`);
2206
+ done(err);
2207
+ }
2208
+ });
2209
+ } catch (error) {
2210
+ log.error(`Adapter Exception: ${error}`);
2211
+ done(error);
2212
+ }
2213
+ }).timeout(attemptTimeout);
2214
+ });
2215
+
2216
+ describe('#activateType', () => {
2217
+ it('should work if integrated or standalone with mockdata', (done) => {
2218
+ try {
2219
+ a.activateType(null, null, null, null, null, null, null, null, null, null, (data, error) => {
2220
+ try {
2221
+ runCommonAsserts(data, error);
2222
+ if (stub) {
2223
+ assert.equal('success', data.response);
2224
+ } else {
2225
+ assert.equal('success', data.response);
2226
+ }
2227
+ saveMockData('Type', 'activateType', 'default', data);
2228
+ done();
2229
+ } catch (err) {
2230
+ log.error(`Test Failure: ${err}`);
2231
+ done(err);
2232
+ }
2233
+ });
2234
+ } catch (error) {
2235
+ log.error(`Adapter Exception: ${error}`);
2236
+ done(error);
2237
+ }
2238
+ }).timeout(attemptTimeout);
2239
+ });
2240
+
2241
+ const typeConfigurationIdentifiers = [{ fakedata: 'fakedata' }];
2242
+ describe('#batchDescribeTypeConfigurations', () => {
2243
+ it('should work if integrated or standalone with mockdata', (done) => {
2244
+ try {
2245
+ a.batchDescribeTypeConfigurations(typeConfigurationIdentifiers, (data, error) => {
2246
+ try {
2247
+ runCommonAsserts(data, error);
2248
+ if (stub) {
2249
+ assert.equal('success', data.response);
2250
+ } else {
2251
+ assert.equal('success', data.response);
2252
+ }
2253
+ saveMockData('Type', 'batchDescribeTypeConfigurations', 'default', data);
2254
+ done();
2255
+ } catch (err) {
2256
+ log.error(`Test Failure: ${err}`);
2257
+ done(err);
2258
+ }
2259
+ });
2260
+ } catch (error) {
2261
+ log.error(`Adapter Exception: ${error}`);
2262
+ done(error);
2263
+ }
2264
+ }).timeout(attemptTimeout);
2265
+ });
2266
+
2267
+ describe('#deactivateOrganizationsAccess', () => {
2268
+ it('should work if integrated or standalone with mockdata', (done) => {
2269
+ try {
2270
+ a.deactivateOrganizationsAccess((data, error) => {
2271
+ try {
2272
+ runCommonAsserts(data, error);
2273
+ if (stub) {
2274
+ assert.equal('success', data.response);
2275
+ } else {
2276
+ assert.equal('success', data.response);
2277
+ }
2278
+ saveMockData('Organization', 'deactivateOrganizationsAccess', 'default', data);
2279
+ done();
2280
+ } catch (err) {
2281
+ log.error(`Test Failure: ${err}`);
2282
+ done(err);
2283
+ }
2284
+ });
2285
+ } catch (error) {
2286
+ log.error(`Adapter Exception: ${error}`);
2287
+ done(error);
2288
+ }
2289
+ }).timeout(attemptTimeout);
2290
+ });
2291
+
2292
+ describe('#deactivateType', () => {
2293
+ it('should work if integrated or standalone with mockdata', (done) => {
2294
+ try {
2295
+ a.deactivateType(null, null, null, (data, error) => {
2296
+ try {
2297
+ runCommonAsserts(data, error);
2298
+ if (stub) {
2299
+ assert.equal('success', data.response);
2300
+ } else {
2301
+ assert.equal('success', data.response);
2302
+ }
2303
+ saveMockData('Type', 'deactivateType', 'default', data);
2304
+ done();
2305
+ } catch (err) {
2306
+ log.error(`Test Failure: ${err}`);
2307
+ done(err);
2308
+ }
2309
+ });
2310
+ } catch (error) {
2311
+ log.error(`Adapter Exception: ${error}`);
2312
+ done(error);
2313
+ }
2314
+ }).timeout(attemptTimeout);
2315
+ });
2316
+
2317
+ const changeSetName = 'fakedata';
2318
+ describe('#describeChangeSetHooks', () => {
2319
+ it('should work if integrated or standalone with mockdata', (done) => {
2320
+ try {
2321
+ a.describeChangeSetHooks(changeSetName, null, null, null, (data, error) => {
2322
+ try {
2323
+ runCommonAsserts(data, error);
2324
+ if (stub) {
2325
+ assert.equal('success', data.response);
2326
+ } else {
2327
+ assert.equal('success', data.response);
2328
+ }
2329
+ saveMockData('ChangeSet', 'describeChangeSetHooks', 'default', data);
2330
+ done();
2331
+ } catch (err) {
2332
+ log.error(`Test Failure: ${err}`);
2333
+ done(err);
2334
+ }
2335
+ });
2336
+ } catch (error) {
2337
+ log.error(`Adapter Exception: ${error}`);
2338
+ done(error);
2339
+ }
2340
+ }).timeout(attemptTimeout);
2341
+ });
2342
+
2343
+ describe('#describeOrganizationsAccess', () => {
2344
+ it('should work if integrated or standalone with mockdata', (done) => {
2345
+ try {
2346
+ a.describeOrganizationsAccess(null, (data, error) => {
2347
+ try {
2348
+ runCommonAsserts(data, error);
2349
+ if (stub) {
2350
+ assert.equal('success', data.response);
2351
+ } else {
2352
+ assert.equal('success', data.response);
2353
+ }
2354
+ saveMockData('Organization', 'describeOrganizationsAccess', 'default', data);
2355
+ done();
2356
+ } catch (err) {
2357
+ log.error(`Test Failure: ${err}`);
2358
+ done(err);
2359
+ }
2360
+ });
2361
+ } catch (error) {
2362
+ log.error(`Adapter Exception: ${error}`);
2363
+ done(error);
2364
+ }
2365
+ }).timeout(attemptTimeout);
2366
+ });
2367
+
2368
+ describe('#describePublisher', () => {
2369
+ it('should work if integrated or standalone with mockdata', (done) => {
2370
+ try {
2371
+ a.describePublisher(null, (data, error) => {
2372
+ try {
2373
+ runCommonAsserts(data, error);
2374
+ if (stub) {
2375
+ assert.equal('success', data.response);
2376
+ } else {
2377
+ assert.equal('success', data.response);
2378
+ }
2379
+ saveMockData('Account', 'describePublisher', 'default', data);
2380
+ done();
2381
+ } catch (err) {
2382
+ log.error(`Test Failure: ${err}`);
2383
+ done(err);
2384
+ }
2385
+ });
2386
+ } catch (error) {
2387
+ log.error(`Adapter Exception: ${error}`);
2388
+ done(error);
2389
+ }
2390
+ }).timeout(attemptTimeout);
2391
+ });
2392
+
2393
+ const stackSetName = 'fakedata';
2394
+ describe('#importStacksToStackSet', () => {
2395
+ it('should work if integrated or standalone with mockdata', (done) => {
2396
+ try {
2397
+ a.importStacksToStackSet(null, null, null, null, null, null, stackSetName, (data, error) => {
2398
+ try {
2399
+ runCommonAsserts(data, error);
2400
+ if (stub) {
2401
+ assert.equal('success', data.response);
2402
+ } else {
2403
+ assert.equal('success', data.response);
2404
+ }
2405
+ saveMockData('Stack', 'importStacksToStackSet', 'default', data);
2406
+ done();
2407
+ } catch (err) {
2408
+ log.error(`Test Failure: ${err}`);
2409
+ done(err);
2410
+ }
2411
+ });
2412
+ } catch (error) {
2413
+ log.error(`Adapter Exception: ${error}`);
2414
+ done(error);
2415
+ }
2416
+ }).timeout(attemptTimeout);
2417
+ });
2418
+
2419
+ describe('#publishType', () => {
2420
+ it('should work if integrated or standalone with mockdata', (done) => {
2421
+ try {
2422
+ a.publishType(null, null, null, null, (data, error) => {
2423
+ try {
2424
+ runCommonAsserts(data, error);
2425
+ if (stub) {
2426
+ assert.equal('success', data.response);
2427
+ } else {
2428
+ assert.equal('success', data.response);
2429
+ }
2430
+ saveMockData('Type', 'publishType', 'default', data);
2431
+ done();
2432
+ } catch (err) {
2433
+ log.error(`Test Failure: ${err}`);
2434
+ done(err);
2435
+ }
2436
+ });
2437
+ } catch (error) {
2438
+ log.error(`Adapter Exception: ${error}`);
2439
+ done(error);
2440
+ }
2441
+ }).timeout(attemptTimeout);
2442
+ });
2443
+
2444
+ const bearerToken = 'fakedata';
2445
+ const operationStatus = 'fakedata';
2446
+ describe('#recordHandlerProgress', () => {
2447
+ it('should work if integrated or standalone with mockdata', (done) => {
2448
+ try {
2449
+ a.recordHandlerProgress(bearerToken, null, null, null, operationStatus, null, null, (data, error) => {
2450
+ try {
2451
+ runCommonAsserts(data, error);
2452
+ if (stub) {
2453
+ assert.equal('success', data.response);
2454
+ } else {
2455
+ assert.equal('success', data.response);
2456
+ }
2457
+ saveMockData('Resource', 'recordHandlerProgress', 'default', data);
2458
+ done();
2459
+ } catch (err) {
2460
+ log.error(`Test Failure: ${err}`);
2461
+ done(err);
2462
+ }
2463
+ });
2464
+ } catch (error) {
2465
+ log.error(`Adapter Exception: ${error}`);
2466
+ done(error);
2467
+ }
2468
+ }).timeout(attemptTimeout);
2469
+ });
2470
+
2471
+ describe('#registerPublisher', () => {
2472
+ it('should work if integrated or standalone with mockdata', (done) => {
2473
+ try {
2474
+ a.registerPublisher(null, null, (data, error) => {
2475
+ try {
2476
+ runCommonAsserts(data, error);
2477
+ if (stub) {
2478
+ assert.equal('success', data.response);
2479
+ } else {
2480
+ assert.equal('success', data.response);
2481
+ }
2482
+ saveMockData('Account', 'registerPublisher', 'default', data);
2483
+ done();
2484
+ } catch (err) {
2485
+ log.error(`Test Failure: ${err}`);
2486
+ done(err);
2487
+ }
2488
+ });
2489
+ } catch (error) {
2490
+ log.error(`Adapter Exception: ${error}`);
2491
+ done(error);
2492
+ }
2493
+ }).timeout(attemptTimeout);
2494
+ });
2495
+
2496
+ const stackName = 'fakedata';
2497
+ describe('#rollbackStack', () => {
2498
+ it('should work if integrated or standalone with mockdata', (done) => {
2499
+ try {
2500
+ a.rollbackStack(null, null, stackName, (data, error) => {
2501
+ try {
2502
+ runCommonAsserts(data, error);
2503
+ if (stub) {
2504
+ assert.equal('success', data.response);
2505
+ } else {
2506
+ assert.equal('success', data.response);
2507
+ }
2508
+ saveMockData('Stack', 'rollbackStack', 'default', data);
2509
+ done();
2510
+ } catch (err) {
2511
+ log.error(`Test Failure: ${err}`);
2512
+ done(err);
2513
+ }
2514
+ });
2515
+ } catch (error) {
2516
+ log.error(`Adapter Exception: ${error}`);
2517
+ done(error);
2518
+ }
2519
+ }).timeout(attemptTimeout);
2520
+ });
2521
+
2522
+ const configuration = 'fakedata';
2523
+ describe('#setTypeConfiguration', () => {
2524
+ it('should work if integrated or standalone with mockdata', (done) => {
2525
+ try {
2526
+ a.setTypeConfiguration(configuration, null, null, null, null, (data, error) => {
2527
+ try {
2528
+ runCommonAsserts(data, error);
2529
+ if (stub) {
2530
+ assert.equal('success', data.response);
2531
+ } else {
2532
+ assert.equal('success', data.response);
2533
+ }
2534
+ saveMockData('Type', 'setTypeConfiguration', 'default', data);
2535
+ done();
2536
+ } catch (err) {
2537
+ log.error(`Test Failure: ${err}`);
2538
+ done(err);
2539
+ }
2540
+ });
2541
+ } catch (error) {
2542
+ log.error(`Adapter Exception: ${error}`);
2543
+ done(error);
2544
+ }
2545
+ }).timeout(attemptTimeout);
2546
+ });
2547
+
2548
+ describe('#testType', () => {
2549
+ it('should work if integrated or standalone with mockdata', (done) => {
2550
+ try {
2551
+ a.testType(null, null, null, null, null, (data, error) => {
2552
+ try {
2553
+ runCommonAsserts(data, error);
2554
+ if (stub) {
2555
+ assert.equal('success', data.response);
2556
+ } else {
2557
+ assert.equal('success', data.response);
2558
+ }
2559
+ saveMockData('Type', 'testType', 'default', data);
2560
+ done();
2561
+ } catch (err) {
2562
+ log.error(`Test Failure: ${err}`);
2563
+ done(err);
2564
+ }
2565
+ });
2566
+ } catch (error) {
2567
+ log.error(`Adapter Exception: ${error}`);
2568
+ done(error);
2569
+ }
2570
+ }).timeout(attemptTimeout);
2571
+ });
2139
2572
  });
2140
2573
  });