@itentialopensource/adapter-aws_lambda 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/.eslintignore +6 -0
  2. package/.eslintrc.js +19 -0
  3. package/.gitlab/.gitkeep +0 -0
  4. package/.gitlab/issue_templates/.gitkeep +0 -0
  5. package/.gitlab/issue_templates/Default.md +17 -0
  6. package/.gitlab/issue_templates/bugReportTemplate.md +76 -0
  7. package/.gitlab/issue_templates/featureRequestTemplate.md +14 -0
  8. package/.jshintrc +0 -0
  9. package/AUTH.md +39 -0
  10. package/BROKER.md +211 -0
  11. package/CALLS.md +603 -0
  12. package/CODE_OF_CONDUCT.md +43 -0
  13. package/CONTRIBUTING.md +13 -0
  14. package/ENHANCE.md +69 -0
  15. package/LICENSE +201 -0
  16. package/PROPERTIES.md +661 -0
  17. package/README.md +344 -0
  18. package/SUMMARY.md +9 -0
  19. package/SYSTEMINFO.md +14 -0
  20. package/TROUBLESHOOT.md +56 -0
  21. package/UTILITIES.md +473 -0
  22. package/adapter.js +8845 -0
  23. package/adapterBase.js +1488 -0
  24. package/entities/.generic/action.json +214 -0
  25. package/entities/.generic/schema.json +28 -0
  26. package/entities/.system/action.json +50 -0
  27. package/entities/.system/mockdatafiles/getToken-default.json +3 -0
  28. package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
  29. package/entities/.system/schema.json +19 -0
  30. package/entities/.system/schemaTokenReq.json +53 -0
  31. package/entities/.system/schemaTokenResp.json +53 -0
  32. package/entities/AccountSettings/action.json +25 -0
  33. package/entities/AccountSettings/schema.json +19 -0
  34. package/entities/CodeSigningConfigs/action.json +127 -0
  35. package/entities/CodeSigningConfigs/schema.json +57 -0
  36. package/entities/EventSourceMappings/action.json +106 -0
  37. package/entities/EventSourceMappings/schema.json +78 -0
  38. package/entities/Functions/action.json +860 -0
  39. package/entities/Functions/schema.json +170 -0
  40. package/entities/Layers/action.json +189 -0
  41. package/entities/Layers/schema.json +126 -0
  42. package/entities/Tags/action.json +65 -0
  43. package/entities/Tags/schema.json +32 -0
  44. package/error.json +190 -0
  45. package/metadata.json +58 -0
  46. package/package.json +77 -0
  47. package/pronghorn.json +4833 -0
  48. package/propertiesDecorators.json +14 -0
  49. package/propertiesSchema.json +1635 -0
  50. package/report/AWS Lambda-swagger.fixed.json +15883 -0
  51. package/report/adapterInfo.json +10 -0
  52. package/report/creationReport.json +615 -0
  53. package/sampleProperties.json +274 -0
  54. package/test/integration/adapterTestBasicGet.js +117 -0
  55. package/test/integration/adapterTestConnectivity.js +117 -0
  56. package/test/integration/adapterTestIntegration.js +2103 -0
  57. package/test/unit/adapterBaseTestUnit.js +1626 -0
  58. package/test/unit/adapterTestUnit.js +3942 -0
  59. package/utils/adapterInfo.js +156 -0
  60. package/utils/argParser.js +44 -0
  61. package/utils/checkMigrate.js +102 -0
  62. package/utils/entitiesToDB.js +190 -0
  63. package/utils/findPath.js +74 -0
  64. package/utils/logger.js +26 -0
  65. package/utils/methodDocumentor.js +273 -0
  66. package/utils/modify.js +153 -0
  67. package/utils/mongoDbConnection.js +79 -0
  68. package/utils/mongoUtils.js +162 -0
  69. package/utils/pre-commit.sh +32 -0
  70. package/utils/removeHooks.js +20 -0
  71. package/utils/setup.js +33 -0
  72. package/utils/taskMover.js +308 -0
  73. package/utils/tbScript.js +103 -0
  74. package/utils/tbUtils.js +347 -0
  75. package/utils/testRunner.js +298 -0
  76. package/utils/troubleshootingAdapter.js +177 -0
  77. package/utils/updateAdapterConfig.js +158 -0
@@ -0,0 +1,2103 @@
1
+ /* @copyright Itential, LLC 2019 (pre-modifications) */
2
+
3
+ // Set globals
4
+ /* global describe it log pronghornProps */
5
+ /* eslint no-unused-vars: warn */
6
+ /* eslint no-underscore-dangle: warn */
7
+ /* eslint import/no-dynamic-require:warn */
8
+
9
+ // include required items for testing & logging
10
+ const assert = require('assert');
11
+ const fs = require('fs');
12
+ const path = require('path');
13
+ const util = require('util');
14
+ const mocha = require('mocha');
15
+ const winston = require('winston');
16
+ const { expect } = require('chai');
17
+ const { use } = require('chai');
18
+ const td = require('testdouble');
19
+ const log = require('../../utils/logger');
20
+
21
+ const anything = td.matchers.anything();
22
+
23
+ // stub and attemptTimeout are used throughout the code so set them here
24
+ const isRapidFail = false;
25
+ const isSaveMockData = false;
26
+
27
+ // read in the properties from the sampleProperties files
28
+ let adaptdir = __dirname;
29
+ if (adaptdir.endsWith('/test/integration')) {
30
+ adaptdir = adaptdir.substring(0, adaptdir.length - 17);
31
+ } else if (adaptdir.endsWith('/test/unit')) {
32
+ adaptdir = adaptdir.substring(0, adaptdir.length - 10);
33
+ }
34
+ const samProps = require(`${adaptdir}/sampleProperties.json`).properties;
35
+
36
+ // these variables can be changed to run in integrated mode so easier to set them here
37
+ // always check these in with bogus data!!!
38
+ samProps.stub = true;
39
+
40
+ // uncomment if connecting
41
+ // samProps.host = 'replace.hostorip.here';
42
+ // samProps.authentication.username = 'username';
43
+ // samProps.authentication.password = 'password';
44
+ // samProps.authentication.token = 'password';
45
+ // samProps.protocol = 'http';
46
+ // samProps.port = 80;
47
+ // samProps.ssl.enabled = false;
48
+ // samProps.ssl.accept_invalid_cert = false;
49
+
50
+ if (samProps.request.attempt_timeout < 30000) {
51
+ samProps.request.attempt_timeout = 30000;
52
+ }
53
+ samProps.devicebroker.enabled = true;
54
+ const attemptTimeout = samProps.request.attempt_timeout;
55
+ const { stub } = samProps;
56
+
57
+ // these are the adapter properties. You generally should not need to alter
58
+ // any of these after they are initially set up
59
+ global.pronghornProps = {
60
+ pathProps: {
61
+ encrypted: false
62
+ },
63
+ adapterProps: {
64
+ adapters: [{
65
+ id: 'Test-aws_lambda',
66
+ type: 'AwsLambda',
67
+ properties: samProps
68
+ }]
69
+ }
70
+ };
71
+
72
+ global.$HOME = `${__dirname}/../..`;
73
+
74
+ /**
75
+ * Runs the common asserts for test
76
+ */
77
+ function runCommonAsserts(data, error) {
78
+ assert.equal(undefined, error);
79
+ assert.notEqual(undefined, data);
80
+ assert.notEqual(null, data);
81
+ assert.notEqual(undefined, data.response);
82
+ assert.notEqual(null, data.response);
83
+ }
84
+
85
+ /**
86
+ * Runs the error asserts for the test
87
+ */
88
+ function runErrorAsserts(data, error, code, origin, displayStr) {
89
+ assert.equal(null, data);
90
+ assert.notEqual(undefined, error);
91
+ assert.notEqual(null, error);
92
+ assert.notEqual(undefined, error.IAPerror);
93
+ assert.notEqual(null, error.IAPerror);
94
+ assert.notEqual(undefined, error.IAPerror.displayString);
95
+ assert.notEqual(null, error.IAPerror.displayString);
96
+ assert.equal(code, error.icode);
97
+ assert.equal(origin, error.IAPerror.origin);
98
+ assert.equal(displayStr, error.IAPerror.displayString);
99
+ }
100
+
101
+ /**
102
+ * @function saveMockData
103
+ * Attempts to take data from responses and place them in MockDataFiles to help create Mockdata.
104
+ * Note, this was built based on entity file structure for Adapter-Engine 1.6.x
105
+ * @param {string} entityName - Name of the entity saving mock data for
106
+ * @param {string} actionName - Name of the action saving mock data for
107
+ * @param {string} descriptor - Something to describe this test (used as a type)
108
+ * @param {string or object} responseData - The data to put in the mock file.
109
+ */
110
+ function saveMockData(entityName, actionName, descriptor, responseData) {
111
+ // do not need to save mockdata if we are running in stub mode (already has mock data) or if told not to save
112
+ if (stub || !isSaveMockData) {
113
+ return false;
114
+ }
115
+
116
+ // must have a response in order to store the response
117
+ if (responseData && responseData.response) {
118
+ let data = responseData.response;
119
+
120
+ // if there was a raw response that one is better as it is untranslated
121
+ if (responseData.raw) {
122
+ data = responseData.raw;
123
+
124
+ try {
125
+ const temp = JSON.parse(data);
126
+ data = temp;
127
+ } catch (pex) {
128
+ // do not care if it did not parse as we will just use data
129
+ }
130
+ }
131
+
132
+ try {
133
+ const base = path.join(__dirname, `../../entities/${entityName}/`);
134
+ const mockdatafolder = 'mockdatafiles';
135
+ const filename = `mockdatafiles/${actionName}-${descriptor}.json`;
136
+
137
+ if (!fs.existsSync(base + mockdatafolder)) {
138
+ fs.mkdirSync(base + mockdatafolder);
139
+ }
140
+
141
+ // write the data we retrieved
142
+ fs.writeFile(base + filename, JSON.stringify(data, null, 2), 'utf8', (errWritingMock) => {
143
+ if (errWritingMock) throw errWritingMock;
144
+
145
+ // update the action file to reflect the changes. Note: We're replacing the default object for now!
146
+ fs.readFile(`${base}action.json`, (errRead, content) => {
147
+ if (errRead) throw errRead;
148
+
149
+ // parse the action file into JSON
150
+ const parsedJson = JSON.parse(content);
151
+
152
+ // The object update we'll write in.
153
+ const responseObj = {
154
+ type: descriptor,
155
+ key: '',
156
+ mockFile: filename
157
+ };
158
+
159
+ // get the object for method we're trying to change.
160
+ const currentMethodAction = parsedJson.actions.find((obj) => obj.name === actionName);
161
+
162
+ // if the method was not found - should never happen but...
163
+ if (!currentMethodAction) {
164
+ throw Error('Can\'t find an action for this method in the provided entity.');
165
+ }
166
+
167
+ // if there is a response object, we want to replace the Response object. Otherwise we'll create one.
168
+ const actionResponseObj = currentMethodAction.responseObjects.find((obj) => obj.type === descriptor);
169
+
170
+ // Add the action responseObj back into the array of response objects.
171
+ if (!actionResponseObj) {
172
+ // if there is a default response object, we want to get the key.
173
+ const defaultResponseObj = currentMethodAction.responseObjects.find((obj) => obj.type === 'default');
174
+
175
+ // save the default key into the new response object
176
+ if (defaultResponseObj) {
177
+ responseObj.key = defaultResponseObj.key;
178
+ }
179
+
180
+ // save the new response object
181
+ currentMethodAction.responseObjects = [responseObj];
182
+ } else {
183
+ // update the location of the mock data file
184
+ actionResponseObj.mockFile = responseObj.mockFile;
185
+ }
186
+
187
+ // Save results
188
+ fs.writeFile(`${base}action.json`, JSON.stringify(parsedJson, null, 2), (err) => {
189
+ if (err) throw err;
190
+ });
191
+ });
192
+ });
193
+ } catch (e) {
194
+ log.debug(`Failed to save mock data for ${actionName}. ${e.message}`);
195
+ return false;
196
+ }
197
+ }
198
+
199
+ // no response to save
200
+ log.debug(`No data passed to save into mockdata for ${actionName}`);
201
+ return false;
202
+ }
203
+
204
+ // require the adapter that we are going to be using
205
+ const AwsLambda = require('../../adapter');
206
+
207
+ // begin the testing - these should be pretty well defined between the describe and the it!
208
+ describe('[integration] Aws_lambda Adapter Test', () => {
209
+ describe('AwsLambda Class Tests', () => {
210
+ const a = new AwsLambda(
211
+ pronghornProps.adapterProps.adapters[0].id,
212
+ pronghornProps.adapterProps.adapters[0].properties
213
+ );
214
+
215
+ if (isRapidFail) {
216
+ const state = {};
217
+ state.passed = true;
218
+
219
+ mocha.afterEach(function x() {
220
+ state.passed = state.passed
221
+ && (this.currentTest.state === 'passed');
222
+ });
223
+ mocha.beforeEach(function x() {
224
+ if (!state.passed) {
225
+ return this.currentTest.skip();
226
+ }
227
+ return true;
228
+ });
229
+ }
230
+
231
+ describe('#class instance created', () => {
232
+ it('should be a class with properties', (done) => {
233
+ try {
234
+ assert.notEqual(null, a);
235
+ assert.notEqual(undefined, a);
236
+ const checkId = global.pronghornProps.adapterProps.adapters[0].id;
237
+ assert.equal(checkId, a.id);
238
+ assert.notEqual(null, a.allProps);
239
+ const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
240
+ assert.equal(check, a.healthcheckType);
241
+ done();
242
+ } catch (error) {
243
+ log.error(`Test Failure: ${error}`);
244
+ done(error);
245
+ }
246
+ }).timeout(attemptTimeout);
247
+ });
248
+
249
+ describe('#connect', () => {
250
+ it('should get connected - no healthcheck', (done) => {
251
+ try {
252
+ a.healthcheckType = 'none';
253
+ a.connect();
254
+
255
+ try {
256
+ assert.equal(true, a.alive);
257
+ done();
258
+ } catch (error) {
259
+ log.error(`Test Failure: ${error}`);
260
+ done(error);
261
+ }
262
+ } catch (error) {
263
+ log.error(`Adapter Exception: ${error}`);
264
+ done(error);
265
+ }
266
+ });
267
+ it('should get connected - startup healthcheck', (done) => {
268
+ try {
269
+ a.healthcheckType = 'startup';
270
+ a.connect();
271
+
272
+ try {
273
+ assert.equal(true, a.alive);
274
+ done();
275
+ } catch (error) {
276
+ log.error(`Test Failure: ${error}`);
277
+ done(error);
278
+ }
279
+ } catch (error) {
280
+ log.error(`Adapter Exception: ${error}`);
281
+ done(error);
282
+ }
283
+ });
284
+ });
285
+
286
+ describe('#healthCheck', () => {
287
+ it('should be healthy', (done) => {
288
+ try {
289
+ a.healthCheck(null, (data) => {
290
+ try {
291
+ assert.equal(true, a.healthy);
292
+ saveMockData('system', 'healthcheck', 'default', data);
293
+ done();
294
+ } catch (err) {
295
+ log.error(`Test Failure: ${err}`);
296
+ done(err);
297
+ }
298
+ });
299
+ } catch (error) {
300
+ log.error(`Adapter Exception: ${error}`);
301
+ done(error);
302
+ }
303
+ }).timeout(attemptTimeout);
304
+ });
305
+
306
+ // broker tests
307
+ describe('#getDevicesFiltered - errors', () => {
308
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
309
+ try {
310
+ const opts = {
311
+ filter: {
312
+ name: 'deviceName'
313
+ }
314
+ };
315
+ a.getDevicesFiltered(opts, (data, error) => {
316
+ try {
317
+ if (stub) {
318
+ if (samProps.devicebroker.getDevicesFiltered[0].handleFailure === 'ignore') {
319
+ assert.equal(null, error);
320
+ assert.notEqual(undefined, data);
321
+ assert.notEqual(null, data);
322
+ assert.equal(0, data.total);
323
+ assert.equal(0, data.list.length);
324
+ } else {
325
+ const displayE = 'Error 400 received on request';
326
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
327
+ }
328
+ } else {
329
+ runCommonAsserts(data, error);
330
+ }
331
+ done();
332
+ } catch (err) {
333
+ log.error(`Test Failure: ${err}`);
334
+ done(err);
335
+ }
336
+ });
337
+ } catch (error) {
338
+ log.error(`Adapter Exception: ${error}`);
339
+ done(error);
340
+ }
341
+ }).timeout(attemptTimeout);
342
+ });
343
+
344
+ describe('#iapGetDeviceCount - errors', () => {
345
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
346
+ try {
347
+ const opts = {
348
+ filter: {
349
+ name: 'deviceName'
350
+ }
351
+ };
352
+ a.iapGetDeviceCount((data, error) => {
353
+ try {
354
+ if (stub) {
355
+ if (samProps.devicebroker.getDevicesFiltered[0].handleFailure === 'ignore') {
356
+ assert.equal(null, error);
357
+ assert.notEqual(undefined, data);
358
+ assert.notEqual(null, data);
359
+ assert.equal(0, data.count);
360
+ } else {
361
+ const displayE = 'Error 400 received on request';
362
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
363
+ }
364
+ } else {
365
+ runCommonAsserts(data, error);
366
+ }
367
+ done();
368
+ } catch (err) {
369
+ log.error(`Test Failure: ${err}`);
370
+ done(err);
371
+ }
372
+ });
373
+ } catch (error) {
374
+ log.error(`Adapter Exception: ${error}`);
375
+ done(error);
376
+ }
377
+ }).timeout(attemptTimeout);
378
+ });
379
+
380
+ // exposed cache tests
381
+ describe('#iapPopulateEntityCache - errors', () => {
382
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
383
+ try {
384
+ a.iapPopulateEntityCache('Device', (data, error) => {
385
+ try {
386
+ if (stub) {
387
+ assert.equal(null, data);
388
+ assert.notEqual(undefined, error);
389
+ assert.notEqual(null, error);
390
+ done();
391
+ } else {
392
+ assert.equal(undefined, error);
393
+ assert.equal('success', data[0]);
394
+ done();
395
+ }
396
+ } catch (err) {
397
+ log.error(`Test Failure: ${err}`);
398
+ done(err);
399
+ }
400
+ });
401
+ } catch (error) {
402
+ log.error(`Adapter Exception: ${error}`);
403
+ done(error);
404
+ }
405
+ }).timeout(attemptTimeout);
406
+ });
407
+
408
+ describe('#iapRetrieveEntitiesCache - errors', () => {
409
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
410
+ try {
411
+ a.iapRetrieveEntitiesCache('Device', {}, (data, error) => {
412
+ try {
413
+ if (stub) {
414
+ assert.equal(null, data);
415
+ assert.notEqual(null, error);
416
+ assert.notEqual(undefined, error);
417
+ } else {
418
+ assert.equal(undefined, error);
419
+ assert.notEqual(null, data);
420
+ assert.notEqual(undefined, data);
421
+ }
422
+ done();
423
+ } catch (err) {
424
+ log.error(`Test Failure: ${err}`);
425
+ done(err);
426
+ }
427
+ });
428
+ } catch (error) {
429
+ log.error(`Adapter Exception: ${error}`);
430
+ done(error);
431
+ }
432
+ }).timeout(attemptTimeout);
433
+ });
434
+ /*
435
+ -----------------------------------------------------------------------
436
+ -----------------------------------------------------------------------
437
+ *** All code above this comment will be replaced during a migration ***
438
+ ******************* DO NOT REMOVE THIS COMMENT BLOCK ******************
439
+ -----------------------------------------------------------------------
440
+ -----------------------------------------------------------------------
441
+ */
442
+
443
+ const layersLayerName = 'fakedata';
444
+ const layersPublishLayerVersionBodyParam = {};
445
+ describe('#publishLayerVersion - errors', () => {
446
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
447
+ try {
448
+ a.publishLayerVersion(layersLayerName, layersPublishLayerVersionBodyParam, null, (data, error) => {
449
+ try {
450
+ if (stub) {
451
+ const displayE = 'Error 400 received on request';
452
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
453
+ } else {
454
+ runCommonAsserts(data, error);
455
+ }
456
+ saveMockData('Layers', 'publishLayerVersion', 'default', data);
457
+ done();
458
+ } catch (err) {
459
+ log.error(`Test Failure: ${err}`);
460
+ done(err);
461
+ }
462
+ });
463
+ } catch (error) {
464
+ log.error(`Adapter Exception: ${error}`);
465
+ done(error);
466
+ }
467
+ }).timeout(attemptTimeout);
468
+ });
469
+
470
+ const layersVersionNumber = 555;
471
+ const layersAddLayerVersionPermissionBodyParam = {};
472
+ describe('#addLayerVersionPermission - errors', () => {
473
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
474
+ try {
475
+ a.addLayerVersionPermission(layersLayerName, layersVersionNumber, null, layersAddLayerVersionPermissionBodyParam, null, (data, error) => {
476
+ try {
477
+ if (stub) {
478
+ const displayE = 'Error 400 received on request';
479
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
480
+ } else {
481
+ runCommonAsserts(data, error);
482
+ }
483
+ saveMockData('Layers', 'addLayerVersionPermission', 'default', data);
484
+ done();
485
+ } catch (err) {
486
+ log.error(`Test Failure: ${err}`);
487
+ done(err);
488
+ }
489
+ });
490
+ } catch (error) {
491
+ log.error(`Adapter Exception: ${error}`);
492
+ done(error);
493
+ }
494
+ }).timeout(attemptTimeout);
495
+ });
496
+
497
+ const layersArn = 'fakedata';
498
+ const layersFind = 'fakedata';
499
+ describe('#getLayerVersionByArn - errors', () => {
500
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
501
+ try {
502
+ a.getLayerVersionByArn(layersArn, layersFind, null, (data, error) => {
503
+ try {
504
+ if (stub) {
505
+ const displayE = 'Error 400 received on request';
506
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
507
+ } else {
508
+ runCommonAsserts(data, error);
509
+ }
510
+ saveMockData('Layers', 'getLayerVersionByArn', 'default', data);
511
+ done();
512
+ } catch (err) {
513
+ log.error(`Test Failure: ${err}`);
514
+ done(err);
515
+ }
516
+ });
517
+ } catch (error) {
518
+ log.error(`Adapter Exception: ${error}`);
519
+ done(error);
520
+ }
521
+ }).timeout(attemptTimeout);
522
+ });
523
+
524
+ describe('#listLayerVersions - errors', () => {
525
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
526
+ try {
527
+ a.listLayerVersions(null, layersLayerName, null, null, null, null, (data, error) => {
528
+ try {
529
+ if (stub) {
530
+ const displayE = 'Error 400 received on request';
531
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
532
+ } else {
533
+ runCommonAsserts(data, error);
534
+ }
535
+ saveMockData('Layers', 'listLayerVersions', 'default', data);
536
+ done();
537
+ } catch (err) {
538
+ log.error(`Test Failure: ${err}`);
539
+ done(err);
540
+ }
541
+ });
542
+ } catch (error) {
543
+ log.error(`Adapter Exception: ${error}`);
544
+ done(error);
545
+ }
546
+ }).timeout(attemptTimeout);
547
+ });
548
+
549
+ describe('#getLayerVersion - errors', () => {
550
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
551
+ try {
552
+ a.getLayerVersion(layersLayerName, layersVersionNumber, null, (data, error) => {
553
+ try {
554
+ if (stub) {
555
+ const displayE = 'Error 400 received on request';
556
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
557
+ } else {
558
+ runCommonAsserts(data, error);
559
+ }
560
+ saveMockData('Layers', 'getLayerVersion', 'default', data);
561
+ done();
562
+ } catch (err) {
563
+ log.error(`Test Failure: ${err}`);
564
+ done(err);
565
+ }
566
+ });
567
+ } catch (error) {
568
+ log.error(`Adapter Exception: ${error}`);
569
+ done(error);
570
+ }
571
+ }).timeout(attemptTimeout);
572
+ });
573
+
574
+ describe('#getLayerVersionPolicy - errors', () => {
575
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
576
+ try {
577
+ a.getLayerVersionPolicy(layersLayerName, layersVersionNumber, null, (data, error) => {
578
+ try {
579
+ if (stub) {
580
+ const displayE = 'Error 400 received on request';
581
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
582
+ } else {
583
+ runCommonAsserts(data, error);
584
+ }
585
+ saveMockData('Layers', 'getLayerVersionPolicy', 'default', data);
586
+ done();
587
+ } catch (err) {
588
+ log.error(`Test Failure: ${err}`);
589
+ done(err);
590
+ }
591
+ });
592
+ } catch (error) {
593
+ log.error(`Adapter Exception: ${error}`);
594
+ done(error);
595
+ }
596
+ }).timeout(attemptTimeout);
597
+ });
598
+
599
+ const functionsFunctionName = 'fakedata';
600
+ const functionsInvokeAsyncBodyParam = {};
601
+ describe('#invokeAsync - errors', () => {
602
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
603
+ try {
604
+ a.invokeAsync(functionsFunctionName, functionsInvokeAsyncBodyParam, null, (data, error) => {
605
+ try {
606
+ if (stub) {
607
+ const displayE = 'Error 400 received on request';
608
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
609
+ } else {
610
+ runCommonAsserts(data, error);
611
+ }
612
+ saveMockData('Functions', 'invokeAsync', 'default', data);
613
+ done();
614
+ } catch (err) {
615
+ log.error(`Test Failure: ${err}`);
616
+ done(err);
617
+ }
618
+ });
619
+ } catch (error) {
620
+ log.error(`Adapter Exception: ${error}`);
621
+ done(error);
622
+ }
623
+ }).timeout(attemptTimeout);
624
+ });
625
+
626
+ const functionsCreateFunctionBodyParam = {};
627
+ describe('#createFunction - errors', () => {
628
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
629
+ try {
630
+ a.createFunction(functionsCreateFunctionBodyParam, null, (data, error) => {
631
+ try {
632
+ if (stub) {
633
+ const displayE = 'Error 400 received on request';
634
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
635
+ } else {
636
+ runCommonAsserts(data, error);
637
+ }
638
+ saveMockData('Functions', 'createFunction', 'default', data);
639
+ done();
640
+ } catch (err) {
641
+ log.error(`Test Failure: ${err}`);
642
+ done(err);
643
+ }
644
+ });
645
+ } catch (error) {
646
+ log.error(`Adapter Exception: ${error}`);
647
+ done(error);
648
+ }
649
+ }).timeout(attemptTimeout);
650
+ });
651
+
652
+ const functionsCreateAliasBodyParam = {};
653
+ describe('#createAlias - errors', () => {
654
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
655
+ try {
656
+ a.createAlias(functionsFunctionName, functionsCreateAliasBodyParam, null, (data, error) => {
657
+ try {
658
+ if (stub) {
659
+ const displayE = 'Error 400 received on request';
660
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
661
+ } else {
662
+ runCommonAsserts(data, error);
663
+ }
664
+ saveMockData('Functions', 'createAlias', 'default', data);
665
+ done();
666
+ } catch (err) {
667
+ log.error(`Test Failure: ${err}`);
668
+ done(err);
669
+ }
670
+ });
671
+ } catch (error) {
672
+ log.error(`Adapter Exception: ${error}`);
673
+ done(error);
674
+ }
675
+ }).timeout(attemptTimeout);
676
+ });
677
+
678
+ const functionsQualifier = 'fakedata';
679
+ const functionsInvokeBodyParam = {
680
+ type: null
681
+ };
682
+ describe('#invoke - errors', () => {
683
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
684
+ try {
685
+ a.invoke(functionsFunctionName, functionsQualifier, functionsInvokeBodyParam, null, (data, error) => {
686
+ try {
687
+ if (stub) {
688
+ const displayE = 'Error 400 received on request';
689
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
690
+ } else {
691
+ runCommonAsserts(data, error);
692
+ }
693
+ saveMockData('Functions', 'invoke', 'default', data);
694
+ done();
695
+ } catch (err) {
696
+ log.error(`Test Failure: ${err}`);
697
+ done(err);
698
+ }
699
+ });
700
+ } catch (error) {
701
+ log.error(`Adapter Exception: ${error}`);
702
+ done(error);
703
+ }
704
+ }).timeout(attemptTimeout);
705
+ });
706
+
707
+ const functionsAddPermissionBodyParam = {};
708
+ describe('#addPermission - errors', () => {
709
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
710
+ try {
711
+ a.addPermission(functionsFunctionName, functionsQualifier, functionsAddPermissionBodyParam, null, (data, error) => {
712
+ try {
713
+ if (stub) {
714
+ const displayE = 'Error 400 received on request';
715
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
716
+ } else {
717
+ runCommonAsserts(data, error);
718
+ }
719
+ saveMockData('Functions', 'addPermission', 'default', data);
720
+ done();
721
+ } catch (err) {
722
+ log.error(`Test Failure: ${err}`);
723
+ done(err);
724
+ }
725
+ });
726
+ } catch (error) {
727
+ log.error(`Adapter Exception: ${error}`);
728
+ done(error);
729
+ }
730
+ }).timeout(attemptTimeout);
731
+ });
732
+
733
+ const functionsPublishVersionBodyParam = {
734
+ type: null
735
+ };
736
+ describe('#publishVersion - errors', () => {
737
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
738
+ try {
739
+ a.publishVersion(functionsFunctionName, functionsPublishVersionBodyParam, null, (data, error) => {
740
+ try {
741
+ if (stub) {
742
+ const displayE = 'Error 400 received on request';
743
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
744
+ } else {
745
+ runCommonAsserts(data, error);
746
+ }
747
+ saveMockData('Functions', 'publishVersion', 'default', data);
748
+ done();
749
+ } catch (err) {
750
+ log.error(`Test Failure: ${err}`);
751
+ done(err);
752
+ }
753
+ });
754
+ } catch (error) {
755
+ log.error(`Adapter Exception: ${error}`);
756
+ done(error);
757
+ }
758
+ }).timeout(attemptTimeout);
759
+ });
760
+
761
+ const functionsUpdateFunctionEventInvokeConfigBodyParam = {
762
+ type: null
763
+ };
764
+ describe('#updateFunctionEventInvokeConfig - errors', () => {
765
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
766
+ try {
767
+ a.updateFunctionEventInvokeConfig(functionsFunctionName, functionsQualifier, functionsUpdateFunctionEventInvokeConfigBodyParam, null, (data, error) => {
768
+ try {
769
+ if (stub) {
770
+ const displayE = 'Error 400 received on request';
771
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
772
+ } else {
773
+ runCommonAsserts(data, error);
774
+ }
775
+ saveMockData('Functions', 'updateFunctionEventInvokeConfig', 'default', data);
776
+ done();
777
+ } catch (err) {
778
+ log.error(`Test Failure: ${err}`);
779
+ done(err);
780
+ }
781
+ });
782
+ } catch (error) {
783
+ log.error(`Adapter Exception: ${error}`);
784
+ done(error);
785
+ }
786
+ }).timeout(attemptTimeout);
787
+ });
788
+
789
+ const functionsCreateFunctionUrlConfigBodyParam = {};
790
+ describe('#createFunctionUrlConfig - errors', () => {
791
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
792
+ try {
793
+ a.createFunctionUrlConfig(functionsFunctionName, functionsQualifier, functionsCreateFunctionUrlConfigBodyParam, null, (data, error) => {
794
+ try {
795
+ if (stub) {
796
+ const displayE = 'Error 400 received on request';
797
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
798
+ } else {
799
+ runCommonAsserts(data, error);
800
+ }
801
+ saveMockData('Functions', 'createFunctionUrlConfig', 'default', data);
802
+ done();
803
+ } catch (err) {
804
+ log.error(`Test Failure: ${err}`);
805
+ done(err);
806
+ }
807
+ });
808
+ } catch (error) {
809
+ log.error(`Adapter Exception: ${error}`);
810
+ done(error);
811
+ }
812
+ }).timeout(attemptTimeout);
813
+ });
814
+
815
+ const functionsInvokeWithResponseStreamBodyParam = {
816
+ type: null
817
+ };
818
+ describe('#invokeWithResponseStream - errors', () => {
819
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
820
+ try {
821
+ a.invokeWithResponseStream(functionsFunctionName, functionsQualifier, functionsInvokeWithResponseStreamBodyParam, null, (data, error) => {
822
+ try {
823
+ if (stub) {
824
+ const displayE = 'Error 400 received on request';
825
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
826
+ } else {
827
+ runCommonAsserts(data, error);
828
+ }
829
+ saveMockData('Functions', 'invokeWithResponseStream', 'default', data);
830
+ done();
831
+ } catch (err) {
832
+ log.error(`Test Failure: ${err}`);
833
+ done(err);
834
+ }
835
+ });
836
+ } catch (error) {
837
+ log.error(`Adapter Exception: ${error}`);
838
+ done(error);
839
+ }
840
+ }).timeout(attemptTimeout);
841
+ });
842
+
843
+ describe('#listFunctions - errors', () => {
844
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
845
+ try {
846
+ a.listFunctions(null, null, null, null, null, (data, error) => {
847
+ try {
848
+ if (stub) {
849
+ const displayE = 'Error 400 received on request';
850
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
851
+ } else {
852
+ runCommonAsserts(data, error);
853
+ }
854
+ saveMockData('Functions', 'listFunctions', 'default', data);
855
+ done();
856
+ } catch (err) {
857
+ log.error(`Test Failure: ${err}`);
858
+ done(err);
859
+ }
860
+ });
861
+ } catch (error) {
862
+ log.error(`Adapter Exception: ${error}`);
863
+ done(error);
864
+ }
865
+ }).timeout(attemptTimeout);
866
+ });
867
+
868
+ describe('#getFunction - errors', () => {
869
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
870
+ try {
871
+ a.getFunction(functionsFunctionName, functionsQualifier, null, (data, error) => {
872
+ try {
873
+ if (stub) {
874
+ const displayE = 'Error 400 received on request';
875
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
876
+ } else {
877
+ runCommonAsserts(data, error);
878
+ }
879
+ saveMockData('Functions', 'getFunction', 'default', data);
880
+ done();
881
+ } catch (err) {
882
+ log.error(`Test Failure: ${err}`);
883
+ done(err);
884
+ }
885
+ });
886
+ } catch (error) {
887
+ log.error(`Adapter Exception: ${error}`);
888
+ done(error);
889
+ }
890
+ }).timeout(attemptTimeout);
891
+ });
892
+
893
+ describe('#listAliases - errors', () => {
894
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
895
+ try {
896
+ a.listAliases(functionsFunctionName, null, null, null, null, (data, error) => {
897
+ try {
898
+ if (stub) {
899
+ const displayE = 'Error 400 received on request';
900
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
901
+ } else {
902
+ runCommonAsserts(data, error);
903
+ }
904
+ saveMockData('Functions', 'listAliases', 'default', data);
905
+ done();
906
+ } catch (err) {
907
+ log.error(`Test Failure: ${err}`);
908
+ done(err);
909
+ }
910
+ });
911
+ } catch (error) {
912
+ log.error(`Adapter Exception: ${error}`);
913
+ done(error);
914
+ }
915
+ }).timeout(attemptTimeout);
916
+ });
917
+
918
+ const functionsName = 'fakedata';
919
+ const functionsUpdateAliasBodyParam = {
920
+ type: null
921
+ };
922
+ describe('#updateAlias - errors', () => {
923
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
924
+ try {
925
+ a.updateAlias(functionsFunctionName, functionsName, functionsUpdateAliasBodyParam, null, (data, error) => {
926
+ try {
927
+ if (stub) {
928
+ const displayE = 'Error 400 received on request';
929
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
930
+ } else {
931
+ runCommonAsserts(data, error);
932
+ }
933
+ saveMockData('Functions', 'updateAlias', 'default', data);
934
+ done();
935
+ } catch (err) {
936
+ log.error(`Test Failure: ${err}`);
937
+ done(err);
938
+ }
939
+ });
940
+ } catch (error) {
941
+ log.error(`Adapter Exception: ${error}`);
942
+ done(error);
943
+ }
944
+ }).timeout(attemptTimeout);
945
+ });
946
+
947
+ describe('#getAlias - errors', () => {
948
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
949
+ try {
950
+ a.getAlias(functionsFunctionName, functionsName, null, (data, error) => {
951
+ try {
952
+ if (stub) {
953
+ const displayE = 'Error 400 received on request';
954
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
955
+ } else {
956
+ runCommonAsserts(data, error);
957
+ }
958
+ saveMockData('Functions', 'getAlias', 'default', data);
959
+ done();
960
+ } catch (err) {
961
+ log.error(`Test Failure: ${err}`);
962
+ done(err);
963
+ }
964
+ });
965
+ } catch (error) {
966
+ log.error(`Adapter Exception: ${error}`);
967
+ done(error);
968
+ }
969
+ }).timeout(attemptTimeout);
970
+ });
971
+
972
+ const functionsUpdateFunctionCodeBodyParam = {
973
+ type: null
974
+ };
975
+ describe('#updateFunctionCode - errors', () => {
976
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
977
+ try {
978
+ a.updateFunctionCode(functionsFunctionName, functionsUpdateFunctionCodeBodyParam, null, (data, error) => {
979
+ try {
980
+ if (stub) {
981
+ const displayE = 'Error 400 received on request';
982
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
983
+ } else {
984
+ runCommonAsserts(data, error);
985
+ }
986
+ saveMockData('Functions', 'updateFunctionCode', 'default', data);
987
+ done();
988
+ } catch (err) {
989
+ log.error(`Test Failure: ${err}`);
990
+ done(err);
991
+ }
992
+ });
993
+ } catch (error) {
994
+ log.error(`Adapter Exception: ${error}`);
995
+ done(error);
996
+ }
997
+ }).timeout(attemptTimeout);
998
+ });
999
+
1000
+ const functionsUpdateFunctionConfigurationBodyParam = {
1001
+ type: null
1002
+ };
1003
+ describe('#updateFunctionConfiguration - errors', () => {
1004
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1005
+ try {
1006
+ a.updateFunctionConfiguration(functionsFunctionName, functionsUpdateFunctionConfigurationBodyParam, null, (data, error) => {
1007
+ try {
1008
+ if (stub) {
1009
+ const displayE = 'Error 400 received on request';
1010
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1011
+ } else {
1012
+ runCommonAsserts(data, error);
1013
+ }
1014
+ saveMockData('Functions', 'updateFunctionConfiguration', 'default', data);
1015
+ done();
1016
+ } catch (err) {
1017
+ log.error(`Test Failure: ${err}`);
1018
+ done(err);
1019
+ }
1020
+ });
1021
+ } catch (error) {
1022
+ log.error(`Adapter Exception: ${error}`);
1023
+ done(error);
1024
+ }
1025
+ }).timeout(attemptTimeout);
1026
+ });
1027
+
1028
+ describe('#getFunctionConfiguration - errors', () => {
1029
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1030
+ try {
1031
+ a.getFunctionConfiguration(functionsFunctionName, functionsQualifier, null, (data, error) => {
1032
+ try {
1033
+ if (stub) {
1034
+ const displayE = 'Error 400 received on request';
1035
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1036
+ } else {
1037
+ runCommonAsserts(data, error);
1038
+ }
1039
+ saveMockData('Functions', 'getFunctionConfiguration', 'default', data);
1040
+ done();
1041
+ } catch (err) {
1042
+ log.error(`Test Failure: ${err}`);
1043
+ done(err);
1044
+ }
1045
+ });
1046
+ } catch (error) {
1047
+ log.error(`Adapter Exception: ${error}`);
1048
+ done(error);
1049
+ }
1050
+ }).timeout(attemptTimeout);
1051
+ });
1052
+
1053
+ describe('#getPolicy - errors', () => {
1054
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1055
+ try {
1056
+ a.getPolicy(functionsFunctionName, functionsQualifier, null, (data, error) => {
1057
+ try {
1058
+ if (stub) {
1059
+ const displayE = 'Error 400 received on request';
1060
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1061
+ } else {
1062
+ runCommonAsserts(data, error);
1063
+ }
1064
+ saveMockData('Functions', 'getPolicy', 'default', data);
1065
+ done();
1066
+ } catch (err) {
1067
+ log.error(`Test Failure: ${err}`);
1068
+ done(err);
1069
+ }
1070
+ });
1071
+ } catch (error) {
1072
+ log.error(`Adapter Exception: ${error}`);
1073
+ done(error);
1074
+ }
1075
+ }).timeout(attemptTimeout);
1076
+ });
1077
+
1078
+ describe('#listVersionsByFunction - errors', () => {
1079
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1080
+ try {
1081
+ a.listVersionsByFunction(functionsFunctionName, null, null, null, (data, error) => {
1082
+ try {
1083
+ if (stub) {
1084
+ const displayE = 'Error 400 received on request';
1085
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1086
+ } else {
1087
+ runCommonAsserts(data, error);
1088
+ }
1089
+ saveMockData('Functions', 'listVersionsByFunction', 'default', data);
1090
+ done();
1091
+ } catch (err) {
1092
+ log.error(`Test Failure: ${err}`);
1093
+ done(err);
1094
+ }
1095
+ });
1096
+ } catch (error) {
1097
+ log.error(`Adapter Exception: ${error}`);
1098
+ done(error);
1099
+ }
1100
+ }).timeout(attemptTimeout);
1101
+ });
1102
+
1103
+ const functionsPutFunctionConcurrencyBodyParam = {};
1104
+ describe('#putFunctionConcurrency - errors', () => {
1105
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1106
+ try {
1107
+ a.putFunctionConcurrency(functionsFunctionName, functionsPutFunctionConcurrencyBodyParam, null, (data, error) => {
1108
+ try {
1109
+ if (stub) {
1110
+ const displayE = 'Error 400 received on request';
1111
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1112
+ } else {
1113
+ runCommonAsserts(data, error);
1114
+ }
1115
+ saveMockData('Functions', 'putFunctionConcurrency', 'default', data);
1116
+ done();
1117
+ } catch (err) {
1118
+ log.error(`Test Failure: ${err}`);
1119
+ done(err);
1120
+ }
1121
+ });
1122
+ } catch (error) {
1123
+ log.error(`Adapter Exception: ${error}`);
1124
+ done(error);
1125
+ }
1126
+ }).timeout(attemptTimeout);
1127
+ });
1128
+
1129
+ const functionsPutFunctionEventInvokeConfigBodyParam = {
1130
+ type: null
1131
+ };
1132
+ describe('#putFunctionEventInvokeConfig - errors', () => {
1133
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1134
+ try {
1135
+ a.putFunctionEventInvokeConfig(functionsFunctionName, functionsQualifier, functionsPutFunctionEventInvokeConfigBodyParam, null, (data, error) => {
1136
+ try {
1137
+ if (stub) {
1138
+ const displayE = 'Error 400 received on request';
1139
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1140
+ } else {
1141
+ runCommonAsserts(data, error);
1142
+ }
1143
+ saveMockData('Functions', 'putFunctionEventInvokeConfig', 'default', data);
1144
+ done();
1145
+ } catch (err) {
1146
+ log.error(`Test Failure: ${err}`);
1147
+ done(err);
1148
+ }
1149
+ });
1150
+ } catch (error) {
1151
+ log.error(`Adapter Exception: ${error}`);
1152
+ done(error);
1153
+ }
1154
+ }).timeout(attemptTimeout);
1155
+ });
1156
+
1157
+ describe('#getFunctionEventInvokeConfig - errors', () => {
1158
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1159
+ try {
1160
+ a.getFunctionEventInvokeConfig(functionsFunctionName, functionsQualifier, null, (data, error) => {
1161
+ try {
1162
+ if (stub) {
1163
+ const displayE = 'Error 400 received on request';
1164
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1165
+ } else {
1166
+ runCommonAsserts(data, error);
1167
+ }
1168
+ saveMockData('Functions', 'getFunctionEventInvokeConfig', 'default', data);
1169
+ done();
1170
+ } catch (err) {
1171
+ log.error(`Test Failure: ${err}`);
1172
+ done(err);
1173
+ }
1174
+ });
1175
+ } catch (error) {
1176
+ log.error(`Adapter Exception: ${error}`);
1177
+ done(error);
1178
+ }
1179
+ }).timeout(attemptTimeout);
1180
+ });
1181
+
1182
+ describe('#listFunctionEventInvokeConfigs - errors', () => {
1183
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1184
+ try {
1185
+ a.listFunctionEventInvokeConfigs(functionsFunctionName, null, null, null, (data, error) => {
1186
+ try {
1187
+ if (stub) {
1188
+ const displayE = 'Error 400 received on request';
1189
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1190
+ } else {
1191
+ runCommonAsserts(data, error);
1192
+ }
1193
+ saveMockData('Functions', 'listFunctionEventInvokeConfigs', 'default', data);
1194
+ done();
1195
+ } catch (err) {
1196
+ log.error(`Test Failure: ${err}`);
1197
+ done(err);
1198
+ }
1199
+ });
1200
+ } catch (error) {
1201
+ log.error(`Adapter Exception: ${error}`);
1202
+ done(error);
1203
+ }
1204
+ }).timeout(attemptTimeout);
1205
+ });
1206
+
1207
+ describe('#getFunctionConcurrency - errors', () => {
1208
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1209
+ try {
1210
+ a.getFunctionConcurrency(functionsFunctionName, null, (data, error) => {
1211
+ try {
1212
+ if (stub) {
1213
+ const displayE = 'Error 400 received on request';
1214
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1215
+ } else {
1216
+ runCommonAsserts(data, error);
1217
+ }
1218
+ saveMockData('Functions', 'getFunctionConcurrency', 'default', data);
1219
+ done();
1220
+ } catch (err) {
1221
+ log.error(`Test Failure: ${err}`);
1222
+ done(err);
1223
+ }
1224
+ });
1225
+ } catch (error) {
1226
+ log.error(`Adapter Exception: ${error}`);
1227
+ done(error);
1228
+ }
1229
+ }).timeout(attemptTimeout);
1230
+ });
1231
+
1232
+ const functionsPutProvisionedConcurrencyConfigBodyParam = {};
1233
+ describe('#putProvisionedConcurrencyConfig - errors', () => {
1234
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1235
+ try {
1236
+ a.putProvisionedConcurrencyConfig(functionsFunctionName, functionsQualifier, functionsPutProvisionedConcurrencyConfigBodyParam, null, (data, error) => {
1237
+ try {
1238
+ if (stub) {
1239
+ const displayE = 'Error 400 received on request';
1240
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1241
+ } else {
1242
+ runCommonAsserts(data, error);
1243
+ }
1244
+ saveMockData('Functions', 'putProvisionedConcurrencyConfig', 'default', data);
1245
+ done();
1246
+ } catch (err) {
1247
+ log.error(`Test Failure: ${err}`);
1248
+ done(err);
1249
+ }
1250
+ });
1251
+ } catch (error) {
1252
+ log.error(`Adapter Exception: ${error}`);
1253
+ done(error);
1254
+ }
1255
+ }).timeout(attemptTimeout);
1256
+ });
1257
+
1258
+ describe('#getProvisionedConcurrencyConfig - errors', () => {
1259
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1260
+ try {
1261
+ a.getProvisionedConcurrencyConfig(functionsFunctionName, functionsQualifier, null, (data, error) => {
1262
+ try {
1263
+ if (stub) {
1264
+ const displayE = 'Error 400 received on request';
1265
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1266
+ } else {
1267
+ runCommonAsserts(data, error);
1268
+ }
1269
+ saveMockData('Functions', 'getProvisionedConcurrencyConfig', 'default', data);
1270
+ done();
1271
+ } catch (err) {
1272
+ log.error(`Test Failure: ${err}`);
1273
+ done(err);
1274
+ }
1275
+ });
1276
+ } catch (error) {
1277
+ log.error(`Adapter Exception: ${error}`);
1278
+ done(error);
1279
+ }
1280
+ }).timeout(attemptTimeout);
1281
+ });
1282
+
1283
+ const functionsPutFunctionCodeSigningConfigBodyParam = {};
1284
+ describe('#putFunctionCodeSigningConfig - errors', () => {
1285
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1286
+ try {
1287
+ a.putFunctionCodeSigningConfig(functionsFunctionName, functionsPutFunctionCodeSigningConfigBodyParam, null, (data, error) => {
1288
+ try {
1289
+ if (stub) {
1290
+ const displayE = 'Error 400 received on request';
1291
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1292
+ } else {
1293
+ runCommonAsserts(data, error);
1294
+ }
1295
+ saveMockData('Functions', 'putFunctionCodeSigningConfig', 'default', data);
1296
+ done();
1297
+ } catch (err) {
1298
+ log.error(`Test Failure: ${err}`);
1299
+ done(err);
1300
+ }
1301
+ });
1302
+ } catch (error) {
1303
+ log.error(`Adapter Exception: ${error}`);
1304
+ done(error);
1305
+ }
1306
+ }).timeout(attemptTimeout);
1307
+ });
1308
+
1309
+ describe('#getFunctionCodeSigningConfig - errors', () => {
1310
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1311
+ try {
1312
+ a.getFunctionCodeSigningConfig(functionsFunctionName, null, (data, error) => {
1313
+ try {
1314
+ if (stub) {
1315
+ const displayE = 'Error 400 received on request';
1316
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1317
+ } else {
1318
+ runCommonAsserts(data, error);
1319
+ }
1320
+ saveMockData('Functions', 'getFunctionCodeSigningConfig', 'default', data);
1321
+ done();
1322
+ } catch (err) {
1323
+ log.error(`Test Failure: ${err}`);
1324
+ done(err);
1325
+ }
1326
+ });
1327
+ } catch (error) {
1328
+ log.error(`Adapter Exception: ${error}`);
1329
+ done(error);
1330
+ }
1331
+ }).timeout(attemptTimeout);
1332
+ });
1333
+
1334
+ const functionsPutRuntimeManagementConfigBodyParam = {};
1335
+ describe('#putRuntimeManagementConfig - errors', () => {
1336
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1337
+ try {
1338
+ a.putRuntimeManagementConfig(functionsFunctionName, functionsQualifier, functionsPutRuntimeManagementConfigBodyParam, null, (data, error) => {
1339
+ try {
1340
+ if (stub) {
1341
+ const displayE = 'Error 400 received on request';
1342
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1343
+ } else {
1344
+ runCommonAsserts(data, error);
1345
+ }
1346
+ saveMockData('Functions', 'putRuntimeManagementConfig', 'default', data);
1347
+ done();
1348
+ } catch (err) {
1349
+ log.error(`Test Failure: ${err}`);
1350
+ done(err);
1351
+ }
1352
+ });
1353
+ } catch (error) {
1354
+ log.error(`Adapter Exception: ${error}`);
1355
+ done(error);
1356
+ }
1357
+ }).timeout(attemptTimeout);
1358
+ });
1359
+
1360
+ describe('#getRuntimeManagementConfig - errors', () => {
1361
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1362
+ try {
1363
+ a.getRuntimeManagementConfig(functionsFunctionName, functionsQualifier, null, (data, error) => {
1364
+ try {
1365
+ if (stub) {
1366
+ const displayE = 'Error 400 received on request';
1367
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1368
+ } else {
1369
+ runCommonAsserts(data, error);
1370
+ }
1371
+ saveMockData('Functions', 'getRuntimeManagementConfig', 'default', data);
1372
+ done();
1373
+ } catch (err) {
1374
+ log.error(`Test Failure: ${err}`);
1375
+ done(err);
1376
+ }
1377
+ });
1378
+ } catch (error) {
1379
+ log.error(`Adapter Exception: ${error}`);
1380
+ done(error);
1381
+ }
1382
+ }).timeout(attemptTimeout);
1383
+ });
1384
+
1385
+ const functionsUpdateFunctionUrlConfigBodyParam = {
1386
+ type: null
1387
+ };
1388
+ describe('#updateFunctionUrlConfig - errors', () => {
1389
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1390
+ try {
1391
+ a.updateFunctionUrlConfig(functionsFunctionName, functionsQualifier, functionsUpdateFunctionUrlConfigBodyParam, null, (data, error) => {
1392
+ try {
1393
+ if (stub) {
1394
+ const displayE = 'Error 400 received on request';
1395
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1396
+ } else {
1397
+ runCommonAsserts(data, error);
1398
+ }
1399
+ saveMockData('Functions', 'updateFunctionUrlConfig', 'default', data);
1400
+ done();
1401
+ } catch (err) {
1402
+ log.error(`Test Failure: ${err}`);
1403
+ done(err);
1404
+ }
1405
+ });
1406
+ } catch (error) {
1407
+ log.error(`Adapter Exception: ${error}`);
1408
+ done(error);
1409
+ }
1410
+ }).timeout(attemptTimeout);
1411
+ });
1412
+
1413
+ describe('#getFunctionUrlConfig - errors', () => {
1414
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1415
+ try {
1416
+ a.getFunctionUrlConfig(functionsFunctionName, functionsQualifier, null, (data, error) => {
1417
+ try {
1418
+ if (stub) {
1419
+ const displayE = 'Error 400 received on request';
1420
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1421
+ } else {
1422
+ runCommonAsserts(data, error);
1423
+ }
1424
+ saveMockData('Functions', 'getFunctionUrlConfig', 'default', data);
1425
+ done();
1426
+ } catch (err) {
1427
+ log.error(`Test Failure: ${err}`);
1428
+ done(err);
1429
+ }
1430
+ });
1431
+ } catch (error) {
1432
+ log.error(`Adapter Exception: ${error}`);
1433
+ done(error);
1434
+ }
1435
+ }).timeout(attemptTimeout);
1436
+ });
1437
+
1438
+ describe('#listFunctionUrlConfigs - errors', () => {
1439
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1440
+ try {
1441
+ a.listFunctionUrlConfigs(functionsFunctionName, null, null, null, (data, error) => {
1442
+ try {
1443
+ if (stub) {
1444
+ const displayE = 'Error 400 received on request';
1445
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1446
+ } else {
1447
+ runCommonAsserts(data, error);
1448
+ }
1449
+ saveMockData('Functions', 'listFunctionUrlConfigs', 'default', data);
1450
+ done();
1451
+ } catch (err) {
1452
+ log.error(`Test Failure: ${err}`);
1453
+ done(err);
1454
+ }
1455
+ });
1456
+ } catch (error) {
1457
+ log.error(`Adapter Exception: ${error}`);
1458
+ done(error);
1459
+ }
1460
+ }).timeout(attemptTimeout);
1461
+ });
1462
+
1463
+ const codeSigningConfigsCreateCodeSigningConfigBodyParam = {};
1464
+ describe('#createCodeSigningConfig - errors', () => {
1465
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1466
+ try {
1467
+ a.createCodeSigningConfig(codeSigningConfigsCreateCodeSigningConfigBodyParam, null, (data, error) => {
1468
+ try {
1469
+ if (stub) {
1470
+ const displayE = 'Error 400 received on request';
1471
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1472
+ } else {
1473
+ runCommonAsserts(data, error);
1474
+ }
1475
+ saveMockData('CodeSigningConfigs', 'createCodeSigningConfig', 'default', data);
1476
+ done();
1477
+ } catch (err) {
1478
+ log.error(`Test Failure: ${err}`);
1479
+ done(err);
1480
+ }
1481
+ });
1482
+ } catch (error) {
1483
+ log.error(`Adapter Exception: ${error}`);
1484
+ done(error);
1485
+ }
1486
+ }).timeout(attemptTimeout);
1487
+ });
1488
+
1489
+ describe('#listCodeSigningConfigs - errors', () => {
1490
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1491
+ try {
1492
+ a.listCodeSigningConfigs(null, null, null, (data, error) => {
1493
+ try {
1494
+ if (stub) {
1495
+ const displayE = 'Error 400 received on request';
1496
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1497
+ } else {
1498
+ runCommonAsserts(data, error);
1499
+ }
1500
+ saveMockData('CodeSigningConfigs', 'listCodeSigningConfigs', 'default', data);
1501
+ done();
1502
+ } catch (err) {
1503
+ log.error(`Test Failure: ${err}`);
1504
+ done(err);
1505
+ }
1506
+ });
1507
+ } catch (error) {
1508
+ log.error(`Adapter Exception: ${error}`);
1509
+ done(error);
1510
+ }
1511
+ }).timeout(attemptTimeout);
1512
+ });
1513
+
1514
+ const codeSigningConfigsCodeSigningConfigArn = 'fakedata';
1515
+ const codeSigningConfigsUpdateCodeSigningConfigBodyParam = {
1516
+ type: null
1517
+ };
1518
+ describe('#updateCodeSigningConfig - errors', () => {
1519
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1520
+ try {
1521
+ a.updateCodeSigningConfig(codeSigningConfigsCodeSigningConfigArn, codeSigningConfigsUpdateCodeSigningConfigBodyParam, null, (data, error) => {
1522
+ try {
1523
+ if (stub) {
1524
+ const displayE = 'Error 400 received on request';
1525
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1526
+ } else {
1527
+ runCommonAsserts(data, error);
1528
+ }
1529
+ saveMockData('CodeSigningConfigs', 'updateCodeSigningConfig', 'default', data);
1530
+ done();
1531
+ } catch (err) {
1532
+ log.error(`Test Failure: ${err}`);
1533
+ done(err);
1534
+ }
1535
+ });
1536
+ } catch (error) {
1537
+ log.error(`Adapter Exception: ${error}`);
1538
+ done(error);
1539
+ }
1540
+ }).timeout(attemptTimeout);
1541
+ });
1542
+
1543
+ describe('#getCodeSigningConfig - errors', () => {
1544
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1545
+ try {
1546
+ a.getCodeSigningConfig(codeSigningConfigsCodeSigningConfigArn, null, (data, error) => {
1547
+ try {
1548
+ if (stub) {
1549
+ const displayE = 'Error 400 received on request';
1550
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1551
+ } else {
1552
+ runCommonAsserts(data, error);
1553
+ }
1554
+ saveMockData('CodeSigningConfigs', 'getCodeSigningConfig', 'default', data);
1555
+ done();
1556
+ } catch (err) {
1557
+ log.error(`Test Failure: ${err}`);
1558
+ done(err);
1559
+ }
1560
+ });
1561
+ } catch (error) {
1562
+ log.error(`Adapter Exception: ${error}`);
1563
+ done(error);
1564
+ }
1565
+ }).timeout(attemptTimeout);
1566
+ });
1567
+
1568
+ describe('#listFunctionsByCodeSigningConfig - errors', () => {
1569
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1570
+ try {
1571
+ a.listFunctionsByCodeSigningConfig(codeSigningConfigsCodeSigningConfigArn, null, null, null, (data, error) => {
1572
+ try {
1573
+ if (stub) {
1574
+ const displayE = 'Error 400 received on request';
1575
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1576
+ } else {
1577
+ runCommonAsserts(data, error);
1578
+ }
1579
+ saveMockData('CodeSigningConfigs', 'listFunctionsByCodeSigningConfig', 'default', data);
1580
+ done();
1581
+ } catch (err) {
1582
+ log.error(`Test Failure: ${err}`);
1583
+ done(err);
1584
+ }
1585
+ });
1586
+ } catch (error) {
1587
+ log.error(`Adapter Exception: ${error}`);
1588
+ done(error);
1589
+ }
1590
+ }).timeout(attemptTimeout);
1591
+ });
1592
+
1593
+ const eventSourceMappingsCreateEventSourceMappingBodyParam = {};
1594
+ describe('#createEventSourceMapping - errors', () => {
1595
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1596
+ try {
1597
+ a.createEventSourceMapping(eventSourceMappingsCreateEventSourceMappingBodyParam, null, (data, error) => {
1598
+ try {
1599
+ if (stub) {
1600
+ const displayE = 'Error 400 received on request';
1601
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1602
+ } else {
1603
+ runCommonAsserts(data, error);
1604
+ }
1605
+ saveMockData('EventSourceMappings', 'createEventSourceMapping', 'default', data);
1606
+ done();
1607
+ } catch (err) {
1608
+ log.error(`Test Failure: ${err}`);
1609
+ done(err);
1610
+ }
1611
+ });
1612
+ } catch (error) {
1613
+ log.error(`Adapter Exception: ${error}`);
1614
+ done(error);
1615
+ }
1616
+ }).timeout(attemptTimeout);
1617
+ });
1618
+
1619
+ describe('#listEventSourceMappings - errors', () => {
1620
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1621
+ try {
1622
+ a.listEventSourceMappings(null, null, null, null, null, (data, error) => {
1623
+ try {
1624
+ if (stub) {
1625
+ const displayE = 'Error 400 received on request';
1626
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1627
+ } else {
1628
+ runCommonAsserts(data, error);
1629
+ }
1630
+ saveMockData('EventSourceMappings', 'listEventSourceMappings', 'default', data);
1631
+ done();
1632
+ } catch (err) {
1633
+ log.error(`Test Failure: ${err}`);
1634
+ done(err);
1635
+ }
1636
+ });
1637
+ } catch (error) {
1638
+ log.error(`Adapter Exception: ${error}`);
1639
+ done(error);
1640
+ }
1641
+ }).timeout(attemptTimeout);
1642
+ });
1643
+
1644
+ const eventSourceMappingsUUID = 'fakedata';
1645
+ const eventSourceMappingsUpdateEventSourceMappingBodyParam = {
1646
+ type: null
1647
+ };
1648
+ describe('#updateEventSourceMapping - errors', () => {
1649
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1650
+ try {
1651
+ a.updateEventSourceMapping(eventSourceMappingsUUID, eventSourceMappingsUpdateEventSourceMappingBodyParam, null, (data, error) => {
1652
+ try {
1653
+ if (stub) {
1654
+ const displayE = 'Error 400 received on request';
1655
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1656
+ } else {
1657
+ runCommonAsserts(data, error);
1658
+ }
1659
+ saveMockData('EventSourceMappings', 'updateEventSourceMapping', 'default', data);
1660
+ done();
1661
+ } catch (err) {
1662
+ log.error(`Test Failure: ${err}`);
1663
+ done(err);
1664
+ }
1665
+ });
1666
+ } catch (error) {
1667
+ log.error(`Adapter Exception: ${error}`);
1668
+ done(error);
1669
+ }
1670
+ }).timeout(attemptTimeout);
1671
+ });
1672
+
1673
+ describe('#getEventSourceMapping - errors', () => {
1674
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1675
+ try {
1676
+ a.getEventSourceMapping(eventSourceMappingsUUID, null, (data, error) => {
1677
+ try {
1678
+ if (stub) {
1679
+ const displayE = 'Error 400 received on request';
1680
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1681
+ } else {
1682
+ runCommonAsserts(data, error);
1683
+ }
1684
+ saveMockData('EventSourceMappings', 'getEventSourceMapping', 'default', data);
1685
+ done();
1686
+ } catch (err) {
1687
+ log.error(`Test Failure: ${err}`);
1688
+ done(err);
1689
+ }
1690
+ });
1691
+ } catch (error) {
1692
+ log.error(`Adapter Exception: ${error}`);
1693
+ done(error);
1694
+ }
1695
+ }).timeout(attemptTimeout);
1696
+ });
1697
+
1698
+ describe('#getAccountSettings - errors', () => {
1699
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1700
+ try {
1701
+ a.getAccountSettings(null, (data, error) => {
1702
+ try {
1703
+ if (stub) {
1704
+ const displayE = 'Error 400 received on request';
1705
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1706
+ } else {
1707
+ runCommonAsserts(data, error);
1708
+ }
1709
+ saveMockData('AccountSettings', 'getAccountSettings', 'default', data);
1710
+ done();
1711
+ } catch (err) {
1712
+ log.error(`Test Failure: ${err}`);
1713
+ done(err);
1714
+ }
1715
+ });
1716
+ } catch (error) {
1717
+ log.error(`Adapter Exception: ${error}`);
1718
+ done(error);
1719
+ }
1720
+ }).timeout(attemptTimeout);
1721
+ });
1722
+
1723
+ const tagsARN = 'fakedata';
1724
+ const tagsTagResourceBodyParam = {};
1725
+ describe('#tagResource - errors', () => {
1726
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1727
+ try {
1728
+ a.tagResource(tagsARN, tagsTagResourceBodyParam, null, (data, error) => {
1729
+ try {
1730
+ if (stub) {
1731
+ const displayE = 'Error 400 received on request';
1732
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1733
+ } else {
1734
+ runCommonAsserts(data, error);
1735
+ }
1736
+ saveMockData('Tags', 'tagResource', 'default', data);
1737
+ done();
1738
+ } catch (err) {
1739
+ log.error(`Test Failure: ${err}`);
1740
+ done(err);
1741
+ }
1742
+ });
1743
+ } catch (error) {
1744
+ log.error(`Adapter Exception: ${error}`);
1745
+ done(error);
1746
+ }
1747
+ }).timeout(attemptTimeout);
1748
+ });
1749
+
1750
+ describe('#listTags - errors', () => {
1751
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1752
+ try {
1753
+ a.listTags(tagsARN, null, (data, error) => {
1754
+ try {
1755
+ if (stub) {
1756
+ const displayE = 'Error 400 received on request';
1757
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1758
+ } else {
1759
+ runCommonAsserts(data, error);
1760
+ }
1761
+ saveMockData('Tags', 'listTags', 'default', data);
1762
+ done();
1763
+ } catch (err) {
1764
+ log.error(`Test Failure: ${err}`);
1765
+ done(err);
1766
+ }
1767
+ });
1768
+ } catch (error) {
1769
+ log.error(`Adapter Exception: ${error}`);
1770
+ done(error);
1771
+ }
1772
+ }).timeout(attemptTimeout);
1773
+ });
1774
+
1775
+ describe('#deleteLayerVersion - errors', () => {
1776
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1777
+ try {
1778
+ a.deleteLayerVersion(layersLayerName, layersVersionNumber, null, (data, error) => {
1779
+ try {
1780
+ if (stub) {
1781
+ const displayE = 'Error 400 received on request';
1782
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1783
+ } else {
1784
+ runCommonAsserts(data, error);
1785
+ }
1786
+ saveMockData('Layers', 'deleteLayerVersion', 'default', data);
1787
+ done();
1788
+ } catch (err) {
1789
+ log.error(`Test Failure: ${err}`);
1790
+ done(err);
1791
+ }
1792
+ });
1793
+ } catch (error) {
1794
+ log.error(`Adapter Exception: ${error}`);
1795
+ done(error);
1796
+ }
1797
+ }).timeout(attemptTimeout);
1798
+ });
1799
+
1800
+ const layersStatementId = 'fakedata';
1801
+ describe('#removeLayerVersionPermission - errors', () => {
1802
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1803
+ try {
1804
+ a.removeLayerVersionPermission(layersLayerName, layersVersionNumber, layersStatementId, null, null, (data, error) => {
1805
+ try {
1806
+ if (stub) {
1807
+ const displayE = 'Error 400 received on request';
1808
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1809
+ } else {
1810
+ runCommonAsserts(data, error);
1811
+ }
1812
+ saveMockData('Layers', 'removeLayerVersionPermission', 'default', data);
1813
+ done();
1814
+ } catch (err) {
1815
+ log.error(`Test Failure: ${err}`);
1816
+ done(err);
1817
+ }
1818
+ });
1819
+ } catch (error) {
1820
+ log.error(`Adapter Exception: ${error}`);
1821
+ done(error);
1822
+ }
1823
+ }).timeout(attemptTimeout);
1824
+ });
1825
+
1826
+ describe('#deleteFunction - errors', () => {
1827
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1828
+ try {
1829
+ a.deleteFunction(functionsFunctionName, functionsQualifier, null, (data, error) => {
1830
+ try {
1831
+ if (stub) {
1832
+ const displayE = 'Error 400 received on request';
1833
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1834
+ } else {
1835
+ runCommonAsserts(data, error);
1836
+ }
1837
+ saveMockData('Functions', 'deleteFunction', 'default', data);
1838
+ done();
1839
+ } catch (err) {
1840
+ log.error(`Test Failure: ${err}`);
1841
+ done(err);
1842
+ }
1843
+ });
1844
+ } catch (error) {
1845
+ log.error(`Adapter Exception: ${error}`);
1846
+ done(error);
1847
+ }
1848
+ }).timeout(attemptTimeout);
1849
+ });
1850
+
1851
+ describe('#deleteAlias - errors', () => {
1852
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1853
+ try {
1854
+ a.deleteAlias(functionsFunctionName, functionsName, null, (data, error) => {
1855
+ try {
1856
+ if (stub) {
1857
+ const displayE = 'Error 400 received on request';
1858
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1859
+ } else {
1860
+ runCommonAsserts(data, error);
1861
+ }
1862
+ saveMockData('Functions', 'deleteAlias', 'default', data);
1863
+ done();
1864
+ } catch (err) {
1865
+ log.error(`Test Failure: ${err}`);
1866
+ done(err);
1867
+ }
1868
+ });
1869
+ } catch (error) {
1870
+ log.error(`Adapter Exception: ${error}`);
1871
+ done(error);
1872
+ }
1873
+ }).timeout(attemptTimeout);
1874
+ });
1875
+
1876
+ const functionsStatementId = 'fakedata';
1877
+ describe('#removePermission - errors', () => {
1878
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1879
+ try {
1880
+ a.removePermission(functionsFunctionName, functionsStatementId, functionsQualifier, null, null, (data, error) => {
1881
+ try {
1882
+ if (stub) {
1883
+ const displayE = 'Error 400 received on request';
1884
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1885
+ } else {
1886
+ runCommonAsserts(data, error);
1887
+ }
1888
+ saveMockData('Functions', 'removePermission', 'default', data);
1889
+ done();
1890
+ } catch (err) {
1891
+ log.error(`Test Failure: ${err}`);
1892
+ done(err);
1893
+ }
1894
+ });
1895
+ } catch (error) {
1896
+ log.error(`Adapter Exception: ${error}`);
1897
+ done(error);
1898
+ }
1899
+ }).timeout(attemptTimeout);
1900
+ });
1901
+
1902
+ describe('#deleteFunctionConcurrency - errors', () => {
1903
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1904
+ try {
1905
+ a.deleteFunctionConcurrency(functionsFunctionName, null, (data, error) => {
1906
+ try {
1907
+ if (stub) {
1908
+ const displayE = 'Error 400 received on request';
1909
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1910
+ } else {
1911
+ runCommonAsserts(data, error);
1912
+ }
1913
+ saveMockData('Functions', 'deleteFunctionConcurrency', 'default', data);
1914
+ done();
1915
+ } catch (err) {
1916
+ log.error(`Test Failure: ${err}`);
1917
+ done(err);
1918
+ }
1919
+ });
1920
+ } catch (error) {
1921
+ log.error(`Adapter Exception: ${error}`);
1922
+ done(error);
1923
+ }
1924
+ }).timeout(attemptTimeout);
1925
+ });
1926
+
1927
+ describe('#deleteFunctionEventInvokeConfig - errors', () => {
1928
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1929
+ try {
1930
+ a.deleteFunctionEventInvokeConfig(functionsFunctionName, functionsQualifier, null, (data, error) => {
1931
+ try {
1932
+ if (stub) {
1933
+ const displayE = 'Error 400 received on request';
1934
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1935
+ } else {
1936
+ runCommonAsserts(data, error);
1937
+ }
1938
+ saveMockData('Functions', 'deleteFunctionEventInvokeConfig', 'default', data);
1939
+ done();
1940
+ } catch (err) {
1941
+ log.error(`Test Failure: ${err}`);
1942
+ done(err);
1943
+ }
1944
+ });
1945
+ } catch (error) {
1946
+ log.error(`Adapter Exception: ${error}`);
1947
+ done(error);
1948
+ }
1949
+ }).timeout(attemptTimeout);
1950
+ });
1951
+
1952
+ describe('#deleteProvisionedConcurrencyConfig - errors', () => {
1953
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1954
+ try {
1955
+ a.deleteProvisionedConcurrencyConfig(functionsFunctionName, functionsQualifier, null, (data, error) => {
1956
+ try {
1957
+ if (stub) {
1958
+ const displayE = 'Error 400 received on request';
1959
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1960
+ } else {
1961
+ runCommonAsserts(data, error);
1962
+ }
1963
+ saveMockData('Functions', 'deleteProvisionedConcurrencyConfig', 'default', data);
1964
+ done();
1965
+ } catch (err) {
1966
+ log.error(`Test Failure: ${err}`);
1967
+ done(err);
1968
+ }
1969
+ });
1970
+ } catch (error) {
1971
+ log.error(`Adapter Exception: ${error}`);
1972
+ done(error);
1973
+ }
1974
+ }).timeout(attemptTimeout);
1975
+ });
1976
+
1977
+ describe('#deleteFunctionCodeSigningConfig - errors', () => {
1978
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
1979
+ try {
1980
+ a.deleteFunctionCodeSigningConfig(functionsFunctionName, null, (data, error) => {
1981
+ try {
1982
+ if (stub) {
1983
+ const displayE = 'Error 400 received on request';
1984
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
1985
+ } else {
1986
+ runCommonAsserts(data, error);
1987
+ }
1988
+ saveMockData('Functions', 'deleteFunctionCodeSigningConfig', 'default', data);
1989
+ done();
1990
+ } catch (err) {
1991
+ log.error(`Test Failure: ${err}`);
1992
+ done(err);
1993
+ }
1994
+ });
1995
+ } catch (error) {
1996
+ log.error(`Adapter Exception: ${error}`);
1997
+ done(error);
1998
+ }
1999
+ }).timeout(attemptTimeout);
2000
+ });
2001
+
2002
+ describe('#deleteFunctionUrlConfig - errors', () => {
2003
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2004
+ try {
2005
+ a.deleteFunctionUrlConfig(functionsFunctionName, functionsQualifier, null, (data, error) => {
2006
+ try {
2007
+ if (stub) {
2008
+ const displayE = 'Error 400 received on request';
2009
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
2010
+ } else {
2011
+ runCommonAsserts(data, error);
2012
+ }
2013
+ saveMockData('Functions', 'deleteFunctionUrlConfig', 'default', data);
2014
+ done();
2015
+ } catch (err) {
2016
+ log.error(`Test Failure: ${err}`);
2017
+ done(err);
2018
+ }
2019
+ });
2020
+ } catch (error) {
2021
+ log.error(`Adapter Exception: ${error}`);
2022
+ done(error);
2023
+ }
2024
+ }).timeout(attemptTimeout);
2025
+ });
2026
+
2027
+ describe('#deleteCodeSigningConfig - errors', () => {
2028
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2029
+ try {
2030
+ a.deleteCodeSigningConfig(codeSigningConfigsCodeSigningConfigArn, null, (data, error) => {
2031
+ try {
2032
+ if (stub) {
2033
+ const displayE = 'Error 400 received on request';
2034
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
2035
+ } else {
2036
+ runCommonAsserts(data, error);
2037
+ }
2038
+ saveMockData('CodeSigningConfigs', 'deleteCodeSigningConfig', 'default', data);
2039
+ done();
2040
+ } catch (err) {
2041
+ log.error(`Test Failure: ${err}`);
2042
+ done(err);
2043
+ }
2044
+ });
2045
+ } catch (error) {
2046
+ log.error(`Adapter Exception: ${error}`);
2047
+ done(error);
2048
+ }
2049
+ }).timeout(attemptTimeout);
2050
+ });
2051
+
2052
+ describe('#deleteEventSourceMapping - errors', () => {
2053
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2054
+ try {
2055
+ a.deleteEventSourceMapping(eventSourceMappingsUUID, null, (data, error) => {
2056
+ try {
2057
+ if (stub) {
2058
+ const displayE = 'Error 400 received on request';
2059
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
2060
+ } else {
2061
+ runCommonAsserts(data, error);
2062
+ }
2063
+ saveMockData('EventSourceMappings', 'deleteEventSourceMapping', 'default', data);
2064
+ done();
2065
+ } catch (err) {
2066
+ log.error(`Test Failure: ${err}`);
2067
+ done(err);
2068
+ }
2069
+ });
2070
+ } catch (error) {
2071
+ log.error(`Adapter Exception: ${error}`);
2072
+ done(error);
2073
+ }
2074
+ }).timeout(attemptTimeout);
2075
+ });
2076
+
2077
+ const tagsTagKeys = [];
2078
+ describe('#untagResource - errors', () => {
2079
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
2080
+ try {
2081
+ a.untagResource(tagsARN, tagsTagKeys, null, (data, error) => {
2082
+ try {
2083
+ if (stub) {
2084
+ const displayE = 'Error 400 received on request';
2085
+ runErrorAsserts(data, error, 'AD.500', 'Test-aws_lambda-connectorRest-handleEndResponse', displayE);
2086
+ } else {
2087
+ runCommonAsserts(data, error);
2088
+ }
2089
+ saveMockData('Tags', 'untagResource', 'default', data);
2090
+ done();
2091
+ } catch (err) {
2092
+ log.error(`Test Failure: ${err}`);
2093
+ done(err);
2094
+ }
2095
+ });
2096
+ } catch (error) {
2097
+ log.error(`Adapter Exception: ${error}`);
2098
+ done(error);
2099
+ }
2100
+ }).timeout(attemptTimeout);
2101
+ });
2102
+ });
2103
+ });