@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.
- package/.eslintignore +6 -0
- package/.eslintrc.js +19 -0
- package/.gitlab/.gitkeep +0 -0
- package/.gitlab/issue_templates/.gitkeep +0 -0
- package/.gitlab/issue_templates/Default.md +17 -0
- package/.gitlab/issue_templates/bugReportTemplate.md +76 -0
- package/.gitlab/issue_templates/featureRequestTemplate.md +14 -0
- package/.jshintrc +0 -0
- package/AUTH.md +39 -0
- package/BROKER.md +211 -0
- package/CALLS.md +603 -0
- package/CODE_OF_CONDUCT.md +43 -0
- package/CONTRIBUTING.md +13 -0
- package/ENHANCE.md +69 -0
- package/LICENSE +201 -0
- package/PROPERTIES.md +661 -0
- package/README.md +344 -0
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +14 -0
- package/TROUBLESHOOT.md +56 -0
- package/UTILITIES.md +473 -0
- package/adapter.js +8845 -0
- package/adapterBase.js +1488 -0
- package/entities/.generic/action.json +214 -0
- package/entities/.generic/schema.json +28 -0
- package/entities/.system/action.json +50 -0
- package/entities/.system/mockdatafiles/getToken-default.json +3 -0
- package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
- package/entities/.system/schema.json +19 -0
- package/entities/.system/schemaTokenReq.json +53 -0
- package/entities/.system/schemaTokenResp.json +53 -0
- package/entities/AccountSettings/action.json +25 -0
- package/entities/AccountSettings/schema.json +19 -0
- package/entities/CodeSigningConfigs/action.json +127 -0
- package/entities/CodeSigningConfigs/schema.json +57 -0
- package/entities/EventSourceMappings/action.json +106 -0
- package/entities/EventSourceMappings/schema.json +78 -0
- package/entities/Functions/action.json +860 -0
- package/entities/Functions/schema.json +170 -0
- package/entities/Layers/action.json +189 -0
- package/entities/Layers/schema.json +126 -0
- package/entities/Tags/action.json +65 -0
- package/entities/Tags/schema.json +32 -0
- package/error.json +190 -0
- package/metadata.json +58 -0
- package/package.json +77 -0
- package/pronghorn.json +4833 -0
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +1635 -0
- package/report/AWS Lambda-swagger.fixed.json +15883 -0
- package/report/adapterInfo.json +10 -0
- package/report/creationReport.json +615 -0
- package/sampleProperties.json +274 -0
- package/test/integration/adapterTestBasicGet.js +117 -0
- package/test/integration/adapterTestConnectivity.js +117 -0
- package/test/integration/adapterTestIntegration.js +2103 -0
- package/test/unit/adapterBaseTestUnit.js +1626 -0
- package/test/unit/adapterTestUnit.js +3942 -0
- package/utils/adapterInfo.js +156 -0
- package/utils/argParser.js +44 -0
- package/utils/checkMigrate.js +102 -0
- package/utils/entitiesToDB.js +190 -0
- package/utils/findPath.js +74 -0
- package/utils/logger.js +26 -0
- package/utils/methodDocumentor.js +273 -0
- package/utils/modify.js +153 -0
- package/utils/mongoDbConnection.js +79 -0
- package/utils/mongoUtils.js +162 -0
- package/utils/pre-commit.sh +32 -0
- package/utils/removeHooks.js +20 -0
- package/utils/setup.js +33 -0
- package/utils/taskMover.js +308 -0
- package/utils/tbScript.js +103 -0
- package/utils/tbUtils.js +347 -0
- package/utils/testRunner.js +298 -0
- package/utils/troubleshootingAdapter.js +177 -0
- package/utils/updateAdapterConfig.js +158 -0
|
@@ -0,0 +1,3942 @@
|
|
|
1
|
+
/* @copyright Itential, LLC 2019 (pre-modifications) */
|
|
2
|
+
|
|
3
|
+
// Set globals
|
|
4
|
+
/* global describe it log pronghornProps */
|
|
5
|
+
/* eslint global-require: warn */
|
|
6
|
+
/* eslint no-unused-vars: warn */
|
|
7
|
+
/* eslint import/no-dynamic-require:warn */
|
|
8
|
+
|
|
9
|
+
// include required items for testing & logging
|
|
10
|
+
const assert = require('assert');
|
|
11
|
+
const path = require('path');
|
|
12
|
+
const util = require('util');
|
|
13
|
+
const execute = require('child_process').execSync;
|
|
14
|
+
const fs = require('fs-extra');
|
|
15
|
+
const mocha = require('mocha');
|
|
16
|
+
const winston = require('winston');
|
|
17
|
+
const { expect } = require('chai');
|
|
18
|
+
const { use } = require('chai');
|
|
19
|
+
const td = require('testdouble');
|
|
20
|
+
const Ajv = require('ajv');
|
|
21
|
+
const log = require('../../utils/logger');
|
|
22
|
+
|
|
23
|
+
const ajv = new Ajv({ strictSchema: false, allErrors: true, allowUnionTypes: true });
|
|
24
|
+
const anything = td.matchers.anything();
|
|
25
|
+
const isRapidFail = 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
|
+
samProps.request.attempt_timeout = 1200000;
|
|
51
|
+
const attemptTimeout = samProps.request.attempt_timeout;
|
|
52
|
+
const { stub } = samProps;
|
|
53
|
+
|
|
54
|
+
// these are the adapter properties. You generally should not need to alter
|
|
55
|
+
// any of these after they are initially set up
|
|
56
|
+
global.pronghornProps = {
|
|
57
|
+
pathProps: {
|
|
58
|
+
encrypted: false
|
|
59
|
+
},
|
|
60
|
+
adapterProps: {
|
|
61
|
+
adapters: [{
|
|
62
|
+
id: 'Test-aws_lambda',
|
|
63
|
+
type: 'AwsLambda',
|
|
64
|
+
properties: samProps
|
|
65
|
+
}]
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
global.$HOME = `${__dirname}/../..`;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Runs the error asserts for the test
|
|
73
|
+
*/
|
|
74
|
+
function runErrorAsserts(data, error, code, origin, displayStr) {
|
|
75
|
+
assert.equal(null, data);
|
|
76
|
+
assert.notEqual(undefined, error);
|
|
77
|
+
assert.notEqual(null, error);
|
|
78
|
+
assert.notEqual(undefined, error.IAPerror);
|
|
79
|
+
assert.notEqual(null, error.IAPerror);
|
|
80
|
+
assert.notEqual(undefined, error.IAPerror.displayString);
|
|
81
|
+
assert.notEqual(null, error.IAPerror.displayString);
|
|
82
|
+
assert.equal(code, error.icode);
|
|
83
|
+
assert.equal(origin, error.IAPerror.origin);
|
|
84
|
+
assert.equal(displayStr, error.IAPerror.displayString);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// require the adapter that we are going to be using
|
|
88
|
+
const AwsLambda = require('../../adapter');
|
|
89
|
+
|
|
90
|
+
// delete the .DS_Store directory in entities -- otherwise this will cause errors
|
|
91
|
+
const dirPath = path.join(__dirname, '../../entities/.DS_Store');
|
|
92
|
+
if (fs.existsSync(dirPath)) {
|
|
93
|
+
try {
|
|
94
|
+
fs.removeSync(dirPath);
|
|
95
|
+
console.log('.DS_Store deleted');
|
|
96
|
+
} catch (e) {
|
|
97
|
+
console.log('Error when deleting .DS_Store:', e);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// begin the testing - these should be pretty well defined between the describe and the it!
|
|
102
|
+
describe('[unit] Aws_lambda Adapter Test', () => {
|
|
103
|
+
describe('AwsLambda Class Tests', () => {
|
|
104
|
+
const a = new AwsLambda(
|
|
105
|
+
pronghornProps.adapterProps.adapters[0].id,
|
|
106
|
+
pronghornProps.adapterProps.adapters[0].properties
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
if (isRapidFail) {
|
|
110
|
+
const state = {};
|
|
111
|
+
state.passed = true;
|
|
112
|
+
|
|
113
|
+
mocha.afterEach(function x() {
|
|
114
|
+
state.passed = state.passed
|
|
115
|
+
&& (this.currentTest.state === 'passed');
|
|
116
|
+
});
|
|
117
|
+
mocha.beforeEach(function x() {
|
|
118
|
+
if (!state.passed) {
|
|
119
|
+
return this.currentTest.skip();
|
|
120
|
+
}
|
|
121
|
+
return true;
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
describe('#class instance created', () => {
|
|
126
|
+
it('should be a class with properties', (done) => {
|
|
127
|
+
try {
|
|
128
|
+
assert.notEqual(null, a);
|
|
129
|
+
assert.notEqual(undefined, a);
|
|
130
|
+
const checkId = global.pronghornProps.adapterProps.adapters[0].id;
|
|
131
|
+
assert.equal(checkId, a.id);
|
|
132
|
+
assert.notEqual(null, a.allProps);
|
|
133
|
+
const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
|
|
134
|
+
assert.equal(check, a.healthcheckType);
|
|
135
|
+
done();
|
|
136
|
+
} catch (error) {
|
|
137
|
+
log.error(`Test Failure: ${error}`);
|
|
138
|
+
done(error);
|
|
139
|
+
}
|
|
140
|
+
}).timeout(attemptTimeout);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
describe('adapterBase.js', () => {
|
|
144
|
+
it('should have an adapterBase.js', (done) => {
|
|
145
|
+
try {
|
|
146
|
+
fs.exists('adapterBase.js', (val) => {
|
|
147
|
+
assert.equal(true, val);
|
|
148
|
+
done();
|
|
149
|
+
});
|
|
150
|
+
} catch (error) {
|
|
151
|
+
log.error(`Test Failure: ${error}`);
|
|
152
|
+
done(error);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
let wffunctions = [];
|
|
158
|
+
describe('#iapGetAdapterWorkflowFunctions', () => {
|
|
159
|
+
it('should retrieve workflow functions', (done) => {
|
|
160
|
+
try {
|
|
161
|
+
wffunctions = a.iapGetAdapterWorkflowFunctions([]);
|
|
162
|
+
|
|
163
|
+
try {
|
|
164
|
+
assert.notEqual(0, wffunctions.length);
|
|
165
|
+
done();
|
|
166
|
+
} catch (err) {
|
|
167
|
+
log.error(`Test Failure: ${err}`);
|
|
168
|
+
done(err);
|
|
169
|
+
}
|
|
170
|
+
} catch (error) {
|
|
171
|
+
log.error(`Adapter Exception: ${error}`);
|
|
172
|
+
done(error);
|
|
173
|
+
}
|
|
174
|
+
}).timeout(attemptTimeout);
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
describe('package.json', () => {
|
|
178
|
+
it('should have a package.json', (done) => {
|
|
179
|
+
try {
|
|
180
|
+
fs.exists('package.json', (val) => {
|
|
181
|
+
assert.equal(true, val);
|
|
182
|
+
done();
|
|
183
|
+
});
|
|
184
|
+
} catch (error) {
|
|
185
|
+
log.error(`Test Failure: ${error}`);
|
|
186
|
+
done(error);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
it('package.json should be validated', (done) => {
|
|
190
|
+
try {
|
|
191
|
+
const packageDotJson = require('../../package.json');
|
|
192
|
+
// Define the JSON schema for package.json
|
|
193
|
+
const packageJsonSchema = {
|
|
194
|
+
type: 'object',
|
|
195
|
+
properties: {
|
|
196
|
+
name: { type: 'string' },
|
|
197
|
+
version: { type: 'string' }
|
|
198
|
+
// May need to add more properties as needed
|
|
199
|
+
},
|
|
200
|
+
required: ['name', 'version']
|
|
201
|
+
};
|
|
202
|
+
const validate = ajv.compile(packageJsonSchema);
|
|
203
|
+
const isValid = validate(packageDotJson);
|
|
204
|
+
|
|
205
|
+
if (isValid === false) {
|
|
206
|
+
log.error('The package.json contains errors');
|
|
207
|
+
assert.equal(true, isValid);
|
|
208
|
+
} else {
|
|
209
|
+
assert.equal(true, isValid);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
done();
|
|
213
|
+
} catch (error) {
|
|
214
|
+
log.error(`Test Failure: ${error}`);
|
|
215
|
+
done(error);
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
it('package.json standard fields should be customized', (done) => {
|
|
219
|
+
try {
|
|
220
|
+
const packageDotJson = require('../../package.json');
|
|
221
|
+
assert.notEqual(-1, packageDotJson.name.indexOf('aws_lambda'));
|
|
222
|
+
assert.notEqual(undefined, packageDotJson.version);
|
|
223
|
+
assert.notEqual(null, packageDotJson.version);
|
|
224
|
+
assert.notEqual('', packageDotJson.version);
|
|
225
|
+
assert.notEqual(undefined, packageDotJson.description);
|
|
226
|
+
assert.notEqual(null, packageDotJson.description);
|
|
227
|
+
assert.notEqual('', packageDotJson.description);
|
|
228
|
+
assert.equal('adapter.js', packageDotJson.main);
|
|
229
|
+
assert.notEqual(undefined, packageDotJson.wizardVersion);
|
|
230
|
+
assert.notEqual(null, packageDotJson.wizardVersion);
|
|
231
|
+
assert.notEqual('', packageDotJson.wizardVersion);
|
|
232
|
+
assert.notEqual(undefined, packageDotJson.engineVersion);
|
|
233
|
+
assert.notEqual(null, packageDotJson.engineVersion);
|
|
234
|
+
assert.notEqual('', packageDotJson.engineVersion);
|
|
235
|
+
assert.equal('http', packageDotJson.adapterType);
|
|
236
|
+
done();
|
|
237
|
+
} catch (error) {
|
|
238
|
+
log.error(`Test Failure: ${error}`);
|
|
239
|
+
done(error);
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
it('package.json proper scripts should be provided', (done) => {
|
|
243
|
+
try {
|
|
244
|
+
const packageDotJson = require('../../package.json');
|
|
245
|
+
assert.notEqual(undefined, packageDotJson.scripts);
|
|
246
|
+
assert.notEqual(null, packageDotJson.scripts);
|
|
247
|
+
assert.notEqual('', packageDotJson.scripts);
|
|
248
|
+
assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js', packageDotJson.scripts.lint);
|
|
249
|
+
assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js --quiet', packageDotJson.scripts['lint:errors']);
|
|
250
|
+
assert.equal('mocha test/unit/adapterBaseTestUnit.js --LOG=error', packageDotJson.scripts['test:baseunit']);
|
|
251
|
+
assert.equal('mocha test/unit/adapterTestUnit.js --LOG=error', packageDotJson.scripts['test:unit']);
|
|
252
|
+
assert.equal('mocha test/integration/adapterTestIntegration.js --LOG=error', packageDotJson.scripts['test:integration']);
|
|
253
|
+
assert.equal('npm run test:baseunit && npm run test:unit && npm run test:integration', packageDotJson.scripts.test);
|
|
254
|
+
done();
|
|
255
|
+
} catch (error) {
|
|
256
|
+
log.error(`Test Failure: ${error}`);
|
|
257
|
+
done(error);
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
it('package.json proper directories should be provided', (done) => {
|
|
261
|
+
try {
|
|
262
|
+
const packageDotJson = require('../../package.json');
|
|
263
|
+
assert.notEqual(undefined, packageDotJson.repository);
|
|
264
|
+
assert.notEqual(null, packageDotJson.repository);
|
|
265
|
+
assert.notEqual('', packageDotJson.repository);
|
|
266
|
+
done();
|
|
267
|
+
} catch (error) {
|
|
268
|
+
log.error(`Test Failure: ${error}`);
|
|
269
|
+
done(error);
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
it('package.json proper dependencies should be provided', (done) => {
|
|
273
|
+
try {
|
|
274
|
+
const packageDotJson = require('../../package.json');
|
|
275
|
+
assert.notEqual(undefined, packageDotJson.dependencies);
|
|
276
|
+
assert.notEqual(null, packageDotJson.dependencies);
|
|
277
|
+
assert.notEqual('', packageDotJson.dependencies);
|
|
278
|
+
assert.equal('8.17.1', packageDotJson.dependencies.ajv);
|
|
279
|
+
assert.equal('1.12.0', packageDotJson.dependencies.axios);
|
|
280
|
+
assert.equal('11.1.0', packageDotJson.dependencies.commander);
|
|
281
|
+
assert.equal('11.3.0', packageDotJson.dependencies['fs-extra']);
|
|
282
|
+
assert.equal('10.8.2', packageDotJson.dependencies.mocha);
|
|
283
|
+
assert.equal('2.0.1', packageDotJson.dependencies['mocha-param']);
|
|
284
|
+
assert.equal('0.4.4', packageDotJson.dependencies.ping);
|
|
285
|
+
assert.equal('1.4.10', packageDotJson.dependencies['readline-sync']);
|
|
286
|
+
assert.equal('7.7.2', packageDotJson.dependencies.semver);
|
|
287
|
+
assert.equal('3.17.0', packageDotJson.dependencies.winston);
|
|
288
|
+
done();
|
|
289
|
+
} catch (error) {
|
|
290
|
+
log.error(`Test Failure: ${error}`);
|
|
291
|
+
done(error);
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
it('package.json proper dev dependencies should be provided', (done) => {
|
|
295
|
+
try {
|
|
296
|
+
const packageDotJson = require('../../package.json');
|
|
297
|
+
assert.notEqual(undefined, packageDotJson.devDependencies);
|
|
298
|
+
assert.notEqual(null, packageDotJson.devDependencies);
|
|
299
|
+
assert.notEqual('', packageDotJson.devDependencies);
|
|
300
|
+
assert.equal('4.5.0', packageDotJson.devDependencies.chai);
|
|
301
|
+
assert.equal('8.57.0', packageDotJson.devDependencies.eslint);
|
|
302
|
+
assert.equal('15.0.0', packageDotJson.devDependencies['eslint-config-airbnb-base']);
|
|
303
|
+
assert.equal('2.31.0', packageDotJson.devDependencies['eslint-plugin-import']);
|
|
304
|
+
assert.equal('3.1.0', packageDotJson.devDependencies['eslint-plugin-json']);
|
|
305
|
+
assert.equal('3.18.0', packageDotJson.devDependencies.testdouble);
|
|
306
|
+
done();
|
|
307
|
+
} catch (error) {
|
|
308
|
+
log.error(`Test Failure: ${error}`);
|
|
309
|
+
done(error);
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
describe('pronghorn.json', () => {
|
|
315
|
+
it('should have a pronghorn.json', (done) => {
|
|
316
|
+
try {
|
|
317
|
+
fs.exists('pronghorn.json', (val) => {
|
|
318
|
+
assert.equal(true, val);
|
|
319
|
+
done();
|
|
320
|
+
});
|
|
321
|
+
} catch (error) {
|
|
322
|
+
log.error(`Test Failure: ${error}`);
|
|
323
|
+
done(error);
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
it('pronghorn.json should be customized', (done) => {
|
|
327
|
+
try {
|
|
328
|
+
const pronghornDotJson = require('../../pronghorn.json');
|
|
329
|
+
assert.notEqual(-1, pronghornDotJson.id.indexOf('aws_lambda'));
|
|
330
|
+
assert.equal('Adapter', pronghornDotJson.type);
|
|
331
|
+
assert.equal('AwsLambda', pronghornDotJson.export);
|
|
332
|
+
assert.equal('Aws_lambda', pronghornDotJson.title);
|
|
333
|
+
assert.equal('adapter.js', pronghornDotJson.src);
|
|
334
|
+
done();
|
|
335
|
+
} catch (error) {
|
|
336
|
+
log.error(`Test Failure: ${error}`);
|
|
337
|
+
done(error);
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
it('pronghorn.json should contain generic adapter methods', (done) => {
|
|
341
|
+
try {
|
|
342
|
+
const pronghornDotJson = require('../../pronghorn.json');
|
|
343
|
+
assert.notEqual(undefined, pronghornDotJson.methods);
|
|
344
|
+
assert.notEqual(null, pronghornDotJson.methods);
|
|
345
|
+
assert.notEqual('', pronghornDotJson.methods);
|
|
346
|
+
assert.equal(true, Array.isArray(pronghornDotJson.methods));
|
|
347
|
+
assert.notEqual(0, pronghornDotJson.methods.length);
|
|
348
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUpdateAdapterConfiguration'));
|
|
349
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapSuspendAdapter'));
|
|
350
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUnsuspendAdapter'));
|
|
351
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapGetAdapterQueue'));
|
|
352
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapFindAdapterPath'));
|
|
353
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapTroubleshootAdapter'));
|
|
354
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterHealthcheck'));
|
|
355
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterConnectivity'));
|
|
356
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterBasicGet'));
|
|
357
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapMoveAdapterEntitiesToDB'));
|
|
358
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapDeactivateTasks'));
|
|
359
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapActivateTasks'));
|
|
360
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapPopulateEntityCache'));
|
|
361
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRetrieveEntitiesCache'));
|
|
362
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'getDevice'));
|
|
363
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'getDevicesFiltered'));
|
|
364
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'isAlive'));
|
|
365
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'getConfig'));
|
|
366
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapGetDeviceCount'));
|
|
367
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapExpandedGenericAdapterRequest'));
|
|
368
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequest'));
|
|
369
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequestNoBasePath'));
|
|
370
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterLint'));
|
|
371
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterTests'));
|
|
372
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapGetAdapterInventory'));
|
|
373
|
+
done();
|
|
374
|
+
} catch (error) {
|
|
375
|
+
log.error(`Test Failure: ${error}`);
|
|
376
|
+
done(error);
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
it('pronghorn.json should only expose workflow functions', (done) => {
|
|
380
|
+
try {
|
|
381
|
+
const pronghornDotJson = require('../../pronghorn.json');
|
|
382
|
+
|
|
383
|
+
for (let m = 0; m < pronghornDotJson.methods.length; m += 1) {
|
|
384
|
+
let found = false;
|
|
385
|
+
let paramissue = false;
|
|
386
|
+
|
|
387
|
+
for (let w = 0; w < wffunctions.length; w += 1) {
|
|
388
|
+
if (pronghornDotJson.methods[m].name === wffunctions[w]) {
|
|
389
|
+
found = true;
|
|
390
|
+
const methLine = execute(`grep " ${wffunctions[w]}(" adapter.js | grep "callback) {"`).toString();
|
|
391
|
+
let wfparams = [];
|
|
392
|
+
|
|
393
|
+
if (methLine && methLine.indexOf('(') >= 0 && methLine.indexOf(')') >= 0) {
|
|
394
|
+
const temp = methLine.substring(methLine.indexOf('(') + 1, methLine.lastIndexOf(')'));
|
|
395
|
+
wfparams = temp.split(',');
|
|
396
|
+
|
|
397
|
+
for (let t = 0; t < wfparams.length; t += 1) {
|
|
398
|
+
// remove default value from the parameter name
|
|
399
|
+
wfparams[t] = wfparams[t].substring(0, wfparams[t].search(/=/) > 0 ? wfparams[t].search(/#|\?|=/) : wfparams[t].length);
|
|
400
|
+
// remove spaces
|
|
401
|
+
wfparams[t] = wfparams[t].trim();
|
|
402
|
+
|
|
403
|
+
if (wfparams[t] === 'callback') {
|
|
404
|
+
wfparams.splice(t, 1);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
// if there are inputs defined but not on the method line
|
|
410
|
+
if (wfparams.length === 0 && (pronghornDotJson.methods[m].input
|
|
411
|
+
&& pronghornDotJson.methods[m].input.length > 0)) {
|
|
412
|
+
paramissue = true;
|
|
413
|
+
} else if (wfparams.length > 0 && (!pronghornDotJson.methods[m].input
|
|
414
|
+
|| pronghornDotJson.methods[m].input.length === 0)) {
|
|
415
|
+
// if there are no inputs defined but there are on the method line
|
|
416
|
+
paramissue = true;
|
|
417
|
+
} else {
|
|
418
|
+
for (let p = 0; p < pronghornDotJson.methods[m].input.length; p += 1) {
|
|
419
|
+
let pfound = false;
|
|
420
|
+
for (let wfp = 0; wfp < wfparams.length; wfp += 1) {
|
|
421
|
+
if (pronghornDotJson.methods[m].input[p].name.toUpperCase() === wfparams[wfp].toUpperCase()) {
|
|
422
|
+
pfound = true;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
if (!pfound) {
|
|
427
|
+
paramissue = true;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
for (let wfp = 0; wfp < wfparams.length; wfp += 1) {
|
|
431
|
+
let pfound = false;
|
|
432
|
+
for (let p = 0; p < pronghornDotJson.methods[m].input.length; p += 1) {
|
|
433
|
+
if (pronghornDotJson.methods[m].input[p].name.toUpperCase() === wfparams[wfp].toUpperCase()) {
|
|
434
|
+
pfound = true;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
if (!pfound) {
|
|
439
|
+
paramissue = true;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
break;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
if (!found) {
|
|
449
|
+
// this is the reason to go through both loops - log which ones are not found so
|
|
450
|
+
// they can be worked
|
|
451
|
+
log.error(`${pronghornDotJson.methods[m].name} not found in workflow functions`);
|
|
452
|
+
}
|
|
453
|
+
if (paramissue) {
|
|
454
|
+
// this is the reason to go through both loops - log which ones are not found so
|
|
455
|
+
// they can be worked
|
|
456
|
+
log.error(`${pronghornDotJson.methods[m].name} has a parameter mismatch`);
|
|
457
|
+
}
|
|
458
|
+
assert.equal(true, found);
|
|
459
|
+
assert.equal(false, paramissue);
|
|
460
|
+
}
|
|
461
|
+
done();
|
|
462
|
+
} catch (error) {
|
|
463
|
+
log.error(`Adapter Exception: ${error}`);
|
|
464
|
+
done(error);
|
|
465
|
+
}
|
|
466
|
+
}).timeout(attemptTimeout);
|
|
467
|
+
it('pronghorn.json should expose all workflow functions', (done) => {
|
|
468
|
+
try {
|
|
469
|
+
const pronghornDotJson = require('../../pronghorn.json');
|
|
470
|
+
for (let w = 0; w < wffunctions.length; w += 1) {
|
|
471
|
+
let found = false;
|
|
472
|
+
|
|
473
|
+
for (let m = 0; m < pronghornDotJson.methods.length; m += 1) {
|
|
474
|
+
if (pronghornDotJson.methods[m].name === wffunctions[w]) {
|
|
475
|
+
found = true;
|
|
476
|
+
break;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
if (!found) {
|
|
481
|
+
// this is the reason to go through both loops - log which ones are not found so
|
|
482
|
+
// they can be worked
|
|
483
|
+
log.error(`${wffunctions[w]} not found in pronghorn.json`);
|
|
484
|
+
}
|
|
485
|
+
assert.equal(true, found);
|
|
486
|
+
}
|
|
487
|
+
done();
|
|
488
|
+
} catch (error) {
|
|
489
|
+
log.error(`Adapter Exception: ${error}`);
|
|
490
|
+
done(error);
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
it('pronghorn.json verify input/output schema objects', (done) => {
|
|
494
|
+
const verifySchema = (methodName, schema) => {
|
|
495
|
+
try {
|
|
496
|
+
ajv.compile(schema);
|
|
497
|
+
} catch (error) {
|
|
498
|
+
const errorMessage = `Invalid schema found in '${methodName}' method.
|
|
499
|
+
Schema => ${JSON.stringify(schema)}.
|
|
500
|
+
Details => ${error.message}`;
|
|
501
|
+
throw new Error(errorMessage);
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
|
|
505
|
+
try {
|
|
506
|
+
const pronghornDotJson = require('../../pronghorn.json');
|
|
507
|
+
const { methods } = pronghornDotJson;
|
|
508
|
+
for (let i = 0; i < methods.length; i += 1) {
|
|
509
|
+
for (let j = 0; j < methods[i].input.length; j += 1) {
|
|
510
|
+
const inputSchema = methods[i].input[j].schema;
|
|
511
|
+
if (inputSchema) {
|
|
512
|
+
verifySchema(methods[i].name, inputSchema);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
const outputSchema = methods[i].output.schema;
|
|
516
|
+
if (outputSchema) {
|
|
517
|
+
verifySchema(methods[i].name, outputSchema);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
done();
|
|
521
|
+
} catch (error) {
|
|
522
|
+
log.error(`Adapter Exception: ${error}`);
|
|
523
|
+
done(error);
|
|
524
|
+
}
|
|
525
|
+
}).timeout(attemptTimeout);
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
describe('propertiesSchema.json', () => {
|
|
529
|
+
it('should have a propertiesSchema.json', (done) => {
|
|
530
|
+
try {
|
|
531
|
+
fs.exists('propertiesSchema.json', (val) => {
|
|
532
|
+
assert.equal(true, val);
|
|
533
|
+
done();
|
|
534
|
+
});
|
|
535
|
+
} catch (error) {
|
|
536
|
+
log.error(`Test Failure: ${error}`);
|
|
537
|
+
done(error);
|
|
538
|
+
}
|
|
539
|
+
});
|
|
540
|
+
it('propertiesSchema.json should be customized', (done) => {
|
|
541
|
+
try {
|
|
542
|
+
const propertiesDotJson = require('../../propertiesSchema.json');
|
|
543
|
+
assert.equal('adapter-aws_lambda', propertiesDotJson.$id);
|
|
544
|
+
assert.equal('object', propertiesDotJson.type);
|
|
545
|
+
assert.equal('http://json-schema.org/draft-07/schema#', propertiesDotJson.$schema);
|
|
546
|
+
done();
|
|
547
|
+
} catch (error) {
|
|
548
|
+
log.error(`Test Failure: ${error}`);
|
|
549
|
+
done(error);
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
it('propertiesSchema.json should contain generic adapter properties', (done) => {
|
|
553
|
+
try {
|
|
554
|
+
const propertiesDotJson = require('../../propertiesSchema.json');
|
|
555
|
+
assert.notEqual(undefined, propertiesDotJson.properties);
|
|
556
|
+
assert.notEqual(null, propertiesDotJson.properties);
|
|
557
|
+
assert.notEqual('', propertiesDotJson.properties);
|
|
558
|
+
assert.equal('string', propertiesDotJson.properties.host.type);
|
|
559
|
+
assert.equal('integer', propertiesDotJson.properties.port.type);
|
|
560
|
+
assert.equal('boolean', propertiesDotJson.properties.stub.type);
|
|
561
|
+
assert.equal('string', propertiesDotJson.properties.protocol.type);
|
|
562
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.authentication);
|
|
563
|
+
assert.notEqual(null, propertiesDotJson.definitions.authentication);
|
|
564
|
+
assert.notEqual('', propertiesDotJson.definitions.authentication);
|
|
565
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.auth_method.type);
|
|
566
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.username.type);
|
|
567
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.password.type);
|
|
568
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.token.type);
|
|
569
|
+
assert.equal('integer', propertiesDotJson.definitions.authentication.properties.invalid_token_error.type);
|
|
570
|
+
assert.equal('integer', propertiesDotJson.definitions.authentication.properties.token_timeout.type);
|
|
571
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.token_cache.type);
|
|
572
|
+
assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field.type));
|
|
573
|
+
assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field_format.type));
|
|
574
|
+
assert.equal('boolean', propertiesDotJson.definitions.authentication.properties.auth_logging.type);
|
|
575
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_id.type);
|
|
576
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_secret.type);
|
|
577
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.grant_type.type);
|
|
578
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.ssl);
|
|
579
|
+
assert.notEqual(null, propertiesDotJson.definitions.ssl);
|
|
580
|
+
assert.notEqual('', propertiesDotJson.definitions.ssl);
|
|
581
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ecdhCurve.type);
|
|
582
|
+
assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.enabled.type);
|
|
583
|
+
assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.accept_invalid_cert.type);
|
|
584
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ca_file.type);
|
|
585
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.key_file.type);
|
|
586
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.cert_file.type);
|
|
587
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.secure_protocol.type);
|
|
588
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ciphers.type);
|
|
589
|
+
assert.equal('string', propertiesDotJson.properties.base_path.type);
|
|
590
|
+
assert.equal('string', propertiesDotJson.properties.version.type);
|
|
591
|
+
assert.equal('string', propertiesDotJson.properties.cache_location.type);
|
|
592
|
+
assert.equal('boolean', propertiesDotJson.properties.encode_pathvars.type);
|
|
593
|
+
assert.equal('boolean', propertiesDotJson.properties.encode_queryvars.type);
|
|
594
|
+
assert.equal(true, Array.isArray(propertiesDotJson.properties.save_metric.type));
|
|
595
|
+
assert.notEqual(undefined, propertiesDotJson.definitions);
|
|
596
|
+
assert.notEqual(null, propertiesDotJson.definitions);
|
|
597
|
+
assert.notEqual('', propertiesDotJson.definitions);
|
|
598
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.healthcheck);
|
|
599
|
+
assert.notEqual(null, propertiesDotJson.definitions.healthcheck);
|
|
600
|
+
assert.notEqual('', propertiesDotJson.definitions.healthcheck);
|
|
601
|
+
assert.equal('string', propertiesDotJson.definitions.healthcheck.properties.type.type);
|
|
602
|
+
assert.equal('integer', propertiesDotJson.definitions.healthcheck.properties.frequency.type);
|
|
603
|
+
assert.equal('object', propertiesDotJson.definitions.healthcheck.properties.query_object.type);
|
|
604
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.throttle);
|
|
605
|
+
assert.notEqual(null, propertiesDotJson.definitions.throttle);
|
|
606
|
+
assert.notEqual('', propertiesDotJson.definitions.throttle);
|
|
607
|
+
assert.equal('boolean', propertiesDotJson.definitions.throttle.properties.throttle_enabled.type);
|
|
608
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.number_pronghorns.type);
|
|
609
|
+
assert.equal('string', propertiesDotJson.definitions.throttle.properties.sync_async.type);
|
|
610
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.max_in_queue.type);
|
|
611
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.concurrent_max.type);
|
|
612
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.expire_timeout.type);
|
|
613
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.avg_runtime.type);
|
|
614
|
+
assert.equal('array', propertiesDotJson.definitions.throttle.properties.priorities.type);
|
|
615
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.request);
|
|
616
|
+
assert.notEqual(null, propertiesDotJson.definitions.request);
|
|
617
|
+
assert.notEqual('', propertiesDotJson.definitions.request);
|
|
618
|
+
assert.equal('integer', propertiesDotJson.definitions.request.properties.number_redirects.type);
|
|
619
|
+
assert.equal('integer', propertiesDotJson.definitions.request.properties.number_retries.type);
|
|
620
|
+
assert.equal(true, Array.isArray(propertiesDotJson.definitions.request.properties.limit_retry_error.type));
|
|
621
|
+
assert.equal('array', propertiesDotJson.definitions.request.properties.failover_codes.type);
|
|
622
|
+
assert.equal('integer', propertiesDotJson.definitions.request.properties.attempt_timeout.type);
|
|
623
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.type);
|
|
624
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.payload.type);
|
|
625
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.uriOptions.type);
|
|
626
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.addlHeaders.type);
|
|
627
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.authData.type);
|
|
628
|
+
assert.equal('boolean', propertiesDotJson.definitions.request.properties.healthcheck_on_timeout.type);
|
|
629
|
+
assert.equal('boolean', propertiesDotJson.definitions.request.properties.return_raw.type);
|
|
630
|
+
assert.equal('boolean', propertiesDotJson.definitions.request.properties.archiving.type);
|
|
631
|
+
assert.equal('boolean', propertiesDotJson.definitions.request.properties.return_request.type);
|
|
632
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.proxy);
|
|
633
|
+
assert.notEqual(null, propertiesDotJson.definitions.proxy);
|
|
634
|
+
assert.notEqual('', propertiesDotJson.definitions.proxy);
|
|
635
|
+
assert.equal('boolean', propertiesDotJson.definitions.proxy.properties.enabled.type);
|
|
636
|
+
assert.equal('string', propertiesDotJson.definitions.proxy.properties.host.type);
|
|
637
|
+
assert.equal('integer', propertiesDotJson.definitions.proxy.properties.port.type);
|
|
638
|
+
assert.equal('string', propertiesDotJson.definitions.proxy.properties.protocol.type);
|
|
639
|
+
assert.equal('string', propertiesDotJson.definitions.proxy.properties.username.type);
|
|
640
|
+
assert.equal('string', propertiesDotJson.definitions.proxy.properties.password.type);
|
|
641
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.mongo);
|
|
642
|
+
assert.notEqual(null, propertiesDotJson.definitions.mongo);
|
|
643
|
+
assert.notEqual('', propertiesDotJson.definitions.mongo);
|
|
644
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.host.type);
|
|
645
|
+
assert.equal('integer', propertiesDotJson.definitions.mongo.properties.port.type);
|
|
646
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.database.type);
|
|
647
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.username.type);
|
|
648
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.password.type);
|
|
649
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.replSet.type);
|
|
650
|
+
assert.equal('object', propertiesDotJson.definitions.mongo.properties.db_ssl.type);
|
|
651
|
+
assert.equal('boolean', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.enabled.type);
|
|
652
|
+
assert.equal('boolean', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.accept_invalid_cert.type);
|
|
653
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.ca_file.type);
|
|
654
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.key_file.type);
|
|
655
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.cert_file.type);
|
|
656
|
+
assert.notEqual('', propertiesDotJson.definitions.devicebroker);
|
|
657
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevice.type);
|
|
658
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevicesFiltered.type);
|
|
659
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.isAlive.type);
|
|
660
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getConfig.type);
|
|
661
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getCount.type);
|
|
662
|
+
done();
|
|
663
|
+
} catch (error) {
|
|
664
|
+
log.error(`Test Failure: ${error}`);
|
|
665
|
+
done(error);
|
|
666
|
+
}
|
|
667
|
+
});
|
|
668
|
+
});
|
|
669
|
+
|
|
670
|
+
describe('error.json', () => {
|
|
671
|
+
it('should have an error.json', (done) => {
|
|
672
|
+
try {
|
|
673
|
+
fs.exists('error.json', (val) => {
|
|
674
|
+
assert.equal(true, val);
|
|
675
|
+
done();
|
|
676
|
+
});
|
|
677
|
+
} catch (error) {
|
|
678
|
+
log.error(`Test Failure: ${error}`);
|
|
679
|
+
done(error);
|
|
680
|
+
}
|
|
681
|
+
});
|
|
682
|
+
it('error.json should have standard adapter errors', (done) => {
|
|
683
|
+
try {
|
|
684
|
+
const errorDotJson = require('../../error.json');
|
|
685
|
+
assert.notEqual(undefined, errorDotJson.errors);
|
|
686
|
+
assert.notEqual(null, errorDotJson.errors);
|
|
687
|
+
assert.notEqual('', errorDotJson.errors);
|
|
688
|
+
assert.equal(true, Array.isArray(errorDotJson.errors));
|
|
689
|
+
assert.notEqual(0, errorDotJson.errors.length);
|
|
690
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.100'));
|
|
691
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.101'));
|
|
692
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.102'));
|
|
693
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.110'));
|
|
694
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.111'));
|
|
695
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.112'));
|
|
696
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.113'));
|
|
697
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.114'));
|
|
698
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.115'));
|
|
699
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.116'));
|
|
700
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.300'));
|
|
701
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.301'));
|
|
702
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.302'));
|
|
703
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.303'));
|
|
704
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.304'));
|
|
705
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.305'));
|
|
706
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.310'));
|
|
707
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.311'));
|
|
708
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.312'));
|
|
709
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.320'));
|
|
710
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.321'));
|
|
711
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.400'));
|
|
712
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.401'));
|
|
713
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.402'));
|
|
714
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.500'));
|
|
715
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.501'));
|
|
716
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.502'));
|
|
717
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.503'));
|
|
718
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.600'));
|
|
719
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.900'));
|
|
720
|
+
done();
|
|
721
|
+
} catch (error) {
|
|
722
|
+
log.error(`Test Failure: ${error}`);
|
|
723
|
+
done(error);
|
|
724
|
+
}
|
|
725
|
+
});
|
|
726
|
+
});
|
|
727
|
+
|
|
728
|
+
describe('sampleProperties.json', () => {
|
|
729
|
+
it('should have a sampleProperties.json', (done) => {
|
|
730
|
+
try {
|
|
731
|
+
fs.exists('sampleProperties.json', (val) => {
|
|
732
|
+
assert.equal(true, val);
|
|
733
|
+
done();
|
|
734
|
+
});
|
|
735
|
+
} catch (error) {
|
|
736
|
+
log.error(`Test Failure: ${error}`);
|
|
737
|
+
done(error);
|
|
738
|
+
}
|
|
739
|
+
});
|
|
740
|
+
it('sampleProperties.json should contain generic adapter properties', (done) => {
|
|
741
|
+
try {
|
|
742
|
+
const sampleDotJson = require('../../sampleProperties.json');
|
|
743
|
+
assert.notEqual(-1, sampleDotJson.id.indexOf('aws_lambda'));
|
|
744
|
+
assert.equal('AwsLambda', sampleDotJson.type);
|
|
745
|
+
assert.notEqual(undefined, sampleDotJson.properties);
|
|
746
|
+
assert.notEqual(null, sampleDotJson.properties);
|
|
747
|
+
assert.notEqual('', sampleDotJson.properties);
|
|
748
|
+
assert.notEqual(undefined, sampleDotJson.properties.host);
|
|
749
|
+
assert.notEqual(undefined, sampleDotJson.properties.port);
|
|
750
|
+
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
751
|
+
assert.notEqual(undefined, sampleDotJson.properties.protocol);
|
|
752
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication);
|
|
753
|
+
assert.notEqual(null, sampleDotJson.properties.authentication);
|
|
754
|
+
assert.notEqual('', sampleDotJson.properties.authentication);
|
|
755
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_method);
|
|
756
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.username);
|
|
757
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.password);
|
|
758
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.token);
|
|
759
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.invalid_token_error);
|
|
760
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.token_timeout);
|
|
761
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.token_cache);
|
|
762
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field);
|
|
763
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field_format);
|
|
764
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_logging);
|
|
765
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.client_id);
|
|
766
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.client_secret);
|
|
767
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.grant_type);
|
|
768
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl);
|
|
769
|
+
assert.notEqual(null, sampleDotJson.properties.ssl);
|
|
770
|
+
assert.notEqual('', sampleDotJson.properties.ssl);
|
|
771
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.ecdhCurve);
|
|
772
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.enabled);
|
|
773
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.accept_invalid_cert);
|
|
774
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.ca_file);
|
|
775
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.key_file);
|
|
776
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.cert_file);
|
|
777
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.secure_protocol);
|
|
778
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.ciphers);
|
|
779
|
+
assert.notEqual(undefined, sampleDotJson.properties.base_path);
|
|
780
|
+
assert.notEqual(undefined, sampleDotJson.properties.version);
|
|
781
|
+
assert.notEqual(undefined, sampleDotJson.properties.cache_location);
|
|
782
|
+
assert.notEqual(undefined, sampleDotJson.properties.encode_pathvars);
|
|
783
|
+
assert.notEqual(undefined, sampleDotJson.properties.encode_queryvars);
|
|
784
|
+
assert.notEqual(undefined, sampleDotJson.properties.save_metric);
|
|
785
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck);
|
|
786
|
+
assert.notEqual(null, sampleDotJson.properties.healthcheck);
|
|
787
|
+
assert.notEqual('', sampleDotJson.properties.healthcheck);
|
|
788
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck.type);
|
|
789
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck.frequency);
|
|
790
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck.query_object);
|
|
791
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle);
|
|
792
|
+
assert.notEqual(null, sampleDotJson.properties.throttle);
|
|
793
|
+
assert.notEqual('', sampleDotJson.properties.throttle);
|
|
794
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.throttle_enabled);
|
|
795
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.number_pronghorns);
|
|
796
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.sync_async);
|
|
797
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.max_in_queue);
|
|
798
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.concurrent_max);
|
|
799
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.expire_timeout);
|
|
800
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.avg_runtime);
|
|
801
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.priorities);
|
|
802
|
+
assert.notEqual(undefined, sampleDotJson.properties.request);
|
|
803
|
+
assert.notEqual(null, sampleDotJson.properties.request);
|
|
804
|
+
assert.notEqual('', sampleDotJson.properties.request);
|
|
805
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.number_redirects);
|
|
806
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.number_retries);
|
|
807
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.limit_retry_error);
|
|
808
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.failover_codes);
|
|
809
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.attempt_timeout);
|
|
810
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request);
|
|
811
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.payload);
|
|
812
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.uriOptions);
|
|
813
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.addlHeaders);
|
|
814
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.authData);
|
|
815
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.healthcheck_on_timeout);
|
|
816
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.return_raw);
|
|
817
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.archiving);
|
|
818
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.return_request);
|
|
819
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy);
|
|
820
|
+
assert.notEqual(null, sampleDotJson.properties.proxy);
|
|
821
|
+
assert.notEqual('', sampleDotJson.properties.proxy);
|
|
822
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.enabled);
|
|
823
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.host);
|
|
824
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.port);
|
|
825
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.protocol);
|
|
826
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.username);
|
|
827
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.password);
|
|
828
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo);
|
|
829
|
+
assert.notEqual(null, sampleDotJson.properties.mongo);
|
|
830
|
+
assert.notEqual('', sampleDotJson.properties.mongo);
|
|
831
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.host);
|
|
832
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.port);
|
|
833
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.database);
|
|
834
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.username);
|
|
835
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.password);
|
|
836
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.replSet);
|
|
837
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl);
|
|
838
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.enabled);
|
|
839
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.accept_invalid_cert);
|
|
840
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.ca_file);
|
|
841
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.key_file);
|
|
842
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.cert_file);
|
|
843
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker);
|
|
844
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevice);
|
|
845
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevicesFiltered);
|
|
846
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.isAlive);
|
|
847
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getConfig);
|
|
848
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getCount);
|
|
849
|
+
assert.notEqual(undefined, sampleDotJson.properties.cache);
|
|
850
|
+
assert.notEqual(undefined, sampleDotJson.properties.cache.entities);
|
|
851
|
+
done();
|
|
852
|
+
} catch (error) {
|
|
853
|
+
log.error(`Test Failure: ${error}`);
|
|
854
|
+
done(error);
|
|
855
|
+
}
|
|
856
|
+
});
|
|
857
|
+
});
|
|
858
|
+
|
|
859
|
+
describe('#checkProperties', () => {
|
|
860
|
+
it('should have a checkProperties function', (done) => {
|
|
861
|
+
try {
|
|
862
|
+
assert.equal(true, typeof a.checkProperties === 'function');
|
|
863
|
+
done();
|
|
864
|
+
} catch (error) {
|
|
865
|
+
log.error(`Test Failure: ${error}`);
|
|
866
|
+
done(error);
|
|
867
|
+
}
|
|
868
|
+
});
|
|
869
|
+
it('the sample properties should be good - if failure change the log level', (done) => {
|
|
870
|
+
try {
|
|
871
|
+
const samplePropsJson = require('../../sampleProperties.json');
|
|
872
|
+
const clean = a.checkProperties(samplePropsJson.properties);
|
|
873
|
+
|
|
874
|
+
try {
|
|
875
|
+
assert.notEqual(0, Object.keys(clean));
|
|
876
|
+
assert.equal(undefined, clean.exception);
|
|
877
|
+
assert.notEqual(undefined, clean.host);
|
|
878
|
+
assert.notEqual(null, clean.host);
|
|
879
|
+
assert.notEqual('', clean.host);
|
|
880
|
+
done();
|
|
881
|
+
} catch (err) {
|
|
882
|
+
log.error(`Test Failure: ${err}`);
|
|
883
|
+
done(err);
|
|
884
|
+
}
|
|
885
|
+
} catch (error) {
|
|
886
|
+
log.error(`Adapter Exception: ${error}`);
|
|
887
|
+
done(error);
|
|
888
|
+
}
|
|
889
|
+
}).timeout(attemptTimeout);
|
|
890
|
+
});
|
|
891
|
+
|
|
892
|
+
describe('README.md', () => {
|
|
893
|
+
it('should have a README', (done) => {
|
|
894
|
+
try {
|
|
895
|
+
fs.exists('README.md', (val) => {
|
|
896
|
+
assert.equal(true, val);
|
|
897
|
+
done();
|
|
898
|
+
});
|
|
899
|
+
} catch (error) {
|
|
900
|
+
log.error(`Test Failure: ${error}`);
|
|
901
|
+
done(error);
|
|
902
|
+
}
|
|
903
|
+
});
|
|
904
|
+
it('README.md should be customized', (done) => {
|
|
905
|
+
try {
|
|
906
|
+
fs.readFile('README.md', 'utf8', (err, data) => {
|
|
907
|
+
assert.equal(-1, data.indexOf('[System]'));
|
|
908
|
+
assert.equal(-1, data.indexOf('[system]'));
|
|
909
|
+
assert.equal(-1, data.indexOf('[version]'));
|
|
910
|
+
assert.equal(-1, data.indexOf('[namespace]'));
|
|
911
|
+
done();
|
|
912
|
+
});
|
|
913
|
+
} catch (error) {
|
|
914
|
+
log.error(`Test Failure: ${error}`);
|
|
915
|
+
done(error);
|
|
916
|
+
}
|
|
917
|
+
});
|
|
918
|
+
});
|
|
919
|
+
|
|
920
|
+
describe('#connect', () => {
|
|
921
|
+
it('should have a connect function', (done) => {
|
|
922
|
+
try {
|
|
923
|
+
assert.equal(true, typeof a.connect === 'function');
|
|
924
|
+
done();
|
|
925
|
+
} catch (error) {
|
|
926
|
+
log.error(`Test Failure: ${error}`);
|
|
927
|
+
done(error);
|
|
928
|
+
}
|
|
929
|
+
});
|
|
930
|
+
});
|
|
931
|
+
|
|
932
|
+
describe('#healthCheck', () => {
|
|
933
|
+
it('should have a healthCheck function', (done) => {
|
|
934
|
+
try {
|
|
935
|
+
assert.equal(true, typeof a.healthCheck === 'function');
|
|
936
|
+
done();
|
|
937
|
+
} catch (error) {
|
|
938
|
+
log.error(`Test Failure: ${error}`);
|
|
939
|
+
done(error);
|
|
940
|
+
}
|
|
941
|
+
});
|
|
942
|
+
});
|
|
943
|
+
|
|
944
|
+
describe('#iapUpdateAdapterConfiguration', () => {
|
|
945
|
+
it('should have a iapUpdateAdapterConfiguration function', (done) => {
|
|
946
|
+
try {
|
|
947
|
+
assert.equal(true, typeof a.iapUpdateAdapterConfiguration === 'function');
|
|
948
|
+
done();
|
|
949
|
+
} catch (error) {
|
|
950
|
+
log.error(`Test Failure: ${error}`);
|
|
951
|
+
done(error);
|
|
952
|
+
}
|
|
953
|
+
});
|
|
954
|
+
});
|
|
955
|
+
|
|
956
|
+
describe('#iapSuspendAdapter', () => {
|
|
957
|
+
it('should have a iapSuspendAdapter function', (done) => {
|
|
958
|
+
try {
|
|
959
|
+
assert.equal(true, typeof a.iapSuspendAdapter === 'function');
|
|
960
|
+
done();
|
|
961
|
+
} catch (error) {
|
|
962
|
+
log.error(`Test Failure: ${error}`);
|
|
963
|
+
done(error);
|
|
964
|
+
}
|
|
965
|
+
});
|
|
966
|
+
});
|
|
967
|
+
|
|
968
|
+
describe('#iapUnsuspendAdapter', () => {
|
|
969
|
+
it('should have a iapUnsuspendAdapter function', (done) => {
|
|
970
|
+
try {
|
|
971
|
+
assert.equal(true, typeof a.iapUnsuspendAdapter === 'function');
|
|
972
|
+
done();
|
|
973
|
+
} catch (error) {
|
|
974
|
+
log.error(`Test Failure: ${error}`);
|
|
975
|
+
done(error);
|
|
976
|
+
}
|
|
977
|
+
});
|
|
978
|
+
});
|
|
979
|
+
|
|
980
|
+
describe('#iapGetAdapterQueue', () => {
|
|
981
|
+
it('should have a iapGetAdapterQueue function', (done) => {
|
|
982
|
+
try {
|
|
983
|
+
assert.equal(true, typeof a.iapGetAdapterQueue === 'function');
|
|
984
|
+
done();
|
|
985
|
+
} catch (error) {
|
|
986
|
+
log.error(`Test Failure: ${error}`);
|
|
987
|
+
done(error);
|
|
988
|
+
}
|
|
989
|
+
});
|
|
990
|
+
});
|
|
991
|
+
|
|
992
|
+
describe('#iapFindAdapterPath', () => {
|
|
993
|
+
it('should have a iapFindAdapterPath function', (done) => {
|
|
994
|
+
try {
|
|
995
|
+
assert.equal(true, typeof a.iapFindAdapterPath === 'function');
|
|
996
|
+
done();
|
|
997
|
+
} catch (error) {
|
|
998
|
+
log.error(`Test Failure: ${error}`);
|
|
999
|
+
done(error);
|
|
1000
|
+
}
|
|
1001
|
+
});
|
|
1002
|
+
it('iapFindAdapterPath should find atleast one path that matches', (done) => {
|
|
1003
|
+
try {
|
|
1004
|
+
a.iapFindAdapterPath('{base_path}/{version}', (data, error) => {
|
|
1005
|
+
try {
|
|
1006
|
+
assert.equal(undefined, error);
|
|
1007
|
+
assert.notEqual(undefined, data);
|
|
1008
|
+
assert.notEqual(null, data);
|
|
1009
|
+
assert.equal(true, data.found);
|
|
1010
|
+
assert.notEqual(undefined, data.foundIn);
|
|
1011
|
+
assert.notEqual(null, data.foundIn);
|
|
1012
|
+
assert.notEqual(0, data.foundIn.length);
|
|
1013
|
+
done();
|
|
1014
|
+
} catch (err) {
|
|
1015
|
+
log.error(`Test Failure: ${err}`);
|
|
1016
|
+
done(err);
|
|
1017
|
+
}
|
|
1018
|
+
});
|
|
1019
|
+
} catch (error) {
|
|
1020
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1021
|
+
done(error);
|
|
1022
|
+
}
|
|
1023
|
+
}).timeout(attemptTimeout);
|
|
1024
|
+
});
|
|
1025
|
+
|
|
1026
|
+
describe('#iapTroubleshootAdapter', () => {
|
|
1027
|
+
it('should have a iapTroubleshootAdapter function', (done) => {
|
|
1028
|
+
try {
|
|
1029
|
+
assert.equal(true, typeof a.iapTroubleshootAdapter === 'function');
|
|
1030
|
+
done();
|
|
1031
|
+
} catch (error) {
|
|
1032
|
+
log.error(`Test Failure: ${error}`);
|
|
1033
|
+
done(error);
|
|
1034
|
+
}
|
|
1035
|
+
});
|
|
1036
|
+
});
|
|
1037
|
+
|
|
1038
|
+
describe('#iapRunAdapterHealthcheck', () => {
|
|
1039
|
+
it('should have a iapRunAdapterHealthcheck function', (done) => {
|
|
1040
|
+
try {
|
|
1041
|
+
assert.equal(true, typeof a.iapRunAdapterHealthcheck === 'function');
|
|
1042
|
+
done();
|
|
1043
|
+
} catch (error) {
|
|
1044
|
+
log.error(`Test Failure: ${error}`);
|
|
1045
|
+
done(error);
|
|
1046
|
+
}
|
|
1047
|
+
});
|
|
1048
|
+
});
|
|
1049
|
+
|
|
1050
|
+
describe('#iapRunAdapterConnectivity', () => {
|
|
1051
|
+
it('should have a iapRunAdapterConnectivity function', (done) => {
|
|
1052
|
+
try {
|
|
1053
|
+
assert.equal(true, typeof a.iapRunAdapterConnectivity === 'function');
|
|
1054
|
+
done();
|
|
1055
|
+
} catch (error) {
|
|
1056
|
+
log.error(`Test Failure: ${error}`);
|
|
1057
|
+
done(error);
|
|
1058
|
+
}
|
|
1059
|
+
});
|
|
1060
|
+
});
|
|
1061
|
+
|
|
1062
|
+
describe('#iapRunAdapterBasicGet', () => {
|
|
1063
|
+
it('should have a iapRunAdapterBasicGet function', (done) => {
|
|
1064
|
+
try {
|
|
1065
|
+
assert.equal(true, typeof a.iapRunAdapterBasicGet === 'function');
|
|
1066
|
+
done();
|
|
1067
|
+
} catch (error) {
|
|
1068
|
+
log.error(`Test Failure: ${error}`);
|
|
1069
|
+
done(error);
|
|
1070
|
+
}
|
|
1071
|
+
});
|
|
1072
|
+
});
|
|
1073
|
+
|
|
1074
|
+
describe('#iapMoveAdapterEntitiesToDB', () => {
|
|
1075
|
+
it('should have a iapMoveAdapterEntitiesToDB function', (done) => {
|
|
1076
|
+
try {
|
|
1077
|
+
assert.equal(true, typeof a.iapMoveAdapterEntitiesToDB === 'function');
|
|
1078
|
+
done();
|
|
1079
|
+
} catch (error) {
|
|
1080
|
+
log.error(`Test Failure: ${error}`);
|
|
1081
|
+
done(error);
|
|
1082
|
+
}
|
|
1083
|
+
});
|
|
1084
|
+
});
|
|
1085
|
+
|
|
1086
|
+
describe('#checkActionFiles', () => {
|
|
1087
|
+
it('should have a checkActionFiles function', (done) => {
|
|
1088
|
+
try {
|
|
1089
|
+
assert.equal(true, typeof a.checkActionFiles === 'function');
|
|
1090
|
+
done();
|
|
1091
|
+
} catch (error) {
|
|
1092
|
+
log.error(`Test Failure: ${error}`);
|
|
1093
|
+
done(error);
|
|
1094
|
+
}
|
|
1095
|
+
});
|
|
1096
|
+
it('the action files should be good - if failure change the log level as most issues are warnings', (done) => {
|
|
1097
|
+
try {
|
|
1098
|
+
const clean = a.checkActionFiles();
|
|
1099
|
+
|
|
1100
|
+
try {
|
|
1101
|
+
for (let c = 0; c < clean.length; c += 1) {
|
|
1102
|
+
log.error(clean[c]);
|
|
1103
|
+
}
|
|
1104
|
+
assert.equal(0, clean.length);
|
|
1105
|
+
done();
|
|
1106
|
+
} catch (err) {
|
|
1107
|
+
log.error(`Test Failure: ${err}`);
|
|
1108
|
+
done(err);
|
|
1109
|
+
}
|
|
1110
|
+
} catch (error) {
|
|
1111
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1112
|
+
done(error);
|
|
1113
|
+
}
|
|
1114
|
+
}).timeout(attemptTimeout);
|
|
1115
|
+
});
|
|
1116
|
+
|
|
1117
|
+
describe('#encryptProperty', () => {
|
|
1118
|
+
it('should have a encryptProperty function', (done) => {
|
|
1119
|
+
try {
|
|
1120
|
+
assert.equal(true, typeof a.encryptProperty === 'function');
|
|
1121
|
+
done();
|
|
1122
|
+
} catch (error) {
|
|
1123
|
+
log.error(`Test Failure: ${error}`);
|
|
1124
|
+
done(error);
|
|
1125
|
+
}
|
|
1126
|
+
});
|
|
1127
|
+
it('should get base64 encoded property', (done) => {
|
|
1128
|
+
try {
|
|
1129
|
+
a.encryptProperty('testing', 'base64', (data, error) => {
|
|
1130
|
+
try {
|
|
1131
|
+
assert.equal(undefined, error);
|
|
1132
|
+
assert.notEqual(undefined, data);
|
|
1133
|
+
assert.notEqual(null, data);
|
|
1134
|
+
assert.notEqual(undefined, data.response);
|
|
1135
|
+
assert.notEqual(null, data.response);
|
|
1136
|
+
assert.equal(0, data.response.indexOf('{code}'));
|
|
1137
|
+
done();
|
|
1138
|
+
} catch (err) {
|
|
1139
|
+
log.error(`Test Failure: ${err}`);
|
|
1140
|
+
done(err);
|
|
1141
|
+
}
|
|
1142
|
+
});
|
|
1143
|
+
} catch (error) {
|
|
1144
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1145
|
+
done(error);
|
|
1146
|
+
}
|
|
1147
|
+
}).timeout(attemptTimeout);
|
|
1148
|
+
it('should get encrypted property', (done) => {
|
|
1149
|
+
try {
|
|
1150
|
+
a.encryptProperty('testing', 'encrypt', (data, error) => {
|
|
1151
|
+
try {
|
|
1152
|
+
assert.equal(undefined, error);
|
|
1153
|
+
assert.notEqual(undefined, data);
|
|
1154
|
+
assert.notEqual(null, data);
|
|
1155
|
+
assert.notEqual(undefined, data.response);
|
|
1156
|
+
assert.notEqual(null, data.response);
|
|
1157
|
+
assert.equal(0, data.response.indexOf('{crypt}'));
|
|
1158
|
+
done();
|
|
1159
|
+
} catch (err) {
|
|
1160
|
+
log.error(`Test Failure: ${err}`);
|
|
1161
|
+
done(err);
|
|
1162
|
+
}
|
|
1163
|
+
});
|
|
1164
|
+
} catch (error) {
|
|
1165
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1166
|
+
done(error);
|
|
1167
|
+
}
|
|
1168
|
+
}).timeout(attemptTimeout);
|
|
1169
|
+
});
|
|
1170
|
+
|
|
1171
|
+
describe('#iapDeactivateTasks', () => {
|
|
1172
|
+
it('should have a iapDeactivateTasks function', (done) => {
|
|
1173
|
+
try {
|
|
1174
|
+
assert.equal(true, typeof a.iapDeactivateTasks === 'function');
|
|
1175
|
+
done();
|
|
1176
|
+
} catch (error) {
|
|
1177
|
+
log.error(`Test Failure: ${error}`);
|
|
1178
|
+
done(error);
|
|
1179
|
+
}
|
|
1180
|
+
});
|
|
1181
|
+
});
|
|
1182
|
+
|
|
1183
|
+
describe('#iapActivateTasks', () => {
|
|
1184
|
+
it('should have a iapActivateTasks function', (done) => {
|
|
1185
|
+
try {
|
|
1186
|
+
assert.equal(true, typeof a.iapActivateTasks === 'function');
|
|
1187
|
+
done();
|
|
1188
|
+
} catch (error) {
|
|
1189
|
+
log.error(`Test Failure: ${error}`);
|
|
1190
|
+
done(error);
|
|
1191
|
+
}
|
|
1192
|
+
});
|
|
1193
|
+
});
|
|
1194
|
+
|
|
1195
|
+
describe('#iapPopulateEntityCache', () => {
|
|
1196
|
+
it('should have a iapPopulateEntityCache function', (done) => {
|
|
1197
|
+
try {
|
|
1198
|
+
assert.equal(true, typeof a.iapPopulateEntityCache === 'function');
|
|
1199
|
+
done();
|
|
1200
|
+
} catch (error) {
|
|
1201
|
+
log.error(`Test Failure: ${error}`);
|
|
1202
|
+
done(error);
|
|
1203
|
+
}
|
|
1204
|
+
});
|
|
1205
|
+
});
|
|
1206
|
+
|
|
1207
|
+
describe('#iapRetrieveEntitiesCache', () => {
|
|
1208
|
+
it('should have a iapRetrieveEntitiesCache function', (done) => {
|
|
1209
|
+
try {
|
|
1210
|
+
assert.equal(true, typeof a.iapRetrieveEntitiesCache === 'function');
|
|
1211
|
+
done();
|
|
1212
|
+
} catch (error) {
|
|
1213
|
+
log.error(`Test Failure: ${error}`);
|
|
1214
|
+
done(error);
|
|
1215
|
+
}
|
|
1216
|
+
});
|
|
1217
|
+
});
|
|
1218
|
+
|
|
1219
|
+
describe('#hasEntities', () => {
|
|
1220
|
+
it('should have a hasEntities function', (done) => {
|
|
1221
|
+
try {
|
|
1222
|
+
assert.equal(true, typeof a.hasEntities === 'function');
|
|
1223
|
+
done();
|
|
1224
|
+
} catch (error) {
|
|
1225
|
+
log.error(`Test Failure: ${error}`);
|
|
1226
|
+
done(error);
|
|
1227
|
+
}
|
|
1228
|
+
});
|
|
1229
|
+
});
|
|
1230
|
+
|
|
1231
|
+
describe('#getDevice', () => {
|
|
1232
|
+
it('should have a getDevice function', (done) => {
|
|
1233
|
+
try {
|
|
1234
|
+
assert.equal(true, typeof a.getDevice === 'function');
|
|
1235
|
+
done();
|
|
1236
|
+
} catch (error) {
|
|
1237
|
+
log.error(`Test Failure: ${error}`);
|
|
1238
|
+
done(error);
|
|
1239
|
+
}
|
|
1240
|
+
});
|
|
1241
|
+
});
|
|
1242
|
+
|
|
1243
|
+
describe('#getDevicesFiltered', () => {
|
|
1244
|
+
it('should have a getDevicesFiltered function', (done) => {
|
|
1245
|
+
try {
|
|
1246
|
+
assert.equal(true, typeof a.getDevicesFiltered === 'function');
|
|
1247
|
+
done();
|
|
1248
|
+
} catch (error) {
|
|
1249
|
+
log.error(`Test Failure: ${error}`);
|
|
1250
|
+
done(error);
|
|
1251
|
+
}
|
|
1252
|
+
});
|
|
1253
|
+
});
|
|
1254
|
+
|
|
1255
|
+
describe('#isAlive', () => {
|
|
1256
|
+
it('should have a isAlive function', (done) => {
|
|
1257
|
+
try {
|
|
1258
|
+
assert.equal(true, typeof a.isAlive === 'function');
|
|
1259
|
+
done();
|
|
1260
|
+
} catch (error) {
|
|
1261
|
+
log.error(`Test Failure: ${error}`);
|
|
1262
|
+
done(error);
|
|
1263
|
+
}
|
|
1264
|
+
});
|
|
1265
|
+
});
|
|
1266
|
+
|
|
1267
|
+
describe('#getConfig', () => {
|
|
1268
|
+
it('should have a getConfig function', (done) => {
|
|
1269
|
+
try {
|
|
1270
|
+
assert.equal(true, typeof a.getConfig === 'function');
|
|
1271
|
+
done();
|
|
1272
|
+
} catch (error) {
|
|
1273
|
+
log.error(`Test Failure: ${error}`);
|
|
1274
|
+
done(error);
|
|
1275
|
+
}
|
|
1276
|
+
});
|
|
1277
|
+
});
|
|
1278
|
+
|
|
1279
|
+
describe('#iapGetDeviceCount', () => {
|
|
1280
|
+
it('should have a iapGetDeviceCount function', (done) => {
|
|
1281
|
+
try {
|
|
1282
|
+
assert.equal(true, typeof a.iapGetDeviceCount === 'function');
|
|
1283
|
+
done();
|
|
1284
|
+
} catch (error) {
|
|
1285
|
+
log.error(`Test Failure: ${error}`);
|
|
1286
|
+
done(error);
|
|
1287
|
+
}
|
|
1288
|
+
});
|
|
1289
|
+
});
|
|
1290
|
+
|
|
1291
|
+
describe('#iapExpandedGenericAdapterRequest', () => {
|
|
1292
|
+
it('should have a iapExpandedGenericAdapterRequest function', (done) => {
|
|
1293
|
+
try {
|
|
1294
|
+
assert.equal(true, typeof a.iapExpandedGenericAdapterRequest === 'function');
|
|
1295
|
+
done();
|
|
1296
|
+
} catch (error) {
|
|
1297
|
+
log.error(`Test Failure: ${error}`);
|
|
1298
|
+
done(error);
|
|
1299
|
+
}
|
|
1300
|
+
});
|
|
1301
|
+
});
|
|
1302
|
+
|
|
1303
|
+
describe('#genericAdapterRequest', () => {
|
|
1304
|
+
it('should have a genericAdapterRequest function', (done) => {
|
|
1305
|
+
try {
|
|
1306
|
+
assert.equal(true, typeof a.genericAdapterRequest === 'function');
|
|
1307
|
+
done();
|
|
1308
|
+
} catch (error) {
|
|
1309
|
+
log.error(`Test Failure: ${error}`);
|
|
1310
|
+
done(error);
|
|
1311
|
+
}
|
|
1312
|
+
});
|
|
1313
|
+
});
|
|
1314
|
+
|
|
1315
|
+
describe('#genericAdapterRequestNoBasePath', () => {
|
|
1316
|
+
it('should have a genericAdapterRequestNoBasePath function', (done) => {
|
|
1317
|
+
try {
|
|
1318
|
+
assert.equal(true, typeof a.genericAdapterRequestNoBasePath === 'function');
|
|
1319
|
+
done();
|
|
1320
|
+
} catch (error) {
|
|
1321
|
+
log.error(`Test Failure: ${error}`);
|
|
1322
|
+
done(error);
|
|
1323
|
+
}
|
|
1324
|
+
});
|
|
1325
|
+
});
|
|
1326
|
+
|
|
1327
|
+
describe('#iapRunAdapterLint', () => {
|
|
1328
|
+
it('should have a iapRunAdapterLint function', (done) => {
|
|
1329
|
+
try {
|
|
1330
|
+
assert.equal(true, typeof a.iapRunAdapterLint === 'function');
|
|
1331
|
+
done();
|
|
1332
|
+
} catch (error) {
|
|
1333
|
+
log.error(`Test Failure: ${error}`);
|
|
1334
|
+
done(error);
|
|
1335
|
+
}
|
|
1336
|
+
});
|
|
1337
|
+
it('retrieve the lint results', (done) => {
|
|
1338
|
+
try {
|
|
1339
|
+
a.iapRunAdapterLint((data, error) => {
|
|
1340
|
+
try {
|
|
1341
|
+
assert.equal(undefined, error);
|
|
1342
|
+
assert.notEqual(undefined, data);
|
|
1343
|
+
assert.notEqual(null, data);
|
|
1344
|
+
assert.notEqual(undefined, data.status);
|
|
1345
|
+
assert.notEqual(null, data.status);
|
|
1346
|
+
assert.equal('SUCCESS', data.status);
|
|
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('#iapRunAdapterTests', () => {
|
|
1361
|
+
it('should have a iapRunAdapterTests function', (done) => {
|
|
1362
|
+
try {
|
|
1363
|
+
assert.equal(true, typeof a.iapRunAdapterTests === 'function');
|
|
1364
|
+
done();
|
|
1365
|
+
} catch (error) {
|
|
1366
|
+
log.error(`Test Failure: ${error}`);
|
|
1367
|
+
done(error);
|
|
1368
|
+
}
|
|
1369
|
+
});
|
|
1370
|
+
});
|
|
1371
|
+
|
|
1372
|
+
describe('#iapGetAdapterInventory', () => {
|
|
1373
|
+
it('should have a iapGetAdapterInventory function', (done) => {
|
|
1374
|
+
try {
|
|
1375
|
+
assert.equal(true, typeof a.iapGetAdapterInventory === 'function');
|
|
1376
|
+
done();
|
|
1377
|
+
} catch (error) {
|
|
1378
|
+
log.error(`Test Failure: ${error}`);
|
|
1379
|
+
done(error);
|
|
1380
|
+
}
|
|
1381
|
+
});
|
|
1382
|
+
it('retrieve the inventory', (done) => {
|
|
1383
|
+
try {
|
|
1384
|
+
a.iapGetAdapterInventory((data, error) => {
|
|
1385
|
+
try {
|
|
1386
|
+
assert.equal(undefined, error);
|
|
1387
|
+
assert.notEqual(undefined, data);
|
|
1388
|
+
assert.notEqual(null, data);
|
|
1389
|
+
done();
|
|
1390
|
+
} catch (err) {
|
|
1391
|
+
log.error(`Test Failure: ${err}`);
|
|
1392
|
+
done(err);
|
|
1393
|
+
}
|
|
1394
|
+
});
|
|
1395
|
+
} catch (error) {
|
|
1396
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1397
|
+
done(error);
|
|
1398
|
+
}
|
|
1399
|
+
}).timeout(attemptTimeout);
|
|
1400
|
+
});
|
|
1401
|
+
describe('metadata.json', () => {
|
|
1402
|
+
it('should have a metadata.json', (done) => {
|
|
1403
|
+
try {
|
|
1404
|
+
fs.exists('metadata.json', (val) => {
|
|
1405
|
+
assert.equal(true, val);
|
|
1406
|
+
done();
|
|
1407
|
+
});
|
|
1408
|
+
} catch (error) {
|
|
1409
|
+
log.error(`Test Failure: ${error}`);
|
|
1410
|
+
done(error);
|
|
1411
|
+
}
|
|
1412
|
+
});
|
|
1413
|
+
it('metadata.json is customized', (done) => {
|
|
1414
|
+
try {
|
|
1415
|
+
const metadataDotJson = require('../../metadata.json');
|
|
1416
|
+
assert.equal('adapter-aws_lambda', metadataDotJson.name);
|
|
1417
|
+
assert.notEqual(undefined, metadataDotJson.webName);
|
|
1418
|
+
assert.notEqual(null, metadataDotJson.webName);
|
|
1419
|
+
assert.notEqual('', metadataDotJson.webName);
|
|
1420
|
+
assert.equal('Adapter', metadataDotJson.type);
|
|
1421
|
+
done();
|
|
1422
|
+
} catch (error) {
|
|
1423
|
+
log.error(`Test Failure: ${error}`);
|
|
1424
|
+
done(error);
|
|
1425
|
+
}
|
|
1426
|
+
});
|
|
1427
|
+
it('metadata.json contains accurate documentation', (done) => {
|
|
1428
|
+
try {
|
|
1429
|
+
const metadataDotJson = require('../../metadata.json');
|
|
1430
|
+
assert.notEqual(undefined, metadataDotJson.documentation);
|
|
1431
|
+
assert.equal('https://www.npmjs.com/package/@itentialopensource/adapter-aws_lambda', metadataDotJson.documentation.npmLink);
|
|
1432
|
+
assert.equal('https://docs.itential.com/opensource/docs/troubleshooting-an-adapter', metadataDotJson.documentation.faqLink);
|
|
1433
|
+
assert.equal('https://gitlab.com/itentialopensource/adapters/contributing-guide', metadataDotJson.documentation.contributeLink);
|
|
1434
|
+
assert.equal('https://itential.atlassian.net/servicedesk/customer/portals', metadataDotJson.documentation.issueLink);
|
|
1435
|
+
done();
|
|
1436
|
+
} catch (error) {
|
|
1437
|
+
log.error(`Test Failure: ${error}`);
|
|
1438
|
+
done(error);
|
|
1439
|
+
}
|
|
1440
|
+
});
|
|
1441
|
+
it('metadata.json has related items', (done) => {
|
|
1442
|
+
try {
|
|
1443
|
+
const metadataDotJson = require('../../metadata.json');
|
|
1444
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems);
|
|
1445
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems.adapters);
|
|
1446
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems.integrations);
|
|
1447
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems.ecosystemApplications);
|
|
1448
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems.workflowProjects);
|
|
1449
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems.transformationProjects);
|
|
1450
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems.exampleProjects);
|
|
1451
|
+
done();
|
|
1452
|
+
} catch (error) {
|
|
1453
|
+
log.error(`Test Failure: ${error}`);
|
|
1454
|
+
done(error);
|
|
1455
|
+
}
|
|
1456
|
+
});
|
|
1457
|
+
});
|
|
1458
|
+
/*
|
|
1459
|
+
-----------------------------------------------------------------------
|
|
1460
|
+
-----------------------------------------------------------------------
|
|
1461
|
+
*** All code above this comment will be replaced during a migration ***
|
|
1462
|
+
******************* DO NOT REMOVE THIS COMMENT BLOCK ******************
|
|
1463
|
+
-----------------------------------------------------------------------
|
|
1464
|
+
-----------------------------------------------------------------------
|
|
1465
|
+
*/
|
|
1466
|
+
|
|
1467
|
+
describe('#addLayerVersionPermission - errors', () => {
|
|
1468
|
+
it('should have a addLayerVersionPermission function', (done) => {
|
|
1469
|
+
try {
|
|
1470
|
+
assert.equal(true, typeof a.addLayerVersionPermission === 'function');
|
|
1471
|
+
done();
|
|
1472
|
+
} catch (error) {
|
|
1473
|
+
log.error(`Test Failure: ${error}`);
|
|
1474
|
+
done(error);
|
|
1475
|
+
}
|
|
1476
|
+
}).timeout(attemptTimeout);
|
|
1477
|
+
it('should error if - missing layerName', (done) => {
|
|
1478
|
+
try {
|
|
1479
|
+
a.addLayerVersionPermission(null, null, null, null, null, (data, error) => {
|
|
1480
|
+
try {
|
|
1481
|
+
const displayE = 'layerName is required';
|
|
1482
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-addLayerVersionPermission', displayE);
|
|
1483
|
+
done();
|
|
1484
|
+
} catch (err) {
|
|
1485
|
+
log.error(`Test Failure: ${err}`);
|
|
1486
|
+
done(err);
|
|
1487
|
+
}
|
|
1488
|
+
});
|
|
1489
|
+
} catch (error) {
|
|
1490
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1491
|
+
done(error);
|
|
1492
|
+
}
|
|
1493
|
+
}).timeout(attemptTimeout);
|
|
1494
|
+
it('should error if - missing versionNumber', (done) => {
|
|
1495
|
+
try {
|
|
1496
|
+
a.addLayerVersionPermission('fakeparam', null, null, null, null, (data, error) => {
|
|
1497
|
+
try {
|
|
1498
|
+
const displayE = 'versionNumber is required';
|
|
1499
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-addLayerVersionPermission', displayE);
|
|
1500
|
+
done();
|
|
1501
|
+
} catch (err) {
|
|
1502
|
+
log.error(`Test Failure: ${err}`);
|
|
1503
|
+
done(err);
|
|
1504
|
+
}
|
|
1505
|
+
});
|
|
1506
|
+
} catch (error) {
|
|
1507
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1508
|
+
done(error);
|
|
1509
|
+
}
|
|
1510
|
+
}).timeout(attemptTimeout);
|
|
1511
|
+
it('should error if - missing body', (done) => {
|
|
1512
|
+
try {
|
|
1513
|
+
a.addLayerVersionPermission('fakeparam', 'fakeparam', 'fakeparam', null, null, (data, error) => {
|
|
1514
|
+
try {
|
|
1515
|
+
const displayE = 'body is required';
|
|
1516
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-addLayerVersionPermission', displayE);
|
|
1517
|
+
done();
|
|
1518
|
+
} catch (err) {
|
|
1519
|
+
log.error(`Test Failure: ${err}`);
|
|
1520
|
+
done(err);
|
|
1521
|
+
}
|
|
1522
|
+
});
|
|
1523
|
+
} catch (error) {
|
|
1524
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1525
|
+
done(error);
|
|
1526
|
+
}
|
|
1527
|
+
}).timeout(attemptTimeout);
|
|
1528
|
+
});
|
|
1529
|
+
|
|
1530
|
+
describe('#getLayerVersionPolicy - errors', () => {
|
|
1531
|
+
it('should have a getLayerVersionPolicy function', (done) => {
|
|
1532
|
+
try {
|
|
1533
|
+
assert.equal(true, typeof a.getLayerVersionPolicy === 'function');
|
|
1534
|
+
done();
|
|
1535
|
+
} catch (error) {
|
|
1536
|
+
log.error(`Test Failure: ${error}`);
|
|
1537
|
+
done(error);
|
|
1538
|
+
}
|
|
1539
|
+
}).timeout(attemptTimeout);
|
|
1540
|
+
it('should error if - missing layerName', (done) => {
|
|
1541
|
+
try {
|
|
1542
|
+
a.getLayerVersionPolicy(null, null, null, (data, error) => {
|
|
1543
|
+
try {
|
|
1544
|
+
const displayE = 'layerName is required';
|
|
1545
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-getLayerVersionPolicy', displayE);
|
|
1546
|
+
done();
|
|
1547
|
+
} catch (err) {
|
|
1548
|
+
log.error(`Test Failure: ${err}`);
|
|
1549
|
+
done(err);
|
|
1550
|
+
}
|
|
1551
|
+
});
|
|
1552
|
+
} catch (error) {
|
|
1553
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1554
|
+
done(error);
|
|
1555
|
+
}
|
|
1556
|
+
}).timeout(attemptTimeout);
|
|
1557
|
+
it('should error if - missing versionNumber', (done) => {
|
|
1558
|
+
try {
|
|
1559
|
+
a.getLayerVersionPolicy('fakeparam', null, null, (data, error) => {
|
|
1560
|
+
try {
|
|
1561
|
+
const displayE = 'versionNumber is required';
|
|
1562
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-getLayerVersionPolicy', displayE);
|
|
1563
|
+
done();
|
|
1564
|
+
} catch (err) {
|
|
1565
|
+
log.error(`Test Failure: ${err}`);
|
|
1566
|
+
done(err);
|
|
1567
|
+
}
|
|
1568
|
+
});
|
|
1569
|
+
} catch (error) {
|
|
1570
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1571
|
+
done(error);
|
|
1572
|
+
}
|
|
1573
|
+
}).timeout(attemptTimeout);
|
|
1574
|
+
});
|
|
1575
|
+
|
|
1576
|
+
describe('#deleteLayerVersion - errors', () => {
|
|
1577
|
+
it('should have a deleteLayerVersion function', (done) => {
|
|
1578
|
+
try {
|
|
1579
|
+
assert.equal(true, typeof a.deleteLayerVersion === 'function');
|
|
1580
|
+
done();
|
|
1581
|
+
} catch (error) {
|
|
1582
|
+
log.error(`Test Failure: ${error}`);
|
|
1583
|
+
done(error);
|
|
1584
|
+
}
|
|
1585
|
+
}).timeout(attemptTimeout);
|
|
1586
|
+
it('should error if - missing layerName', (done) => {
|
|
1587
|
+
try {
|
|
1588
|
+
a.deleteLayerVersion(null, null, null, (data, error) => {
|
|
1589
|
+
try {
|
|
1590
|
+
const displayE = 'layerName is required';
|
|
1591
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-deleteLayerVersion', displayE);
|
|
1592
|
+
done();
|
|
1593
|
+
} catch (err) {
|
|
1594
|
+
log.error(`Test Failure: ${err}`);
|
|
1595
|
+
done(err);
|
|
1596
|
+
}
|
|
1597
|
+
});
|
|
1598
|
+
} catch (error) {
|
|
1599
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1600
|
+
done(error);
|
|
1601
|
+
}
|
|
1602
|
+
}).timeout(attemptTimeout);
|
|
1603
|
+
it('should error if - missing versionNumber', (done) => {
|
|
1604
|
+
try {
|
|
1605
|
+
a.deleteLayerVersion('fakeparam', null, null, (data, error) => {
|
|
1606
|
+
try {
|
|
1607
|
+
const displayE = 'versionNumber is required';
|
|
1608
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-deleteLayerVersion', displayE);
|
|
1609
|
+
done();
|
|
1610
|
+
} catch (err) {
|
|
1611
|
+
log.error(`Test Failure: ${err}`);
|
|
1612
|
+
done(err);
|
|
1613
|
+
}
|
|
1614
|
+
});
|
|
1615
|
+
} catch (error) {
|
|
1616
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1617
|
+
done(error);
|
|
1618
|
+
}
|
|
1619
|
+
}).timeout(attemptTimeout);
|
|
1620
|
+
});
|
|
1621
|
+
|
|
1622
|
+
describe('#getLayerVersion - errors', () => {
|
|
1623
|
+
it('should have a getLayerVersion function', (done) => {
|
|
1624
|
+
try {
|
|
1625
|
+
assert.equal(true, typeof a.getLayerVersion === 'function');
|
|
1626
|
+
done();
|
|
1627
|
+
} catch (error) {
|
|
1628
|
+
log.error(`Test Failure: ${error}`);
|
|
1629
|
+
done(error);
|
|
1630
|
+
}
|
|
1631
|
+
}).timeout(attemptTimeout);
|
|
1632
|
+
it('should error if - missing layerName', (done) => {
|
|
1633
|
+
try {
|
|
1634
|
+
a.getLayerVersion(null, null, null, (data, error) => {
|
|
1635
|
+
try {
|
|
1636
|
+
const displayE = 'layerName is required';
|
|
1637
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-getLayerVersion', displayE);
|
|
1638
|
+
done();
|
|
1639
|
+
} catch (err) {
|
|
1640
|
+
log.error(`Test Failure: ${err}`);
|
|
1641
|
+
done(err);
|
|
1642
|
+
}
|
|
1643
|
+
});
|
|
1644
|
+
} catch (error) {
|
|
1645
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1646
|
+
done(error);
|
|
1647
|
+
}
|
|
1648
|
+
}).timeout(attemptTimeout);
|
|
1649
|
+
it('should error if - missing versionNumber', (done) => {
|
|
1650
|
+
try {
|
|
1651
|
+
a.getLayerVersion('fakeparam', null, null, (data, error) => {
|
|
1652
|
+
try {
|
|
1653
|
+
const displayE = 'versionNumber is required';
|
|
1654
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-getLayerVersion', displayE);
|
|
1655
|
+
done();
|
|
1656
|
+
} catch (err) {
|
|
1657
|
+
log.error(`Test Failure: ${err}`);
|
|
1658
|
+
done(err);
|
|
1659
|
+
}
|
|
1660
|
+
});
|
|
1661
|
+
} catch (error) {
|
|
1662
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1663
|
+
done(error);
|
|
1664
|
+
}
|
|
1665
|
+
}).timeout(attemptTimeout);
|
|
1666
|
+
});
|
|
1667
|
+
|
|
1668
|
+
describe('#getLayerVersionByArn - errors', () => {
|
|
1669
|
+
it('should have a getLayerVersionByArn function', (done) => {
|
|
1670
|
+
try {
|
|
1671
|
+
assert.equal(true, typeof a.getLayerVersionByArn === 'function');
|
|
1672
|
+
done();
|
|
1673
|
+
} catch (error) {
|
|
1674
|
+
log.error(`Test Failure: ${error}`);
|
|
1675
|
+
done(error);
|
|
1676
|
+
}
|
|
1677
|
+
}).timeout(attemptTimeout);
|
|
1678
|
+
it('should error if - missing arn', (done) => {
|
|
1679
|
+
try {
|
|
1680
|
+
a.getLayerVersionByArn(null, null, null, (data, error) => {
|
|
1681
|
+
try {
|
|
1682
|
+
const displayE = 'arn is required';
|
|
1683
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-getLayerVersionByArn', displayE);
|
|
1684
|
+
done();
|
|
1685
|
+
} catch (err) {
|
|
1686
|
+
log.error(`Test Failure: ${err}`);
|
|
1687
|
+
done(err);
|
|
1688
|
+
}
|
|
1689
|
+
});
|
|
1690
|
+
} catch (error) {
|
|
1691
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1692
|
+
done(error);
|
|
1693
|
+
}
|
|
1694
|
+
}).timeout(attemptTimeout);
|
|
1695
|
+
it('should error if - missing find', (done) => {
|
|
1696
|
+
try {
|
|
1697
|
+
a.getLayerVersionByArn('fakeparam', null, null, (data, error) => {
|
|
1698
|
+
try {
|
|
1699
|
+
const displayE = 'find is required';
|
|
1700
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-getLayerVersionByArn', displayE);
|
|
1701
|
+
done();
|
|
1702
|
+
} catch (err) {
|
|
1703
|
+
log.error(`Test Failure: ${err}`);
|
|
1704
|
+
done(err);
|
|
1705
|
+
}
|
|
1706
|
+
});
|
|
1707
|
+
} catch (error) {
|
|
1708
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1709
|
+
done(error);
|
|
1710
|
+
}
|
|
1711
|
+
}).timeout(attemptTimeout);
|
|
1712
|
+
});
|
|
1713
|
+
|
|
1714
|
+
describe('#listLayerVersions - errors', () => {
|
|
1715
|
+
it('should have a listLayerVersions function', (done) => {
|
|
1716
|
+
try {
|
|
1717
|
+
assert.equal(true, typeof a.listLayerVersions === 'function');
|
|
1718
|
+
done();
|
|
1719
|
+
} catch (error) {
|
|
1720
|
+
log.error(`Test Failure: ${error}`);
|
|
1721
|
+
done(error);
|
|
1722
|
+
}
|
|
1723
|
+
}).timeout(attemptTimeout);
|
|
1724
|
+
it('should error if - missing layerName', (done) => {
|
|
1725
|
+
try {
|
|
1726
|
+
a.listLayerVersions('fakeparam', null, null, null, null, null, (data, error) => {
|
|
1727
|
+
try {
|
|
1728
|
+
const displayE = 'layerName is required';
|
|
1729
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-listLayerVersions', displayE);
|
|
1730
|
+
done();
|
|
1731
|
+
} catch (err) {
|
|
1732
|
+
log.error(`Test Failure: ${err}`);
|
|
1733
|
+
done(err);
|
|
1734
|
+
}
|
|
1735
|
+
});
|
|
1736
|
+
} catch (error) {
|
|
1737
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1738
|
+
done(error);
|
|
1739
|
+
}
|
|
1740
|
+
}).timeout(attemptTimeout);
|
|
1741
|
+
});
|
|
1742
|
+
|
|
1743
|
+
describe('#publishLayerVersion - errors', () => {
|
|
1744
|
+
it('should have a publishLayerVersion function', (done) => {
|
|
1745
|
+
try {
|
|
1746
|
+
assert.equal(true, typeof a.publishLayerVersion === 'function');
|
|
1747
|
+
done();
|
|
1748
|
+
} catch (error) {
|
|
1749
|
+
log.error(`Test Failure: ${error}`);
|
|
1750
|
+
done(error);
|
|
1751
|
+
}
|
|
1752
|
+
}).timeout(attemptTimeout);
|
|
1753
|
+
it('should error if - missing layerName', (done) => {
|
|
1754
|
+
try {
|
|
1755
|
+
a.publishLayerVersion(null, null, null, (data, error) => {
|
|
1756
|
+
try {
|
|
1757
|
+
const displayE = 'layerName is required';
|
|
1758
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-publishLayerVersion', displayE);
|
|
1759
|
+
done();
|
|
1760
|
+
} catch (err) {
|
|
1761
|
+
log.error(`Test Failure: ${err}`);
|
|
1762
|
+
done(err);
|
|
1763
|
+
}
|
|
1764
|
+
});
|
|
1765
|
+
} catch (error) {
|
|
1766
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1767
|
+
done(error);
|
|
1768
|
+
}
|
|
1769
|
+
}).timeout(attemptTimeout);
|
|
1770
|
+
it('should error if - missing body', (done) => {
|
|
1771
|
+
try {
|
|
1772
|
+
a.publishLayerVersion('fakeparam', null, null, (data, error) => {
|
|
1773
|
+
try {
|
|
1774
|
+
const displayE = 'body is required';
|
|
1775
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-publishLayerVersion', displayE);
|
|
1776
|
+
done();
|
|
1777
|
+
} catch (err) {
|
|
1778
|
+
log.error(`Test Failure: ${err}`);
|
|
1779
|
+
done(err);
|
|
1780
|
+
}
|
|
1781
|
+
});
|
|
1782
|
+
} catch (error) {
|
|
1783
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1784
|
+
done(error);
|
|
1785
|
+
}
|
|
1786
|
+
}).timeout(attemptTimeout);
|
|
1787
|
+
});
|
|
1788
|
+
|
|
1789
|
+
describe('#listLayers - errors', () => {
|
|
1790
|
+
it('should have a listLayers function', (done) => {
|
|
1791
|
+
try {
|
|
1792
|
+
assert.equal(true, typeof a.listLayers === 'function');
|
|
1793
|
+
done();
|
|
1794
|
+
} catch (error) {
|
|
1795
|
+
log.error(`Test Failure: ${error}`);
|
|
1796
|
+
done(error);
|
|
1797
|
+
}
|
|
1798
|
+
}).timeout(attemptTimeout);
|
|
1799
|
+
});
|
|
1800
|
+
|
|
1801
|
+
describe('#removeLayerVersionPermission - errors', () => {
|
|
1802
|
+
it('should have a removeLayerVersionPermission function', (done) => {
|
|
1803
|
+
try {
|
|
1804
|
+
assert.equal(true, typeof a.removeLayerVersionPermission === 'function');
|
|
1805
|
+
done();
|
|
1806
|
+
} catch (error) {
|
|
1807
|
+
log.error(`Test Failure: ${error}`);
|
|
1808
|
+
done(error);
|
|
1809
|
+
}
|
|
1810
|
+
}).timeout(attemptTimeout);
|
|
1811
|
+
it('should error if - missing layerName', (done) => {
|
|
1812
|
+
try {
|
|
1813
|
+
a.removeLayerVersionPermission(null, null, null, null, null, (data, error) => {
|
|
1814
|
+
try {
|
|
1815
|
+
const displayE = 'layerName is required';
|
|
1816
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-removeLayerVersionPermission', displayE);
|
|
1817
|
+
done();
|
|
1818
|
+
} catch (err) {
|
|
1819
|
+
log.error(`Test Failure: ${err}`);
|
|
1820
|
+
done(err);
|
|
1821
|
+
}
|
|
1822
|
+
});
|
|
1823
|
+
} catch (error) {
|
|
1824
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1825
|
+
done(error);
|
|
1826
|
+
}
|
|
1827
|
+
}).timeout(attemptTimeout);
|
|
1828
|
+
it('should error if - missing versionNumber', (done) => {
|
|
1829
|
+
try {
|
|
1830
|
+
a.removeLayerVersionPermission('fakeparam', null, null, null, null, (data, error) => {
|
|
1831
|
+
try {
|
|
1832
|
+
const displayE = 'versionNumber is required';
|
|
1833
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-removeLayerVersionPermission', displayE);
|
|
1834
|
+
done();
|
|
1835
|
+
} catch (err) {
|
|
1836
|
+
log.error(`Test Failure: ${err}`);
|
|
1837
|
+
done(err);
|
|
1838
|
+
}
|
|
1839
|
+
});
|
|
1840
|
+
} catch (error) {
|
|
1841
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1842
|
+
done(error);
|
|
1843
|
+
}
|
|
1844
|
+
}).timeout(attemptTimeout);
|
|
1845
|
+
it('should error if - missing statementId', (done) => {
|
|
1846
|
+
try {
|
|
1847
|
+
a.removeLayerVersionPermission('fakeparam', 'fakeparam', null, null, null, (data, error) => {
|
|
1848
|
+
try {
|
|
1849
|
+
const displayE = 'statementId is required';
|
|
1850
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-removeLayerVersionPermission', displayE);
|
|
1851
|
+
done();
|
|
1852
|
+
} catch (err) {
|
|
1853
|
+
log.error(`Test Failure: ${err}`);
|
|
1854
|
+
done(err);
|
|
1855
|
+
}
|
|
1856
|
+
});
|
|
1857
|
+
} catch (error) {
|
|
1858
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1859
|
+
done(error);
|
|
1860
|
+
}
|
|
1861
|
+
}).timeout(attemptTimeout);
|
|
1862
|
+
});
|
|
1863
|
+
|
|
1864
|
+
describe('#addPermission - errors', () => {
|
|
1865
|
+
it('should have a addPermission function', (done) => {
|
|
1866
|
+
try {
|
|
1867
|
+
assert.equal(true, typeof a.addPermission === 'function');
|
|
1868
|
+
done();
|
|
1869
|
+
} catch (error) {
|
|
1870
|
+
log.error(`Test Failure: ${error}`);
|
|
1871
|
+
done(error);
|
|
1872
|
+
}
|
|
1873
|
+
}).timeout(attemptTimeout);
|
|
1874
|
+
it('should error if - missing functionName', (done) => {
|
|
1875
|
+
try {
|
|
1876
|
+
a.addPermission(null, null, null, null, (data, error) => {
|
|
1877
|
+
try {
|
|
1878
|
+
const displayE = 'functionName is required';
|
|
1879
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-addPermission', displayE);
|
|
1880
|
+
done();
|
|
1881
|
+
} catch (err) {
|
|
1882
|
+
log.error(`Test Failure: ${err}`);
|
|
1883
|
+
done(err);
|
|
1884
|
+
}
|
|
1885
|
+
});
|
|
1886
|
+
} catch (error) {
|
|
1887
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1888
|
+
done(error);
|
|
1889
|
+
}
|
|
1890
|
+
}).timeout(attemptTimeout);
|
|
1891
|
+
it('should error if - missing body', (done) => {
|
|
1892
|
+
try {
|
|
1893
|
+
a.addPermission('fakeparam', 'fakeparam', null, null, (data, error) => {
|
|
1894
|
+
try {
|
|
1895
|
+
const displayE = 'body is required';
|
|
1896
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-addPermission', displayE);
|
|
1897
|
+
done();
|
|
1898
|
+
} catch (err) {
|
|
1899
|
+
log.error(`Test Failure: ${err}`);
|
|
1900
|
+
done(err);
|
|
1901
|
+
}
|
|
1902
|
+
});
|
|
1903
|
+
} catch (error) {
|
|
1904
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1905
|
+
done(error);
|
|
1906
|
+
}
|
|
1907
|
+
}).timeout(attemptTimeout);
|
|
1908
|
+
});
|
|
1909
|
+
|
|
1910
|
+
describe('#getPolicy - errors', () => {
|
|
1911
|
+
it('should have a getPolicy function', (done) => {
|
|
1912
|
+
try {
|
|
1913
|
+
assert.equal(true, typeof a.getPolicy === 'function');
|
|
1914
|
+
done();
|
|
1915
|
+
} catch (error) {
|
|
1916
|
+
log.error(`Test Failure: ${error}`);
|
|
1917
|
+
done(error);
|
|
1918
|
+
}
|
|
1919
|
+
}).timeout(attemptTimeout);
|
|
1920
|
+
it('should error if - missing functionName', (done) => {
|
|
1921
|
+
try {
|
|
1922
|
+
a.getPolicy(null, null, null, (data, error) => {
|
|
1923
|
+
try {
|
|
1924
|
+
const displayE = 'functionName is required';
|
|
1925
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-getPolicy', displayE);
|
|
1926
|
+
done();
|
|
1927
|
+
} catch (err) {
|
|
1928
|
+
log.error(`Test Failure: ${err}`);
|
|
1929
|
+
done(err);
|
|
1930
|
+
}
|
|
1931
|
+
});
|
|
1932
|
+
} catch (error) {
|
|
1933
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1934
|
+
done(error);
|
|
1935
|
+
}
|
|
1936
|
+
}).timeout(attemptTimeout);
|
|
1937
|
+
});
|
|
1938
|
+
|
|
1939
|
+
describe('#createAlias - errors', () => {
|
|
1940
|
+
it('should have a createAlias function', (done) => {
|
|
1941
|
+
try {
|
|
1942
|
+
assert.equal(true, typeof a.createAlias === 'function');
|
|
1943
|
+
done();
|
|
1944
|
+
} catch (error) {
|
|
1945
|
+
log.error(`Test Failure: ${error}`);
|
|
1946
|
+
done(error);
|
|
1947
|
+
}
|
|
1948
|
+
}).timeout(attemptTimeout);
|
|
1949
|
+
it('should error if - missing functionName', (done) => {
|
|
1950
|
+
try {
|
|
1951
|
+
a.createAlias(null, null, null, (data, error) => {
|
|
1952
|
+
try {
|
|
1953
|
+
const displayE = 'functionName is required';
|
|
1954
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-createAlias', displayE);
|
|
1955
|
+
done();
|
|
1956
|
+
} catch (err) {
|
|
1957
|
+
log.error(`Test Failure: ${err}`);
|
|
1958
|
+
done(err);
|
|
1959
|
+
}
|
|
1960
|
+
});
|
|
1961
|
+
} catch (error) {
|
|
1962
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1963
|
+
done(error);
|
|
1964
|
+
}
|
|
1965
|
+
}).timeout(attemptTimeout);
|
|
1966
|
+
it('should error if - missing body', (done) => {
|
|
1967
|
+
try {
|
|
1968
|
+
a.createAlias('fakeparam', null, null, (data, error) => {
|
|
1969
|
+
try {
|
|
1970
|
+
const displayE = 'body is required';
|
|
1971
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-createAlias', displayE);
|
|
1972
|
+
done();
|
|
1973
|
+
} catch (err) {
|
|
1974
|
+
log.error(`Test Failure: ${err}`);
|
|
1975
|
+
done(err);
|
|
1976
|
+
}
|
|
1977
|
+
});
|
|
1978
|
+
} catch (error) {
|
|
1979
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1980
|
+
done(error);
|
|
1981
|
+
}
|
|
1982
|
+
}).timeout(attemptTimeout);
|
|
1983
|
+
});
|
|
1984
|
+
|
|
1985
|
+
describe('#listAliases - errors', () => {
|
|
1986
|
+
it('should have a listAliases function', (done) => {
|
|
1987
|
+
try {
|
|
1988
|
+
assert.equal(true, typeof a.listAliases === 'function');
|
|
1989
|
+
done();
|
|
1990
|
+
} catch (error) {
|
|
1991
|
+
log.error(`Test Failure: ${error}`);
|
|
1992
|
+
done(error);
|
|
1993
|
+
}
|
|
1994
|
+
}).timeout(attemptTimeout);
|
|
1995
|
+
it('should error if - missing functionName', (done) => {
|
|
1996
|
+
try {
|
|
1997
|
+
a.listAliases(null, null, null, null, null, (data, error) => {
|
|
1998
|
+
try {
|
|
1999
|
+
const displayE = 'functionName is required';
|
|
2000
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-listAliases', displayE);
|
|
2001
|
+
done();
|
|
2002
|
+
} catch (err) {
|
|
2003
|
+
log.error(`Test Failure: ${err}`);
|
|
2004
|
+
done(err);
|
|
2005
|
+
}
|
|
2006
|
+
});
|
|
2007
|
+
} catch (error) {
|
|
2008
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2009
|
+
done(error);
|
|
2010
|
+
}
|
|
2011
|
+
}).timeout(attemptTimeout);
|
|
2012
|
+
});
|
|
2013
|
+
|
|
2014
|
+
describe('#createFunction - errors', () => {
|
|
2015
|
+
it('should have a createFunction function', (done) => {
|
|
2016
|
+
try {
|
|
2017
|
+
assert.equal(true, typeof a.createFunction === 'function');
|
|
2018
|
+
done();
|
|
2019
|
+
} catch (error) {
|
|
2020
|
+
log.error(`Test Failure: ${error}`);
|
|
2021
|
+
done(error);
|
|
2022
|
+
}
|
|
2023
|
+
}).timeout(attemptTimeout);
|
|
2024
|
+
it('should error if - missing body', (done) => {
|
|
2025
|
+
try {
|
|
2026
|
+
a.createFunction(null, null, (data, error) => {
|
|
2027
|
+
try {
|
|
2028
|
+
const displayE = 'body is required';
|
|
2029
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-createFunction', displayE);
|
|
2030
|
+
done();
|
|
2031
|
+
} catch (err) {
|
|
2032
|
+
log.error(`Test Failure: ${err}`);
|
|
2033
|
+
done(err);
|
|
2034
|
+
}
|
|
2035
|
+
});
|
|
2036
|
+
} catch (error) {
|
|
2037
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2038
|
+
done(error);
|
|
2039
|
+
}
|
|
2040
|
+
}).timeout(attemptTimeout);
|
|
2041
|
+
});
|
|
2042
|
+
|
|
2043
|
+
describe('#createFunctionUrlConfig - errors', () => {
|
|
2044
|
+
it('should have a createFunctionUrlConfig function', (done) => {
|
|
2045
|
+
try {
|
|
2046
|
+
assert.equal(true, typeof a.createFunctionUrlConfig === 'function');
|
|
2047
|
+
done();
|
|
2048
|
+
} catch (error) {
|
|
2049
|
+
log.error(`Test Failure: ${error}`);
|
|
2050
|
+
done(error);
|
|
2051
|
+
}
|
|
2052
|
+
}).timeout(attemptTimeout);
|
|
2053
|
+
it('should error if - missing functionName', (done) => {
|
|
2054
|
+
try {
|
|
2055
|
+
a.createFunctionUrlConfig(null, null, null, null, (data, error) => {
|
|
2056
|
+
try {
|
|
2057
|
+
const displayE = 'functionName is required';
|
|
2058
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-createFunctionUrlConfig', displayE);
|
|
2059
|
+
done();
|
|
2060
|
+
} catch (err) {
|
|
2061
|
+
log.error(`Test Failure: ${err}`);
|
|
2062
|
+
done(err);
|
|
2063
|
+
}
|
|
2064
|
+
});
|
|
2065
|
+
} catch (error) {
|
|
2066
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2067
|
+
done(error);
|
|
2068
|
+
}
|
|
2069
|
+
}).timeout(attemptTimeout);
|
|
2070
|
+
it('should error if - missing body', (done) => {
|
|
2071
|
+
try {
|
|
2072
|
+
a.createFunctionUrlConfig('fakeparam', 'fakeparam', null, null, (data, error) => {
|
|
2073
|
+
try {
|
|
2074
|
+
const displayE = 'body is required';
|
|
2075
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-createFunctionUrlConfig', displayE);
|
|
2076
|
+
done();
|
|
2077
|
+
} catch (err) {
|
|
2078
|
+
log.error(`Test Failure: ${err}`);
|
|
2079
|
+
done(err);
|
|
2080
|
+
}
|
|
2081
|
+
});
|
|
2082
|
+
} catch (error) {
|
|
2083
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2084
|
+
done(error);
|
|
2085
|
+
}
|
|
2086
|
+
}).timeout(attemptTimeout);
|
|
2087
|
+
});
|
|
2088
|
+
|
|
2089
|
+
describe('#deleteFunctionUrlConfig - errors', () => {
|
|
2090
|
+
it('should have a deleteFunctionUrlConfig function', (done) => {
|
|
2091
|
+
try {
|
|
2092
|
+
assert.equal(true, typeof a.deleteFunctionUrlConfig === 'function');
|
|
2093
|
+
done();
|
|
2094
|
+
} catch (error) {
|
|
2095
|
+
log.error(`Test Failure: ${error}`);
|
|
2096
|
+
done(error);
|
|
2097
|
+
}
|
|
2098
|
+
}).timeout(attemptTimeout);
|
|
2099
|
+
it('should error if - missing functionName', (done) => {
|
|
2100
|
+
try {
|
|
2101
|
+
a.deleteFunctionUrlConfig(null, null, null, (data, error) => {
|
|
2102
|
+
try {
|
|
2103
|
+
const displayE = 'functionName is required';
|
|
2104
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-deleteFunctionUrlConfig', displayE);
|
|
2105
|
+
done();
|
|
2106
|
+
} catch (err) {
|
|
2107
|
+
log.error(`Test Failure: ${err}`);
|
|
2108
|
+
done(err);
|
|
2109
|
+
}
|
|
2110
|
+
});
|
|
2111
|
+
} catch (error) {
|
|
2112
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2113
|
+
done(error);
|
|
2114
|
+
}
|
|
2115
|
+
}).timeout(attemptTimeout);
|
|
2116
|
+
});
|
|
2117
|
+
|
|
2118
|
+
describe('#getFunctionUrlConfig - errors', () => {
|
|
2119
|
+
it('should have a getFunctionUrlConfig function', (done) => {
|
|
2120
|
+
try {
|
|
2121
|
+
assert.equal(true, typeof a.getFunctionUrlConfig === 'function');
|
|
2122
|
+
done();
|
|
2123
|
+
} catch (error) {
|
|
2124
|
+
log.error(`Test Failure: ${error}`);
|
|
2125
|
+
done(error);
|
|
2126
|
+
}
|
|
2127
|
+
}).timeout(attemptTimeout);
|
|
2128
|
+
it('should error if - missing functionName', (done) => {
|
|
2129
|
+
try {
|
|
2130
|
+
a.getFunctionUrlConfig(null, null, null, (data, error) => {
|
|
2131
|
+
try {
|
|
2132
|
+
const displayE = 'functionName is required';
|
|
2133
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-getFunctionUrlConfig', displayE);
|
|
2134
|
+
done();
|
|
2135
|
+
} catch (err) {
|
|
2136
|
+
log.error(`Test Failure: ${err}`);
|
|
2137
|
+
done(err);
|
|
2138
|
+
}
|
|
2139
|
+
});
|
|
2140
|
+
} catch (error) {
|
|
2141
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2142
|
+
done(error);
|
|
2143
|
+
}
|
|
2144
|
+
}).timeout(attemptTimeout);
|
|
2145
|
+
});
|
|
2146
|
+
|
|
2147
|
+
describe('#updateFunctionUrlConfig - errors', () => {
|
|
2148
|
+
it('should have a updateFunctionUrlConfig function', (done) => {
|
|
2149
|
+
try {
|
|
2150
|
+
assert.equal(true, typeof a.updateFunctionUrlConfig === 'function');
|
|
2151
|
+
done();
|
|
2152
|
+
} catch (error) {
|
|
2153
|
+
log.error(`Test Failure: ${error}`);
|
|
2154
|
+
done(error);
|
|
2155
|
+
}
|
|
2156
|
+
}).timeout(attemptTimeout);
|
|
2157
|
+
it('should error if - missing functionName', (done) => {
|
|
2158
|
+
try {
|
|
2159
|
+
a.updateFunctionUrlConfig(null, null, null, null, (data, error) => {
|
|
2160
|
+
try {
|
|
2161
|
+
const displayE = 'functionName is required';
|
|
2162
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-updateFunctionUrlConfig', displayE);
|
|
2163
|
+
done();
|
|
2164
|
+
} catch (err) {
|
|
2165
|
+
log.error(`Test Failure: ${err}`);
|
|
2166
|
+
done(err);
|
|
2167
|
+
}
|
|
2168
|
+
});
|
|
2169
|
+
} catch (error) {
|
|
2170
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2171
|
+
done(error);
|
|
2172
|
+
}
|
|
2173
|
+
}).timeout(attemptTimeout);
|
|
2174
|
+
it('should error if - missing body', (done) => {
|
|
2175
|
+
try {
|
|
2176
|
+
a.updateFunctionUrlConfig('fakeparam', 'fakeparam', null, null, (data, error) => {
|
|
2177
|
+
try {
|
|
2178
|
+
const displayE = 'body is required';
|
|
2179
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-updateFunctionUrlConfig', displayE);
|
|
2180
|
+
done();
|
|
2181
|
+
} catch (err) {
|
|
2182
|
+
log.error(`Test Failure: ${err}`);
|
|
2183
|
+
done(err);
|
|
2184
|
+
}
|
|
2185
|
+
});
|
|
2186
|
+
} catch (error) {
|
|
2187
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2188
|
+
done(error);
|
|
2189
|
+
}
|
|
2190
|
+
}).timeout(attemptTimeout);
|
|
2191
|
+
});
|
|
2192
|
+
|
|
2193
|
+
describe('#deleteAlias - errors', () => {
|
|
2194
|
+
it('should have a deleteAlias function', (done) => {
|
|
2195
|
+
try {
|
|
2196
|
+
assert.equal(true, typeof a.deleteAlias === 'function');
|
|
2197
|
+
done();
|
|
2198
|
+
} catch (error) {
|
|
2199
|
+
log.error(`Test Failure: ${error}`);
|
|
2200
|
+
done(error);
|
|
2201
|
+
}
|
|
2202
|
+
}).timeout(attemptTimeout);
|
|
2203
|
+
it('should error if - missing functionName', (done) => {
|
|
2204
|
+
try {
|
|
2205
|
+
a.deleteAlias(null, null, null, (data, error) => {
|
|
2206
|
+
try {
|
|
2207
|
+
const displayE = 'functionName is required';
|
|
2208
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-deleteAlias', displayE);
|
|
2209
|
+
done();
|
|
2210
|
+
} catch (err) {
|
|
2211
|
+
log.error(`Test Failure: ${err}`);
|
|
2212
|
+
done(err);
|
|
2213
|
+
}
|
|
2214
|
+
});
|
|
2215
|
+
} catch (error) {
|
|
2216
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2217
|
+
done(error);
|
|
2218
|
+
}
|
|
2219
|
+
}).timeout(attemptTimeout);
|
|
2220
|
+
it('should error if - missing name', (done) => {
|
|
2221
|
+
try {
|
|
2222
|
+
a.deleteAlias('fakeparam', null, null, (data, error) => {
|
|
2223
|
+
try {
|
|
2224
|
+
const displayE = 'name is required';
|
|
2225
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-deleteAlias', displayE);
|
|
2226
|
+
done();
|
|
2227
|
+
} catch (err) {
|
|
2228
|
+
log.error(`Test Failure: ${err}`);
|
|
2229
|
+
done(err);
|
|
2230
|
+
}
|
|
2231
|
+
});
|
|
2232
|
+
} catch (error) {
|
|
2233
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2234
|
+
done(error);
|
|
2235
|
+
}
|
|
2236
|
+
}).timeout(attemptTimeout);
|
|
2237
|
+
});
|
|
2238
|
+
|
|
2239
|
+
describe('#getAlias - errors', () => {
|
|
2240
|
+
it('should have a getAlias function', (done) => {
|
|
2241
|
+
try {
|
|
2242
|
+
assert.equal(true, typeof a.getAlias === 'function');
|
|
2243
|
+
done();
|
|
2244
|
+
} catch (error) {
|
|
2245
|
+
log.error(`Test Failure: ${error}`);
|
|
2246
|
+
done(error);
|
|
2247
|
+
}
|
|
2248
|
+
}).timeout(attemptTimeout);
|
|
2249
|
+
it('should error if - missing functionName', (done) => {
|
|
2250
|
+
try {
|
|
2251
|
+
a.getAlias(null, null, null, (data, error) => {
|
|
2252
|
+
try {
|
|
2253
|
+
const displayE = 'functionName is required';
|
|
2254
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-getAlias', displayE);
|
|
2255
|
+
done();
|
|
2256
|
+
} catch (err) {
|
|
2257
|
+
log.error(`Test Failure: ${err}`);
|
|
2258
|
+
done(err);
|
|
2259
|
+
}
|
|
2260
|
+
});
|
|
2261
|
+
} catch (error) {
|
|
2262
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2263
|
+
done(error);
|
|
2264
|
+
}
|
|
2265
|
+
}).timeout(attemptTimeout);
|
|
2266
|
+
it('should error if - missing name', (done) => {
|
|
2267
|
+
try {
|
|
2268
|
+
a.getAlias('fakeparam', null, null, (data, error) => {
|
|
2269
|
+
try {
|
|
2270
|
+
const displayE = 'name is required';
|
|
2271
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-getAlias', displayE);
|
|
2272
|
+
done();
|
|
2273
|
+
} catch (err) {
|
|
2274
|
+
log.error(`Test Failure: ${err}`);
|
|
2275
|
+
done(err);
|
|
2276
|
+
}
|
|
2277
|
+
});
|
|
2278
|
+
} catch (error) {
|
|
2279
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2280
|
+
done(error);
|
|
2281
|
+
}
|
|
2282
|
+
}).timeout(attemptTimeout);
|
|
2283
|
+
});
|
|
2284
|
+
|
|
2285
|
+
describe('#updateAlias - errors', () => {
|
|
2286
|
+
it('should have a updateAlias function', (done) => {
|
|
2287
|
+
try {
|
|
2288
|
+
assert.equal(true, typeof a.updateAlias === 'function');
|
|
2289
|
+
done();
|
|
2290
|
+
} catch (error) {
|
|
2291
|
+
log.error(`Test Failure: ${error}`);
|
|
2292
|
+
done(error);
|
|
2293
|
+
}
|
|
2294
|
+
}).timeout(attemptTimeout);
|
|
2295
|
+
it('should error if - missing functionName', (done) => {
|
|
2296
|
+
try {
|
|
2297
|
+
a.updateAlias(null, null, null, null, (data, error) => {
|
|
2298
|
+
try {
|
|
2299
|
+
const displayE = 'functionName is required';
|
|
2300
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-updateAlias', displayE);
|
|
2301
|
+
done();
|
|
2302
|
+
} catch (err) {
|
|
2303
|
+
log.error(`Test Failure: ${err}`);
|
|
2304
|
+
done(err);
|
|
2305
|
+
}
|
|
2306
|
+
});
|
|
2307
|
+
} catch (error) {
|
|
2308
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2309
|
+
done(error);
|
|
2310
|
+
}
|
|
2311
|
+
}).timeout(attemptTimeout);
|
|
2312
|
+
it('should error if - missing name', (done) => {
|
|
2313
|
+
try {
|
|
2314
|
+
a.updateAlias('fakeparam', null, null, null, (data, error) => {
|
|
2315
|
+
try {
|
|
2316
|
+
const displayE = 'name is required';
|
|
2317
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-updateAlias', displayE);
|
|
2318
|
+
done();
|
|
2319
|
+
} catch (err) {
|
|
2320
|
+
log.error(`Test Failure: ${err}`);
|
|
2321
|
+
done(err);
|
|
2322
|
+
}
|
|
2323
|
+
});
|
|
2324
|
+
} catch (error) {
|
|
2325
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2326
|
+
done(error);
|
|
2327
|
+
}
|
|
2328
|
+
}).timeout(attemptTimeout);
|
|
2329
|
+
it('should error if - missing body', (done) => {
|
|
2330
|
+
try {
|
|
2331
|
+
a.updateAlias('fakeparam', 'fakeparam', null, null, (data, error) => {
|
|
2332
|
+
try {
|
|
2333
|
+
const displayE = 'body is required';
|
|
2334
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-updateAlias', displayE);
|
|
2335
|
+
done();
|
|
2336
|
+
} catch (err) {
|
|
2337
|
+
log.error(`Test Failure: ${err}`);
|
|
2338
|
+
done(err);
|
|
2339
|
+
}
|
|
2340
|
+
});
|
|
2341
|
+
} catch (error) {
|
|
2342
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2343
|
+
done(error);
|
|
2344
|
+
}
|
|
2345
|
+
}).timeout(attemptTimeout);
|
|
2346
|
+
});
|
|
2347
|
+
|
|
2348
|
+
describe('#deleteFunction - errors', () => {
|
|
2349
|
+
it('should have a deleteFunction function', (done) => {
|
|
2350
|
+
try {
|
|
2351
|
+
assert.equal(true, typeof a.deleteFunction === 'function');
|
|
2352
|
+
done();
|
|
2353
|
+
} catch (error) {
|
|
2354
|
+
log.error(`Test Failure: ${error}`);
|
|
2355
|
+
done(error);
|
|
2356
|
+
}
|
|
2357
|
+
}).timeout(attemptTimeout);
|
|
2358
|
+
it('should error if - missing functionName', (done) => {
|
|
2359
|
+
try {
|
|
2360
|
+
a.deleteFunction(null, null, null, (data, error) => {
|
|
2361
|
+
try {
|
|
2362
|
+
const displayE = 'functionName is required';
|
|
2363
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-deleteFunction', displayE);
|
|
2364
|
+
done();
|
|
2365
|
+
} catch (err) {
|
|
2366
|
+
log.error(`Test Failure: ${err}`);
|
|
2367
|
+
done(err);
|
|
2368
|
+
}
|
|
2369
|
+
});
|
|
2370
|
+
} catch (error) {
|
|
2371
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2372
|
+
done(error);
|
|
2373
|
+
}
|
|
2374
|
+
}).timeout(attemptTimeout);
|
|
2375
|
+
});
|
|
2376
|
+
|
|
2377
|
+
describe('#getFunction - errors', () => {
|
|
2378
|
+
it('should have a getFunction function', (done) => {
|
|
2379
|
+
try {
|
|
2380
|
+
assert.equal(true, typeof a.getFunction === 'function');
|
|
2381
|
+
done();
|
|
2382
|
+
} catch (error) {
|
|
2383
|
+
log.error(`Test Failure: ${error}`);
|
|
2384
|
+
done(error);
|
|
2385
|
+
}
|
|
2386
|
+
}).timeout(attemptTimeout);
|
|
2387
|
+
it('should error if - missing functionName', (done) => {
|
|
2388
|
+
try {
|
|
2389
|
+
a.getFunction(null, null, null, (data, error) => {
|
|
2390
|
+
try {
|
|
2391
|
+
const displayE = 'functionName is required';
|
|
2392
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-getFunction', displayE);
|
|
2393
|
+
done();
|
|
2394
|
+
} catch (err) {
|
|
2395
|
+
log.error(`Test Failure: ${err}`);
|
|
2396
|
+
done(err);
|
|
2397
|
+
}
|
|
2398
|
+
});
|
|
2399
|
+
} catch (error) {
|
|
2400
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2401
|
+
done(error);
|
|
2402
|
+
}
|
|
2403
|
+
}).timeout(attemptTimeout);
|
|
2404
|
+
});
|
|
2405
|
+
|
|
2406
|
+
describe('#deleteFunctionCodeSigningConfig - errors', () => {
|
|
2407
|
+
it('should have a deleteFunctionCodeSigningConfig function', (done) => {
|
|
2408
|
+
try {
|
|
2409
|
+
assert.equal(true, typeof a.deleteFunctionCodeSigningConfig === 'function');
|
|
2410
|
+
done();
|
|
2411
|
+
} catch (error) {
|
|
2412
|
+
log.error(`Test Failure: ${error}`);
|
|
2413
|
+
done(error);
|
|
2414
|
+
}
|
|
2415
|
+
}).timeout(attemptTimeout);
|
|
2416
|
+
it('should error if - missing functionName', (done) => {
|
|
2417
|
+
try {
|
|
2418
|
+
a.deleteFunctionCodeSigningConfig(null, null, (data, error) => {
|
|
2419
|
+
try {
|
|
2420
|
+
const displayE = 'functionName is required';
|
|
2421
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-deleteFunctionCodeSigningConfig', displayE);
|
|
2422
|
+
done();
|
|
2423
|
+
} catch (err) {
|
|
2424
|
+
log.error(`Test Failure: ${err}`);
|
|
2425
|
+
done(err);
|
|
2426
|
+
}
|
|
2427
|
+
});
|
|
2428
|
+
} catch (error) {
|
|
2429
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2430
|
+
done(error);
|
|
2431
|
+
}
|
|
2432
|
+
}).timeout(attemptTimeout);
|
|
2433
|
+
});
|
|
2434
|
+
|
|
2435
|
+
describe('#getFunctionCodeSigningConfig - errors', () => {
|
|
2436
|
+
it('should have a getFunctionCodeSigningConfig function', (done) => {
|
|
2437
|
+
try {
|
|
2438
|
+
assert.equal(true, typeof a.getFunctionCodeSigningConfig === 'function');
|
|
2439
|
+
done();
|
|
2440
|
+
} catch (error) {
|
|
2441
|
+
log.error(`Test Failure: ${error}`);
|
|
2442
|
+
done(error);
|
|
2443
|
+
}
|
|
2444
|
+
}).timeout(attemptTimeout);
|
|
2445
|
+
it('should error if - missing functionName', (done) => {
|
|
2446
|
+
try {
|
|
2447
|
+
a.getFunctionCodeSigningConfig(null, null, (data, error) => {
|
|
2448
|
+
try {
|
|
2449
|
+
const displayE = 'functionName is required';
|
|
2450
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-getFunctionCodeSigningConfig', displayE);
|
|
2451
|
+
done();
|
|
2452
|
+
} catch (err) {
|
|
2453
|
+
log.error(`Test Failure: ${err}`);
|
|
2454
|
+
done(err);
|
|
2455
|
+
}
|
|
2456
|
+
});
|
|
2457
|
+
} catch (error) {
|
|
2458
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2459
|
+
done(error);
|
|
2460
|
+
}
|
|
2461
|
+
}).timeout(attemptTimeout);
|
|
2462
|
+
});
|
|
2463
|
+
|
|
2464
|
+
describe('#putFunctionCodeSigningConfig - errors', () => {
|
|
2465
|
+
it('should have a putFunctionCodeSigningConfig function', (done) => {
|
|
2466
|
+
try {
|
|
2467
|
+
assert.equal(true, typeof a.putFunctionCodeSigningConfig === 'function');
|
|
2468
|
+
done();
|
|
2469
|
+
} catch (error) {
|
|
2470
|
+
log.error(`Test Failure: ${error}`);
|
|
2471
|
+
done(error);
|
|
2472
|
+
}
|
|
2473
|
+
}).timeout(attemptTimeout);
|
|
2474
|
+
it('should error if - missing functionName', (done) => {
|
|
2475
|
+
try {
|
|
2476
|
+
a.putFunctionCodeSigningConfig(null, null, null, (data, error) => {
|
|
2477
|
+
try {
|
|
2478
|
+
const displayE = 'functionName is required';
|
|
2479
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-putFunctionCodeSigningConfig', displayE);
|
|
2480
|
+
done();
|
|
2481
|
+
} catch (err) {
|
|
2482
|
+
log.error(`Test Failure: ${err}`);
|
|
2483
|
+
done(err);
|
|
2484
|
+
}
|
|
2485
|
+
});
|
|
2486
|
+
} catch (error) {
|
|
2487
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2488
|
+
done(error);
|
|
2489
|
+
}
|
|
2490
|
+
}).timeout(attemptTimeout);
|
|
2491
|
+
it('should error if - missing body', (done) => {
|
|
2492
|
+
try {
|
|
2493
|
+
a.putFunctionCodeSigningConfig('fakeparam', null, null, (data, error) => {
|
|
2494
|
+
try {
|
|
2495
|
+
const displayE = 'body is required';
|
|
2496
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-putFunctionCodeSigningConfig', displayE);
|
|
2497
|
+
done();
|
|
2498
|
+
} catch (err) {
|
|
2499
|
+
log.error(`Test Failure: ${err}`);
|
|
2500
|
+
done(err);
|
|
2501
|
+
}
|
|
2502
|
+
});
|
|
2503
|
+
} catch (error) {
|
|
2504
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2505
|
+
done(error);
|
|
2506
|
+
}
|
|
2507
|
+
}).timeout(attemptTimeout);
|
|
2508
|
+
});
|
|
2509
|
+
|
|
2510
|
+
describe('#deleteFunctionConcurrency - errors', () => {
|
|
2511
|
+
it('should have a deleteFunctionConcurrency function', (done) => {
|
|
2512
|
+
try {
|
|
2513
|
+
assert.equal(true, typeof a.deleteFunctionConcurrency === 'function');
|
|
2514
|
+
done();
|
|
2515
|
+
} catch (error) {
|
|
2516
|
+
log.error(`Test Failure: ${error}`);
|
|
2517
|
+
done(error);
|
|
2518
|
+
}
|
|
2519
|
+
}).timeout(attemptTimeout);
|
|
2520
|
+
it('should error if - missing functionName', (done) => {
|
|
2521
|
+
try {
|
|
2522
|
+
a.deleteFunctionConcurrency(null, null, (data, error) => {
|
|
2523
|
+
try {
|
|
2524
|
+
const displayE = 'functionName is required';
|
|
2525
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-deleteFunctionConcurrency', displayE);
|
|
2526
|
+
done();
|
|
2527
|
+
} catch (err) {
|
|
2528
|
+
log.error(`Test Failure: ${err}`);
|
|
2529
|
+
done(err);
|
|
2530
|
+
}
|
|
2531
|
+
});
|
|
2532
|
+
} catch (error) {
|
|
2533
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2534
|
+
done(error);
|
|
2535
|
+
}
|
|
2536
|
+
}).timeout(attemptTimeout);
|
|
2537
|
+
});
|
|
2538
|
+
|
|
2539
|
+
describe('#putFunctionConcurrency - errors', () => {
|
|
2540
|
+
it('should have a putFunctionConcurrency function', (done) => {
|
|
2541
|
+
try {
|
|
2542
|
+
assert.equal(true, typeof a.putFunctionConcurrency === 'function');
|
|
2543
|
+
done();
|
|
2544
|
+
} catch (error) {
|
|
2545
|
+
log.error(`Test Failure: ${error}`);
|
|
2546
|
+
done(error);
|
|
2547
|
+
}
|
|
2548
|
+
}).timeout(attemptTimeout);
|
|
2549
|
+
it('should error if - missing functionName', (done) => {
|
|
2550
|
+
try {
|
|
2551
|
+
a.putFunctionConcurrency(null, null, null, (data, error) => {
|
|
2552
|
+
try {
|
|
2553
|
+
const displayE = 'functionName is required';
|
|
2554
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-putFunctionConcurrency', displayE);
|
|
2555
|
+
done();
|
|
2556
|
+
} catch (err) {
|
|
2557
|
+
log.error(`Test Failure: ${err}`);
|
|
2558
|
+
done(err);
|
|
2559
|
+
}
|
|
2560
|
+
});
|
|
2561
|
+
} catch (error) {
|
|
2562
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2563
|
+
done(error);
|
|
2564
|
+
}
|
|
2565
|
+
}).timeout(attemptTimeout);
|
|
2566
|
+
it('should error if - missing body', (done) => {
|
|
2567
|
+
try {
|
|
2568
|
+
a.putFunctionConcurrency('fakeparam', null, null, (data, error) => {
|
|
2569
|
+
try {
|
|
2570
|
+
const displayE = 'body is required';
|
|
2571
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-putFunctionConcurrency', displayE);
|
|
2572
|
+
done();
|
|
2573
|
+
} catch (err) {
|
|
2574
|
+
log.error(`Test Failure: ${err}`);
|
|
2575
|
+
done(err);
|
|
2576
|
+
}
|
|
2577
|
+
});
|
|
2578
|
+
} catch (error) {
|
|
2579
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2580
|
+
done(error);
|
|
2581
|
+
}
|
|
2582
|
+
}).timeout(attemptTimeout);
|
|
2583
|
+
});
|
|
2584
|
+
|
|
2585
|
+
describe('#deleteFunctionEventInvokeConfig - errors', () => {
|
|
2586
|
+
it('should have a deleteFunctionEventInvokeConfig function', (done) => {
|
|
2587
|
+
try {
|
|
2588
|
+
assert.equal(true, typeof a.deleteFunctionEventInvokeConfig === 'function');
|
|
2589
|
+
done();
|
|
2590
|
+
} catch (error) {
|
|
2591
|
+
log.error(`Test Failure: ${error}`);
|
|
2592
|
+
done(error);
|
|
2593
|
+
}
|
|
2594
|
+
}).timeout(attemptTimeout);
|
|
2595
|
+
it('should error if - missing functionName', (done) => {
|
|
2596
|
+
try {
|
|
2597
|
+
a.deleteFunctionEventInvokeConfig(null, null, null, (data, error) => {
|
|
2598
|
+
try {
|
|
2599
|
+
const displayE = 'functionName is required';
|
|
2600
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-deleteFunctionEventInvokeConfig', displayE);
|
|
2601
|
+
done();
|
|
2602
|
+
} catch (err) {
|
|
2603
|
+
log.error(`Test Failure: ${err}`);
|
|
2604
|
+
done(err);
|
|
2605
|
+
}
|
|
2606
|
+
});
|
|
2607
|
+
} catch (error) {
|
|
2608
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2609
|
+
done(error);
|
|
2610
|
+
}
|
|
2611
|
+
}).timeout(attemptTimeout);
|
|
2612
|
+
});
|
|
2613
|
+
|
|
2614
|
+
describe('#getFunctionEventInvokeConfig - errors', () => {
|
|
2615
|
+
it('should have a getFunctionEventInvokeConfig function', (done) => {
|
|
2616
|
+
try {
|
|
2617
|
+
assert.equal(true, typeof a.getFunctionEventInvokeConfig === 'function');
|
|
2618
|
+
done();
|
|
2619
|
+
} catch (error) {
|
|
2620
|
+
log.error(`Test Failure: ${error}`);
|
|
2621
|
+
done(error);
|
|
2622
|
+
}
|
|
2623
|
+
}).timeout(attemptTimeout);
|
|
2624
|
+
it('should error if - missing functionName', (done) => {
|
|
2625
|
+
try {
|
|
2626
|
+
a.getFunctionEventInvokeConfig(null, null, null, (data, error) => {
|
|
2627
|
+
try {
|
|
2628
|
+
const displayE = 'functionName is required';
|
|
2629
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-getFunctionEventInvokeConfig', displayE);
|
|
2630
|
+
done();
|
|
2631
|
+
} catch (err) {
|
|
2632
|
+
log.error(`Test Failure: ${err}`);
|
|
2633
|
+
done(err);
|
|
2634
|
+
}
|
|
2635
|
+
});
|
|
2636
|
+
} catch (error) {
|
|
2637
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2638
|
+
done(error);
|
|
2639
|
+
}
|
|
2640
|
+
}).timeout(attemptTimeout);
|
|
2641
|
+
});
|
|
2642
|
+
|
|
2643
|
+
describe('#putFunctionEventInvokeConfig - errors', () => {
|
|
2644
|
+
it('should have a putFunctionEventInvokeConfig function', (done) => {
|
|
2645
|
+
try {
|
|
2646
|
+
assert.equal(true, typeof a.putFunctionEventInvokeConfig === 'function');
|
|
2647
|
+
done();
|
|
2648
|
+
} catch (error) {
|
|
2649
|
+
log.error(`Test Failure: ${error}`);
|
|
2650
|
+
done(error);
|
|
2651
|
+
}
|
|
2652
|
+
}).timeout(attemptTimeout);
|
|
2653
|
+
it('should error if - missing functionName', (done) => {
|
|
2654
|
+
try {
|
|
2655
|
+
a.putFunctionEventInvokeConfig(null, null, null, null, (data, error) => {
|
|
2656
|
+
try {
|
|
2657
|
+
const displayE = 'functionName is required';
|
|
2658
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-putFunctionEventInvokeConfig', displayE);
|
|
2659
|
+
done();
|
|
2660
|
+
} catch (err) {
|
|
2661
|
+
log.error(`Test Failure: ${err}`);
|
|
2662
|
+
done(err);
|
|
2663
|
+
}
|
|
2664
|
+
});
|
|
2665
|
+
} catch (error) {
|
|
2666
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2667
|
+
done(error);
|
|
2668
|
+
}
|
|
2669
|
+
}).timeout(attemptTimeout);
|
|
2670
|
+
it('should error if - missing body', (done) => {
|
|
2671
|
+
try {
|
|
2672
|
+
a.putFunctionEventInvokeConfig('fakeparam', 'fakeparam', null, null, (data, error) => {
|
|
2673
|
+
try {
|
|
2674
|
+
const displayE = 'body is required';
|
|
2675
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-putFunctionEventInvokeConfig', displayE);
|
|
2676
|
+
done();
|
|
2677
|
+
} catch (err) {
|
|
2678
|
+
log.error(`Test Failure: ${err}`);
|
|
2679
|
+
done(err);
|
|
2680
|
+
}
|
|
2681
|
+
});
|
|
2682
|
+
} catch (error) {
|
|
2683
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2684
|
+
done(error);
|
|
2685
|
+
}
|
|
2686
|
+
}).timeout(attemptTimeout);
|
|
2687
|
+
});
|
|
2688
|
+
|
|
2689
|
+
describe('#updateFunctionEventInvokeConfig - errors', () => {
|
|
2690
|
+
it('should have a updateFunctionEventInvokeConfig function', (done) => {
|
|
2691
|
+
try {
|
|
2692
|
+
assert.equal(true, typeof a.updateFunctionEventInvokeConfig === 'function');
|
|
2693
|
+
done();
|
|
2694
|
+
} catch (error) {
|
|
2695
|
+
log.error(`Test Failure: ${error}`);
|
|
2696
|
+
done(error);
|
|
2697
|
+
}
|
|
2698
|
+
}).timeout(attemptTimeout);
|
|
2699
|
+
it('should error if - missing functionName', (done) => {
|
|
2700
|
+
try {
|
|
2701
|
+
a.updateFunctionEventInvokeConfig(null, null, null, null, (data, error) => {
|
|
2702
|
+
try {
|
|
2703
|
+
const displayE = 'functionName is required';
|
|
2704
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-updateFunctionEventInvokeConfig', displayE);
|
|
2705
|
+
done();
|
|
2706
|
+
} catch (err) {
|
|
2707
|
+
log.error(`Test Failure: ${err}`);
|
|
2708
|
+
done(err);
|
|
2709
|
+
}
|
|
2710
|
+
});
|
|
2711
|
+
} catch (error) {
|
|
2712
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2713
|
+
done(error);
|
|
2714
|
+
}
|
|
2715
|
+
}).timeout(attemptTimeout);
|
|
2716
|
+
it('should error if - missing body', (done) => {
|
|
2717
|
+
try {
|
|
2718
|
+
a.updateFunctionEventInvokeConfig('fakeparam', 'fakeparam', null, null, (data, error) => {
|
|
2719
|
+
try {
|
|
2720
|
+
const displayE = 'body is required';
|
|
2721
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-updateFunctionEventInvokeConfig', displayE);
|
|
2722
|
+
done();
|
|
2723
|
+
} catch (err) {
|
|
2724
|
+
log.error(`Test Failure: ${err}`);
|
|
2725
|
+
done(err);
|
|
2726
|
+
}
|
|
2727
|
+
});
|
|
2728
|
+
} catch (error) {
|
|
2729
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2730
|
+
done(error);
|
|
2731
|
+
}
|
|
2732
|
+
}).timeout(attemptTimeout);
|
|
2733
|
+
});
|
|
2734
|
+
|
|
2735
|
+
describe('#deleteProvisionedConcurrencyConfig - errors', () => {
|
|
2736
|
+
it('should have a deleteProvisionedConcurrencyConfig function', (done) => {
|
|
2737
|
+
try {
|
|
2738
|
+
assert.equal(true, typeof a.deleteProvisionedConcurrencyConfig === 'function');
|
|
2739
|
+
done();
|
|
2740
|
+
} catch (error) {
|
|
2741
|
+
log.error(`Test Failure: ${error}`);
|
|
2742
|
+
done(error);
|
|
2743
|
+
}
|
|
2744
|
+
}).timeout(attemptTimeout);
|
|
2745
|
+
it('should error if - missing functionName', (done) => {
|
|
2746
|
+
try {
|
|
2747
|
+
a.deleteProvisionedConcurrencyConfig(null, null, null, (data, error) => {
|
|
2748
|
+
try {
|
|
2749
|
+
const displayE = 'functionName is required';
|
|
2750
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-deleteProvisionedConcurrencyConfig', displayE);
|
|
2751
|
+
done();
|
|
2752
|
+
} catch (err) {
|
|
2753
|
+
log.error(`Test Failure: ${err}`);
|
|
2754
|
+
done(err);
|
|
2755
|
+
}
|
|
2756
|
+
});
|
|
2757
|
+
} catch (error) {
|
|
2758
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2759
|
+
done(error);
|
|
2760
|
+
}
|
|
2761
|
+
}).timeout(attemptTimeout);
|
|
2762
|
+
it('should error if - missing qualifier', (done) => {
|
|
2763
|
+
try {
|
|
2764
|
+
a.deleteProvisionedConcurrencyConfig('fakeparam', null, null, (data, error) => {
|
|
2765
|
+
try {
|
|
2766
|
+
const displayE = 'qualifier is required';
|
|
2767
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-deleteProvisionedConcurrencyConfig', displayE);
|
|
2768
|
+
done();
|
|
2769
|
+
} catch (err) {
|
|
2770
|
+
log.error(`Test Failure: ${err}`);
|
|
2771
|
+
done(err);
|
|
2772
|
+
}
|
|
2773
|
+
});
|
|
2774
|
+
} catch (error) {
|
|
2775
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2776
|
+
done(error);
|
|
2777
|
+
}
|
|
2778
|
+
}).timeout(attemptTimeout);
|
|
2779
|
+
});
|
|
2780
|
+
|
|
2781
|
+
describe('#getProvisionedConcurrencyConfig - errors', () => {
|
|
2782
|
+
it('should have a getProvisionedConcurrencyConfig function', (done) => {
|
|
2783
|
+
try {
|
|
2784
|
+
assert.equal(true, typeof a.getProvisionedConcurrencyConfig === 'function');
|
|
2785
|
+
done();
|
|
2786
|
+
} catch (error) {
|
|
2787
|
+
log.error(`Test Failure: ${error}`);
|
|
2788
|
+
done(error);
|
|
2789
|
+
}
|
|
2790
|
+
}).timeout(attemptTimeout);
|
|
2791
|
+
it('should error if - missing functionName', (done) => {
|
|
2792
|
+
try {
|
|
2793
|
+
a.getProvisionedConcurrencyConfig(null, null, null, (data, error) => {
|
|
2794
|
+
try {
|
|
2795
|
+
const displayE = 'functionName is required';
|
|
2796
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-getProvisionedConcurrencyConfig', displayE);
|
|
2797
|
+
done();
|
|
2798
|
+
} catch (err) {
|
|
2799
|
+
log.error(`Test Failure: ${err}`);
|
|
2800
|
+
done(err);
|
|
2801
|
+
}
|
|
2802
|
+
});
|
|
2803
|
+
} catch (error) {
|
|
2804
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2805
|
+
done(error);
|
|
2806
|
+
}
|
|
2807
|
+
}).timeout(attemptTimeout);
|
|
2808
|
+
it('should error if - missing qualifier', (done) => {
|
|
2809
|
+
try {
|
|
2810
|
+
a.getProvisionedConcurrencyConfig('fakeparam', null, null, (data, error) => {
|
|
2811
|
+
try {
|
|
2812
|
+
const displayE = 'qualifier is required';
|
|
2813
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-getProvisionedConcurrencyConfig', displayE);
|
|
2814
|
+
done();
|
|
2815
|
+
} catch (err) {
|
|
2816
|
+
log.error(`Test Failure: ${err}`);
|
|
2817
|
+
done(err);
|
|
2818
|
+
}
|
|
2819
|
+
});
|
|
2820
|
+
} catch (error) {
|
|
2821
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2822
|
+
done(error);
|
|
2823
|
+
}
|
|
2824
|
+
}).timeout(attemptTimeout);
|
|
2825
|
+
});
|
|
2826
|
+
|
|
2827
|
+
describe('#putProvisionedConcurrencyConfig - errors', () => {
|
|
2828
|
+
it('should have a putProvisionedConcurrencyConfig function', (done) => {
|
|
2829
|
+
try {
|
|
2830
|
+
assert.equal(true, typeof a.putProvisionedConcurrencyConfig === 'function');
|
|
2831
|
+
done();
|
|
2832
|
+
} catch (error) {
|
|
2833
|
+
log.error(`Test Failure: ${error}`);
|
|
2834
|
+
done(error);
|
|
2835
|
+
}
|
|
2836
|
+
}).timeout(attemptTimeout);
|
|
2837
|
+
it('should error if - missing functionName', (done) => {
|
|
2838
|
+
try {
|
|
2839
|
+
a.putProvisionedConcurrencyConfig(null, null, null, null, (data, error) => {
|
|
2840
|
+
try {
|
|
2841
|
+
const displayE = 'functionName is required';
|
|
2842
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-putProvisionedConcurrencyConfig', displayE);
|
|
2843
|
+
done();
|
|
2844
|
+
} catch (err) {
|
|
2845
|
+
log.error(`Test Failure: ${err}`);
|
|
2846
|
+
done(err);
|
|
2847
|
+
}
|
|
2848
|
+
});
|
|
2849
|
+
} catch (error) {
|
|
2850
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2851
|
+
done(error);
|
|
2852
|
+
}
|
|
2853
|
+
}).timeout(attemptTimeout);
|
|
2854
|
+
it('should error if - missing qualifier', (done) => {
|
|
2855
|
+
try {
|
|
2856
|
+
a.putProvisionedConcurrencyConfig('fakeparam', null, null, null, (data, error) => {
|
|
2857
|
+
try {
|
|
2858
|
+
const displayE = 'qualifier is required';
|
|
2859
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-putProvisionedConcurrencyConfig', displayE);
|
|
2860
|
+
done();
|
|
2861
|
+
} catch (err) {
|
|
2862
|
+
log.error(`Test Failure: ${err}`);
|
|
2863
|
+
done(err);
|
|
2864
|
+
}
|
|
2865
|
+
});
|
|
2866
|
+
} catch (error) {
|
|
2867
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2868
|
+
done(error);
|
|
2869
|
+
}
|
|
2870
|
+
}).timeout(attemptTimeout);
|
|
2871
|
+
it('should error if - missing body', (done) => {
|
|
2872
|
+
try {
|
|
2873
|
+
a.putProvisionedConcurrencyConfig('fakeparam', 'fakeparam', null, null, (data, error) => {
|
|
2874
|
+
try {
|
|
2875
|
+
const displayE = 'body is required';
|
|
2876
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-putProvisionedConcurrencyConfig', displayE);
|
|
2877
|
+
done();
|
|
2878
|
+
} catch (err) {
|
|
2879
|
+
log.error(`Test Failure: ${err}`);
|
|
2880
|
+
done(err);
|
|
2881
|
+
}
|
|
2882
|
+
});
|
|
2883
|
+
} catch (error) {
|
|
2884
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2885
|
+
done(error);
|
|
2886
|
+
}
|
|
2887
|
+
}).timeout(attemptTimeout);
|
|
2888
|
+
});
|
|
2889
|
+
|
|
2890
|
+
describe('#getFunctionConcurrency - errors', () => {
|
|
2891
|
+
it('should have a getFunctionConcurrency function', (done) => {
|
|
2892
|
+
try {
|
|
2893
|
+
assert.equal(true, typeof a.getFunctionConcurrency === 'function');
|
|
2894
|
+
done();
|
|
2895
|
+
} catch (error) {
|
|
2896
|
+
log.error(`Test Failure: ${error}`);
|
|
2897
|
+
done(error);
|
|
2898
|
+
}
|
|
2899
|
+
}).timeout(attemptTimeout);
|
|
2900
|
+
it('should error if - missing functionName', (done) => {
|
|
2901
|
+
try {
|
|
2902
|
+
a.getFunctionConcurrency(null, null, (data, error) => {
|
|
2903
|
+
try {
|
|
2904
|
+
const displayE = 'functionName is required';
|
|
2905
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-getFunctionConcurrency', displayE);
|
|
2906
|
+
done();
|
|
2907
|
+
} catch (err) {
|
|
2908
|
+
log.error(`Test Failure: ${err}`);
|
|
2909
|
+
done(err);
|
|
2910
|
+
}
|
|
2911
|
+
});
|
|
2912
|
+
} catch (error) {
|
|
2913
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2914
|
+
done(error);
|
|
2915
|
+
}
|
|
2916
|
+
}).timeout(attemptTimeout);
|
|
2917
|
+
});
|
|
2918
|
+
|
|
2919
|
+
describe('#getFunctionConfiguration - errors', () => {
|
|
2920
|
+
it('should have a getFunctionConfiguration function', (done) => {
|
|
2921
|
+
try {
|
|
2922
|
+
assert.equal(true, typeof a.getFunctionConfiguration === 'function');
|
|
2923
|
+
done();
|
|
2924
|
+
} catch (error) {
|
|
2925
|
+
log.error(`Test Failure: ${error}`);
|
|
2926
|
+
done(error);
|
|
2927
|
+
}
|
|
2928
|
+
}).timeout(attemptTimeout);
|
|
2929
|
+
it('should error if - missing functionName', (done) => {
|
|
2930
|
+
try {
|
|
2931
|
+
a.getFunctionConfiguration(null, null, null, (data, error) => {
|
|
2932
|
+
try {
|
|
2933
|
+
const displayE = 'functionName is required';
|
|
2934
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-getFunctionConfiguration', displayE);
|
|
2935
|
+
done();
|
|
2936
|
+
} catch (err) {
|
|
2937
|
+
log.error(`Test Failure: ${err}`);
|
|
2938
|
+
done(err);
|
|
2939
|
+
}
|
|
2940
|
+
});
|
|
2941
|
+
} catch (error) {
|
|
2942
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2943
|
+
done(error);
|
|
2944
|
+
}
|
|
2945
|
+
}).timeout(attemptTimeout);
|
|
2946
|
+
});
|
|
2947
|
+
|
|
2948
|
+
describe('#updateFunctionConfiguration - errors', () => {
|
|
2949
|
+
it('should have a updateFunctionConfiguration function', (done) => {
|
|
2950
|
+
try {
|
|
2951
|
+
assert.equal(true, typeof a.updateFunctionConfiguration === 'function');
|
|
2952
|
+
done();
|
|
2953
|
+
} catch (error) {
|
|
2954
|
+
log.error(`Test Failure: ${error}`);
|
|
2955
|
+
done(error);
|
|
2956
|
+
}
|
|
2957
|
+
}).timeout(attemptTimeout);
|
|
2958
|
+
it('should error if - missing functionName', (done) => {
|
|
2959
|
+
try {
|
|
2960
|
+
a.updateFunctionConfiguration(null, null, null, (data, error) => {
|
|
2961
|
+
try {
|
|
2962
|
+
const displayE = 'functionName is required';
|
|
2963
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-updateFunctionConfiguration', displayE);
|
|
2964
|
+
done();
|
|
2965
|
+
} catch (err) {
|
|
2966
|
+
log.error(`Test Failure: ${err}`);
|
|
2967
|
+
done(err);
|
|
2968
|
+
}
|
|
2969
|
+
});
|
|
2970
|
+
} catch (error) {
|
|
2971
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2972
|
+
done(error);
|
|
2973
|
+
}
|
|
2974
|
+
}).timeout(attemptTimeout);
|
|
2975
|
+
it('should error if - missing body', (done) => {
|
|
2976
|
+
try {
|
|
2977
|
+
a.updateFunctionConfiguration('fakeparam', null, null, (data, error) => {
|
|
2978
|
+
try {
|
|
2979
|
+
const displayE = 'body is required';
|
|
2980
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-updateFunctionConfiguration', displayE);
|
|
2981
|
+
done();
|
|
2982
|
+
} catch (err) {
|
|
2983
|
+
log.error(`Test Failure: ${err}`);
|
|
2984
|
+
done(err);
|
|
2985
|
+
}
|
|
2986
|
+
});
|
|
2987
|
+
} catch (error) {
|
|
2988
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2989
|
+
done(error);
|
|
2990
|
+
}
|
|
2991
|
+
}).timeout(attemptTimeout);
|
|
2992
|
+
});
|
|
2993
|
+
|
|
2994
|
+
describe('#getRuntimeManagementConfig - errors', () => {
|
|
2995
|
+
it('should have a getRuntimeManagementConfig function', (done) => {
|
|
2996
|
+
try {
|
|
2997
|
+
assert.equal(true, typeof a.getRuntimeManagementConfig === 'function');
|
|
2998
|
+
done();
|
|
2999
|
+
} catch (error) {
|
|
3000
|
+
log.error(`Test Failure: ${error}`);
|
|
3001
|
+
done(error);
|
|
3002
|
+
}
|
|
3003
|
+
}).timeout(attemptTimeout);
|
|
3004
|
+
it('should error if - missing functionName', (done) => {
|
|
3005
|
+
try {
|
|
3006
|
+
a.getRuntimeManagementConfig(null, null, null, (data, error) => {
|
|
3007
|
+
try {
|
|
3008
|
+
const displayE = 'functionName is required';
|
|
3009
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-getRuntimeManagementConfig', displayE);
|
|
3010
|
+
done();
|
|
3011
|
+
} catch (err) {
|
|
3012
|
+
log.error(`Test Failure: ${err}`);
|
|
3013
|
+
done(err);
|
|
3014
|
+
}
|
|
3015
|
+
});
|
|
3016
|
+
} catch (error) {
|
|
3017
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3018
|
+
done(error);
|
|
3019
|
+
}
|
|
3020
|
+
}).timeout(attemptTimeout);
|
|
3021
|
+
});
|
|
3022
|
+
|
|
3023
|
+
describe('#putRuntimeManagementConfig - errors', () => {
|
|
3024
|
+
it('should have a putRuntimeManagementConfig function', (done) => {
|
|
3025
|
+
try {
|
|
3026
|
+
assert.equal(true, typeof a.putRuntimeManagementConfig === 'function');
|
|
3027
|
+
done();
|
|
3028
|
+
} catch (error) {
|
|
3029
|
+
log.error(`Test Failure: ${error}`);
|
|
3030
|
+
done(error);
|
|
3031
|
+
}
|
|
3032
|
+
}).timeout(attemptTimeout);
|
|
3033
|
+
it('should error if - missing functionName', (done) => {
|
|
3034
|
+
try {
|
|
3035
|
+
a.putRuntimeManagementConfig(null, null, null, null, (data, error) => {
|
|
3036
|
+
try {
|
|
3037
|
+
const displayE = 'functionName is required';
|
|
3038
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-putRuntimeManagementConfig', displayE);
|
|
3039
|
+
done();
|
|
3040
|
+
} catch (err) {
|
|
3041
|
+
log.error(`Test Failure: ${err}`);
|
|
3042
|
+
done(err);
|
|
3043
|
+
}
|
|
3044
|
+
});
|
|
3045
|
+
} catch (error) {
|
|
3046
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3047
|
+
done(error);
|
|
3048
|
+
}
|
|
3049
|
+
}).timeout(attemptTimeout);
|
|
3050
|
+
it('should error if - missing body', (done) => {
|
|
3051
|
+
try {
|
|
3052
|
+
a.putRuntimeManagementConfig('fakeparam', 'fakeparam', null, null, (data, error) => {
|
|
3053
|
+
try {
|
|
3054
|
+
const displayE = 'body is required';
|
|
3055
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-putRuntimeManagementConfig', displayE);
|
|
3056
|
+
done();
|
|
3057
|
+
} catch (err) {
|
|
3058
|
+
log.error(`Test Failure: ${err}`);
|
|
3059
|
+
done(err);
|
|
3060
|
+
}
|
|
3061
|
+
});
|
|
3062
|
+
} catch (error) {
|
|
3063
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3064
|
+
done(error);
|
|
3065
|
+
}
|
|
3066
|
+
}).timeout(attemptTimeout);
|
|
3067
|
+
});
|
|
3068
|
+
|
|
3069
|
+
describe('#invoke - errors', () => {
|
|
3070
|
+
it('should have a invoke function', (done) => {
|
|
3071
|
+
try {
|
|
3072
|
+
assert.equal(true, typeof a.invoke === 'function');
|
|
3073
|
+
done();
|
|
3074
|
+
} catch (error) {
|
|
3075
|
+
log.error(`Test Failure: ${error}`);
|
|
3076
|
+
done(error);
|
|
3077
|
+
}
|
|
3078
|
+
}).timeout(attemptTimeout);
|
|
3079
|
+
it('should error if - missing functionName', (done) => {
|
|
3080
|
+
try {
|
|
3081
|
+
a.invoke(null, null, null, null, (data, error) => {
|
|
3082
|
+
try {
|
|
3083
|
+
const displayE = 'functionName is required';
|
|
3084
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-invoke', displayE);
|
|
3085
|
+
done();
|
|
3086
|
+
} catch (err) {
|
|
3087
|
+
log.error(`Test Failure: ${err}`);
|
|
3088
|
+
done(err);
|
|
3089
|
+
}
|
|
3090
|
+
});
|
|
3091
|
+
} catch (error) {
|
|
3092
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3093
|
+
done(error);
|
|
3094
|
+
}
|
|
3095
|
+
}).timeout(attemptTimeout);
|
|
3096
|
+
it('should error if - missing body', (done) => {
|
|
3097
|
+
try {
|
|
3098
|
+
a.invoke('fakeparam', 'fakeparam', null, null, (data, error) => {
|
|
3099
|
+
try {
|
|
3100
|
+
const displayE = 'body is required';
|
|
3101
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-invoke', displayE);
|
|
3102
|
+
done();
|
|
3103
|
+
} catch (err) {
|
|
3104
|
+
log.error(`Test Failure: ${err}`);
|
|
3105
|
+
done(err);
|
|
3106
|
+
}
|
|
3107
|
+
});
|
|
3108
|
+
} catch (error) {
|
|
3109
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3110
|
+
done(error);
|
|
3111
|
+
}
|
|
3112
|
+
}).timeout(attemptTimeout);
|
|
3113
|
+
});
|
|
3114
|
+
|
|
3115
|
+
describe('#invokeAsync - errors', () => {
|
|
3116
|
+
it('should have a invokeAsync function', (done) => {
|
|
3117
|
+
try {
|
|
3118
|
+
assert.equal(true, typeof a.invokeAsync === 'function');
|
|
3119
|
+
done();
|
|
3120
|
+
} catch (error) {
|
|
3121
|
+
log.error(`Test Failure: ${error}`);
|
|
3122
|
+
done(error);
|
|
3123
|
+
}
|
|
3124
|
+
}).timeout(attemptTimeout);
|
|
3125
|
+
it('should error if - missing functionName', (done) => {
|
|
3126
|
+
try {
|
|
3127
|
+
a.invokeAsync(null, null, null, (data, error) => {
|
|
3128
|
+
try {
|
|
3129
|
+
const displayE = 'functionName is required';
|
|
3130
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-invokeAsync', displayE);
|
|
3131
|
+
done();
|
|
3132
|
+
} catch (err) {
|
|
3133
|
+
log.error(`Test Failure: ${err}`);
|
|
3134
|
+
done(err);
|
|
3135
|
+
}
|
|
3136
|
+
});
|
|
3137
|
+
} catch (error) {
|
|
3138
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3139
|
+
done(error);
|
|
3140
|
+
}
|
|
3141
|
+
}).timeout(attemptTimeout);
|
|
3142
|
+
it('should error if - missing body', (done) => {
|
|
3143
|
+
try {
|
|
3144
|
+
a.invokeAsync('fakeparam', null, null, (data, error) => {
|
|
3145
|
+
try {
|
|
3146
|
+
const displayE = 'body is required';
|
|
3147
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-invokeAsync', displayE);
|
|
3148
|
+
done();
|
|
3149
|
+
} catch (err) {
|
|
3150
|
+
log.error(`Test Failure: ${err}`);
|
|
3151
|
+
done(err);
|
|
3152
|
+
}
|
|
3153
|
+
});
|
|
3154
|
+
} catch (error) {
|
|
3155
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3156
|
+
done(error);
|
|
3157
|
+
}
|
|
3158
|
+
}).timeout(attemptTimeout);
|
|
3159
|
+
});
|
|
3160
|
+
|
|
3161
|
+
describe('#invokeWithResponseStream - errors', () => {
|
|
3162
|
+
it('should have a invokeWithResponseStream function', (done) => {
|
|
3163
|
+
try {
|
|
3164
|
+
assert.equal(true, typeof a.invokeWithResponseStream === 'function');
|
|
3165
|
+
done();
|
|
3166
|
+
} catch (error) {
|
|
3167
|
+
log.error(`Test Failure: ${error}`);
|
|
3168
|
+
done(error);
|
|
3169
|
+
}
|
|
3170
|
+
}).timeout(attemptTimeout);
|
|
3171
|
+
it('should error if - missing functionName', (done) => {
|
|
3172
|
+
try {
|
|
3173
|
+
a.invokeWithResponseStream(null, null, null, null, (data, error) => {
|
|
3174
|
+
try {
|
|
3175
|
+
const displayE = 'functionName is required';
|
|
3176
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-invokeWithResponseStream', displayE);
|
|
3177
|
+
done();
|
|
3178
|
+
} catch (err) {
|
|
3179
|
+
log.error(`Test Failure: ${err}`);
|
|
3180
|
+
done(err);
|
|
3181
|
+
}
|
|
3182
|
+
});
|
|
3183
|
+
} catch (error) {
|
|
3184
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3185
|
+
done(error);
|
|
3186
|
+
}
|
|
3187
|
+
}).timeout(attemptTimeout);
|
|
3188
|
+
it('should error if - missing body', (done) => {
|
|
3189
|
+
try {
|
|
3190
|
+
a.invokeWithResponseStream('fakeparam', 'fakeparam', null, null, (data, error) => {
|
|
3191
|
+
try {
|
|
3192
|
+
const displayE = 'body is required';
|
|
3193
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-invokeWithResponseStream', displayE);
|
|
3194
|
+
done();
|
|
3195
|
+
} catch (err) {
|
|
3196
|
+
log.error(`Test Failure: ${err}`);
|
|
3197
|
+
done(err);
|
|
3198
|
+
}
|
|
3199
|
+
});
|
|
3200
|
+
} catch (error) {
|
|
3201
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3202
|
+
done(error);
|
|
3203
|
+
}
|
|
3204
|
+
}).timeout(attemptTimeout);
|
|
3205
|
+
});
|
|
3206
|
+
|
|
3207
|
+
describe('#listFunctionEventInvokeConfigs - errors', () => {
|
|
3208
|
+
it('should have a listFunctionEventInvokeConfigs function', (done) => {
|
|
3209
|
+
try {
|
|
3210
|
+
assert.equal(true, typeof a.listFunctionEventInvokeConfigs === 'function');
|
|
3211
|
+
done();
|
|
3212
|
+
} catch (error) {
|
|
3213
|
+
log.error(`Test Failure: ${error}`);
|
|
3214
|
+
done(error);
|
|
3215
|
+
}
|
|
3216
|
+
}).timeout(attemptTimeout);
|
|
3217
|
+
it('should error if - missing functionName', (done) => {
|
|
3218
|
+
try {
|
|
3219
|
+
a.listFunctionEventInvokeConfigs(null, null, null, null, (data, error) => {
|
|
3220
|
+
try {
|
|
3221
|
+
const displayE = 'functionName is required';
|
|
3222
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-listFunctionEventInvokeConfigs', displayE);
|
|
3223
|
+
done();
|
|
3224
|
+
} catch (err) {
|
|
3225
|
+
log.error(`Test Failure: ${err}`);
|
|
3226
|
+
done(err);
|
|
3227
|
+
}
|
|
3228
|
+
});
|
|
3229
|
+
} catch (error) {
|
|
3230
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3231
|
+
done(error);
|
|
3232
|
+
}
|
|
3233
|
+
}).timeout(attemptTimeout);
|
|
3234
|
+
});
|
|
3235
|
+
|
|
3236
|
+
describe('#listFunctionUrlConfigs - errors', () => {
|
|
3237
|
+
it('should have a listFunctionUrlConfigs function', (done) => {
|
|
3238
|
+
try {
|
|
3239
|
+
assert.equal(true, typeof a.listFunctionUrlConfigs === 'function');
|
|
3240
|
+
done();
|
|
3241
|
+
} catch (error) {
|
|
3242
|
+
log.error(`Test Failure: ${error}`);
|
|
3243
|
+
done(error);
|
|
3244
|
+
}
|
|
3245
|
+
}).timeout(attemptTimeout);
|
|
3246
|
+
it('should error if - missing functionName', (done) => {
|
|
3247
|
+
try {
|
|
3248
|
+
a.listFunctionUrlConfigs(null, null, null, null, (data, error) => {
|
|
3249
|
+
try {
|
|
3250
|
+
const displayE = 'functionName is required';
|
|
3251
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-listFunctionUrlConfigs', displayE);
|
|
3252
|
+
done();
|
|
3253
|
+
} catch (err) {
|
|
3254
|
+
log.error(`Test Failure: ${err}`);
|
|
3255
|
+
done(err);
|
|
3256
|
+
}
|
|
3257
|
+
});
|
|
3258
|
+
} catch (error) {
|
|
3259
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3260
|
+
done(error);
|
|
3261
|
+
}
|
|
3262
|
+
}).timeout(attemptTimeout);
|
|
3263
|
+
});
|
|
3264
|
+
|
|
3265
|
+
describe('#listFunctions - errors', () => {
|
|
3266
|
+
it('should have a listFunctions function', (done) => {
|
|
3267
|
+
try {
|
|
3268
|
+
assert.equal(true, typeof a.listFunctions === 'function');
|
|
3269
|
+
done();
|
|
3270
|
+
} catch (error) {
|
|
3271
|
+
log.error(`Test Failure: ${error}`);
|
|
3272
|
+
done(error);
|
|
3273
|
+
}
|
|
3274
|
+
}).timeout(attemptTimeout);
|
|
3275
|
+
});
|
|
3276
|
+
|
|
3277
|
+
describe('#listProvisionedConcurrencyConfigs - errors', () => {
|
|
3278
|
+
it('should have a listProvisionedConcurrencyConfigs function', (done) => {
|
|
3279
|
+
try {
|
|
3280
|
+
assert.equal(true, typeof a.listProvisionedConcurrencyConfigs === 'function');
|
|
3281
|
+
done();
|
|
3282
|
+
} catch (error) {
|
|
3283
|
+
log.error(`Test Failure: ${error}`);
|
|
3284
|
+
done(error);
|
|
3285
|
+
}
|
|
3286
|
+
}).timeout(attemptTimeout);
|
|
3287
|
+
it('should error if - missing functionName', (done) => {
|
|
3288
|
+
try {
|
|
3289
|
+
a.listProvisionedConcurrencyConfigs(null, null, null, null, null, (data, error) => {
|
|
3290
|
+
try {
|
|
3291
|
+
const displayE = 'functionName is required';
|
|
3292
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-listProvisionedConcurrencyConfigs', displayE);
|
|
3293
|
+
done();
|
|
3294
|
+
} catch (err) {
|
|
3295
|
+
log.error(`Test Failure: ${err}`);
|
|
3296
|
+
done(err);
|
|
3297
|
+
}
|
|
3298
|
+
});
|
|
3299
|
+
} catch (error) {
|
|
3300
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3301
|
+
done(error);
|
|
3302
|
+
}
|
|
3303
|
+
}).timeout(attemptTimeout);
|
|
3304
|
+
it('should error if - missing list', (done) => {
|
|
3305
|
+
try {
|
|
3306
|
+
a.listProvisionedConcurrencyConfigs('fakeparam', 'fakeparam', 'fakeparam', null, null, (data, error) => {
|
|
3307
|
+
try {
|
|
3308
|
+
const displayE = 'list is required';
|
|
3309
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-listProvisionedConcurrencyConfigs', displayE);
|
|
3310
|
+
done();
|
|
3311
|
+
} catch (err) {
|
|
3312
|
+
log.error(`Test Failure: ${err}`);
|
|
3313
|
+
done(err);
|
|
3314
|
+
}
|
|
3315
|
+
});
|
|
3316
|
+
} catch (error) {
|
|
3317
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3318
|
+
done(error);
|
|
3319
|
+
}
|
|
3320
|
+
}).timeout(attemptTimeout);
|
|
3321
|
+
});
|
|
3322
|
+
|
|
3323
|
+
describe('#listVersionsByFunction - errors', () => {
|
|
3324
|
+
it('should have a listVersionsByFunction function', (done) => {
|
|
3325
|
+
try {
|
|
3326
|
+
assert.equal(true, typeof a.listVersionsByFunction === 'function');
|
|
3327
|
+
done();
|
|
3328
|
+
} catch (error) {
|
|
3329
|
+
log.error(`Test Failure: ${error}`);
|
|
3330
|
+
done(error);
|
|
3331
|
+
}
|
|
3332
|
+
}).timeout(attemptTimeout);
|
|
3333
|
+
it('should error if - missing functionName', (done) => {
|
|
3334
|
+
try {
|
|
3335
|
+
a.listVersionsByFunction(null, null, null, null, (data, error) => {
|
|
3336
|
+
try {
|
|
3337
|
+
const displayE = 'functionName is required';
|
|
3338
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-listVersionsByFunction', displayE);
|
|
3339
|
+
done();
|
|
3340
|
+
} catch (err) {
|
|
3341
|
+
log.error(`Test Failure: ${err}`);
|
|
3342
|
+
done(err);
|
|
3343
|
+
}
|
|
3344
|
+
});
|
|
3345
|
+
} catch (error) {
|
|
3346
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3347
|
+
done(error);
|
|
3348
|
+
}
|
|
3349
|
+
}).timeout(attemptTimeout);
|
|
3350
|
+
});
|
|
3351
|
+
|
|
3352
|
+
describe('#publishVersion - errors', () => {
|
|
3353
|
+
it('should have a publishVersion function', (done) => {
|
|
3354
|
+
try {
|
|
3355
|
+
assert.equal(true, typeof a.publishVersion === 'function');
|
|
3356
|
+
done();
|
|
3357
|
+
} catch (error) {
|
|
3358
|
+
log.error(`Test Failure: ${error}`);
|
|
3359
|
+
done(error);
|
|
3360
|
+
}
|
|
3361
|
+
}).timeout(attemptTimeout);
|
|
3362
|
+
it('should error if - missing functionName', (done) => {
|
|
3363
|
+
try {
|
|
3364
|
+
a.publishVersion(null, null, null, (data, error) => {
|
|
3365
|
+
try {
|
|
3366
|
+
const displayE = 'functionName is required';
|
|
3367
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-publishVersion', displayE);
|
|
3368
|
+
done();
|
|
3369
|
+
} catch (err) {
|
|
3370
|
+
log.error(`Test Failure: ${err}`);
|
|
3371
|
+
done(err);
|
|
3372
|
+
}
|
|
3373
|
+
});
|
|
3374
|
+
} catch (error) {
|
|
3375
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3376
|
+
done(error);
|
|
3377
|
+
}
|
|
3378
|
+
}).timeout(attemptTimeout);
|
|
3379
|
+
it('should error if - missing body', (done) => {
|
|
3380
|
+
try {
|
|
3381
|
+
a.publishVersion('fakeparam', null, null, (data, error) => {
|
|
3382
|
+
try {
|
|
3383
|
+
const displayE = 'body is required';
|
|
3384
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-publishVersion', displayE);
|
|
3385
|
+
done();
|
|
3386
|
+
} catch (err) {
|
|
3387
|
+
log.error(`Test Failure: ${err}`);
|
|
3388
|
+
done(err);
|
|
3389
|
+
}
|
|
3390
|
+
});
|
|
3391
|
+
} catch (error) {
|
|
3392
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3393
|
+
done(error);
|
|
3394
|
+
}
|
|
3395
|
+
}).timeout(attemptTimeout);
|
|
3396
|
+
});
|
|
3397
|
+
|
|
3398
|
+
describe('#removePermission - errors', () => {
|
|
3399
|
+
it('should have a removePermission function', (done) => {
|
|
3400
|
+
try {
|
|
3401
|
+
assert.equal(true, typeof a.removePermission === 'function');
|
|
3402
|
+
done();
|
|
3403
|
+
} catch (error) {
|
|
3404
|
+
log.error(`Test Failure: ${error}`);
|
|
3405
|
+
done(error);
|
|
3406
|
+
}
|
|
3407
|
+
}).timeout(attemptTimeout);
|
|
3408
|
+
it('should error if - missing functionName', (done) => {
|
|
3409
|
+
try {
|
|
3410
|
+
a.removePermission(null, null, null, null, null, (data, error) => {
|
|
3411
|
+
try {
|
|
3412
|
+
const displayE = 'functionName is required';
|
|
3413
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-removePermission', displayE);
|
|
3414
|
+
done();
|
|
3415
|
+
} catch (err) {
|
|
3416
|
+
log.error(`Test Failure: ${err}`);
|
|
3417
|
+
done(err);
|
|
3418
|
+
}
|
|
3419
|
+
});
|
|
3420
|
+
} catch (error) {
|
|
3421
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3422
|
+
done(error);
|
|
3423
|
+
}
|
|
3424
|
+
}).timeout(attemptTimeout);
|
|
3425
|
+
it('should error if - missing statementId', (done) => {
|
|
3426
|
+
try {
|
|
3427
|
+
a.removePermission('fakeparam', null, null, null, null, (data, error) => {
|
|
3428
|
+
try {
|
|
3429
|
+
const displayE = 'statementId is required';
|
|
3430
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-removePermission', displayE);
|
|
3431
|
+
done();
|
|
3432
|
+
} catch (err) {
|
|
3433
|
+
log.error(`Test Failure: ${err}`);
|
|
3434
|
+
done(err);
|
|
3435
|
+
}
|
|
3436
|
+
});
|
|
3437
|
+
} catch (error) {
|
|
3438
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3439
|
+
done(error);
|
|
3440
|
+
}
|
|
3441
|
+
}).timeout(attemptTimeout);
|
|
3442
|
+
});
|
|
3443
|
+
|
|
3444
|
+
describe('#updateFunctionCode - errors', () => {
|
|
3445
|
+
it('should have a updateFunctionCode function', (done) => {
|
|
3446
|
+
try {
|
|
3447
|
+
assert.equal(true, typeof a.updateFunctionCode === 'function');
|
|
3448
|
+
done();
|
|
3449
|
+
} catch (error) {
|
|
3450
|
+
log.error(`Test Failure: ${error}`);
|
|
3451
|
+
done(error);
|
|
3452
|
+
}
|
|
3453
|
+
}).timeout(attemptTimeout);
|
|
3454
|
+
it('should error if - missing functionName', (done) => {
|
|
3455
|
+
try {
|
|
3456
|
+
a.updateFunctionCode(null, null, null, (data, error) => {
|
|
3457
|
+
try {
|
|
3458
|
+
const displayE = 'functionName is required';
|
|
3459
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-updateFunctionCode', displayE);
|
|
3460
|
+
done();
|
|
3461
|
+
} catch (err) {
|
|
3462
|
+
log.error(`Test Failure: ${err}`);
|
|
3463
|
+
done(err);
|
|
3464
|
+
}
|
|
3465
|
+
});
|
|
3466
|
+
} catch (error) {
|
|
3467
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3468
|
+
done(error);
|
|
3469
|
+
}
|
|
3470
|
+
}).timeout(attemptTimeout);
|
|
3471
|
+
it('should error if - missing body', (done) => {
|
|
3472
|
+
try {
|
|
3473
|
+
a.updateFunctionCode('fakeparam', null, null, (data, error) => {
|
|
3474
|
+
try {
|
|
3475
|
+
const displayE = 'body is required';
|
|
3476
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-updateFunctionCode', displayE);
|
|
3477
|
+
done();
|
|
3478
|
+
} catch (err) {
|
|
3479
|
+
log.error(`Test Failure: ${err}`);
|
|
3480
|
+
done(err);
|
|
3481
|
+
}
|
|
3482
|
+
});
|
|
3483
|
+
} catch (error) {
|
|
3484
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3485
|
+
done(error);
|
|
3486
|
+
}
|
|
3487
|
+
}).timeout(attemptTimeout);
|
|
3488
|
+
});
|
|
3489
|
+
|
|
3490
|
+
describe('#createCodeSigningConfig - errors', () => {
|
|
3491
|
+
it('should have a createCodeSigningConfig function', (done) => {
|
|
3492
|
+
try {
|
|
3493
|
+
assert.equal(true, typeof a.createCodeSigningConfig === 'function');
|
|
3494
|
+
done();
|
|
3495
|
+
} catch (error) {
|
|
3496
|
+
log.error(`Test Failure: ${error}`);
|
|
3497
|
+
done(error);
|
|
3498
|
+
}
|
|
3499
|
+
}).timeout(attemptTimeout);
|
|
3500
|
+
it('should error if - missing body', (done) => {
|
|
3501
|
+
try {
|
|
3502
|
+
a.createCodeSigningConfig(null, null, (data, error) => {
|
|
3503
|
+
try {
|
|
3504
|
+
const displayE = 'body is required';
|
|
3505
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-createCodeSigningConfig', displayE);
|
|
3506
|
+
done();
|
|
3507
|
+
} catch (err) {
|
|
3508
|
+
log.error(`Test Failure: ${err}`);
|
|
3509
|
+
done(err);
|
|
3510
|
+
}
|
|
3511
|
+
});
|
|
3512
|
+
} catch (error) {
|
|
3513
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3514
|
+
done(error);
|
|
3515
|
+
}
|
|
3516
|
+
}).timeout(attemptTimeout);
|
|
3517
|
+
});
|
|
3518
|
+
|
|
3519
|
+
describe('#listCodeSigningConfigs - errors', () => {
|
|
3520
|
+
it('should have a listCodeSigningConfigs function', (done) => {
|
|
3521
|
+
try {
|
|
3522
|
+
assert.equal(true, typeof a.listCodeSigningConfigs === 'function');
|
|
3523
|
+
done();
|
|
3524
|
+
} catch (error) {
|
|
3525
|
+
log.error(`Test Failure: ${error}`);
|
|
3526
|
+
done(error);
|
|
3527
|
+
}
|
|
3528
|
+
}).timeout(attemptTimeout);
|
|
3529
|
+
});
|
|
3530
|
+
|
|
3531
|
+
describe('#deleteCodeSigningConfig - errors', () => {
|
|
3532
|
+
it('should have a deleteCodeSigningConfig function', (done) => {
|
|
3533
|
+
try {
|
|
3534
|
+
assert.equal(true, typeof a.deleteCodeSigningConfig === 'function');
|
|
3535
|
+
done();
|
|
3536
|
+
} catch (error) {
|
|
3537
|
+
log.error(`Test Failure: ${error}`);
|
|
3538
|
+
done(error);
|
|
3539
|
+
}
|
|
3540
|
+
}).timeout(attemptTimeout);
|
|
3541
|
+
it('should error if - missing codeSigningConfigArn', (done) => {
|
|
3542
|
+
try {
|
|
3543
|
+
a.deleteCodeSigningConfig(null, null, (data, error) => {
|
|
3544
|
+
try {
|
|
3545
|
+
const displayE = 'codeSigningConfigArn is required';
|
|
3546
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-deleteCodeSigningConfig', displayE);
|
|
3547
|
+
done();
|
|
3548
|
+
} catch (err) {
|
|
3549
|
+
log.error(`Test Failure: ${err}`);
|
|
3550
|
+
done(err);
|
|
3551
|
+
}
|
|
3552
|
+
});
|
|
3553
|
+
} catch (error) {
|
|
3554
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3555
|
+
done(error);
|
|
3556
|
+
}
|
|
3557
|
+
}).timeout(attemptTimeout);
|
|
3558
|
+
});
|
|
3559
|
+
|
|
3560
|
+
describe('#getCodeSigningConfig - errors', () => {
|
|
3561
|
+
it('should have a getCodeSigningConfig function', (done) => {
|
|
3562
|
+
try {
|
|
3563
|
+
assert.equal(true, typeof a.getCodeSigningConfig === 'function');
|
|
3564
|
+
done();
|
|
3565
|
+
} catch (error) {
|
|
3566
|
+
log.error(`Test Failure: ${error}`);
|
|
3567
|
+
done(error);
|
|
3568
|
+
}
|
|
3569
|
+
}).timeout(attemptTimeout);
|
|
3570
|
+
it('should error if - missing codeSigningConfigArn', (done) => {
|
|
3571
|
+
try {
|
|
3572
|
+
a.getCodeSigningConfig(null, null, (data, error) => {
|
|
3573
|
+
try {
|
|
3574
|
+
const displayE = 'codeSigningConfigArn is required';
|
|
3575
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-getCodeSigningConfig', displayE);
|
|
3576
|
+
done();
|
|
3577
|
+
} catch (err) {
|
|
3578
|
+
log.error(`Test Failure: ${err}`);
|
|
3579
|
+
done(err);
|
|
3580
|
+
}
|
|
3581
|
+
});
|
|
3582
|
+
} catch (error) {
|
|
3583
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3584
|
+
done(error);
|
|
3585
|
+
}
|
|
3586
|
+
}).timeout(attemptTimeout);
|
|
3587
|
+
});
|
|
3588
|
+
|
|
3589
|
+
describe('#updateCodeSigningConfig - errors', () => {
|
|
3590
|
+
it('should have a updateCodeSigningConfig function', (done) => {
|
|
3591
|
+
try {
|
|
3592
|
+
assert.equal(true, typeof a.updateCodeSigningConfig === 'function');
|
|
3593
|
+
done();
|
|
3594
|
+
} catch (error) {
|
|
3595
|
+
log.error(`Test Failure: ${error}`);
|
|
3596
|
+
done(error);
|
|
3597
|
+
}
|
|
3598
|
+
}).timeout(attemptTimeout);
|
|
3599
|
+
it('should error if - missing codeSigningConfigArn', (done) => {
|
|
3600
|
+
try {
|
|
3601
|
+
a.updateCodeSigningConfig(null, null, null, (data, error) => {
|
|
3602
|
+
try {
|
|
3603
|
+
const displayE = 'codeSigningConfigArn is required';
|
|
3604
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-updateCodeSigningConfig', displayE);
|
|
3605
|
+
done();
|
|
3606
|
+
} catch (err) {
|
|
3607
|
+
log.error(`Test Failure: ${err}`);
|
|
3608
|
+
done(err);
|
|
3609
|
+
}
|
|
3610
|
+
});
|
|
3611
|
+
} catch (error) {
|
|
3612
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3613
|
+
done(error);
|
|
3614
|
+
}
|
|
3615
|
+
}).timeout(attemptTimeout);
|
|
3616
|
+
it('should error if - missing body', (done) => {
|
|
3617
|
+
try {
|
|
3618
|
+
a.updateCodeSigningConfig('fakeparam', null, null, (data, error) => {
|
|
3619
|
+
try {
|
|
3620
|
+
const displayE = 'body is required';
|
|
3621
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-updateCodeSigningConfig', displayE);
|
|
3622
|
+
done();
|
|
3623
|
+
} catch (err) {
|
|
3624
|
+
log.error(`Test Failure: ${err}`);
|
|
3625
|
+
done(err);
|
|
3626
|
+
}
|
|
3627
|
+
});
|
|
3628
|
+
} catch (error) {
|
|
3629
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3630
|
+
done(error);
|
|
3631
|
+
}
|
|
3632
|
+
}).timeout(attemptTimeout);
|
|
3633
|
+
});
|
|
3634
|
+
|
|
3635
|
+
describe('#listFunctionsByCodeSigningConfig - errors', () => {
|
|
3636
|
+
it('should have a listFunctionsByCodeSigningConfig function', (done) => {
|
|
3637
|
+
try {
|
|
3638
|
+
assert.equal(true, typeof a.listFunctionsByCodeSigningConfig === 'function');
|
|
3639
|
+
done();
|
|
3640
|
+
} catch (error) {
|
|
3641
|
+
log.error(`Test Failure: ${error}`);
|
|
3642
|
+
done(error);
|
|
3643
|
+
}
|
|
3644
|
+
}).timeout(attemptTimeout);
|
|
3645
|
+
it('should error if - missing codeSigningConfigArn', (done) => {
|
|
3646
|
+
try {
|
|
3647
|
+
a.listFunctionsByCodeSigningConfig(null, null, null, null, (data, error) => {
|
|
3648
|
+
try {
|
|
3649
|
+
const displayE = 'codeSigningConfigArn is required';
|
|
3650
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-listFunctionsByCodeSigningConfig', displayE);
|
|
3651
|
+
done();
|
|
3652
|
+
} catch (err) {
|
|
3653
|
+
log.error(`Test Failure: ${err}`);
|
|
3654
|
+
done(err);
|
|
3655
|
+
}
|
|
3656
|
+
});
|
|
3657
|
+
} catch (error) {
|
|
3658
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3659
|
+
done(error);
|
|
3660
|
+
}
|
|
3661
|
+
}).timeout(attemptTimeout);
|
|
3662
|
+
});
|
|
3663
|
+
|
|
3664
|
+
describe('#createEventSourceMapping - errors', () => {
|
|
3665
|
+
it('should have a createEventSourceMapping function', (done) => {
|
|
3666
|
+
try {
|
|
3667
|
+
assert.equal(true, typeof a.createEventSourceMapping === 'function');
|
|
3668
|
+
done();
|
|
3669
|
+
} catch (error) {
|
|
3670
|
+
log.error(`Test Failure: ${error}`);
|
|
3671
|
+
done(error);
|
|
3672
|
+
}
|
|
3673
|
+
}).timeout(attemptTimeout);
|
|
3674
|
+
it('should error if - missing body', (done) => {
|
|
3675
|
+
try {
|
|
3676
|
+
a.createEventSourceMapping(null, null, (data, error) => {
|
|
3677
|
+
try {
|
|
3678
|
+
const displayE = 'body is required';
|
|
3679
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-createEventSourceMapping', displayE);
|
|
3680
|
+
done();
|
|
3681
|
+
} catch (err) {
|
|
3682
|
+
log.error(`Test Failure: ${err}`);
|
|
3683
|
+
done(err);
|
|
3684
|
+
}
|
|
3685
|
+
});
|
|
3686
|
+
} catch (error) {
|
|
3687
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3688
|
+
done(error);
|
|
3689
|
+
}
|
|
3690
|
+
}).timeout(attemptTimeout);
|
|
3691
|
+
});
|
|
3692
|
+
|
|
3693
|
+
describe('#listEventSourceMappings - errors', () => {
|
|
3694
|
+
it('should have a listEventSourceMappings function', (done) => {
|
|
3695
|
+
try {
|
|
3696
|
+
assert.equal(true, typeof a.listEventSourceMappings === 'function');
|
|
3697
|
+
done();
|
|
3698
|
+
} catch (error) {
|
|
3699
|
+
log.error(`Test Failure: ${error}`);
|
|
3700
|
+
done(error);
|
|
3701
|
+
}
|
|
3702
|
+
}).timeout(attemptTimeout);
|
|
3703
|
+
});
|
|
3704
|
+
|
|
3705
|
+
describe('#deleteEventSourceMapping - errors', () => {
|
|
3706
|
+
it('should have a deleteEventSourceMapping function', (done) => {
|
|
3707
|
+
try {
|
|
3708
|
+
assert.equal(true, typeof a.deleteEventSourceMapping === 'function');
|
|
3709
|
+
done();
|
|
3710
|
+
} catch (error) {
|
|
3711
|
+
log.error(`Test Failure: ${error}`);
|
|
3712
|
+
done(error);
|
|
3713
|
+
}
|
|
3714
|
+
}).timeout(attemptTimeout);
|
|
3715
|
+
it('should error if - missing uUID', (done) => {
|
|
3716
|
+
try {
|
|
3717
|
+
a.deleteEventSourceMapping(null, null, (data, error) => {
|
|
3718
|
+
try {
|
|
3719
|
+
const displayE = 'uUID is required';
|
|
3720
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-deleteEventSourceMapping', displayE);
|
|
3721
|
+
done();
|
|
3722
|
+
} catch (err) {
|
|
3723
|
+
log.error(`Test Failure: ${err}`);
|
|
3724
|
+
done(err);
|
|
3725
|
+
}
|
|
3726
|
+
});
|
|
3727
|
+
} catch (error) {
|
|
3728
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3729
|
+
done(error);
|
|
3730
|
+
}
|
|
3731
|
+
}).timeout(attemptTimeout);
|
|
3732
|
+
});
|
|
3733
|
+
|
|
3734
|
+
describe('#getEventSourceMapping - errors', () => {
|
|
3735
|
+
it('should have a getEventSourceMapping function', (done) => {
|
|
3736
|
+
try {
|
|
3737
|
+
assert.equal(true, typeof a.getEventSourceMapping === 'function');
|
|
3738
|
+
done();
|
|
3739
|
+
} catch (error) {
|
|
3740
|
+
log.error(`Test Failure: ${error}`);
|
|
3741
|
+
done(error);
|
|
3742
|
+
}
|
|
3743
|
+
}).timeout(attemptTimeout);
|
|
3744
|
+
it('should error if - missing uUID', (done) => {
|
|
3745
|
+
try {
|
|
3746
|
+
a.getEventSourceMapping(null, null, (data, error) => {
|
|
3747
|
+
try {
|
|
3748
|
+
const displayE = 'uUID is required';
|
|
3749
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-getEventSourceMapping', displayE);
|
|
3750
|
+
done();
|
|
3751
|
+
} catch (err) {
|
|
3752
|
+
log.error(`Test Failure: ${err}`);
|
|
3753
|
+
done(err);
|
|
3754
|
+
}
|
|
3755
|
+
});
|
|
3756
|
+
} catch (error) {
|
|
3757
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3758
|
+
done(error);
|
|
3759
|
+
}
|
|
3760
|
+
}).timeout(attemptTimeout);
|
|
3761
|
+
});
|
|
3762
|
+
|
|
3763
|
+
describe('#updateEventSourceMapping - errors', () => {
|
|
3764
|
+
it('should have a updateEventSourceMapping function', (done) => {
|
|
3765
|
+
try {
|
|
3766
|
+
assert.equal(true, typeof a.updateEventSourceMapping === 'function');
|
|
3767
|
+
done();
|
|
3768
|
+
} catch (error) {
|
|
3769
|
+
log.error(`Test Failure: ${error}`);
|
|
3770
|
+
done(error);
|
|
3771
|
+
}
|
|
3772
|
+
}).timeout(attemptTimeout);
|
|
3773
|
+
it('should error if - missing uUID', (done) => {
|
|
3774
|
+
try {
|
|
3775
|
+
a.updateEventSourceMapping(null, null, null, (data, error) => {
|
|
3776
|
+
try {
|
|
3777
|
+
const displayE = 'uUID is required';
|
|
3778
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-updateEventSourceMapping', displayE);
|
|
3779
|
+
done();
|
|
3780
|
+
} catch (err) {
|
|
3781
|
+
log.error(`Test Failure: ${err}`);
|
|
3782
|
+
done(err);
|
|
3783
|
+
}
|
|
3784
|
+
});
|
|
3785
|
+
} catch (error) {
|
|
3786
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3787
|
+
done(error);
|
|
3788
|
+
}
|
|
3789
|
+
}).timeout(attemptTimeout);
|
|
3790
|
+
it('should error if - missing body', (done) => {
|
|
3791
|
+
try {
|
|
3792
|
+
a.updateEventSourceMapping('fakeparam', null, null, (data, error) => {
|
|
3793
|
+
try {
|
|
3794
|
+
const displayE = 'body is required';
|
|
3795
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-updateEventSourceMapping', displayE);
|
|
3796
|
+
done();
|
|
3797
|
+
} catch (err) {
|
|
3798
|
+
log.error(`Test Failure: ${err}`);
|
|
3799
|
+
done(err);
|
|
3800
|
+
}
|
|
3801
|
+
});
|
|
3802
|
+
} catch (error) {
|
|
3803
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3804
|
+
done(error);
|
|
3805
|
+
}
|
|
3806
|
+
}).timeout(attemptTimeout);
|
|
3807
|
+
});
|
|
3808
|
+
|
|
3809
|
+
describe('#getAccountSettings - errors', () => {
|
|
3810
|
+
it('should have a getAccountSettings function', (done) => {
|
|
3811
|
+
try {
|
|
3812
|
+
assert.equal(true, typeof a.getAccountSettings === 'function');
|
|
3813
|
+
done();
|
|
3814
|
+
} catch (error) {
|
|
3815
|
+
log.error(`Test Failure: ${error}`);
|
|
3816
|
+
done(error);
|
|
3817
|
+
}
|
|
3818
|
+
}).timeout(attemptTimeout);
|
|
3819
|
+
});
|
|
3820
|
+
|
|
3821
|
+
describe('#listTags - errors', () => {
|
|
3822
|
+
it('should have a listTags function', (done) => {
|
|
3823
|
+
try {
|
|
3824
|
+
assert.equal(true, typeof a.listTags === 'function');
|
|
3825
|
+
done();
|
|
3826
|
+
} catch (error) {
|
|
3827
|
+
log.error(`Test Failure: ${error}`);
|
|
3828
|
+
done(error);
|
|
3829
|
+
}
|
|
3830
|
+
}).timeout(attemptTimeout);
|
|
3831
|
+
it('should error if - missing aRN', (done) => {
|
|
3832
|
+
try {
|
|
3833
|
+
a.listTags(null, null, (data, error) => {
|
|
3834
|
+
try {
|
|
3835
|
+
const displayE = 'aRN is required';
|
|
3836
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-listTags', displayE);
|
|
3837
|
+
done();
|
|
3838
|
+
} catch (err) {
|
|
3839
|
+
log.error(`Test Failure: ${err}`);
|
|
3840
|
+
done(err);
|
|
3841
|
+
}
|
|
3842
|
+
});
|
|
3843
|
+
} catch (error) {
|
|
3844
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3845
|
+
done(error);
|
|
3846
|
+
}
|
|
3847
|
+
}).timeout(attemptTimeout);
|
|
3848
|
+
});
|
|
3849
|
+
|
|
3850
|
+
describe('#tagResource - errors', () => {
|
|
3851
|
+
it('should have a tagResource function', (done) => {
|
|
3852
|
+
try {
|
|
3853
|
+
assert.equal(true, typeof a.tagResource === 'function');
|
|
3854
|
+
done();
|
|
3855
|
+
} catch (error) {
|
|
3856
|
+
log.error(`Test Failure: ${error}`);
|
|
3857
|
+
done(error);
|
|
3858
|
+
}
|
|
3859
|
+
}).timeout(attemptTimeout);
|
|
3860
|
+
it('should error if - missing aRN', (done) => {
|
|
3861
|
+
try {
|
|
3862
|
+
a.tagResource(null, null, null, (data, error) => {
|
|
3863
|
+
try {
|
|
3864
|
+
const displayE = 'aRN is required';
|
|
3865
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-tagResource', displayE);
|
|
3866
|
+
done();
|
|
3867
|
+
} catch (err) {
|
|
3868
|
+
log.error(`Test Failure: ${err}`);
|
|
3869
|
+
done(err);
|
|
3870
|
+
}
|
|
3871
|
+
});
|
|
3872
|
+
} catch (error) {
|
|
3873
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3874
|
+
done(error);
|
|
3875
|
+
}
|
|
3876
|
+
}).timeout(attemptTimeout);
|
|
3877
|
+
it('should error if - missing body', (done) => {
|
|
3878
|
+
try {
|
|
3879
|
+
a.tagResource('fakeparam', null, null, (data, error) => {
|
|
3880
|
+
try {
|
|
3881
|
+
const displayE = 'body is required';
|
|
3882
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-tagResource', displayE);
|
|
3883
|
+
done();
|
|
3884
|
+
} catch (err) {
|
|
3885
|
+
log.error(`Test Failure: ${err}`);
|
|
3886
|
+
done(err);
|
|
3887
|
+
}
|
|
3888
|
+
});
|
|
3889
|
+
} catch (error) {
|
|
3890
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3891
|
+
done(error);
|
|
3892
|
+
}
|
|
3893
|
+
}).timeout(attemptTimeout);
|
|
3894
|
+
});
|
|
3895
|
+
|
|
3896
|
+
describe('#untagResource - errors', () => {
|
|
3897
|
+
it('should have a untagResource function', (done) => {
|
|
3898
|
+
try {
|
|
3899
|
+
assert.equal(true, typeof a.untagResource === 'function');
|
|
3900
|
+
done();
|
|
3901
|
+
} catch (error) {
|
|
3902
|
+
log.error(`Test Failure: ${error}`);
|
|
3903
|
+
done(error);
|
|
3904
|
+
}
|
|
3905
|
+
}).timeout(attemptTimeout);
|
|
3906
|
+
it('should error if - missing aRN', (done) => {
|
|
3907
|
+
try {
|
|
3908
|
+
a.untagResource(null, null, null, (data, error) => {
|
|
3909
|
+
try {
|
|
3910
|
+
const displayE = 'aRN is required';
|
|
3911
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-untagResource', displayE);
|
|
3912
|
+
done();
|
|
3913
|
+
} catch (err) {
|
|
3914
|
+
log.error(`Test Failure: ${err}`);
|
|
3915
|
+
done(err);
|
|
3916
|
+
}
|
|
3917
|
+
});
|
|
3918
|
+
} catch (error) {
|
|
3919
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3920
|
+
done(error);
|
|
3921
|
+
}
|
|
3922
|
+
}).timeout(attemptTimeout);
|
|
3923
|
+
it('should error if - missing tagKeys', (done) => {
|
|
3924
|
+
try {
|
|
3925
|
+
a.untagResource('fakeparam', null, null, (data, error) => {
|
|
3926
|
+
try {
|
|
3927
|
+
const displayE = 'tagKeys is required';
|
|
3928
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-aws_lambda-adapter-untagResource', displayE);
|
|
3929
|
+
done();
|
|
3930
|
+
} catch (err) {
|
|
3931
|
+
log.error(`Test Failure: ${err}`);
|
|
3932
|
+
done(err);
|
|
3933
|
+
}
|
|
3934
|
+
});
|
|
3935
|
+
} catch (error) {
|
|
3936
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3937
|
+
done(error);
|
|
3938
|
+
}
|
|
3939
|
+
}).timeout(attemptTimeout);
|
|
3940
|
+
});
|
|
3941
|
+
});
|
|
3942
|
+
});
|