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