@itentialopensource/adapter-aws_cloudformation 0.1.3 → 0.2.2

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 (87) hide show
  1. package/.eslintignore +1 -0
  2. package/AUTH.md +53 -0
  3. package/BROKER.md +199 -0
  4. package/CALLS.md +620 -0
  5. package/CHANGELOG.md +3 -18
  6. package/CODE_OF_CONDUCT.md +12 -17
  7. package/CONTRIBUTING.md +3 -148
  8. package/ENHANCE.md +69 -0
  9. package/PROPERTIES.md +641 -0
  10. package/README.md +240 -423
  11. package/SUMMARY.md +9 -0
  12. package/TROUBLESHOOT.md +47 -0
  13. package/adapter.js +4788 -1315
  14. package/adapterBase.js +979 -278
  15. package/changelogs/CHANGELOG.md +48 -0
  16. package/entities/.generic/action.json +214 -0
  17. package/entities/.generic/schema.json +28 -0
  18. package/entities/.system/action.json +1 -1
  19. package/entities/Account/action.json +42 -0
  20. package/entities/Account/mockdatafiles/describePublisher-default.xml +6 -0
  21. package/entities/Account/mockdatafiles/registerPublisher-default.xml +6 -0
  22. package/entities/Account/schema.json +3 -1
  23. package/entities/ChangeSet/action.json +21 -0
  24. package/entities/ChangeSet/mockdatafiles/describeChangeSetHooks-default.xml +6 -0
  25. package/entities/ChangeSet/schema.json +2 -1
  26. package/entities/Organization/action.json +67 -0
  27. package/entities/Organization/mockdatafiles/activateOrganizationsAccess-default.xml +6 -0
  28. package/entities/Organization/mockdatafiles/deactivateOrganizationsAccess-default.xml +6 -0
  29. package/entities/Organization/mockdatafiles/describeOrganizationsAccess-default.xml +8 -0
  30. package/entities/Organization/schema.json +21 -0
  31. package/entities/Resource/action.json +21 -0
  32. package/entities/Resource/mockdatafiles/recordHandlerProgress-default.xml +6 -0
  33. package/entities/Resource/schema.json +2 -1
  34. package/entities/Stack/action.json +42 -0
  35. package/entities/Stack/mockdatafiles/importStacksToStackSet-default.xml +6 -0
  36. package/entities/Stack/mockdatafiles/rollbackStack-default.xml +6 -0
  37. package/entities/Stack/schema.json +3 -1
  38. package/entities/Type/action.json +126 -0
  39. package/entities/Type/mockdatafiles/activateType-default.xml +6 -0
  40. package/entities/Type/mockdatafiles/batchDescribeTypeConfigurations-default.xml +6 -0
  41. package/entities/Type/mockdatafiles/deactivateType-default.xml +6 -0
  42. package/entities/Type/mockdatafiles/publishType-default.xml +6 -0
  43. package/entities/Type/mockdatafiles/setTypeConfiguration-default.xml +6 -0
  44. package/entities/Type/mockdatafiles/testType-default.xml +6 -0
  45. package/entities/Type/schema.json +7 -1
  46. package/error.json +12 -0
  47. package/metadata.json +44 -0
  48. package/package.json +41 -20
  49. package/pronghorn.json +8996 -1335
  50. package/propertiesDecorators.json +14 -0
  51. package/propertiesSchema.json +877 -9
  52. package/refs?service=git-upload-pack +0 -0
  53. package/report/adapter-openapi.json +25034 -0
  54. package/report/adapter-openapi.yaml +22498 -0
  55. package/report/adapterInfo.json +10 -0
  56. package/report/updateReport1614638977739.json +95 -0
  57. package/report/updateReport1691507502657.json +120 -0
  58. package/report/updateReport1692202523445.json +120 -0
  59. package/report/updateReport1694461395239.json +120 -0
  60. package/report/updateReport1698420779793.json +120 -0
  61. package/sampleProperties.json +166 -9
  62. package/storage/metrics.json +1141 -0
  63. package/test/integration/adapterTestBasicGet.js +83 -0
  64. package/test/integration/adapterTestConnectivity.js +142 -0
  65. package/test/integration/adapterTestIntegration.js +541 -103
  66. package/test/unit/adapterBaseTestUnit.js +1024 -0
  67. package/test/unit/adapterTestUnit.js +1273 -218
  68. package/utils/adapterInfo.js +206 -0
  69. package/utils/addAuth.js +94 -0
  70. package/utils/artifactize.js +1 -1
  71. package/utils/basicGet.js +50 -0
  72. package/utils/checkMigrate.js +63 -0
  73. package/utils/entitiesToDB.js +179 -0
  74. package/utils/findPath.js +74 -0
  75. package/utils/methodDocumentor.js +273 -0
  76. package/utils/modify.js +152 -0
  77. package/utils/packModificationScript.js +2 -2
  78. package/utils/patches2bundledDeps.js +90 -0
  79. package/utils/pre-commit.sh +5 -0
  80. package/utils/removeHooks.js +20 -0
  81. package/utils/taskMover.js +309 -0
  82. package/utils/tbScript.js +239 -0
  83. package/utils/tbUtils.js +489 -0
  84. package/utils/testRunner.js +17 -17
  85. package/utils/troubleshootingAdapter.js +193 -0
  86. package/img/adapter.jpg +0 -0
  87. package/workflows/README.md +0 -3
@@ -4,36 +4,48 @@
4
4
  /* global describe it log pronghornProps */
5
5
  /* eslint global-require: warn */
6
6
  /* eslint no-unused-vars: warn */
7
+ /* eslint import/no-dynamic-require:warn */
7
8
 
8
9
  // include required items for testing & logging
9
10
  const assert = require('assert');
10
- const fs = require('fs-extra');
11
- const mocha = require('mocha');
12
11
  const path = require('path');
13
12
  const util = require('util');
14
- const winston = require('winston');
15
13
  const execute = require('child_process').execSync;
14
+ const fs = require('fs-extra');
15
+ const mocha = require('mocha');
16
+ const winston = require('winston');
16
17
  const { expect } = require('chai');
17
18
  const { use } = require('chai');
18
19
  const td = require('testdouble');
20
+ const Ajv = require('ajv');
19
21
 
22
+ const ajv = new Ajv({ strictSchema: false, allErrors: true, allowUnionTypes: true });
20
23
  const anything = td.matchers.anything();
21
-
22
- // stub and attemptTimeout are used throughout the code so set them here
23
24
  let logLevel = 'none';
24
- const stub = true;
25
25
  const isRapidFail = false;
26
- const attemptTimeout = 120000;
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;
27
35
 
28
36
  // these variables can be changed to run in integrated mode so easier to set them here
29
37
  // always check these in with bogus data!!!
30
- const host = 'replace.hostorip.here';
31
- const username = 'username';
32
- const password = 'password';
33
- const protocol = 'http';
34
- const port = 80;
35
- const sslenable = false;
36
- 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
+ samProps.request.attempt_timeout = 1200000;
47
+ const attemptTimeout = samProps.request.attempt_timeout;
48
+ const { stub } = samProps;
37
49
 
38
50
  // these are the adapter properties. You generally should not need to alter
39
51
  // any of these after they are initially set up
@@ -43,99 +55,9 @@ global.pronghornProps = {
43
55
  },
44
56
  adapterProps: {
45
57
  adapters: [{
46
- id: 'Test-awscloudFormation',
47
- type: 'AwsCloudFormation',
48
- properties: {
49
- host,
50
- region: 'us-east-1',
51
- port,
52
- base_path: '/api',
53
- version: 'v2016-11-15',
54
- cache_location: 'none',
55
- encode_pathvars: true,
56
- save_metric: false,
57
- stub,
58
- protocol,
59
- authentication: {
60
- auth_method: 'no_authentication',
61
- username,
62
- password,
63
- access_key: 'access',
64
- secret_key: 'secret',
65
- token: '',
66
- invalid_token_error: 401,
67
- token_timeout: -1,
68
- token_cache: 'local',
69
- auth_field: 'header.headers.Authorization',
70
- auth_field_format: 'Basic {b64}{username}:{password}{/b64}'
71
- },
72
- healthcheck: {
73
- type: 'none',
74
- frequency: 60000
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
- },
107
- proxy: {
108
- enabled: false,
109
- host: '',
110
- port: 1,
111
- protocol: 'http'
112
- },
113
- ssl: {
114
- ecdhCurve: '',
115
- enabled: sslenable,
116
- accept_invalid_cert: sslinvalid,
117
- ca_file: '',
118
- key_file: '',
119
- cert_file: '',
120
- secure_protocol: '',
121
- ciphers: ''
122
- },
123
- mongo: {
124
- host: '',
125
- port: 0,
126
- database: '',
127
- username: '',
128
- password: '',
129
- replSet: '',
130
- db_ssl: {
131
- enabled: sslenable,
132
- accept_invalid_cert: false,
133
- ca_file: '',
134
- key_file: '',
135
- cert_file: ''
136
- }
137
- }
138
- }
58
+ id: 'Test-aws_cloudformation',
59
+ type: 'aws_cloudformation',
60
+ properties: samProps
139
61
  }]
140
62
  }
141
63
  };
@@ -196,7 +118,7 @@ function runErrorAsserts(data, error, code, origin, displayStr) {
196
118
  }
197
119
 
198
120
  // require the adapter that we are going to be using
199
- const AwsCloudFormation = require('../../adapter.js');
121
+ const AwsCloudFormation = require('../../adapter');
200
122
 
201
123
  // delete the .DS_Store directory in entities -- otherwise this will cause errors
202
124
  const dirPath = path.join(__dirname, '../../entities/.DS_Store');
@@ -238,6 +160,8 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
238
160
  try {
239
161
  assert.notEqual(null, a);
240
162
  assert.notEqual(undefined, a);
163
+ const checkId = global.pronghornProps.adapterProps.adapters[0].id;
164
+ assert.equal(checkId, a.id);
241
165
  assert.notEqual(null, a.allProps);
242
166
  const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
243
167
  assert.equal(check, a.healthcheckType);
@@ -264,10 +188,10 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
264
188
  });
265
189
 
266
190
  let wffunctions = [];
267
- describe('#getWorkflowFunctions', () => {
191
+ describe('#iapGetAdapterWorkflowFunctions', () => {
268
192
  it('should retrieve workflow functions', (done) => {
269
193
  try {
270
- wffunctions = a.getWorkflowFunctions();
194
+ wffunctions = a.iapGetAdapterWorkflowFunctions([]);
271
195
 
272
196
  try {
273
197
  assert.notEqual(0, wffunctions.length);
@@ -298,19 +222,24 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
298
222
  it('package.json should be validated', (done) => {
299
223
  try {
300
224
  const packageDotJson = require('../../package.json');
301
- const { PJV } = require('package-json-validator');
302
- const options = {
303
- warnings: true, // show warnings
304
- recommendations: true // show recommendations
225
+ // Define the JSON schema for package.json
226
+ const packageJsonSchema = {
227
+ type: 'object',
228
+ properties: {
229
+ name: { type: 'string' },
230
+ version: { type: 'string' }
231
+ // May need to add more properties as needed
232
+ },
233
+ required: ['name', 'version']
305
234
  };
306
- const results = PJV.validate(JSON.stringify(packageDotJson), 'npm', options);
235
+ const validate = ajv.compile(packageJsonSchema);
236
+ const isValid = validate(packageDotJson);
307
237
 
308
- if (results.valid === false) {
309
- log.error('The package.json contains the following errors: ');
310
- log.error(util.inspect(results));
311
- assert.equal(true, results.valid);
238
+ if (isValid === false) {
239
+ log.error('The package.json contains errors');
240
+ assert.equal(true, isValid);
312
241
  } else {
313
- assert.equal(true, results.valid);
242
+ assert.equal(true, isValid);
314
243
  }
315
244
 
316
245
  done();
@@ -319,13 +248,102 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
319
248
  done(error);
320
249
  }
321
250
  });
322
- it('package.json should be customized', (done) => {
251
+ it('package.json standard fields should be customized', (done) => {
323
252
  try {
324
253
  const packageDotJson = require('../../package.json');
325
254
  assert.notEqual(-1, packageDotJson.name.indexOf('aws_cloudformation'));
326
255
  assert.notEqual(undefined, packageDotJson.version);
327
256
  assert.notEqual(null, packageDotJson.version);
328
257
  assert.notEqual('', packageDotJson.version);
258
+ assert.notEqual(undefined, packageDotJson.description);
259
+ assert.notEqual(null, packageDotJson.description);
260
+ assert.notEqual('', packageDotJson.description);
261
+ assert.equal('adapter.js', packageDotJson.main);
262
+ assert.notEqual(undefined, packageDotJson.wizardVersion);
263
+ assert.notEqual(null, packageDotJson.wizardVersion);
264
+ assert.notEqual('', packageDotJson.wizardVersion);
265
+ assert.notEqual(undefined, packageDotJson.engineVersion);
266
+ assert.notEqual(null, packageDotJson.engineVersion);
267
+ assert.notEqual('', packageDotJson.engineVersion);
268
+ assert.equal('http', packageDotJson.adapterType);
269
+ done();
270
+ } catch (error) {
271
+ log.error(`Test Failure: ${error}`);
272
+ done(error);
273
+ }
274
+ });
275
+ it('package.json proper scripts should be provided', (done) => {
276
+ try {
277
+ const packageDotJson = require('../../package.json');
278
+ assert.notEqual(undefined, packageDotJson.scripts);
279
+ assert.notEqual(null, packageDotJson.scripts);
280
+ assert.notEqual('', packageDotJson.scripts);
281
+ assert.equal('node utils/setup.js', packageDotJson.scripts.preinstall);
282
+ assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js', packageDotJson.scripts.lint);
283
+ assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js --quiet', packageDotJson.scripts['lint:errors']);
284
+ assert.equal('mocha test/unit/adapterBaseTestUnit.js --LOG=error', packageDotJson.scripts['test:baseunit']);
285
+ assert.equal('mocha test/unit/adapterTestUnit.js --LOG=error', packageDotJson.scripts['test:unit']);
286
+ assert.equal('mocha test/integration/adapterTestIntegration.js --LOG=error', packageDotJson.scripts['test:integration']);
287
+ assert.equal('nyc --reporter html --reporter text mocha --reporter dot test/*', packageDotJson.scripts['test:cover']);
288
+ assert.equal('npm run test:baseunit && npm run test:unit && npm run test:integration', packageDotJson.scripts.test);
289
+ assert.equal('npm publish --registry=https://registry.npmjs.org --access=public', packageDotJson.scripts.deploy);
290
+ assert.equal('npm run deploy', packageDotJson.scripts.build);
291
+ done();
292
+ } catch (error) {
293
+ log.error(`Test Failure: ${error}`);
294
+ done(error);
295
+ }
296
+ });
297
+ it('package.json proper directories should be provided', (done) => {
298
+ try {
299
+ const packageDotJson = require('../../package.json');
300
+ assert.notEqual(undefined, packageDotJson.repository);
301
+ assert.notEqual(null, packageDotJson.repository);
302
+ assert.notEqual('', packageDotJson.repository);
303
+ assert.equal('git', packageDotJson.repository.type);
304
+ assert.equal('git@gitlab.com:itentialopensource/adapters/', packageDotJson.repository.url.substring(0, 43));
305
+ assert.equal('https://gitlab.com/itentialopensource/adapters/', packageDotJson.homepage.substring(0, 47));
306
+ done();
307
+ } catch (error) {
308
+ log.error(`Test Failure: ${error}`);
309
+ done(error);
310
+ }
311
+ });
312
+ it('package.json proper dependencies should be provided', (done) => {
313
+ try {
314
+ const packageDotJson = require('../../package.json');
315
+ assert.notEqual(undefined, packageDotJson.dependencies);
316
+ assert.notEqual(null, packageDotJson.dependencies);
317
+ assert.notEqual('', packageDotJson.dependencies);
318
+ assert.equal('^8.12.0', packageDotJson.dependencies.ajv);
319
+ assert.equal('^1.4.0', packageDotJson.dependencies.axios);
320
+ assert.equal('^11.0.0', packageDotJson.dependencies.commander);
321
+ assert.equal('^11.1.1', packageDotJson.dependencies['fs-extra']);
322
+ assert.equal('^10.2.0', packageDotJson.dependencies.mocha);
323
+ assert.equal('^2.0.1', packageDotJson.dependencies['mocha-param']);
324
+ assert.equal('^15.1.0', packageDotJson.dependencies.nyc);
325
+ assert.equal('^0.4.4', packageDotJson.dependencies.ping);
326
+ assert.equal('^1.4.10', packageDotJson.dependencies['readline-sync']);
327
+ assert.equal('^7.5.3', packageDotJson.dependencies.semver);
328
+ assert.equal('^3.9.0', packageDotJson.dependencies.winston);
329
+ done();
330
+ } catch (error) {
331
+ log.error(`Test Failure: ${error}`);
332
+ done(error);
333
+ }
334
+ });
335
+ it('package.json proper dev dependencies should be provided', (done) => {
336
+ try {
337
+ const packageDotJson = require('../../package.json');
338
+ assert.notEqual(undefined, packageDotJson.devDependencies);
339
+ assert.notEqual(null, packageDotJson.devDependencies);
340
+ assert.notEqual('', packageDotJson.devDependencies);
341
+ assert.equal('^4.3.7', packageDotJson.devDependencies.chai);
342
+ assert.equal('^8.44.0', packageDotJson.devDependencies.eslint);
343
+ assert.equal('^15.0.0', packageDotJson.devDependencies['eslint-config-airbnb-base']);
344
+ assert.equal('^2.27.5', packageDotJson.devDependencies['eslint-plugin-import']);
345
+ assert.equal('^3.1.0', packageDotJson.devDependencies['eslint-plugin-json']);
346
+ assert.equal('^3.18.0', packageDotJson.devDependencies.testdouble);
329
347
  done();
330
348
  } catch (error) {
331
349
  log.error(`Test Failure: ${error}`);
@@ -350,8 +368,49 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
350
368
  try {
351
369
  const pronghornDotJson = require('../../pronghorn.json');
352
370
  assert.notEqual(-1, pronghornDotJson.id.indexOf('aws_cloudformation'));
371
+ assert.equal('Adapter', pronghornDotJson.type);
353
372
  assert.equal('AwsCloudFormation', pronghornDotJson.export);
354
373
  assert.equal('AwsCloudFormation', pronghornDotJson.title);
374
+ assert.equal('adapter.js', pronghornDotJson.src);
375
+ done();
376
+ } catch (error) {
377
+ log.error(`Test Failure: ${error}`);
378
+ done(error);
379
+ }
380
+ });
381
+ it('pronghorn.json should contain generic adapter methods', (done) => {
382
+ try {
383
+ const pronghornDotJson = require('../../pronghorn.json');
384
+ assert.notEqual(undefined, pronghornDotJson.methods);
385
+ assert.notEqual(null, pronghornDotJson.methods);
386
+ assert.notEqual('', pronghornDotJson.methods);
387
+ assert.equal(true, Array.isArray(pronghornDotJson.methods));
388
+ assert.notEqual(0, pronghornDotJson.methods.length);
389
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUpdateAdapterConfiguration'));
390
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapSuspendAdapter'));
391
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUnsuspendAdapter'));
392
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapGetAdapterQueue'));
393
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapFindAdapterPath'));
394
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapTroubleshootAdapter'));
395
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterHealthcheck'));
396
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterConnectivity'));
397
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterBasicGet'));
398
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapMoveAdapterEntitiesToDB'));
399
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapDeactivateTasks'));
400
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapActivateTasks'));
401
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapPopulateEntityCache'));
402
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRetrieveEntitiesCache'));
403
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'getDevice'));
404
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'getDevicesFiltered'));
405
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'isAlive'));
406
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'getConfig'));
407
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapGetDeviceCount'));
408
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapExpandedGenericAdapterRequest'));
409
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequest'));
410
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequestNoBasePath'));
411
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterLint'));
412
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterTests'));
413
+ assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapGetAdapterInventory'));
355
414
  done();
356
415
  } catch (error) {
357
416
  log.error(`Test Failure: ${error}`);
@@ -373,7 +432,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
373
432
  let wfparams = [];
374
433
 
375
434
  if (methLine && methLine.indexOf('(') >= 0 && methLine.indexOf(')') >= 0) {
376
- const temp = methLine.substring(methLine.indexOf('(') + 1, methLine.indexOf(')'));
435
+ const temp = methLine.substring(methLine.indexOf('(') + 1, methLine.lastIndexOf(')'));
377
436
  wfparams = temp.split(',');
378
437
 
379
438
  for (let t = 0; t < wfparams.length; t += 1) {
@@ -472,6 +531,39 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
472
531
  done(error);
473
532
  }
474
533
  });
534
+ it('pronghorn.json verify input/output schema objects', (done) => {
535
+ const verifySchema = (methodName, schema) => {
536
+ try {
537
+ ajv.compile(schema);
538
+ } catch (error) {
539
+ const errorMessage = `Invalid schema found in '${methodName}' method.
540
+ Schema => ${JSON.stringify(schema)}.
541
+ Details => ${error.message}`;
542
+ throw new Error(errorMessage);
543
+ }
544
+ };
545
+
546
+ try {
547
+ const pronghornDotJson = require('../../pronghorn.json');
548
+ const { methods } = pronghornDotJson;
549
+ for (let i = 0; i < methods.length; i += 1) {
550
+ for (let j = 0; j < methods[i].input.length; j += 1) {
551
+ const inputSchema = methods[i].input[j].schema;
552
+ if (inputSchema) {
553
+ verifySchema(methods[i].name, inputSchema);
554
+ }
555
+ }
556
+ const outputSchema = methods[i].output.schema;
557
+ if (outputSchema) {
558
+ verifySchema(methods[i].name, outputSchema);
559
+ }
560
+ }
561
+ done();
562
+ } catch (error) {
563
+ log.error(`Adapter Exception: ${error}`);
564
+ done(error);
565
+ }
566
+ });
475
567
  });
476
568
 
477
569
  describe('propertiesSchema.json', () => {
@@ -490,6 +582,124 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
490
582
  try {
491
583
  const propertiesDotJson = require('../../propertiesSchema.json');
492
584
  assert.equal('adapter-aws_cloudformation', propertiesDotJson.$id);
585
+ assert.equal('object', propertiesDotJson.type);
586
+ assert.equal('http://json-schema.org/draft-07/schema#', propertiesDotJson.$schema);
587
+ done();
588
+ } catch (error) {
589
+ log.error(`Test Failure: ${error}`);
590
+ done(error);
591
+ }
592
+ });
593
+ it('propertiesSchema.json should contain generic adapter properties', (done) => {
594
+ try {
595
+ const propertiesDotJson = require('../../propertiesSchema.json');
596
+ assert.notEqual(undefined, propertiesDotJson.properties);
597
+ assert.notEqual(null, propertiesDotJson.properties);
598
+ assert.notEqual('', propertiesDotJson.properties);
599
+ assert.equal('string', propertiesDotJson.properties.host.type);
600
+ assert.equal('integer', propertiesDotJson.properties.port.type);
601
+ assert.equal('boolean', propertiesDotJson.properties.stub.type);
602
+ assert.equal('string', propertiesDotJson.properties.protocol.type);
603
+ assert.notEqual(undefined, propertiesDotJson.definitions.authentication);
604
+ assert.notEqual(null, propertiesDotJson.definitions.authentication);
605
+ assert.notEqual('', propertiesDotJson.definitions.authentication);
606
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.auth_method.type);
607
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.username.type);
608
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.password.type);
609
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.token.type);
610
+ assert.equal('integer', propertiesDotJson.definitions.authentication.properties.invalid_token_error.type);
611
+ assert.equal('integer', propertiesDotJson.definitions.authentication.properties.token_timeout.type);
612
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.token_cache.type);
613
+ assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field.type));
614
+ assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field_format.type));
615
+ assert.equal('boolean', propertiesDotJson.definitions.authentication.properties.auth_logging.type);
616
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_id.type);
617
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_secret.type);
618
+ assert.equal('string', propertiesDotJson.definitions.authentication.properties.grant_type.type);
619
+ assert.notEqual(undefined, propertiesDotJson.definitions.ssl);
620
+ assert.notEqual(null, propertiesDotJson.definitions.ssl);
621
+ assert.notEqual('', propertiesDotJson.definitions.ssl);
622
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.ecdhCurve.type);
623
+ assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.enabled.type);
624
+ assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.accept_invalid_cert.type);
625
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.ca_file.type);
626
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.key_file.type);
627
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.cert_file.type);
628
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.secure_protocol.type);
629
+ assert.equal('string', propertiesDotJson.definitions.ssl.properties.ciphers.type);
630
+ assert.equal('string', propertiesDotJson.properties.base_path.type);
631
+ assert.equal('string', propertiesDotJson.properties.version.type);
632
+ assert.equal('string', propertiesDotJson.properties.cache_location.type);
633
+ assert.equal('boolean', propertiesDotJson.properties.encode_pathvars.type);
634
+ assert.equal('boolean', propertiesDotJson.properties.encode_queryvars.type);
635
+ assert.equal(true, Array.isArray(propertiesDotJson.properties.save_metric.type));
636
+ assert.notEqual(undefined, propertiesDotJson.definitions);
637
+ assert.notEqual(null, propertiesDotJson.definitions);
638
+ assert.notEqual('', propertiesDotJson.definitions);
639
+ assert.notEqual(undefined, propertiesDotJson.definitions.healthcheck);
640
+ assert.notEqual(null, propertiesDotJson.definitions.healthcheck);
641
+ assert.notEqual('', propertiesDotJson.definitions.healthcheck);
642
+ assert.equal('string', propertiesDotJson.definitions.healthcheck.properties.type.type);
643
+ assert.equal('integer', propertiesDotJson.definitions.healthcheck.properties.frequency.type);
644
+ assert.equal('object', propertiesDotJson.definitions.healthcheck.properties.query_object.type);
645
+ assert.notEqual(undefined, propertiesDotJson.definitions.throttle);
646
+ assert.notEqual(null, propertiesDotJson.definitions.throttle);
647
+ assert.notEqual('', propertiesDotJson.definitions.throttle);
648
+ assert.equal('boolean', propertiesDotJson.definitions.throttle.properties.throttle_enabled.type);
649
+ assert.equal('integer', propertiesDotJson.definitions.throttle.properties.number_pronghorns.type);
650
+ assert.equal('string', propertiesDotJson.definitions.throttle.properties.sync_async.type);
651
+ assert.equal('integer', propertiesDotJson.definitions.throttle.properties.max_in_queue.type);
652
+ assert.equal('integer', propertiesDotJson.definitions.throttle.properties.concurrent_max.type);
653
+ assert.equal('integer', propertiesDotJson.definitions.throttle.properties.expire_timeout.type);
654
+ assert.equal('integer', propertiesDotJson.definitions.throttle.properties.avg_runtime.type);
655
+ assert.equal('array', propertiesDotJson.definitions.throttle.properties.priorities.type);
656
+ assert.notEqual(undefined, propertiesDotJson.definitions.request);
657
+ assert.notEqual(null, propertiesDotJson.definitions.request);
658
+ assert.notEqual('', propertiesDotJson.definitions.request);
659
+ assert.equal('integer', propertiesDotJson.definitions.request.properties.number_redirects.type);
660
+ assert.equal('integer', propertiesDotJson.definitions.request.properties.number_retries.type);
661
+ assert.equal(true, Array.isArray(propertiesDotJson.definitions.request.properties.limit_retry_error.type));
662
+ assert.equal('array', propertiesDotJson.definitions.request.properties.failover_codes.type);
663
+ assert.equal('integer', propertiesDotJson.definitions.request.properties.attempt_timeout.type);
664
+ assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.type);
665
+ assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.payload.type);
666
+ assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.uriOptions.type);
667
+ assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.addlHeaders.type);
668
+ assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.authData.type);
669
+ assert.equal('boolean', propertiesDotJson.definitions.request.properties.healthcheck_on_timeout.type);
670
+ assert.equal('boolean', propertiesDotJson.definitions.request.properties.return_raw.type);
671
+ assert.equal('boolean', propertiesDotJson.definitions.request.properties.archiving.type);
672
+ assert.equal('boolean', propertiesDotJson.definitions.request.properties.return_request.type);
673
+ assert.notEqual(undefined, propertiesDotJson.definitions.proxy);
674
+ assert.notEqual(null, propertiesDotJson.definitions.proxy);
675
+ assert.notEqual('', propertiesDotJson.definitions.proxy);
676
+ assert.equal('boolean', propertiesDotJson.definitions.proxy.properties.enabled.type);
677
+ assert.equal('string', propertiesDotJson.definitions.proxy.properties.host.type);
678
+ assert.equal('integer', propertiesDotJson.definitions.proxy.properties.port.type);
679
+ assert.equal('string', propertiesDotJson.definitions.proxy.properties.protocol.type);
680
+ assert.equal('string', propertiesDotJson.definitions.proxy.properties.username.type);
681
+ assert.equal('string', propertiesDotJson.definitions.proxy.properties.password.type);
682
+ assert.notEqual(undefined, propertiesDotJson.definitions.mongo);
683
+ assert.notEqual(null, propertiesDotJson.definitions.mongo);
684
+ assert.notEqual('', propertiesDotJson.definitions.mongo);
685
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.host.type);
686
+ assert.equal('integer', propertiesDotJson.definitions.mongo.properties.port.type);
687
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.database.type);
688
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.username.type);
689
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.password.type);
690
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.replSet.type);
691
+ assert.equal('object', propertiesDotJson.definitions.mongo.properties.db_ssl.type);
692
+ assert.equal('boolean', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.enabled.type);
693
+ assert.equal('boolean', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.accept_invalid_cert.type);
694
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.ca_file.type);
695
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.key_file.type);
696
+ assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.cert_file.type);
697
+ assert.notEqual('', propertiesDotJson.definitions.devicebroker);
698
+ assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevice.type);
699
+ assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevicesFiltered.type);
700
+ assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.isAlive.type);
701
+ assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getConfig.type);
702
+ assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getCount.type);
493
703
  done();
494
704
  } catch (error) {
495
705
  log.error(`Test Failure: ${error}`);
@@ -510,6 +720,50 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
510
720
  done(error);
511
721
  }
512
722
  });
723
+ it('error.json should have standard adapter errors', (done) => {
724
+ try {
725
+ const errorDotJson = require('../../error.json');
726
+ assert.notEqual(undefined, errorDotJson.errors);
727
+ assert.notEqual(null, errorDotJson.errors);
728
+ assert.notEqual('', errorDotJson.errors);
729
+ assert.equal(true, Array.isArray(errorDotJson.errors));
730
+ assert.notEqual(0, errorDotJson.errors.length);
731
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.100'));
732
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.101'));
733
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.102'));
734
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.110'));
735
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.111'));
736
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.112'));
737
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.113'));
738
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.114'));
739
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.115'));
740
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.116'));
741
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.300'));
742
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.301'));
743
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.302'));
744
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.303'));
745
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.304'));
746
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.305'));
747
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.310'));
748
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.311'));
749
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.312'));
750
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.320'));
751
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.321'));
752
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.400'));
753
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.401'));
754
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.402'));
755
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.500'));
756
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.501'));
757
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.502'));
758
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.503'));
759
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.600'));
760
+ assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.900'));
761
+ done();
762
+ } catch (error) {
763
+ log.error(`Test Failure: ${error}`);
764
+ done(error);
765
+ }
766
+ });
513
767
  });
514
768
 
515
769
  describe('sampleProperties.json', () => {
@@ -524,6 +778,123 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
524
778
  done(error);
525
779
  }
526
780
  });
781
+ it('sampleProperties.json should contain generic adapter properties', (done) => {
782
+ try {
783
+ const sampleDotJson = require('../../sampleProperties.json');
784
+ assert.notEqual(-1, sampleDotJson.id.indexOf('aws_cloudformation'));
785
+ assert.equal('AwsCloudFormation', sampleDotJson.type);
786
+ assert.notEqual(undefined, sampleDotJson.properties);
787
+ assert.notEqual(null, sampleDotJson.properties);
788
+ assert.notEqual('', sampleDotJson.properties);
789
+ assert.notEqual(undefined, sampleDotJson.properties.host);
790
+ assert.notEqual(undefined, sampleDotJson.properties.port);
791
+ assert.notEqual(undefined, sampleDotJson.properties.stub);
792
+ assert.notEqual(undefined, sampleDotJson.properties.protocol);
793
+ assert.notEqual(undefined, sampleDotJson.properties.authentication);
794
+ assert.notEqual(null, sampleDotJson.properties.authentication);
795
+ assert.notEqual('', sampleDotJson.properties.authentication);
796
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_method);
797
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.username);
798
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.password);
799
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.token);
800
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.invalid_token_error);
801
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.token_timeout);
802
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.token_cache);
803
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field);
804
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field_format);
805
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_logging);
806
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.client_id);
807
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.client_secret);
808
+ assert.notEqual(undefined, sampleDotJson.properties.authentication.grant_type);
809
+ assert.notEqual(undefined, sampleDotJson.properties.ssl);
810
+ assert.notEqual(null, sampleDotJson.properties.ssl);
811
+ assert.notEqual('', sampleDotJson.properties.ssl);
812
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.ecdhCurve);
813
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.enabled);
814
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.accept_invalid_cert);
815
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.ca_file);
816
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.key_file);
817
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.cert_file);
818
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.secure_protocol);
819
+ assert.notEqual(undefined, sampleDotJson.properties.ssl.ciphers);
820
+ assert.notEqual(undefined, sampleDotJson.properties.base_path);
821
+ assert.notEqual(undefined, sampleDotJson.properties.version);
822
+ assert.notEqual(undefined, sampleDotJson.properties.cache_location);
823
+ assert.notEqual(undefined, sampleDotJson.properties.encode_pathvars);
824
+ assert.notEqual(undefined, sampleDotJson.properties.encode_queryvars);
825
+ assert.notEqual(undefined, sampleDotJson.properties.save_metric);
826
+ assert.notEqual(undefined, sampleDotJson.properties.healthcheck);
827
+ assert.notEqual(null, sampleDotJson.properties.healthcheck);
828
+ assert.notEqual('', sampleDotJson.properties.healthcheck);
829
+ assert.notEqual(undefined, sampleDotJson.properties.healthcheck.type);
830
+ assert.notEqual(undefined, sampleDotJson.properties.healthcheck.frequency);
831
+ assert.notEqual(undefined, sampleDotJson.properties.healthcheck.query_object);
832
+ assert.notEqual(undefined, sampleDotJson.properties.throttle);
833
+ assert.notEqual(null, sampleDotJson.properties.throttle);
834
+ assert.notEqual('', sampleDotJson.properties.throttle);
835
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.throttle_enabled);
836
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.number_pronghorns);
837
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.sync_async);
838
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.max_in_queue);
839
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.concurrent_max);
840
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.expire_timeout);
841
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.avg_runtime);
842
+ assert.notEqual(undefined, sampleDotJson.properties.throttle.priorities);
843
+ assert.notEqual(undefined, sampleDotJson.properties.request);
844
+ assert.notEqual(null, sampleDotJson.properties.request);
845
+ assert.notEqual('', sampleDotJson.properties.request);
846
+ assert.notEqual(undefined, sampleDotJson.properties.request.number_redirects);
847
+ assert.notEqual(undefined, sampleDotJson.properties.request.number_retries);
848
+ assert.notEqual(undefined, sampleDotJson.properties.request.limit_retry_error);
849
+ assert.notEqual(undefined, sampleDotJson.properties.request.failover_codes);
850
+ assert.notEqual(undefined, sampleDotJson.properties.request.attempt_timeout);
851
+ assert.notEqual(undefined, sampleDotJson.properties.request.global_request);
852
+ assert.notEqual(undefined, sampleDotJson.properties.request.global_request.payload);
853
+ assert.notEqual(undefined, sampleDotJson.properties.request.global_request.uriOptions);
854
+ assert.notEqual(undefined, sampleDotJson.properties.request.global_request.addlHeaders);
855
+ assert.notEqual(undefined, sampleDotJson.properties.request.global_request.authData);
856
+ assert.notEqual(undefined, sampleDotJson.properties.request.healthcheck_on_timeout);
857
+ assert.notEqual(undefined, sampleDotJson.properties.request.return_raw);
858
+ assert.notEqual(undefined, sampleDotJson.properties.request.archiving);
859
+ assert.notEqual(undefined, sampleDotJson.properties.request.return_request);
860
+ assert.notEqual(undefined, sampleDotJson.properties.proxy);
861
+ assert.notEqual(null, sampleDotJson.properties.proxy);
862
+ assert.notEqual('', sampleDotJson.properties.proxy);
863
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.enabled);
864
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.host);
865
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.port);
866
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.protocol);
867
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.username);
868
+ assert.notEqual(undefined, sampleDotJson.properties.proxy.password);
869
+ assert.notEqual(undefined, sampleDotJson.properties.mongo);
870
+ assert.notEqual(null, sampleDotJson.properties.mongo);
871
+ assert.notEqual('', sampleDotJson.properties.mongo);
872
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.host);
873
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.port);
874
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.database);
875
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.username);
876
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.password);
877
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.replSet);
878
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl);
879
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.enabled);
880
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.accept_invalid_cert);
881
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.ca_file);
882
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.key_file);
883
+ assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.cert_file);
884
+ assert.notEqual(undefined, sampleDotJson.properties.devicebroker);
885
+ assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevice);
886
+ assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevicesFiltered);
887
+ assert.notEqual(undefined, sampleDotJson.properties.devicebroker.isAlive);
888
+ assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getConfig);
889
+ assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getCount);
890
+ assert.notEqual(undefined, sampleDotJson.properties.cache);
891
+ assert.notEqual(undefined, sampleDotJson.properties.cache.entities);
892
+ done();
893
+ } catch (error) {
894
+ log.error(`Test Failure: ${error}`);
895
+ done(error);
896
+ }
897
+ });
527
898
  });
528
899
 
529
900
  describe('#checkProperties', () => {
@@ -611,6 +982,148 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
611
982
  });
612
983
  });
613
984
 
985
+ describe('#iapUpdateAdapterConfiguration', () => {
986
+ it('should have a iapUpdateAdapterConfiguration function', (done) => {
987
+ try {
988
+ assert.equal(true, typeof a.iapUpdateAdapterConfiguration === 'function');
989
+ done();
990
+ } catch (error) {
991
+ log.error(`Test Failure: ${error}`);
992
+ done(error);
993
+ }
994
+ });
995
+ });
996
+
997
+ describe('#iapSuspendAdapter', () => {
998
+ it('should have a iapSuspendAdapter function', (done) => {
999
+ try {
1000
+ assert.equal(true, typeof a.iapSuspendAdapter === 'function');
1001
+ done();
1002
+ } catch (error) {
1003
+ log.error(`Test Failure: ${error}`);
1004
+ done(error);
1005
+ }
1006
+ });
1007
+ });
1008
+
1009
+ describe('#iapUnsuspendAdapter', () => {
1010
+ it('should have a iapUnsuspendAdapter function', (done) => {
1011
+ try {
1012
+ assert.equal(true, typeof a.iapUnsuspendAdapter === 'function');
1013
+ done();
1014
+ } catch (error) {
1015
+ log.error(`Test Failure: ${error}`);
1016
+ done(error);
1017
+ }
1018
+ });
1019
+ });
1020
+
1021
+ describe('#iapGetAdapterQueue', () => {
1022
+ it('should have a iapGetAdapterQueue function', (done) => {
1023
+ try {
1024
+ assert.equal(true, typeof a.iapGetAdapterQueue === 'function');
1025
+ done();
1026
+ } catch (error) {
1027
+ log.error(`Test Failure: ${error}`);
1028
+ done(error);
1029
+ }
1030
+ });
1031
+ });
1032
+
1033
+ describe('#iapFindAdapterPath', () => {
1034
+ it('should have a iapFindAdapterPath function', (done) => {
1035
+ try {
1036
+ assert.equal(true, typeof a.iapFindAdapterPath === 'function');
1037
+ done();
1038
+ } catch (error) {
1039
+ log.error(`Test Failure: ${error}`);
1040
+ done(error);
1041
+ }
1042
+ });
1043
+ it('iapFindAdapterPath should find atleast one path that matches', (done) => {
1044
+ try {
1045
+ a.iapFindAdapterPath('{base_path}/{version}', (data, error) => {
1046
+ try {
1047
+ assert.equal(undefined, error);
1048
+ assert.notEqual(undefined, data);
1049
+ assert.notEqual(null, data);
1050
+ assert.equal(true, data.found);
1051
+ assert.notEqual(undefined, data.foundIn);
1052
+ assert.notEqual(null, data.foundIn);
1053
+ assert.notEqual(0, data.foundIn.length);
1054
+ done();
1055
+ } catch (err) {
1056
+ log.error(`Test Failure: ${err}`);
1057
+ done(err);
1058
+ }
1059
+ });
1060
+ } catch (error) {
1061
+ log.error(`Adapter Exception: ${error}`);
1062
+ done(error);
1063
+ }
1064
+ }).timeout(attemptTimeout);
1065
+ });
1066
+
1067
+ describe('#iapTroubleshootAdapter', () => {
1068
+ it('should have a iapTroubleshootAdapter function', (done) => {
1069
+ try {
1070
+ assert.equal(true, typeof a.iapTroubleshootAdapter === 'function');
1071
+ done();
1072
+ } catch (error) {
1073
+ log.error(`Test Failure: ${error}`);
1074
+ done(error);
1075
+ }
1076
+ });
1077
+ });
1078
+
1079
+ describe('#iapRunAdapterHealthcheck', () => {
1080
+ it('should have a iapRunAdapterHealthcheck function', (done) => {
1081
+ try {
1082
+ assert.equal(true, typeof a.iapRunAdapterHealthcheck === 'function');
1083
+ done();
1084
+ } catch (error) {
1085
+ log.error(`Test Failure: ${error}`);
1086
+ done(error);
1087
+ }
1088
+ });
1089
+ });
1090
+
1091
+ describe('#iapRunAdapterConnectivity', () => {
1092
+ it('should have a iapRunAdapterConnectivity function', (done) => {
1093
+ try {
1094
+ assert.equal(true, typeof a.iapRunAdapterConnectivity === 'function');
1095
+ done();
1096
+ } catch (error) {
1097
+ log.error(`Test Failure: ${error}`);
1098
+ done(error);
1099
+ }
1100
+ });
1101
+ });
1102
+
1103
+ describe('#iapRunAdapterBasicGet', () => {
1104
+ it('should have a iapRunAdapterBasicGet function', (done) => {
1105
+ try {
1106
+ assert.equal(true, typeof a.iapRunAdapterBasicGet === 'function');
1107
+ done();
1108
+ } catch (error) {
1109
+ log.error(`Test Failure: ${error}`);
1110
+ done(error);
1111
+ }
1112
+ });
1113
+ });
1114
+
1115
+ describe('#iapMoveAdapterEntitiesToDB', () => {
1116
+ it('should have a iapMoveAdapterEntitiesToDB function', (done) => {
1117
+ try {
1118
+ assert.equal(true, typeof a.iapMoveAdapterEntitiesToDB === 'function');
1119
+ done();
1120
+ } catch (error) {
1121
+ log.error(`Test Failure: ${error}`);
1122
+ done(error);
1123
+ }
1124
+ });
1125
+ });
1126
+
614
1127
  describe('#checkActionFiles', () => {
615
1128
  it('should have a checkActionFiles function', (done) => {
616
1129
  try {
@@ -696,50 +1209,293 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
696
1209
  }).timeout(attemptTimeout);
697
1210
  });
698
1211
 
699
- // describe('#hasEntity', () => {
700
- // it('should have a hasEntity function', (done) => {
701
- // try {
702
- // assert.equal(true, typeof a.hasEntity === 'function');
703
- // done();
704
- // } catch (error) {
705
- // log.error(`Test Failure: ${error}`);
706
- // done(error);
707
- // }
708
- // });
709
- // it('should find entity', (done) => {
710
- // try {
711
- // a.hasEntity('template_entity', // 'a9e9c33dc61122760072455df62663d2', (data) => {
712
- // try {
713
- // assert.equal(true, data[0]);
714
- // done();
715
- // } catch (err) {
716
- // log.error(`Test Failure: ${err}`);
717
- // done(err);
718
- // }
719
- // });
720
- // } catch (error) {
721
- // log.error(`Adapter Exception: ${error}`);
722
- // done(error);
723
- // }
724
- // }).timeout(attemptTimeout);
725
- // it('should not find entity', (done) => {
726
- // try {
727
- // a.hasEntity('template_entity', 'blah', (data) => {
728
- // try {
729
- // assert.equal(false, data[0]);
730
- // done();
731
- // } catch (err) {
732
- // log.error(`Test Failure: ${err}`);
733
- // done(err);
734
- // }
735
- // });
736
- // } catch (error) {
737
- // log.error(`Adapter Exception: ${error}`);
738
- // done(error);
739
- // }
740
- // }).timeout(attemptTimeout);
741
- // });
1212
+ describe('#iapDeactivateTasks', () => {
1213
+ it('should have a iapDeactivateTasks function', (done) => {
1214
+ try {
1215
+ assert.equal(true, typeof a.iapDeactivateTasks === 'function');
1216
+ done();
1217
+ } catch (error) {
1218
+ log.error(`Test Failure: ${error}`);
1219
+ done(error);
1220
+ }
1221
+ });
1222
+ });
742
1223
 
1224
+ describe('#iapActivateTasks', () => {
1225
+ it('should have a iapActivateTasks function', (done) => {
1226
+ try {
1227
+ assert.equal(true, typeof a.iapActivateTasks === 'function');
1228
+ done();
1229
+ } catch (error) {
1230
+ log.error(`Test Failure: ${error}`);
1231
+ done(error);
1232
+ }
1233
+ });
1234
+ });
1235
+
1236
+ describe('#iapPopulateEntityCache', () => {
1237
+ it('should have a iapPopulateEntityCache function', (done) => {
1238
+ try {
1239
+ assert.equal(true, typeof a.iapPopulateEntityCache === 'function');
1240
+ done();
1241
+ } catch (error) {
1242
+ log.error(`Test Failure: ${error}`);
1243
+ done(error);
1244
+ }
1245
+ });
1246
+ });
1247
+
1248
+ describe('#iapRetrieveEntitiesCache', () => {
1249
+ it('should have a iapRetrieveEntitiesCache function', (done) => {
1250
+ try {
1251
+ assert.equal(true, typeof a.iapRetrieveEntitiesCache === 'function');
1252
+ done();
1253
+ } catch (error) {
1254
+ log.error(`Test Failure: ${error}`);
1255
+ done(error);
1256
+ }
1257
+ });
1258
+ });
1259
+
1260
+ describe('#hasEntities', () => {
1261
+ it('should have a hasEntities function', (done) => {
1262
+ try {
1263
+ assert.equal(true, typeof a.hasEntities === 'function');
1264
+ done();
1265
+ } catch (error) {
1266
+ log.error(`Test Failure: ${error}`);
1267
+ done(error);
1268
+ }
1269
+ });
1270
+ });
1271
+
1272
+ describe('#getDevice', () => {
1273
+ it('should have a getDevice function', (done) => {
1274
+ try {
1275
+ assert.equal(true, typeof a.getDevice === 'function');
1276
+ done();
1277
+ } catch (error) {
1278
+ log.error(`Test Failure: ${error}`);
1279
+ done(error);
1280
+ }
1281
+ });
1282
+ });
1283
+
1284
+ describe('#getDevicesFiltered', () => {
1285
+ it('should have a getDevicesFiltered function', (done) => {
1286
+ try {
1287
+ assert.equal(true, typeof a.getDevicesFiltered === 'function');
1288
+ done();
1289
+ } catch (error) {
1290
+ log.error(`Test Failure: ${error}`);
1291
+ done(error);
1292
+ }
1293
+ });
1294
+ });
1295
+
1296
+ describe('#isAlive', () => {
1297
+ it('should have a isAlive function', (done) => {
1298
+ try {
1299
+ assert.equal(true, typeof a.isAlive === 'function');
1300
+ done();
1301
+ } catch (error) {
1302
+ log.error(`Test Failure: ${error}`);
1303
+ done(error);
1304
+ }
1305
+ });
1306
+ });
1307
+
1308
+ describe('#getConfig', () => {
1309
+ it('should have a getConfig function', (done) => {
1310
+ try {
1311
+ assert.equal(true, typeof a.getConfig === 'function');
1312
+ done();
1313
+ } catch (error) {
1314
+ log.error(`Test Failure: ${error}`);
1315
+ done(error);
1316
+ }
1317
+ });
1318
+ });
1319
+
1320
+ describe('#iapGetDeviceCount', () => {
1321
+ it('should have a iapGetDeviceCount function', (done) => {
1322
+ try {
1323
+ assert.equal(true, typeof a.iapGetDeviceCount === 'function');
1324
+ done();
1325
+ } catch (error) {
1326
+ log.error(`Test Failure: ${error}`);
1327
+ done(error);
1328
+ }
1329
+ });
1330
+ });
1331
+
1332
+ describe('#iapExpandedGenericAdapterRequest', () => {
1333
+ it('should have a iapExpandedGenericAdapterRequest function', (done) => {
1334
+ try {
1335
+ assert.equal(true, typeof a.iapExpandedGenericAdapterRequest === 'function');
1336
+ done();
1337
+ } catch (error) {
1338
+ log.error(`Test Failure: ${error}`);
1339
+ done(error);
1340
+ }
1341
+ });
1342
+ });
1343
+
1344
+ describe('#genericAdapterRequest', () => {
1345
+ it('should have a genericAdapterRequest function', (done) => {
1346
+ try {
1347
+ assert.equal(true, typeof a.genericAdapterRequest === 'function');
1348
+ done();
1349
+ } catch (error) {
1350
+ log.error(`Test Failure: ${error}`);
1351
+ done(error);
1352
+ }
1353
+ });
1354
+ });
1355
+
1356
+ describe('#genericAdapterRequestNoBasePath', () => {
1357
+ it('should have a genericAdapterRequestNoBasePath function', (done) => {
1358
+ try {
1359
+ assert.equal(true, typeof a.genericAdapterRequestNoBasePath === 'function');
1360
+ done();
1361
+ } catch (error) {
1362
+ log.error(`Test Failure: ${error}`);
1363
+ done(error);
1364
+ }
1365
+ });
1366
+ });
1367
+
1368
+ describe('#iapRunAdapterLint', () => {
1369
+ it('should have a iapRunAdapterLint function', (done) => {
1370
+ try {
1371
+ assert.equal(true, typeof a.iapRunAdapterLint === 'function');
1372
+ done();
1373
+ } catch (error) {
1374
+ log.error(`Test Failure: ${error}`);
1375
+ done(error);
1376
+ }
1377
+ });
1378
+ it('retrieve the lint results', (done) => {
1379
+ try {
1380
+ a.iapRunAdapterLint((data, error) => {
1381
+ try {
1382
+ assert.equal(undefined, error);
1383
+ assert.notEqual(undefined, data);
1384
+ assert.notEqual(null, data);
1385
+ assert.notEqual(undefined, data.status);
1386
+ assert.notEqual(null, data.status);
1387
+ assert.equal('SUCCESS', data.status);
1388
+ done();
1389
+ } catch (err) {
1390
+ log.error(`Test Failure: ${err}`);
1391
+ done(err);
1392
+ }
1393
+ });
1394
+ } catch (error) {
1395
+ log.error(`Adapter Exception: ${error}`);
1396
+ done(error);
1397
+ }
1398
+ }).timeout(attemptTimeout);
1399
+ });
1400
+
1401
+ describe('#iapRunAdapterTests', () => {
1402
+ it('should have a iapRunAdapterTests function', (done) => {
1403
+ try {
1404
+ assert.equal(true, typeof a.iapRunAdapterTests === 'function');
1405
+ done();
1406
+ } catch (error) {
1407
+ log.error(`Test Failure: ${error}`);
1408
+ done(error);
1409
+ }
1410
+ });
1411
+ });
1412
+
1413
+ describe('#iapGetAdapterInventory', () => {
1414
+ it('should have a iapGetAdapterInventory function', (done) => {
1415
+ try {
1416
+ assert.equal(true, typeof a.iapGetAdapterInventory === 'function');
1417
+ done();
1418
+ } catch (error) {
1419
+ log.error(`Test Failure: ${error}`);
1420
+ done(error);
1421
+ }
1422
+ });
1423
+ it('retrieve the inventory', (done) => {
1424
+ try {
1425
+ a.iapGetAdapterInventory((data, error) => {
1426
+ try {
1427
+ assert.equal(undefined, error);
1428
+ assert.notEqual(undefined, data);
1429
+ assert.notEqual(null, data);
1430
+ done();
1431
+ } catch (err) {
1432
+ log.error(`Test Failure: ${err}`);
1433
+ done(err);
1434
+ }
1435
+ });
1436
+ } catch (error) {
1437
+ log.error(`Adapter Exception: ${error}`);
1438
+ done(error);
1439
+ }
1440
+ }).timeout(attemptTimeout);
1441
+ });
1442
+ describe('metadata.json', () => {
1443
+ it('should have a metadata.json', (done) => {
1444
+ try {
1445
+ fs.exists('metadata.json', (val) => {
1446
+ assert.equal(true, val);
1447
+ done();
1448
+ });
1449
+ } catch (error) {
1450
+ log.error(`Test Failure: ${error}`);
1451
+ done(error);
1452
+ }
1453
+ });
1454
+ it('metadata.json is customized', (done) => {
1455
+ try {
1456
+ const metadataDotJson = require('../../metadata.json');
1457
+ assert.equal('adapter-aws_cloudformation', metadataDotJson.name);
1458
+ assert.notEqual(undefined, metadataDotJson.webName);
1459
+ assert.notEqual(null, metadataDotJson.webName);
1460
+ assert.notEqual('', metadataDotJson.webName);
1461
+ assert.equal('Adapter', metadataDotJson.type);
1462
+ done();
1463
+ } catch (error) {
1464
+ log.error(`Test Failure: ${error}`);
1465
+ done(error);
1466
+ }
1467
+ });
1468
+ it('metadata.json contains accurate documentation', (done) => {
1469
+ try {
1470
+ const metadataDotJson = require('../../metadata.json');
1471
+ assert.notEqual(undefined, metadataDotJson.documentation);
1472
+ assert.equal('https://www.npmjs.com/package/@itentialopensource/adapter-aws_cloudformation', metadataDotJson.documentation.npmLink);
1473
+ assert.equal('https://docs.itential.com/opensource/docs/troubleshooting-an-adapter', metadataDotJson.documentation.faqLink);
1474
+ assert.equal('https://gitlab.com/itentialopensource/adapters/contributing-guide', metadataDotJson.documentation.contributeLink);
1475
+ assert.equal('https://itential.atlassian.net/servicedesk/customer/portals', metadataDotJson.documentation.issueLink);
1476
+ done();
1477
+ } catch (error) {
1478
+ log.error(`Test Failure: ${error}`);
1479
+ done(error);
1480
+ }
1481
+ });
1482
+ it('metadata.json has related items', (done) => {
1483
+ try {
1484
+ const metadataDotJson = require('../../metadata.json');
1485
+ assert.notEqual(undefined, metadataDotJson.relatedItems);
1486
+ assert.notEqual(undefined, metadataDotJson.relatedItems.adapters);
1487
+ assert.notEqual(undefined, metadataDotJson.relatedItems.integrations);
1488
+ assert.notEqual(undefined, metadataDotJson.relatedItems.ecosystemApplications);
1489
+ assert.notEqual(undefined, metadataDotJson.relatedItems.workflowProjects);
1490
+ assert.notEqual(undefined, metadataDotJson.relatedItems.transformationProjects);
1491
+ assert.notEqual(undefined, metadataDotJson.relatedItems.exampleProjects);
1492
+ done();
1493
+ } catch (error) {
1494
+ log.error(`Test Failure: ${error}`);
1495
+ done(error);
1496
+ }
1497
+ });
1498
+ });
743
1499
  /*
744
1500
  -----------------------------------------------------------------------
745
1501
  -----------------------------------------------------------------------
@@ -788,7 +1544,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
788
1544
  a.createStack(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
789
1545
  try {
790
1546
  const displayE = 'stackName is required';
791
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-createStack', displayE);
1547
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-createStackSTSRole', displayE);
792
1548
  done();
793
1549
  } catch (err) {
794
1550
  log.error(`Test Failure: ${err}`);
@@ -817,7 +1573,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
817
1573
  a.updateStack(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
818
1574
  try {
819
1575
  const displayE = 'stackName is required';
820
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-updateStack', displayE);
1576
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-updateStackSTSRole', displayE);
821
1577
  done();
822
1578
  } catch (err) {
823
1579
  log.error(`Test Failure: ${err}`);
@@ -846,7 +1602,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
846
1602
  a.updateTerminationProtection(null, null, (data, error) => {
847
1603
  try {
848
1604
  const displayE = 'stackName is required';
849
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-updateTerminationProtection', displayE);
1605
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-updateTerminationProtectionSTSRole', displayE);
850
1606
  done();
851
1607
  } catch (err) {
852
1608
  log.error(`Test Failure: ${err}`);
@@ -863,7 +1619,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
863
1619
  a.updateTerminationProtection('fake data', null, (data, error) => {
864
1620
  try {
865
1621
  const displayE = 'enableTerminationProtection is required';
866
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-updateTerminationProtection', displayE);
1622
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-updateTerminationProtectionSTSRole', displayE);
867
1623
  done();
868
1624
  } catch (err) {
869
1625
  log.error(`Test Failure: ${err}`);
@@ -892,7 +1648,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
892
1648
  a.deleteStack(null, null, null, null, (data, error) => {
893
1649
  try {
894
1650
  const displayE = 'stackName is required';
895
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-deleteStack', displayE);
1651
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-deleteStackSTSRole', displayE);
896
1652
  done();
897
1653
  } catch (err) {
898
1654
  log.error(`Test Failure: ${err}`);
@@ -921,7 +1677,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
921
1677
  a.listStackInstances(null, null, null, null, null, (data, error) => {
922
1678
  try {
923
1679
  const displayE = 'stackSetName is required';
924
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-listStackInstances', displayE);
1680
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-listStackInstancesSTSRole', displayE);
925
1681
  done();
926
1682
  } catch (err) {
927
1683
  log.error(`Test Failure: ${err}`);
@@ -950,7 +1706,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
950
1706
  a.describeStackInstance(null, null, null, (data, error) => {
951
1707
  try {
952
1708
  const displayE = 'stackSetName is required';
953
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-describeStackInstance', displayE);
1709
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-describeStackInstanceSTSRole', displayE);
954
1710
  done();
955
1711
  } catch (err) {
956
1712
  log.error(`Test Failure: ${err}`);
@@ -967,7 +1723,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
967
1723
  a.describeStackInstance('fake data', null, null, (data, error) => {
968
1724
  try {
969
1725
  const displayE = 'stackInstanceAccount is required';
970
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-describeStackInstance', displayE);
1726
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-describeStackInstanceSTSRole', displayE);
971
1727
  done();
972
1728
  } catch (err) {
973
1729
  log.error(`Test Failure: ${err}`);
@@ -984,7 +1740,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
984
1740
  a.describeStackInstance('fake data', 'fake data', null, (data, error) => {
985
1741
  try {
986
1742
  const displayE = 'stackInstanceRegion is required';
987
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-describeStackInstance', displayE);
1743
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-describeStackInstanceSTSRole', displayE);
988
1744
  done();
989
1745
  } catch (err) {
990
1746
  log.error(`Test Failure: ${err}`);
@@ -1013,7 +1769,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1013
1769
  a.createStackInstances(null, null, null, null, null, null, null, (data, error) => {
1014
1770
  try {
1015
1771
  const displayE = 'stackSetName is required';
1016
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-createStackInstances', displayE);
1772
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-createStackInstancesSTSRole', displayE);
1017
1773
  done();
1018
1774
  } catch (err) {
1019
1775
  log.error(`Test Failure: ${err}`);
@@ -1030,7 +1786,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1030
1786
  a.createStackInstances('fake data', null, null, null, null, null, null, (data, error) => {
1031
1787
  try {
1032
1788
  const displayE = 'regions is required';
1033
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-createStackInstances', displayE);
1789
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-createStackInstancesSTSRole', displayE);
1034
1790
  done();
1035
1791
  } catch (err) {
1036
1792
  log.error(`Test Failure: ${err}`);
@@ -1059,7 +1815,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1059
1815
  a.updateStackInstances(null, null, null, null, null, null, null, (data, error) => {
1060
1816
  try {
1061
1817
  const displayE = 'stackSetName is required';
1062
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-updateStackInstances', displayE);
1818
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-updateStackInstancesSTSRole', displayE);
1063
1819
  done();
1064
1820
  } catch (err) {
1065
1821
  log.error(`Test Failure: ${err}`);
@@ -1076,7 +1832,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1076
1832
  a.updateStackInstances('fake data', null, null, null, null, null, null, (data, error) => {
1077
1833
  try {
1078
1834
  const displayE = 'regions is required';
1079
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-updateStackInstances', displayE);
1835
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-updateStackInstancesSTSRole', displayE);
1080
1836
  done();
1081
1837
  } catch (err) {
1082
1838
  log.error(`Test Failure: ${err}`);
@@ -1105,7 +1861,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1105
1861
  a.deleteStackInstances(null, null, null, null, null, null, null, (data, error) => {
1106
1862
  try {
1107
1863
  const displayE = 'stackSetName is required';
1108
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-deleteStackInstances', displayE);
1864
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-deleteStackInstancesSTSRole', displayE);
1109
1865
  done();
1110
1866
  } catch (err) {
1111
1867
  log.error(`Test Failure: ${err}`);
@@ -1122,7 +1878,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1122
1878
  a.deleteStackInstances('fake data', null, null, null, null, null, null, (data, error) => {
1123
1879
  try {
1124
1880
  const displayE = 'regions is required';
1125
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-deleteStackInstances', displayE);
1881
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-deleteStackInstancesSTSRole', displayE);
1126
1882
  done();
1127
1883
  } catch (err) {
1128
1884
  log.error(`Test Failure: ${err}`);
@@ -1139,7 +1895,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1139
1895
  a.deleteStackInstances('fake data', ['fake data'], null, null, null, null, null, (data, error) => {
1140
1896
  try {
1141
1897
  const displayE = 'retainStacks is required';
1142
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-deleteStackInstances', displayE);
1898
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-deleteStackInstancesSTSRole', displayE);
1143
1899
  done();
1144
1900
  } catch (err) {
1145
1901
  log.error(`Test Failure: ${err}`);
@@ -1180,7 +1936,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1180
1936
  a.describeStackSet(null, (data, error) => {
1181
1937
  try {
1182
1938
  const displayE = 'stackSetName is required';
1183
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-describeStackSet', displayE);
1939
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-describeStackSetSTSRole', displayE);
1184
1940
  done();
1185
1941
  } catch (err) {
1186
1942
  log.error(`Test Failure: ${err}`);
@@ -1209,7 +1965,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1209
1965
  a.createStackSet(null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
1210
1966
  try {
1211
1967
  const displayE = 'stackSetName is required';
1212
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-createStackSet', displayE);
1968
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-createStackSetSTSRole', displayE);
1213
1969
  done();
1214
1970
  } catch (err) {
1215
1971
  log.error(`Test Failure: ${err}`);
@@ -1238,7 +1994,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1238
1994
  a.updateStackSet(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
1239
1995
  try {
1240
1996
  const displayE = 'stackSetName is required';
1241
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-updateStackSet', displayE);
1997
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-updateStackSetSTSRole', displayE);
1242
1998
  done();
1243
1999
  } catch (err) {
1244
2000
  log.error(`Test Failure: ${err}`);
@@ -1267,7 +2023,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1267
2023
  a.deleteStackSet(null, (data, error) => {
1268
2024
  try {
1269
2025
  const displayE = 'stackSetName is required';
1270
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-deleteStackSet', displayE);
2026
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-deleteStackSetSTSRole', displayE);
1271
2027
  done();
1272
2028
  } catch (err) {
1273
2029
  log.error(`Test Failure: ${err}`);
@@ -1296,7 +2052,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1296
2052
  a.cancelUpdateStack(null, null, (data, error) => {
1297
2053
  try {
1298
2054
  const displayE = 'stackName is required';
1299
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-cancelUpdateStack', displayE);
2055
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-cancelUpdateStackSTSRole', displayE);
1300
2056
  done();
1301
2057
  } catch (err) {
1302
2058
  log.error(`Test Failure: ${err}`);
@@ -1325,7 +2081,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1325
2081
  a.listStackSetOperations(null, null, null, (data, error) => {
1326
2082
  try {
1327
2083
  const displayE = 'stackSetName is required';
1328
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-listStackSetOperations', displayE);
2084
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-listStackSetOperationsSTSRole', displayE);
1329
2085
  done();
1330
2086
  } catch (err) {
1331
2087
  log.error(`Test Failure: ${err}`);
@@ -1354,7 +2110,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1354
2110
  a.listStackSetOperationResults(null, null, null, null, (data, error) => {
1355
2111
  try {
1356
2112
  const displayE = 'stackSetName is required';
1357
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-listStackSetOperationResults', displayE);
2113
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-listStackSetOperationResultsSTSRole', displayE);
1358
2114
  done();
1359
2115
  } catch (err) {
1360
2116
  log.error(`Test Failure: ${err}`);
@@ -1371,7 +2127,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1371
2127
  a.listStackSetOperationResults('fake data', null, null, null, (data, error) => {
1372
2128
  try {
1373
2129
  const displayE = 'operationId is required';
1374
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-listStackSetOperationResults', displayE);
2130
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-listStackSetOperationResultsSTSRole', displayE);
1375
2131
  done();
1376
2132
  } catch (err) {
1377
2133
  log.error(`Test Failure: ${err}`);
@@ -1400,7 +2156,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1400
2156
  a.describeStackSetOperation(null, null, (data, error) => {
1401
2157
  try {
1402
2158
  const displayE = 'stackSetName is required';
1403
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-describeStackSetOperation', displayE);
2159
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-describeStackSetOperationSTSRole', displayE);
1404
2160
  done();
1405
2161
  } catch (err) {
1406
2162
  log.error(`Test Failure: ${err}`);
@@ -1417,7 +2173,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1417
2173
  a.describeStackSetOperation('fake data', null, (data, error) => {
1418
2174
  try {
1419
2175
  const displayE = 'operationId is required';
1420
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-describeStackSetOperation', displayE);
2176
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-describeStackSetOperationSTSRole', displayE);
1421
2177
  done();
1422
2178
  } catch (err) {
1423
2179
  log.error(`Test Failure: ${err}`);
@@ -1446,7 +2202,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1446
2202
  a.stopStackSetOperation(null, null, (data, error) => {
1447
2203
  try {
1448
2204
  const displayE = 'stackSetName is required';
1449
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-stopStackSetOperation', displayE);
2205
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-stopStackSetOperationSTSRole', displayE);
1450
2206
  done();
1451
2207
  } catch (err) {
1452
2208
  log.error(`Test Failure: ${err}`);
@@ -1463,7 +2219,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1463
2219
  a.stopStackSetOperation('fake data', null, (data, error) => {
1464
2220
  try {
1465
2221
  const displayE = 'operationId is required';
1466
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-stopStackSetOperation', displayE);
2222
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-stopStackSetOperationSTSRole', displayE);
1467
2223
  done();
1468
2224
  } catch (err) {
1469
2225
  log.error(`Test Failure: ${err}`);
@@ -1504,7 +2260,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1504
2260
  a.listStackResources(null, null, (data, error) => {
1505
2261
  try {
1506
2262
  const displayE = 'stackName is required';
1507
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-listStackResources', displayE);
2263
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-listStackResourcesSTSRole', displayE);
1508
2264
  done();
1509
2265
  } catch (err) {
1510
2266
  log.error(`Test Failure: ${err}`);
@@ -1533,7 +2289,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1533
2289
  a.describeStackResource(null, null, (data, error) => {
1534
2290
  try {
1535
2291
  const displayE = 'stackName is required';
1536
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-describeStackResource', displayE);
2292
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-describeStackResourceSTSRole', displayE);
1537
2293
  done();
1538
2294
  } catch (err) {
1539
2295
  log.error(`Test Failure: ${err}`);
@@ -1550,7 +2306,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1550
2306
  a.describeStackResource('fake data', null, (data, error) => {
1551
2307
  try {
1552
2308
  const displayE = 'logicalResourceId is required';
1553
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-describeStackResource', displayE);
2309
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-describeStackResourceSTSRole', displayE);
1554
2310
  done();
1555
2311
  } catch (err) {
1556
2312
  log.error(`Test Failure: ${err}`);
@@ -1591,7 +2347,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1591
2347
  a.describeStackResourceDrifts(null, null, null, null, (data, error) => {
1592
2348
  try {
1593
2349
  const displayE = 'stackName is required';
1594
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-describeStackResourceDrifts', displayE);
2350
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-describeStackResourceDriftsSTSRole', displayE);
1595
2351
  done();
1596
2352
  } catch (err) {
1597
2353
  log.error(`Test Failure: ${err}`);
@@ -1620,7 +2376,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1620
2376
  a.detectStackResourceDrift(null, null, (data, error) => {
1621
2377
  try {
1622
2378
  const displayE = 'stackName is required';
1623
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-detectStackResourceDrift', displayE);
2379
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-detectStackResourceDriftSTSRole', displayE);
1624
2380
  done();
1625
2381
  } catch (err) {
1626
2382
  log.error(`Test Failure: ${err}`);
@@ -1637,7 +2393,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1637
2393
  a.detectStackResourceDrift('fake data', null, (data, error) => {
1638
2394
  try {
1639
2395
  const displayE = 'logicalResourceId is required';
1640
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-detectStackResourceDrift', displayE);
2396
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-detectStackResourceDriftSTSRole', displayE);
1641
2397
  done();
1642
2398
  } catch (err) {
1643
2399
  log.error(`Test Failure: ${err}`);
@@ -1666,7 +2422,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1666
2422
  a.describeStackDriftDetectionStatus(null, (data, error) => {
1667
2423
  try {
1668
2424
  const displayE = 'stackDriftDetectionId is required';
1669
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-describeStackDriftDetectionStatus', displayE);
2425
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-describeStackDriftDetectionStatusSTSRole', displayE);
1670
2426
  done();
1671
2427
  } catch (err) {
1672
2428
  log.error(`Test Failure: ${err}`);
@@ -1695,7 +2451,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1695
2451
  a.detectStackDrift(null, null, (data, error) => {
1696
2452
  try {
1697
2453
  const displayE = 'stackName is required';
1698
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-detectStackDrift', displayE);
2454
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-detectStackDriftSTSRole', displayE);
1699
2455
  done();
1700
2456
  } catch (err) {
1701
2457
  log.error(`Test Failure: ${err}`);
@@ -1724,7 +2480,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1724
2480
  a.detectStackSetDrift(null, null, null, (data, error) => {
1725
2481
  try {
1726
2482
  const displayE = 'stackSetName is required';
1727
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-detectStackSetDrift', displayE);
2483
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-detectStackSetDriftSTSRole', displayE);
1728
2484
  done();
1729
2485
  } catch (err) {
1730
2486
  log.error(`Test Failure: ${err}`);
@@ -1753,7 +2509,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1753
2509
  a.getStackPolicy(null, (data, error) => {
1754
2510
  try {
1755
2511
  const displayE = 'stackName is required';
1756
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-getStackPolicy', displayE);
2512
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-getStackPolicySTSRole', displayE);
1757
2513
  done();
1758
2514
  } catch (err) {
1759
2515
  log.error(`Test Failure: ${err}`);
@@ -1782,7 +2538,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1782
2538
  a.setStackPolicy(null, null, null, (data, error) => {
1783
2539
  try {
1784
2540
  const displayE = 'stackName is required';
1785
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-setStackPolicy', displayE);
2541
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-setStackPolicySTSRole', displayE);
1786
2542
  done();
1787
2543
  } catch (err) {
1788
2544
  log.error(`Test Failure: ${err}`);
@@ -1811,7 +2567,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1811
2567
  a.continueUpdateRollback(null, null, null, null, (data, error) => {
1812
2568
  try {
1813
2569
  const displayE = 'stackName is required';
1814
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-continueUpdateRollback', displayE);
2570
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-continueUpdateRollbackSTSRole', displayE);
1815
2571
  done();
1816
2572
  } catch (err) {
1817
2573
  log.error(`Test Failure: ${err}`);
@@ -1840,7 +2596,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1840
2596
  a.listChangeSets(null, null, (data, error) => {
1841
2597
  try {
1842
2598
  const displayE = 'stackName is required';
1843
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-listChangeSets', displayE);
2599
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-listChangeSetsSTSRole', displayE);
1844
2600
  done();
1845
2601
  } catch (err) {
1846
2602
  log.error(`Test Failure: ${err}`);
@@ -1869,7 +2625,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1869
2625
  a.describeChangeSet(null, null, null, (data, error) => {
1870
2626
  try {
1871
2627
  const displayE = 'changeSetName is required';
1872
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-describeChangeSet', displayE);
2628
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-describeChangeSetSTSRole', displayE);
1873
2629
  done();
1874
2630
  } catch (err) {
1875
2631
  log.error(`Test Failure: ${err}`);
@@ -1898,7 +2654,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1898
2654
  a.executeChangeSet(null, null, null, (data, error) => {
1899
2655
  try {
1900
2656
  const displayE = 'changeSetName is required';
1901
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-executeChangeSet', displayE);
2657
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-executeChangeSetSTSRole', displayE);
1902
2658
  done();
1903
2659
  } catch (err) {
1904
2660
  log.error(`Test Failure: ${err}`);
@@ -1927,7 +2683,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1927
2683
  a.createChangeSet(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
1928
2684
  try {
1929
2685
  const displayE = 'stackName is required';
1930
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-createChangeSet', displayE);
2686
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-createChangeSetSTSRole', displayE);
1931
2687
  done();
1932
2688
  } catch (err) {
1933
2689
  log.error(`Test Failure: ${err}`);
@@ -1944,7 +2700,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1944
2700
  a.createChangeSet('fake data', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
1945
2701
  try {
1946
2702
  const displayE = 'changeSetName is required';
1947
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-createChangeSet', displayE);
2703
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-createChangeSetSTSRole', displayE);
1948
2704
  done();
1949
2705
  } catch (err) {
1950
2706
  log.error(`Test Failure: ${err}`);
@@ -1973,7 +2729,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
1973
2729
  a.deleteChangeSet(null, null, (data, error) => {
1974
2730
  try {
1975
2731
  const displayE = 'changeSetName is required';
1976
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-deleteChangeSet', displayE);
2732
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-deleteChangeSetSTSRole', displayE);
1977
2733
  done();
1978
2734
  } catch (err) {
1979
2735
  log.error(`Test Failure: ${err}`);
@@ -2038,7 +2794,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
2038
2794
  a.describeTypeRegistration(null, (data, error) => {
2039
2795
  try {
2040
2796
  const displayE = 'registrationToken is required';
2041
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-describeTypeRegistration', displayE);
2797
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-describeTypeRegistrationSTSRole', displayE);
2042
2798
  done();
2043
2799
  } catch (err) {
2044
2800
  log.error(`Test Failure: ${err}`);
@@ -2067,7 +2823,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
2067
2823
  a.registerType(null, null, null, null, null, null, (data, error) => {
2068
2824
  try {
2069
2825
  const displayE = 'schemaHandlerPackage is required';
2070
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-registerType', displayE);
2826
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-registerTypeSTSRole', displayE);
2071
2827
  done();
2072
2828
  } catch (err) {
2073
2829
  log.error(`Test Failure: ${err}`);
@@ -2132,7 +2888,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
2132
2888
  a.listImports(null, null, (data, error) => {
2133
2889
  try {
2134
2890
  const displayE = 'exportName is required';
2135
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-listImports', displayE);
2891
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-listImportsSTSRole', displayE);
2136
2892
  done();
2137
2893
  } catch (err) {
2138
2894
  log.error(`Test Failure: ${err}`);
@@ -2233,7 +2989,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
2233
2989
  a.signalResource(null, null, null, null, (data, error) => {
2234
2990
  try {
2235
2991
  const displayE = 'logicalResourceId is required';
2236
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-signalResource', displayE);
2992
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-signalResourceSTSRole', displayE);
2237
2993
  done();
2238
2994
  } catch (err) {
2239
2995
  log.error(`Test Failure: ${err}`);
@@ -2250,7 +3006,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
2250
3006
  a.signalResource('fake data', null, null, null, (data, error) => {
2251
3007
  try {
2252
3008
  const displayE = 'stackName is required';
2253
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-signalResource', displayE);
3009
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-signalResourceSTSRole', displayE);
2254
3010
  done();
2255
3011
  } catch (err) {
2256
3012
  log.error(`Test Failure: ${err}`);
@@ -2267,7 +3023,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
2267
3023
  a.signalResource('fake data', 'fake data', null, null, (data, error) => {
2268
3024
  try {
2269
3025
  const displayE = 'status is required';
2270
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-signalResource', displayE);
3026
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-signalResourceSTSRole', displayE);
2271
3027
  done();
2272
3028
  } catch (err) {
2273
3029
  log.error(`Test Failure: ${err}`);
@@ -2284,7 +3040,7 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
2284
3040
  a.signalResource('fake data', 'fake data', 'fake data', null, (data, error) => {
2285
3041
  try {
2286
3042
  const displayE = 'uniqueId is required';
2287
- runErrorAsserts(data, error, 'AD.300', 'Test-awscloudFormation-adapter-signalResource', displayE);
3043
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-signalResourceSTSRole', displayE);
2288
3044
  done();
2289
3045
  } catch (err) {
2290
3046
  log.error(`Test Failure: ${err}`);
@@ -2296,6 +3052,305 @@ describe('[unit] AwsCloudFormation Adapter Test', () => {
2296
3052
  done(error);
2297
3053
  }
2298
3054
  }).timeout(attemptTimeout);
3055
+
3056
+ describe('#activateOrganizationsAccess - errors', () => {
3057
+ it('should have a activateOrganizationsAccess function', (done) => {
3058
+ try {
3059
+ assert.equal(true, typeof a.activateOrganizationsAccess === 'function');
3060
+ done();
3061
+ } catch (error) {
3062
+ log.error(`Test Failure: ${error}`);
3063
+ done(error);
3064
+ }
3065
+ }).timeout(attemptTimeout);
3066
+ });
3067
+
3068
+ describe('#activateType - errors', () => {
3069
+ it('should have a activateType function', (done) => {
3070
+ try {
3071
+ assert.equal(true, typeof a.activateType === 'function');
3072
+ done();
3073
+ } catch (error) {
3074
+ log.error(`Test Failure: ${error}`);
3075
+ done(error);
3076
+ }
3077
+ }).timeout(attemptTimeout);
3078
+ });
3079
+
3080
+ describe('#batchDescribeTypeConfigurations - errors', () => {
3081
+ it('should have a batchDescribeTypeConfigurations function', (done) => {
3082
+ try {
3083
+ assert.equal(true, typeof a.batchDescribeTypeConfigurations === 'function');
3084
+ done();
3085
+ } catch (error) {
3086
+ log.error(`Test Failure: ${error}`);
3087
+ done(error);
3088
+ }
3089
+ }).timeout(attemptTimeout);
3090
+ it('should error if - missing typeConfigurationIdentifiers', (done) => {
3091
+ try {
3092
+ a.batchDescribeTypeConfigurations(null, (data, error) => {
3093
+ try {
3094
+ const displayE = 'typeConfigurationIdentifiers is required';
3095
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-batchDescribeTypeConfigurationsSTSRole', displayE);
3096
+ done();
3097
+ } catch (err) {
3098
+ log.error(`Test Failure: ${err}`);
3099
+ done(err);
3100
+ }
3101
+ });
3102
+ } catch (error) {
3103
+ log.error(`Adapter Exception: ${error}`);
3104
+ done(error);
3105
+ }
3106
+ }).timeout(attemptTimeout);
3107
+ });
3108
+
3109
+ describe('#deactivateOrganizationsAccess - errors', () => {
3110
+ it('should have a deactivateOrganizationsAccess function', (done) => {
3111
+ try {
3112
+ assert.equal(true, typeof a.deactivateOrganizationsAccess === 'function');
3113
+ done();
3114
+ } catch (error) {
3115
+ log.error(`Test Failure: ${error}`);
3116
+ done(error);
3117
+ }
3118
+ }).timeout(attemptTimeout);
3119
+ });
3120
+
3121
+ describe('#deactivateType - errors', () => {
3122
+ it('should have a deactivateType function', (done) => {
3123
+ try {
3124
+ assert.equal(true, typeof a.deactivateType === 'function');
3125
+ done();
3126
+ } catch (error) {
3127
+ log.error(`Test Failure: ${error}`);
3128
+ done(error);
3129
+ }
3130
+ }).timeout(attemptTimeout);
3131
+ });
3132
+
3133
+ describe('#describeChangeSetHooks - errors', () => {
3134
+ it('should have a describeChangeSetHooks function', (done) => {
3135
+ try {
3136
+ assert.equal(true, typeof a.describeChangeSetHooks === 'function');
3137
+ done();
3138
+ } catch (error) {
3139
+ log.error(`Test Failure: ${error}`);
3140
+ done(error);
3141
+ }
3142
+ }).timeout(attemptTimeout);
3143
+ it('should error if - missing changeSetName', (done) => {
3144
+ try {
3145
+ a.describeChangeSetHooks(null, null, null, null, (data, error) => {
3146
+ try {
3147
+ const displayE = 'changeSetName is required';
3148
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-describeChangeSetHooksSTSRole', displayE);
3149
+ done();
3150
+ } catch (err) {
3151
+ log.error(`Test Failure: ${err}`);
3152
+ done(err);
3153
+ }
3154
+ });
3155
+ } catch (error) {
3156
+ log.error(`Adapter Exception: ${error}`);
3157
+ done(error);
3158
+ }
3159
+ }).timeout(attemptTimeout);
3160
+ });
3161
+
3162
+ describe('#describeOrganizationsAccess - errors', () => {
3163
+ it('should have a describeOrganizationsAccess function', (done) => {
3164
+ try {
3165
+ assert.equal(true, typeof a.describeOrganizationsAccess === 'function');
3166
+ done();
3167
+ } catch (error) {
3168
+ log.error(`Test Failure: ${error}`);
3169
+ done(error);
3170
+ }
3171
+ }).timeout(attemptTimeout);
3172
+ });
3173
+
3174
+ describe('#describePublisher - errors', () => {
3175
+ it('should have a describePublisher function', (done) => {
3176
+ try {
3177
+ assert.equal(true, typeof a.describePublisher === 'function');
3178
+ done();
3179
+ } catch (error) {
3180
+ log.error(`Test Failure: ${error}`);
3181
+ done(error);
3182
+ }
3183
+ }).timeout(attemptTimeout);
3184
+ });
3185
+
3186
+ describe('#importStacksToStackSet - errors', () => {
3187
+ it('should have a importStacksToStackSet function', (done) => {
3188
+ try {
3189
+ assert.equal(true, typeof a.importStacksToStackSet === 'function');
3190
+ done();
3191
+ } catch (error) {
3192
+ log.error(`Test Failure: ${error}`);
3193
+ done(error);
3194
+ }
3195
+ }).timeout(attemptTimeout);
3196
+ it('should error if - missing stackSetName', (done) => {
3197
+ try {
3198
+ a.importStacksToStackSet(null, null, null, null, null, null, null, (data, error) => {
3199
+ try {
3200
+ const displayE = 'stackSetName is required';
3201
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-importStacksToStackSetSTSRole', displayE);
3202
+ done();
3203
+ } catch (err) {
3204
+ log.error(`Test Failure: ${err}`);
3205
+ done(err);
3206
+ }
3207
+ });
3208
+ } catch (error) {
3209
+ log.error(`Adapter Exception: ${error}`);
3210
+ done(error);
3211
+ }
3212
+ }).timeout(attemptTimeout);
3213
+ });
3214
+
3215
+ describe('#publishType - errors', () => {
3216
+ it('should have a publishType function', (done) => {
3217
+ try {
3218
+ assert.equal(true, typeof a.publishType === 'function');
3219
+ done();
3220
+ } catch (error) {
3221
+ log.error(`Test Failure: ${error}`);
3222
+ done(error);
3223
+ }
3224
+ }).timeout(attemptTimeout);
3225
+ });
3226
+
3227
+ describe('#recordHandlerProgress - errors', () => {
3228
+ it('should have a recordHandlerProgress function', (done) => {
3229
+ try {
3230
+ assert.equal(true, typeof a.recordHandlerProgress === 'function');
3231
+ done();
3232
+ } catch (error) {
3233
+ log.error(`Test Failure: ${error}`);
3234
+ done(error);
3235
+ }
3236
+ }).timeout(attemptTimeout);
3237
+ it('should error if - missing bearerToken', (done) => {
3238
+ try {
3239
+ a.recordHandlerProgress(null, null, null, null, null, null, null, (data, error) => {
3240
+ try {
3241
+ const displayE = 'bearerToken is required';
3242
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-recordHandlerProgressSTSRole', displayE);
3243
+ done();
3244
+ } catch (err) {
3245
+ log.error(`Test Failure: ${err}`);
3246
+ done(err);
3247
+ }
3248
+ });
3249
+ } catch (error) {
3250
+ log.error(`Adapter Exception: ${error}`);
3251
+ done(error);
3252
+ }
3253
+ }).timeout(attemptTimeout);
3254
+ it('should error if - missing operationStatus', (done) => {
3255
+ try {
3256
+ a.recordHandlerProgress('fakedata', null, null, null, null, null, null, (data, error) => {
3257
+ try {
3258
+ const displayE = 'operationStatus is required';
3259
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-recordHandlerProgressSTSRole', displayE);
3260
+ done();
3261
+ } catch (err) {
3262
+ log.error(`Test Failure: ${err}`);
3263
+ done(err);
3264
+ }
3265
+ });
3266
+ } catch (error) {
3267
+ log.error(`Adapter Exception: ${error}`);
3268
+ done(error);
3269
+ }
3270
+ }).timeout(attemptTimeout);
3271
+ });
3272
+
3273
+ describe('#registerPublisher - errors', () => {
3274
+ it('should have a registerPublisher function', (done) => {
3275
+ try {
3276
+ assert.equal(true, typeof a.registerPublisher === 'function');
3277
+ done();
3278
+ } catch (error) {
3279
+ log.error(`Test Failure: ${error}`);
3280
+ done(error);
3281
+ }
3282
+ }).timeout(attemptTimeout);
3283
+ });
3284
+
3285
+ describe('#rollbackStack - errors', () => {
3286
+ it('should have a rollbackStack function', (done) => {
3287
+ try {
3288
+ assert.equal(true, typeof a.rollbackStack === 'function');
3289
+ done();
3290
+ } catch (error) {
3291
+ log.error(`Test Failure: ${error}`);
3292
+ done(error);
3293
+ }
3294
+ }).timeout(attemptTimeout);
3295
+ it('should error if - missing stackName', (done) => {
3296
+ try {
3297
+ a.rollbackStack(null, null, null, (data, error) => {
3298
+ try {
3299
+ const displayE = 'stackName is required';
3300
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-rollbackStackSTSRole', displayE);
3301
+ done();
3302
+ } catch (err) {
3303
+ log.error(`Test Failure: ${err}`);
3304
+ done(err);
3305
+ }
3306
+ });
3307
+ } catch (error) {
3308
+ log.error(`Adapter Exception: ${error}`);
3309
+ done(error);
3310
+ }
3311
+ }).timeout(attemptTimeout);
3312
+ });
3313
+
3314
+ describe('#setTypeConfiguration - errors', () => {
3315
+ it('should have a setTypeConfiguration function', (done) => {
3316
+ try {
3317
+ assert.equal(true, typeof a.setTypeConfiguration === 'function');
3318
+ done();
3319
+ } catch (error) {
3320
+ log.error(`Test Failure: ${error}`);
3321
+ done(error);
3322
+ }
3323
+ }).timeout(attemptTimeout);
3324
+ it('should error if - missing configuration', (done) => {
3325
+ try {
3326
+ a.setTypeConfiguration(null, null, null, null, null, (data, error) => {
3327
+ try {
3328
+ const displayE = 'configuration is required';
3329
+ runErrorAsserts(data, error, 'AD.300', 'Test-aws_cloudformation-adapter-setTypeConfigurationSTSRole', displayE);
3330
+ done();
3331
+ } catch (err) {
3332
+ log.error(`Test Failure: ${err}`);
3333
+ done(err);
3334
+ }
3335
+ });
3336
+ } catch (error) {
3337
+ log.error(`Adapter Exception: ${error}`);
3338
+ done(error);
3339
+ }
3340
+ }).timeout(attemptTimeout);
3341
+ });
3342
+
3343
+ describe('#testType - errors', () => {
3344
+ it('should have a testType function', (done) => {
3345
+ try {
3346
+ assert.equal(true, typeof a.testType === 'function');
3347
+ done();
3348
+ } catch (error) {
3349
+ log.error(`Test Failure: ${error}`);
3350
+ done(error);
3351
+ }
3352
+ }).timeout(attemptTimeout);
3353
+ });
2299
3354
  });
2300
3355
  });
2301
3356
  });