@itentialopensource/adapter-webex_teams 0.5.4 → 0.6.0
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 +1 -0
- package/.eslintrc.js +12 -12
- package/AUTH.md +39 -0
- package/BROKER.md +199 -0
- package/CALLS.md +169 -0
- package/CHANGELOG.md +41 -18
- package/CODE_OF_CONDUCT.md +12 -17
- package/CONTRIBUTING.md +88 -74
- package/ENHANCE.md +69 -0
- package/PROPERTIES.md +641 -0
- package/README.md +247 -395
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +11 -0
- package/TROUBLESHOOT.md +47 -0
- package/adapter.js +898 -35
- package/adapterBase.js +1331 -50
- package/entities/.generic/action.json +214 -0
- package/entities/.generic/schema.json +28 -0
- package/entities/.system/action.json +3 -3
- package/entities/.system/schemaTokenReq.json +24 -0
- package/entities/.system/schemaTokenResp.json +1 -1
- package/error.json +12 -0
- package/package.json +47 -23
- package/pronghorn.json +642 -0
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +507 -13
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +10 -0
- package/report/updateReport1594310783472.json +95 -0
- package/report/updateReport1615908902547.json +95 -0
- package/report/updateReport1653575821854.json +120 -0
- package/sampleProperties.json +115 -11
- package/storage/metrics.json +692 -0
- package/test/integration/adapterTestBasicGet.js +85 -0
- package/test/integration/adapterTestConnectivity.js +93 -0
- package/test/integration/adapterTestIntegration.js +42 -105
- package/test/unit/adapterBaseTestUnit.js +949 -0
- package/test/unit/adapterTestUnit.js +683 -144
- package/utils/adapterInfo.js +206 -0
- package/utils/addAuth.js +94 -0
- package/utils/artifactize.js +9 -14
- 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/modify.js +154 -0
- package/utils/packModificationScript.js +1 -1
- package/utils/patches2bundledDeps.js +90 -0
- package/utils/pre-commit.sh +4 -1
- package/utils/removeHooks.js +20 -0
- package/utils/tbScript.js +184 -0
- package/utils/tbUtils.js +469 -0
- package/utils/testRunner.js +16 -16
- package/utils/troubleshootingAdapter.js +190 -0
- package/gl-code-quality-report.json +0 -1
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
/* global describe it log pronghornProps */
|
|
5
5
|
/* eslint global-require: warn */
|
|
6
6
|
/* eslint no-unused-vars: warn */
|
|
7
|
+
/* eslint import/no-dynamic-require:warn */
|
|
7
8
|
|
|
8
9
|
// include required items for testing & logging
|
|
9
10
|
const assert = require('assert');
|
|
@@ -18,22 +19,31 @@ const { use } = require('chai');
|
|
|
18
19
|
const td = require('testdouble');
|
|
19
20
|
|
|
20
21
|
const anything = td.matchers.anything();
|
|
21
|
-
|
|
22
|
-
// stub and attemptTimeout are used throughout the code so set them here
|
|
23
22
|
let logLevel = 'none';
|
|
24
|
-
const stub = true;
|
|
25
23
|
const isRapidFail = false;
|
|
26
|
-
|
|
24
|
+
|
|
25
|
+
// read in the properties from the sampleProperties files
|
|
26
|
+
let adaptdir = __dirname;
|
|
27
|
+
if (adaptdir.endsWith('/test/integration')) {
|
|
28
|
+
adaptdir = adaptdir.substring(0, adaptdir.length - 17);
|
|
29
|
+
} else if (adaptdir.endsWith('/test/unit')) {
|
|
30
|
+
adaptdir = adaptdir.substring(0, adaptdir.length - 10);
|
|
31
|
+
}
|
|
32
|
+
const samProps = require(`${adaptdir}/sampleProperties.json`).properties;
|
|
27
33
|
|
|
28
34
|
// these variables can be changed to run in integrated mode so easier to set them here
|
|
29
35
|
// always check these in with bogus data!!!
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
samProps.stub = true;
|
|
37
|
+
samProps.host = 'replace.hostorip.here';
|
|
38
|
+
samProps.authentication.username = 'username';
|
|
39
|
+
samProps.authentication.password = 'password';
|
|
40
|
+
samProps.protocol = 'http';
|
|
41
|
+
samProps.port = 80;
|
|
42
|
+
samProps.ssl.enabled = false;
|
|
43
|
+
samProps.ssl.accept_invalid_cert = false;
|
|
44
|
+
samProps.request.attempt_timeout = 60000;
|
|
45
|
+
const attemptTimeout = samProps.request.attempt_timeout;
|
|
46
|
+
const { stub } = samProps;
|
|
37
47
|
|
|
38
48
|
// these are the adapter properties. You generally should not need to alter
|
|
39
49
|
// any of these after they are initially set up
|
|
@@ -43,89 +53,9 @@ global.pronghornProps = {
|
|
|
43
53
|
},
|
|
44
54
|
adapterProps: {
|
|
45
55
|
adapters: [{
|
|
46
|
-
id: 'Test-
|
|
56
|
+
id: 'Test-webex_teams',
|
|
47
57
|
type: 'WebexTeams',
|
|
48
|
-
properties:
|
|
49
|
-
host,
|
|
50
|
-
port,
|
|
51
|
-
base_path: '//api',
|
|
52
|
-
version: 'v1.3.1',
|
|
53
|
-
cache_location: 'none',
|
|
54
|
-
save_metric: false,
|
|
55
|
-
stub,
|
|
56
|
-
protocol,
|
|
57
|
-
authentication: {
|
|
58
|
-
auth_method: 'no_authentication',
|
|
59
|
-
username,
|
|
60
|
-
password,
|
|
61
|
-
token: '',
|
|
62
|
-
token_timeout: -1,
|
|
63
|
-
token_cache: 'local',
|
|
64
|
-
invalid_token_error: 401,
|
|
65
|
-
auth_field: 'header.headers.Authorization',
|
|
66
|
-
auth_field_format: 'Basic {b64}{username}:{password}{/b64}'
|
|
67
|
-
},
|
|
68
|
-
healthcheck: {
|
|
69
|
-
type: 'none',
|
|
70
|
-
frequency: 60000
|
|
71
|
-
},
|
|
72
|
-
throttle: {
|
|
73
|
-
throttle_enabled: false,
|
|
74
|
-
number_pronghorns: 1,
|
|
75
|
-
sync_async: 'sync',
|
|
76
|
-
max_in_queue: 1000,
|
|
77
|
-
concurrent_max: 1,
|
|
78
|
-
expire_timeout: 0,
|
|
79
|
-
avg_runtime: 200
|
|
80
|
-
},
|
|
81
|
-
request: {
|
|
82
|
-
number_redirects: 0,
|
|
83
|
-
number_retries: 3,
|
|
84
|
-
limit_retry_error: 0,
|
|
85
|
-
failover_codes: [],
|
|
86
|
-
attempt_timeout: attemptTimeout,
|
|
87
|
-
global_request: {
|
|
88
|
-
payload: {},
|
|
89
|
-
uriOptions: {},
|
|
90
|
-
addlHeaders: {},
|
|
91
|
-
authData: {}
|
|
92
|
-
},
|
|
93
|
-
healthcheck_on_timeout: true,
|
|
94
|
-
return_raw: true,
|
|
95
|
-
archiving: false
|
|
96
|
-
},
|
|
97
|
-
proxy: {
|
|
98
|
-
enabled: false,
|
|
99
|
-
host: '',
|
|
100
|
-
port: 1,
|
|
101
|
-
protocol: 'http'
|
|
102
|
-
},
|
|
103
|
-
ssl: {
|
|
104
|
-
ecdhCurve: '',
|
|
105
|
-
enabled: sslenable,
|
|
106
|
-
accept_invalid_cert: sslinvalid,
|
|
107
|
-
ca_file: '',
|
|
108
|
-
key_file: '',
|
|
109
|
-
cert_file: '',
|
|
110
|
-
secure_protocol: '',
|
|
111
|
-
ciphers: ''
|
|
112
|
-
},
|
|
113
|
-
mongo: {
|
|
114
|
-
host: '',
|
|
115
|
-
port: 0,
|
|
116
|
-
database: '',
|
|
117
|
-
username,
|
|
118
|
-
password: '',
|
|
119
|
-
replSet: '',
|
|
120
|
-
db_ssl: {
|
|
121
|
-
enabled: false,
|
|
122
|
-
accept_invalid_cert: false,
|
|
123
|
-
ca_file: '',
|
|
124
|
-
key_file: '',
|
|
125
|
-
cert_file: ''
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
58
|
+
properties: samProps
|
|
129
59
|
}]
|
|
130
60
|
}
|
|
131
61
|
};
|
|
@@ -161,7 +91,7 @@ process.argv.forEach((val) => {
|
|
|
161
91
|
});
|
|
162
92
|
|
|
163
93
|
// need to set global logging
|
|
164
|
-
global.log =
|
|
94
|
+
global.log = winston.createLogger({
|
|
165
95
|
level: logLevel,
|
|
166
96
|
levels: myCustomLevels.levels,
|
|
167
97
|
transports: [
|
|
@@ -185,9 +115,8 @@ function runErrorAsserts(data, error, code, origin, displayStr) {
|
|
|
185
115
|
assert.equal(displayStr, error.IAPerror.displayString);
|
|
186
116
|
}
|
|
187
117
|
|
|
188
|
-
|
|
189
118
|
// require the adapter that we are going to be using
|
|
190
|
-
const WebexTeams = require('../../adapter
|
|
119
|
+
const WebexTeams = require('../../adapter');
|
|
191
120
|
|
|
192
121
|
// delete the .DS_Store directory in entities -- otherwise this will cause errors
|
|
193
122
|
const dirPath = path.join(__dirname, '../../entities/.DS_Store');
|
|
@@ -229,6 +158,8 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
229
158
|
try {
|
|
230
159
|
assert.notEqual(null, a);
|
|
231
160
|
assert.notEqual(undefined, a);
|
|
161
|
+
const checkId = global.pronghornProps.adapterProps.adapters[0].id;
|
|
162
|
+
assert.equal(checkId, a.id);
|
|
232
163
|
assert.notEqual(null, a.allProps);
|
|
233
164
|
const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
|
|
234
165
|
assert.equal(check, a.healthcheckType);
|
|
@@ -255,10 +186,10 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
255
186
|
});
|
|
256
187
|
|
|
257
188
|
let wffunctions = [];
|
|
258
|
-
describe('#
|
|
189
|
+
describe('#iapGetAdapterWorkflowFunctions', () => {
|
|
259
190
|
it('should retrieve workflow functions', (done) => {
|
|
260
191
|
try {
|
|
261
|
-
wffunctions = a.
|
|
192
|
+
wffunctions = a.iapGetAdapterWorkflowFunctions([]);
|
|
262
193
|
|
|
263
194
|
try {
|
|
264
195
|
assert.notEqual(0, wffunctions.length);
|
|
@@ -310,13 +241,103 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
310
241
|
done(error);
|
|
311
242
|
}
|
|
312
243
|
});
|
|
313
|
-
it('package.json should be customized', (done) => {
|
|
244
|
+
it('package.json standard fields should be customized', (done) => {
|
|
314
245
|
try {
|
|
315
246
|
const packageDotJson = require('../../package.json');
|
|
316
247
|
assert.notEqual(-1, packageDotJson.name.indexOf('webex_teams'));
|
|
317
248
|
assert.notEqual(undefined, packageDotJson.version);
|
|
318
249
|
assert.notEqual(null, packageDotJson.version);
|
|
319
250
|
assert.notEqual('', packageDotJson.version);
|
|
251
|
+
assert.notEqual(undefined, packageDotJson.description);
|
|
252
|
+
assert.notEqual(null, packageDotJson.description);
|
|
253
|
+
assert.notEqual('', packageDotJson.description);
|
|
254
|
+
assert.equal('adapter.js', packageDotJson.main);
|
|
255
|
+
assert.notEqual(undefined, packageDotJson.wizardVersion);
|
|
256
|
+
assert.notEqual(null, packageDotJson.wizardVersion);
|
|
257
|
+
assert.notEqual('', packageDotJson.wizardVersion);
|
|
258
|
+
assert.notEqual(undefined, packageDotJson.engineVersion);
|
|
259
|
+
assert.notEqual(null, packageDotJson.engineVersion);
|
|
260
|
+
assert.notEqual('', packageDotJson.engineVersion);
|
|
261
|
+
assert.equal('http', packageDotJson.adapterType);
|
|
262
|
+
done();
|
|
263
|
+
} catch (error) {
|
|
264
|
+
log.error(`Test Failure: ${error}`);
|
|
265
|
+
done(error);
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
it('package.json proper scripts should be provided', (done) => {
|
|
269
|
+
try {
|
|
270
|
+
const packageDotJson = require('../../package.json');
|
|
271
|
+
assert.notEqual(undefined, packageDotJson.scripts);
|
|
272
|
+
assert.notEqual(null, packageDotJson.scripts);
|
|
273
|
+
assert.notEqual('', packageDotJson.scripts);
|
|
274
|
+
assert.equal('node utils/setup.js && npm install --package-lock-only --ignore-scripts && npx npm-force-resolutions', packageDotJson.scripts.preinstall);
|
|
275
|
+
assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js', packageDotJson.scripts.lint);
|
|
276
|
+
assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js --quiet', packageDotJson.scripts['lint:errors']);
|
|
277
|
+
assert.equal('mocha test/unit/adapterBaseTestUnit.js --LOG=error', packageDotJson.scripts['test:baseunit']);
|
|
278
|
+
assert.equal('mocha test/unit/adapterTestUnit.js --LOG=error', packageDotJson.scripts['test:unit']);
|
|
279
|
+
assert.equal('mocha test/integration/adapterTestIntegration.js --LOG=error', packageDotJson.scripts['test:integration']);
|
|
280
|
+
assert.equal('nyc --reporter html --reporter text mocha --reporter dot test/*', packageDotJson.scripts['test:cover']);
|
|
281
|
+
assert.equal('npm run test:baseunit && npm run test:unit && npm run test:integration', packageDotJson.scripts.test);
|
|
282
|
+
assert.equal('npm publish --registry=https://registry.npmjs.org --access=public', packageDotJson.scripts.deploy);
|
|
283
|
+
assert.equal('npm run deploy', packageDotJson.scripts.build);
|
|
284
|
+
done();
|
|
285
|
+
} catch (error) {
|
|
286
|
+
log.error(`Test Failure: ${error}`);
|
|
287
|
+
done(error);
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
it('package.json proper directories should be provided', (done) => {
|
|
291
|
+
try {
|
|
292
|
+
const packageDotJson = require('../../package.json');
|
|
293
|
+
assert.notEqual(undefined, packageDotJson.repository);
|
|
294
|
+
assert.notEqual(null, packageDotJson.repository);
|
|
295
|
+
assert.notEqual('', packageDotJson.repository);
|
|
296
|
+
assert.equal('git', packageDotJson.repository.type);
|
|
297
|
+
assert.equal('git@gitlab.com:itentialopensource/adapters/', packageDotJson.repository.url.substring(0, 43));
|
|
298
|
+
assert.equal('https://gitlab.com/itentialopensource/adapters/', packageDotJson.homepage.substring(0, 47));
|
|
299
|
+
done();
|
|
300
|
+
} catch (error) {
|
|
301
|
+
log.error(`Test Failure: ${error}`);
|
|
302
|
+
done(error);
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
it('package.json proper dependencies should be provided', (done) => {
|
|
306
|
+
try {
|
|
307
|
+
const packageDotJson = require('../../package.json');
|
|
308
|
+
assert.notEqual(undefined, packageDotJson.dependencies);
|
|
309
|
+
assert.notEqual(null, packageDotJson.dependencies);
|
|
310
|
+
assert.notEqual('', packageDotJson.dependencies);
|
|
311
|
+
assert.equal('^6.12.0', packageDotJson.dependencies.ajv);
|
|
312
|
+
assert.equal('^0.21.0', packageDotJson.dependencies.axios);
|
|
313
|
+
assert.equal('^2.20.0', packageDotJson.dependencies.commander);
|
|
314
|
+
assert.equal('^8.1.0', packageDotJson.dependencies['fs-extra']);
|
|
315
|
+
assert.equal('^9.0.1', packageDotJson.dependencies.mocha);
|
|
316
|
+
assert.equal('^2.0.1', packageDotJson.dependencies['mocha-param']);
|
|
317
|
+
assert.equal('^0.5.3', packageDotJson.dependencies['network-diagnostics']);
|
|
318
|
+
assert.equal('^15.1.0', packageDotJson.dependencies.nyc);
|
|
319
|
+
assert.equal('^1.4.10', packageDotJson.dependencies['readline-sync']);
|
|
320
|
+
assert.equal('^7.3.2', packageDotJson.dependencies.semver);
|
|
321
|
+
assert.equal('^3.3.3', packageDotJson.dependencies.winston);
|
|
322
|
+
done();
|
|
323
|
+
} catch (error) {
|
|
324
|
+
log.error(`Test Failure: ${error}`);
|
|
325
|
+
done(error);
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
it('package.json proper dev dependencies should be provided', (done) => {
|
|
329
|
+
try {
|
|
330
|
+
const packageDotJson = require('../../package.json');
|
|
331
|
+
assert.notEqual(undefined, packageDotJson.devDependencies);
|
|
332
|
+
assert.notEqual(null, packageDotJson.devDependencies);
|
|
333
|
+
assert.notEqual('', packageDotJson.devDependencies);
|
|
334
|
+
assert.equal('^4.3.4', packageDotJson.devDependencies.chai);
|
|
335
|
+
assert.equal('^7.29.0', packageDotJson.devDependencies.eslint);
|
|
336
|
+
assert.equal('^14.2.1', packageDotJson.devDependencies['eslint-config-airbnb-base']);
|
|
337
|
+
assert.equal('^2.23.4', packageDotJson.devDependencies['eslint-plugin-import']);
|
|
338
|
+
assert.equal('^3.0.0', packageDotJson.devDependencies['eslint-plugin-json']);
|
|
339
|
+
assert.equal('^0.6.3', packageDotJson.devDependencies['package-json-validator']);
|
|
340
|
+
assert.equal('^3.16.1', packageDotJson.devDependencies.testdouble);
|
|
320
341
|
done();
|
|
321
342
|
} catch (error) {
|
|
322
343
|
log.error(`Test Failure: ${error}`);
|
|
@@ -341,8 +362,35 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
341
362
|
try {
|
|
342
363
|
const pronghornDotJson = require('../../pronghorn.json');
|
|
343
364
|
assert.notEqual(-1, pronghornDotJson.id.indexOf('webex_teams'));
|
|
365
|
+
assert.equal('Adapter', pronghornDotJson.type);
|
|
344
366
|
assert.equal('WebexTeams', pronghornDotJson.export);
|
|
345
367
|
assert.equal('WebexTeams', pronghornDotJson.title);
|
|
368
|
+
assert.equal('adapter.js', pronghornDotJson.src);
|
|
369
|
+
done();
|
|
370
|
+
} catch (error) {
|
|
371
|
+
log.error(`Test Failure: ${error}`);
|
|
372
|
+
done(error);
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
it('pronghorn.json should contain generic adapter methods', (done) => {
|
|
376
|
+
try {
|
|
377
|
+
const pronghornDotJson = require('../../pronghorn.json');
|
|
378
|
+
assert.notEqual(undefined, pronghornDotJson.methods);
|
|
379
|
+
assert.notEqual(null, pronghornDotJson.methods);
|
|
380
|
+
assert.notEqual('', pronghornDotJson.methods);
|
|
381
|
+
assert.equal(true, Array.isArray(pronghornDotJson.methods));
|
|
382
|
+
assert.notEqual(0, pronghornDotJson.methods.length);
|
|
383
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUpdateAdapterConfiguration'));
|
|
384
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapFindAdapterPath'));
|
|
385
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapTroubleshootAdapter'));
|
|
386
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterHealthcheck'));
|
|
387
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterConnectivity'));
|
|
388
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterBasicGet'));
|
|
389
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapSuspendAdapter'));
|
|
390
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUnsuspendAdapter'));
|
|
391
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapGetAdapterQueue'));
|
|
392
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequest'));
|
|
393
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequestNoBasePath'));
|
|
346
394
|
done();
|
|
347
395
|
} catch (error) {
|
|
348
396
|
log.error(`Test Failure: ${error}`);
|
|
@@ -364,7 +412,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
364
412
|
let wfparams = [];
|
|
365
413
|
|
|
366
414
|
if (methLine && methLine.indexOf('(') >= 0 && methLine.indexOf(')') >= 0) {
|
|
367
|
-
const temp = methLine.substring(methLine.indexOf('(') + 1, methLine.
|
|
415
|
+
const temp = methLine.substring(methLine.indexOf('(') + 1, methLine.lastIndexOf(')'));
|
|
368
416
|
wfparams = temp.split(',');
|
|
369
417
|
|
|
370
418
|
for (let t = 0; t < wfparams.length; t += 1) {
|
|
@@ -481,6 +529,124 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
481
529
|
try {
|
|
482
530
|
const propertiesDotJson = require('../../propertiesSchema.json');
|
|
483
531
|
assert.equal('adapter-webex_teams', propertiesDotJson.$id);
|
|
532
|
+
assert.equal('object', propertiesDotJson.type);
|
|
533
|
+
assert.equal('http://json-schema.org/draft-07/schema#', propertiesDotJson.$schema);
|
|
534
|
+
done();
|
|
535
|
+
} catch (error) {
|
|
536
|
+
log.error(`Test Failure: ${error}`);
|
|
537
|
+
done(error);
|
|
538
|
+
}
|
|
539
|
+
});
|
|
540
|
+
it('propertiesSchema.json should contain generic adapter properties', (done) => {
|
|
541
|
+
try {
|
|
542
|
+
const propertiesDotJson = require('../../propertiesSchema.json');
|
|
543
|
+
assert.notEqual(undefined, propertiesDotJson.properties);
|
|
544
|
+
assert.notEqual(null, propertiesDotJson.properties);
|
|
545
|
+
assert.notEqual('', propertiesDotJson.properties);
|
|
546
|
+
assert.equal('string', propertiesDotJson.properties.host.type);
|
|
547
|
+
assert.equal('integer', propertiesDotJson.properties.port.type);
|
|
548
|
+
assert.equal('boolean', propertiesDotJson.properties.stub.type);
|
|
549
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.authentication);
|
|
550
|
+
assert.notEqual(null, propertiesDotJson.definitions.authentication);
|
|
551
|
+
assert.notEqual('', propertiesDotJson.definitions.authentication);
|
|
552
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.auth_method.type);
|
|
553
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.username.type);
|
|
554
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.password.type);
|
|
555
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.token.type);
|
|
556
|
+
assert.equal('integer', propertiesDotJson.definitions.authentication.properties.invalid_token_error.type);
|
|
557
|
+
assert.equal('integer', propertiesDotJson.definitions.authentication.properties.token_timeout.type);
|
|
558
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.token_cache.type);
|
|
559
|
+
assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field.type));
|
|
560
|
+
assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field_format.type));
|
|
561
|
+
assert.equal('boolean', propertiesDotJson.definitions.authentication.properties.auth_logging.type);
|
|
562
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_id.type);
|
|
563
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_secret.type);
|
|
564
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.grant_type.type);
|
|
565
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.ssl);
|
|
566
|
+
assert.notEqual(null, propertiesDotJson.definitions.ssl);
|
|
567
|
+
assert.notEqual('', propertiesDotJson.definitions.ssl);
|
|
568
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ecdhCurve.type);
|
|
569
|
+
assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.enabled.type);
|
|
570
|
+
assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.accept_invalid_cert.type);
|
|
571
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ca_file.type);
|
|
572
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.key_file.type);
|
|
573
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.cert_file.type);
|
|
574
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.secure_protocol.type);
|
|
575
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ciphers.type);
|
|
576
|
+
assert.equal('string', propertiesDotJson.properties.base_path.type);
|
|
577
|
+
assert.equal('string', propertiesDotJson.properties.version.type);
|
|
578
|
+
assert.equal('string', propertiesDotJson.properties.cache_location.type);
|
|
579
|
+
assert.equal('boolean', propertiesDotJson.properties.encode_pathvars.type);
|
|
580
|
+
assert.equal('boolean', propertiesDotJson.properties.encode_queryvars.type);
|
|
581
|
+
assert.equal(true, Array.isArray(propertiesDotJson.properties.save_metric.type));
|
|
582
|
+
assert.equal('string', propertiesDotJson.properties.protocol.type);
|
|
583
|
+
assert.notEqual(undefined, propertiesDotJson.definitions);
|
|
584
|
+
assert.notEqual(null, propertiesDotJson.definitions);
|
|
585
|
+
assert.notEqual('', propertiesDotJson.definitions);
|
|
586
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.healthcheck);
|
|
587
|
+
assert.notEqual(null, propertiesDotJson.definitions.healthcheck);
|
|
588
|
+
assert.notEqual('', propertiesDotJson.definitions.healthcheck);
|
|
589
|
+
assert.equal('string', propertiesDotJson.definitions.healthcheck.properties.type.type);
|
|
590
|
+
assert.equal('integer', propertiesDotJson.definitions.healthcheck.properties.frequency.type);
|
|
591
|
+
assert.equal('object', propertiesDotJson.definitions.healthcheck.properties.query_object.type);
|
|
592
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.throttle);
|
|
593
|
+
assert.notEqual(null, propertiesDotJson.definitions.throttle);
|
|
594
|
+
assert.notEqual('', propertiesDotJson.definitions.throttle);
|
|
595
|
+
assert.equal('boolean', propertiesDotJson.definitions.throttle.properties.throttle_enabled.type);
|
|
596
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.number_pronghorns.type);
|
|
597
|
+
assert.equal('string', propertiesDotJson.definitions.throttle.properties.sync_async.type);
|
|
598
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.max_in_queue.type);
|
|
599
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.concurrent_max.type);
|
|
600
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.expire_timeout.type);
|
|
601
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.avg_runtime.type);
|
|
602
|
+
assert.equal('array', propertiesDotJson.definitions.throttle.properties.priorities.type);
|
|
603
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.request);
|
|
604
|
+
assert.notEqual(null, propertiesDotJson.definitions.request);
|
|
605
|
+
assert.notEqual('', propertiesDotJson.definitions.request);
|
|
606
|
+
assert.equal('integer', propertiesDotJson.definitions.request.properties.number_redirects.type);
|
|
607
|
+
assert.equal('integer', propertiesDotJson.definitions.request.properties.number_retries.type);
|
|
608
|
+
assert.equal(true, Array.isArray(propertiesDotJson.definitions.request.properties.limit_retry_error.type));
|
|
609
|
+
assert.equal('array', propertiesDotJson.definitions.request.properties.failover_codes.type);
|
|
610
|
+
assert.equal('integer', propertiesDotJson.definitions.request.properties.attempt_timeout.type);
|
|
611
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.type);
|
|
612
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.payload.type);
|
|
613
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.uriOptions.type);
|
|
614
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.addlHeaders.type);
|
|
615
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.authData.type);
|
|
616
|
+
assert.equal('boolean', propertiesDotJson.definitions.request.properties.healthcheck_on_timeout.type);
|
|
617
|
+
assert.equal('boolean', propertiesDotJson.definitions.request.properties.return_raw.type);
|
|
618
|
+
assert.equal('boolean', propertiesDotJson.definitions.request.properties.archiving.type);
|
|
619
|
+
assert.equal('boolean', propertiesDotJson.definitions.request.properties.return_request.type);
|
|
620
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.proxy);
|
|
621
|
+
assert.notEqual(null, propertiesDotJson.definitions.proxy);
|
|
622
|
+
assert.notEqual('', propertiesDotJson.definitions.proxy);
|
|
623
|
+
assert.equal('boolean', propertiesDotJson.definitions.proxy.properties.enabled.type);
|
|
624
|
+
assert.equal('string', propertiesDotJson.definitions.proxy.properties.host.type);
|
|
625
|
+
assert.equal('integer', propertiesDotJson.definitions.proxy.properties.port.type);
|
|
626
|
+
assert.equal('string', propertiesDotJson.definitions.proxy.properties.protocol.type);
|
|
627
|
+
assert.equal('string', propertiesDotJson.definitions.proxy.properties.username.type);
|
|
628
|
+
assert.equal('string', propertiesDotJson.definitions.proxy.properties.password.type);
|
|
629
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.mongo);
|
|
630
|
+
assert.notEqual(null, propertiesDotJson.definitions.mongo);
|
|
631
|
+
assert.notEqual('', propertiesDotJson.definitions.mongo);
|
|
632
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.host.type);
|
|
633
|
+
assert.equal('integer', propertiesDotJson.definitions.mongo.properties.port.type);
|
|
634
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.database.type);
|
|
635
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.username.type);
|
|
636
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.password.type);
|
|
637
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.replSet.type);
|
|
638
|
+
assert.equal('object', propertiesDotJson.definitions.mongo.properties.db_ssl.type);
|
|
639
|
+
assert.equal('boolean', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.enabled.type);
|
|
640
|
+
assert.equal('boolean', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.accept_invalid_cert.type);
|
|
641
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.ca_file.type);
|
|
642
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.key_file.type);
|
|
643
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.cert_file.type);
|
|
644
|
+
assert.notEqual('', propertiesDotJson.definitions.devicebroker);
|
|
645
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevice.type);
|
|
646
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevicesFiltered.type);
|
|
647
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.isAlive.type);
|
|
648
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getConfig.type);
|
|
649
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getCount.type);
|
|
484
650
|
done();
|
|
485
651
|
} catch (error) {
|
|
486
652
|
log.error(`Test Failure: ${error}`);
|
|
@@ -501,6 +667,50 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
501
667
|
done(error);
|
|
502
668
|
}
|
|
503
669
|
});
|
|
670
|
+
it('error.json should have standard adapter errors', (done) => {
|
|
671
|
+
try {
|
|
672
|
+
const errorDotJson = require('../../error.json');
|
|
673
|
+
assert.notEqual(undefined, errorDotJson.errors);
|
|
674
|
+
assert.notEqual(null, errorDotJson.errors);
|
|
675
|
+
assert.notEqual('', errorDotJson.errors);
|
|
676
|
+
assert.equal(true, Array.isArray(errorDotJson.errors));
|
|
677
|
+
assert.notEqual(0, errorDotJson.errors.length);
|
|
678
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.100'));
|
|
679
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.101'));
|
|
680
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.102'));
|
|
681
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.110'));
|
|
682
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.111'));
|
|
683
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.112'));
|
|
684
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.113'));
|
|
685
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.114'));
|
|
686
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.115'));
|
|
687
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.116'));
|
|
688
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.300'));
|
|
689
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.301'));
|
|
690
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.302'));
|
|
691
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.303'));
|
|
692
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.304'));
|
|
693
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.305'));
|
|
694
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.310'));
|
|
695
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.311'));
|
|
696
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.312'));
|
|
697
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.320'));
|
|
698
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.321'));
|
|
699
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.400'));
|
|
700
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.401'));
|
|
701
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.402'));
|
|
702
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.500'));
|
|
703
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.501'));
|
|
704
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.502'));
|
|
705
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.503'));
|
|
706
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.600'));
|
|
707
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.900'));
|
|
708
|
+
done();
|
|
709
|
+
} catch (error) {
|
|
710
|
+
log.error(`Test Failure: ${error}`);
|
|
711
|
+
done(error);
|
|
712
|
+
}
|
|
713
|
+
});
|
|
504
714
|
});
|
|
505
715
|
|
|
506
716
|
describe('sampleProperties.json', () => {
|
|
@@ -515,6 +725,121 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
515
725
|
done(error);
|
|
516
726
|
}
|
|
517
727
|
});
|
|
728
|
+
it('sampleProperties.json should contain generic adapter properties', (done) => {
|
|
729
|
+
try {
|
|
730
|
+
const sampleDotJson = require('../../sampleProperties.json');
|
|
731
|
+
assert.notEqual(-1, sampleDotJson.id.indexOf('webex_teams'));
|
|
732
|
+
assert.equal('WebexTeams', sampleDotJson.type);
|
|
733
|
+
assert.notEqual(undefined, sampleDotJson.properties);
|
|
734
|
+
assert.notEqual(null, sampleDotJson.properties);
|
|
735
|
+
assert.notEqual('', sampleDotJson.properties);
|
|
736
|
+
assert.notEqual(undefined, sampleDotJson.properties.host);
|
|
737
|
+
assert.notEqual(undefined, sampleDotJson.properties.port);
|
|
738
|
+
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
739
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication);
|
|
740
|
+
assert.notEqual(null, sampleDotJson.properties.authentication);
|
|
741
|
+
assert.notEqual('', sampleDotJson.properties.authentication);
|
|
742
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_method);
|
|
743
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.username);
|
|
744
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.password);
|
|
745
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.token);
|
|
746
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.invalid_token_error);
|
|
747
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.token_timeout);
|
|
748
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.token_cache);
|
|
749
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field);
|
|
750
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field_format);
|
|
751
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_logging);
|
|
752
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.client_id);
|
|
753
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.client_secret);
|
|
754
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.grant_type);
|
|
755
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl);
|
|
756
|
+
assert.notEqual(null, sampleDotJson.properties.ssl);
|
|
757
|
+
assert.notEqual('', sampleDotJson.properties.ssl);
|
|
758
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.ecdhCurve);
|
|
759
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.enabled);
|
|
760
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.accept_invalid_cert);
|
|
761
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.ca_file);
|
|
762
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.key_file);
|
|
763
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.cert_file);
|
|
764
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.secure_protocol);
|
|
765
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.ciphers);
|
|
766
|
+
assert.notEqual(undefined, sampleDotJson.properties.base_path);
|
|
767
|
+
assert.notEqual(undefined, sampleDotJson.properties.version);
|
|
768
|
+
assert.notEqual(undefined, sampleDotJson.properties.cache_location);
|
|
769
|
+
assert.notEqual(undefined, sampleDotJson.properties.encode_pathvars);
|
|
770
|
+
assert.notEqual(undefined, sampleDotJson.properties.encode_queryvars);
|
|
771
|
+
assert.notEqual(undefined, sampleDotJson.properties.save_metric);
|
|
772
|
+
assert.notEqual(undefined, sampleDotJson.properties.protocol);
|
|
773
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck);
|
|
774
|
+
assert.notEqual(null, sampleDotJson.properties.healthcheck);
|
|
775
|
+
assert.notEqual('', sampleDotJson.properties.healthcheck);
|
|
776
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck.type);
|
|
777
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck.frequency);
|
|
778
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck.query_object);
|
|
779
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle);
|
|
780
|
+
assert.notEqual(null, sampleDotJson.properties.throttle);
|
|
781
|
+
assert.notEqual('', sampleDotJson.properties.throttle);
|
|
782
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.throttle_enabled);
|
|
783
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.number_pronghorns);
|
|
784
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.sync_async);
|
|
785
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.max_in_queue);
|
|
786
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.concurrent_max);
|
|
787
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.expire_timeout);
|
|
788
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.avg_runtime);
|
|
789
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.priorities);
|
|
790
|
+
assert.notEqual(undefined, sampleDotJson.properties.request);
|
|
791
|
+
assert.notEqual(null, sampleDotJson.properties.request);
|
|
792
|
+
assert.notEqual('', sampleDotJson.properties.request);
|
|
793
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.number_redirects);
|
|
794
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.number_retries);
|
|
795
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.limit_retry_error);
|
|
796
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.failover_codes);
|
|
797
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.attempt_timeout);
|
|
798
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request);
|
|
799
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.payload);
|
|
800
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.uriOptions);
|
|
801
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.addlHeaders);
|
|
802
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.authData);
|
|
803
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.healthcheck_on_timeout);
|
|
804
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.return_raw);
|
|
805
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.archiving);
|
|
806
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.return_request);
|
|
807
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy);
|
|
808
|
+
assert.notEqual(null, sampleDotJson.properties.proxy);
|
|
809
|
+
assert.notEqual('', sampleDotJson.properties.proxy);
|
|
810
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.enabled);
|
|
811
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.host);
|
|
812
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.port);
|
|
813
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.protocol);
|
|
814
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.username);
|
|
815
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.password);
|
|
816
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo);
|
|
817
|
+
assert.notEqual(null, sampleDotJson.properties.mongo);
|
|
818
|
+
assert.notEqual('', sampleDotJson.properties.mongo);
|
|
819
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.host);
|
|
820
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.port);
|
|
821
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.database);
|
|
822
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.username);
|
|
823
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.password);
|
|
824
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.replSet);
|
|
825
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl);
|
|
826
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.enabled);
|
|
827
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.accept_invalid_cert);
|
|
828
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.ca_file);
|
|
829
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.key_file);
|
|
830
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.cert_file);
|
|
831
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker);
|
|
832
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevice);
|
|
833
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevicesFiltered);
|
|
834
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.isAlive);
|
|
835
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getConfig);
|
|
836
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getCount);
|
|
837
|
+
done();
|
|
838
|
+
} catch (error) {
|
|
839
|
+
log.error(`Test Failure: ${error}`);
|
|
840
|
+
done(error);
|
|
841
|
+
}
|
|
842
|
+
});
|
|
518
843
|
});
|
|
519
844
|
|
|
520
845
|
describe('#checkProperties', () => {
|
|
@@ -602,6 +927,148 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
602
927
|
});
|
|
603
928
|
});
|
|
604
929
|
|
|
930
|
+
describe('#iapUpdateAdapterConfiguration', () => {
|
|
931
|
+
it('should have a iapUpdateAdapterConfiguration function', (done) => {
|
|
932
|
+
try {
|
|
933
|
+
assert.equal(true, typeof a.iapUpdateAdapterConfiguration === 'function');
|
|
934
|
+
done();
|
|
935
|
+
} catch (error) {
|
|
936
|
+
log.error(`Test Failure: ${error}`);
|
|
937
|
+
done(error);
|
|
938
|
+
}
|
|
939
|
+
});
|
|
940
|
+
});
|
|
941
|
+
|
|
942
|
+
describe('#iapFindAdapterPath', () => {
|
|
943
|
+
it('should have a iapFindAdapterPath function', (done) => {
|
|
944
|
+
try {
|
|
945
|
+
assert.equal(true, typeof a.iapFindAdapterPath === 'function');
|
|
946
|
+
done();
|
|
947
|
+
} catch (error) {
|
|
948
|
+
log.error(`Test Failure: ${error}`);
|
|
949
|
+
done(error);
|
|
950
|
+
}
|
|
951
|
+
});
|
|
952
|
+
it('iapFindAdapterPath should find atleast one path that matches', (done) => {
|
|
953
|
+
try {
|
|
954
|
+
a.iapFindAdapterPath('{base_path}/{version}', (data, error) => {
|
|
955
|
+
try {
|
|
956
|
+
assert.equal(undefined, error);
|
|
957
|
+
assert.notEqual(undefined, data);
|
|
958
|
+
assert.notEqual(null, data);
|
|
959
|
+
assert.equal(true, data.found);
|
|
960
|
+
assert.notEqual(undefined, data.foundIn);
|
|
961
|
+
assert.notEqual(null, data.foundIn);
|
|
962
|
+
assert.notEqual(0, data.foundIn.length);
|
|
963
|
+
done();
|
|
964
|
+
} catch (err) {
|
|
965
|
+
log.error(`Test Failure: ${err}`);
|
|
966
|
+
done(err);
|
|
967
|
+
}
|
|
968
|
+
});
|
|
969
|
+
} catch (error) {
|
|
970
|
+
log.error(`Adapter Exception: ${error}`);
|
|
971
|
+
done(error);
|
|
972
|
+
}
|
|
973
|
+
}).timeout(attemptTimeout);
|
|
974
|
+
});
|
|
975
|
+
|
|
976
|
+
describe('#iapSuspendAdapter', () => {
|
|
977
|
+
it('should have a iapSuspendAdapter function', (done) => {
|
|
978
|
+
try {
|
|
979
|
+
assert.equal(true, typeof a.iapSuspendAdapter === 'function');
|
|
980
|
+
done();
|
|
981
|
+
} catch (error) {
|
|
982
|
+
log.error(`Test Failure: ${error}`);
|
|
983
|
+
done(error);
|
|
984
|
+
}
|
|
985
|
+
});
|
|
986
|
+
});
|
|
987
|
+
|
|
988
|
+
describe('#iapUnsuspendAdapter', () => {
|
|
989
|
+
it('should have a iapUnsuspendAdapter function', (done) => {
|
|
990
|
+
try {
|
|
991
|
+
assert.equal(true, typeof a.iapUnsuspendAdapter === 'function');
|
|
992
|
+
done();
|
|
993
|
+
} catch (error) {
|
|
994
|
+
log.error(`Test Failure: ${error}`);
|
|
995
|
+
done(error);
|
|
996
|
+
}
|
|
997
|
+
});
|
|
998
|
+
});
|
|
999
|
+
|
|
1000
|
+
describe('#iapGetAdapterQueue', () => {
|
|
1001
|
+
it('should have a iapGetAdapterQueue function', (done) => {
|
|
1002
|
+
try {
|
|
1003
|
+
assert.equal(true, typeof a.iapGetAdapterQueue === 'function');
|
|
1004
|
+
done();
|
|
1005
|
+
} catch (error) {
|
|
1006
|
+
log.error(`Test Failure: ${error}`);
|
|
1007
|
+
done(error);
|
|
1008
|
+
}
|
|
1009
|
+
});
|
|
1010
|
+
});
|
|
1011
|
+
|
|
1012
|
+
describe('#iapTroubleshootAdapter', () => {
|
|
1013
|
+
it('should have a iapTroubleshootAdapter function', (done) => {
|
|
1014
|
+
try {
|
|
1015
|
+
assert.equal(true, typeof a.iapTroubleshootAdapter === 'function');
|
|
1016
|
+
done();
|
|
1017
|
+
} catch (error) {
|
|
1018
|
+
log.error(`Test Failure: ${error}`);
|
|
1019
|
+
done(error);
|
|
1020
|
+
}
|
|
1021
|
+
});
|
|
1022
|
+
});
|
|
1023
|
+
|
|
1024
|
+
describe('#iapRunAdapterHealthcheck', () => {
|
|
1025
|
+
it('should have a iapRunAdapterHealthcheck function', (done) => {
|
|
1026
|
+
try {
|
|
1027
|
+
assert.equal(true, typeof a.iapRunAdapterHealthcheck === 'function');
|
|
1028
|
+
done();
|
|
1029
|
+
} catch (error) {
|
|
1030
|
+
log.error(`Test Failure: ${error}`);
|
|
1031
|
+
done(error);
|
|
1032
|
+
}
|
|
1033
|
+
});
|
|
1034
|
+
});
|
|
1035
|
+
|
|
1036
|
+
describe('#iapRunAdapterConnectivity', () => {
|
|
1037
|
+
it('should have a iapRunAdapterConnectivity function', (done) => {
|
|
1038
|
+
try {
|
|
1039
|
+
assert.equal(true, typeof a.iapRunAdapterConnectivity === 'function');
|
|
1040
|
+
done();
|
|
1041
|
+
} catch (error) {
|
|
1042
|
+
log.error(`Test Failure: ${error}`);
|
|
1043
|
+
done(error);
|
|
1044
|
+
}
|
|
1045
|
+
});
|
|
1046
|
+
});
|
|
1047
|
+
|
|
1048
|
+
describe('#iapRunAdapterBasicGet', () => {
|
|
1049
|
+
it('should have a iapRunAdapterBasicGet function', (done) => {
|
|
1050
|
+
try {
|
|
1051
|
+
assert.equal(true, typeof a.iapRunAdapterBasicGet === 'function');
|
|
1052
|
+
done();
|
|
1053
|
+
} catch (error) {
|
|
1054
|
+
log.error(`Test Failure: ${error}`);
|
|
1055
|
+
done(error);
|
|
1056
|
+
}
|
|
1057
|
+
});
|
|
1058
|
+
});
|
|
1059
|
+
|
|
1060
|
+
describe('#iapMoveAdapterEntitiesToDB', () => {
|
|
1061
|
+
it('should have a iapMoveAdapterEntitiesToDB function', (done) => {
|
|
1062
|
+
try {
|
|
1063
|
+
assert.equal(true, typeof a.iapMoveAdapterEntitiesToDB === 'function');
|
|
1064
|
+
done();
|
|
1065
|
+
} catch (error) {
|
|
1066
|
+
log.error(`Test Failure: ${error}`);
|
|
1067
|
+
done(error);
|
|
1068
|
+
}
|
|
1069
|
+
});
|
|
1070
|
+
});
|
|
1071
|
+
|
|
605
1072
|
describe('#checkActionFiles', () => {
|
|
606
1073
|
it('should have a checkActionFiles function', (done) => {
|
|
607
1074
|
try {
|
|
@@ -687,10 +1154,10 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
687
1154
|
}).timeout(attemptTimeout);
|
|
688
1155
|
});
|
|
689
1156
|
|
|
690
|
-
// describe('#
|
|
691
|
-
// it('should have a
|
|
1157
|
+
// describe('#iapHasAdapterEntity', () => {
|
|
1158
|
+
// it('should have a iapHasAdapterEntity function', (done) => {
|
|
692
1159
|
// try {
|
|
693
|
-
// assert.equal(true, typeof a.
|
|
1160
|
+
// assert.equal(true, typeof a.iapHasAdapterEntity === 'function');
|
|
694
1161
|
// done();
|
|
695
1162
|
// } catch (error) {
|
|
696
1163
|
// log.error(`Test Failure: ${error}`);
|
|
@@ -699,7 +1166,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
699
1166
|
// });
|
|
700
1167
|
// it('should find entity', (done) => {
|
|
701
1168
|
// try {
|
|
702
|
-
// a.
|
|
1169
|
+
// a.iapHasAdapterEntity('template_entity', // 'a9e9c33dc61122760072455df62663d2', (data) => {
|
|
703
1170
|
// try {
|
|
704
1171
|
// assert.equal(true, data[0]);
|
|
705
1172
|
// done();
|
|
@@ -715,7 +1182,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
715
1182
|
// }).timeout(attemptTimeout);
|
|
716
1183
|
// it('should not find entity', (done) => {
|
|
717
1184
|
// try {
|
|
718
|
-
// a.
|
|
1185
|
+
// a.iapHasAdapterEntity('template_entity', 'blah', (data) => {
|
|
719
1186
|
// try {
|
|
720
1187
|
// assert.equal(false, data[0]);
|
|
721
1188
|
// done();
|
|
@@ -731,6 +1198,78 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
731
1198
|
// }).timeout(attemptTimeout);
|
|
732
1199
|
// });
|
|
733
1200
|
|
|
1201
|
+
describe('#hasEntities', () => {
|
|
1202
|
+
it('should have a hasEntities function', (done) => {
|
|
1203
|
+
try {
|
|
1204
|
+
assert.equal(true, typeof a.hasEntities === 'function');
|
|
1205
|
+
done();
|
|
1206
|
+
} catch (error) {
|
|
1207
|
+
log.error(`Test Failure: ${error}`);
|
|
1208
|
+
done(error);
|
|
1209
|
+
}
|
|
1210
|
+
});
|
|
1211
|
+
});
|
|
1212
|
+
|
|
1213
|
+
describe('#getDevice', () => {
|
|
1214
|
+
it('should have a getDevice function', (done) => {
|
|
1215
|
+
try {
|
|
1216
|
+
assert.equal(true, typeof a.getDevice === 'function');
|
|
1217
|
+
done();
|
|
1218
|
+
} catch (error) {
|
|
1219
|
+
log.error(`Test Failure: ${error}`);
|
|
1220
|
+
done(error);
|
|
1221
|
+
}
|
|
1222
|
+
});
|
|
1223
|
+
});
|
|
1224
|
+
|
|
1225
|
+
describe('#getDevicesFiltered', () => {
|
|
1226
|
+
it('should have a getDevicesFiltered function', (done) => {
|
|
1227
|
+
try {
|
|
1228
|
+
assert.equal(true, typeof a.getDevicesFiltered === 'function');
|
|
1229
|
+
done();
|
|
1230
|
+
} catch (error) {
|
|
1231
|
+
log.error(`Test Failure: ${error}`);
|
|
1232
|
+
done(error);
|
|
1233
|
+
}
|
|
1234
|
+
});
|
|
1235
|
+
});
|
|
1236
|
+
|
|
1237
|
+
describe('#isAlive', () => {
|
|
1238
|
+
it('should have a isAlive function', (done) => {
|
|
1239
|
+
try {
|
|
1240
|
+
assert.equal(true, typeof a.isAlive === 'function');
|
|
1241
|
+
done();
|
|
1242
|
+
} catch (error) {
|
|
1243
|
+
log.error(`Test Failure: ${error}`);
|
|
1244
|
+
done(error);
|
|
1245
|
+
}
|
|
1246
|
+
});
|
|
1247
|
+
});
|
|
1248
|
+
|
|
1249
|
+
describe('#getConfig', () => {
|
|
1250
|
+
it('should have a getConfig function', (done) => {
|
|
1251
|
+
try {
|
|
1252
|
+
assert.equal(true, typeof a.getConfig === 'function');
|
|
1253
|
+
done();
|
|
1254
|
+
} catch (error) {
|
|
1255
|
+
log.error(`Test Failure: ${error}`);
|
|
1256
|
+
done(error);
|
|
1257
|
+
}
|
|
1258
|
+
});
|
|
1259
|
+
});
|
|
1260
|
+
|
|
1261
|
+
describe('#iapGetDeviceCount', () => {
|
|
1262
|
+
it('should have a iapGetDeviceCount function', (done) => {
|
|
1263
|
+
try {
|
|
1264
|
+
assert.equal(true, typeof a.iapGetDeviceCount === 'function');
|
|
1265
|
+
done();
|
|
1266
|
+
} catch (error) {
|
|
1267
|
+
log.error(`Test Failure: ${error}`);
|
|
1268
|
+
done(error);
|
|
1269
|
+
}
|
|
1270
|
+
});
|
|
1271
|
+
});
|
|
1272
|
+
|
|
734
1273
|
/*
|
|
735
1274
|
-----------------------------------------------------------------------
|
|
736
1275
|
-----------------------------------------------------------------------
|
|
@@ -767,7 +1306,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
767
1306
|
a.addPerson(null, (data, error) => {
|
|
768
1307
|
try {
|
|
769
1308
|
const displayE = 'body is required';
|
|
770
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1309
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-addPerson', displayE);
|
|
771
1310
|
done();
|
|
772
1311
|
} catch (err) {
|
|
773
1312
|
log.error(`Test Failure: ${err}`);
|
|
@@ -796,7 +1335,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
796
1335
|
a.getPerson(null, (data, error) => {
|
|
797
1336
|
try {
|
|
798
1337
|
const displayE = 'personId is required';
|
|
799
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1338
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getPerson', displayE);
|
|
800
1339
|
done();
|
|
801
1340
|
} catch (err) {
|
|
802
1341
|
log.error(`Test Failure: ${err}`);
|
|
@@ -825,7 +1364,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
825
1364
|
a.updatePerson(null, null, (data, error) => {
|
|
826
1365
|
try {
|
|
827
1366
|
const displayE = 'personId is required';
|
|
828
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1367
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updatePerson', displayE);
|
|
829
1368
|
done();
|
|
830
1369
|
} catch (err) {
|
|
831
1370
|
log.error(`Test Failure: ${err}`);
|
|
@@ -842,7 +1381,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
842
1381
|
a.updatePerson('fakeparam', null, (data, error) => {
|
|
843
1382
|
try {
|
|
844
1383
|
const displayE = 'body is required';
|
|
845
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1384
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updatePerson', displayE);
|
|
846
1385
|
done();
|
|
847
1386
|
} catch (err) {
|
|
848
1387
|
log.error(`Test Failure: ${err}`);
|
|
@@ -871,7 +1410,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
871
1410
|
a.deletePerson(null, (data, error) => {
|
|
872
1411
|
try {
|
|
873
1412
|
const displayE = 'personId is required';
|
|
874
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1413
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-deletePerson', displayE);
|
|
875
1414
|
done();
|
|
876
1415
|
} catch (err) {
|
|
877
1416
|
log.error(`Test Failure: ${err}`);
|
|
@@ -924,7 +1463,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
924
1463
|
a.createRoom(null, (data, error) => {
|
|
925
1464
|
try {
|
|
926
1465
|
const displayE = 'body is required';
|
|
927
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1466
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-createRoom', displayE);
|
|
928
1467
|
done();
|
|
929
1468
|
} catch (err) {
|
|
930
1469
|
log.error(`Test Failure: ${err}`);
|
|
@@ -953,7 +1492,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
953
1492
|
a.getRoom(null, (data, error) => {
|
|
954
1493
|
try {
|
|
955
1494
|
const displayE = 'roomId is required';
|
|
956
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1495
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getRoom', displayE);
|
|
957
1496
|
done();
|
|
958
1497
|
} catch (err) {
|
|
959
1498
|
log.error(`Test Failure: ${err}`);
|
|
@@ -982,7 +1521,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
982
1521
|
a.updateRoom(null, null, (data, error) => {
|
|
983
1522
|
try {
|
|
984
1523
|
const displayE = 'roomId is required';
|
|
985
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1524
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updateRoom', displayE);
|
|
986
1525
|
done();
|
|
987
1526
|
} catch (err) {
|
|
988
1527
|
log.error(`Test Failure: ${err}`);
|
|
@@ -999,7 +1538,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
999
1538
|
a.updateRoom('fakeparam', null, (data, error) => {
|
|
1000
1539
|
try {
|
|
1001
1540
|
const displayE = 'body is required';
|
|
1002
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1541
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updateRoom', displayE);
|
|
1003
1542
|
done();
|
|
1004
1543
|
} catch (err) {
|
|
1005
1544
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1028,7 +1567,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1028
1567
|
a.deleteRoom(null, (data, error) => {
|
|
1029
1568
|
try {
|
|
1030
1569
|
const displayE = 'roomId is required';
|
|
1031
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1570
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-deleteRoom', displayE);
|
|
1032
1571
|
done();
|
|
1033
1572
|
} catch (err) {
|
|
1034
1573
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1069,7 +1608,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1069
1608
|
a.createMembership(null, (data, error) => {
|
|
1070
1609
|
try {
|
|
1071
1610
|
const displayE = 'body is required';
|
|
1072
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1611
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-createMembership', displayE);
|
|
1073
1612
|
done();
|
|
1074
1613
|
} catch (err) {
|
|
1075
1614
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1098,7 +1637,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1098
1637
|
a.getMembership(null, (data, error) => {
|
|
1099
1638
|
try {
|
|
1100
1639
|
const displayE = 'membershipId is required';
|
|
1101
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1640
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getMembership', displayE);
|
|
1102
1641
|
done();
|
|
1103
1642
|
} catch (err) {
|
|
1104
1643
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1127,7 +1666,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1127
1666
|
a.updateMembership(null, null, (data, error) => {
|
|
1128
1667
|
try {
|
|
1129
1668
|
const displayE = 'membershipId is required';
|
|
1130
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1669
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updateMembership', displayE);
|
|
1131
1670
|
done();
|
|
1132
1671
|
} catch (err) {
|
|
1133
1672
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1144,7 +1683,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1144
1683
|
a.updateMembership('fakeparam', null, (data, error) => {
|
|
1145
1684
|
try {
|
|
1146
1685
|
const displayE = 'body is required';
|
|
1147
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1686
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updateMembership', displayE);
|
|
1148
1687
|
done();
|
|
1149
1688
|
} catch (err) {
|
|
1150
1689
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1173,7 +1712,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1173
1712
|
a.deleteMembership(null, (data, error) => {
|
|
1174
1713
|
try {
|
|
1175
1714
|
const displayE = 'membershipId is required';
|
|
1176
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1715
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-deleteMembership', displayE);
|
|
1177
1716
|
done();
|
|
1178
1717
|
} catch (err) {
|
|
1179
1718
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1202,7 +1741,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1202
1741
|
a.getMessages(null, null, null, null, null, (data, error) => {
|
|
1203
1742
|
try {
|
|
1204
1743
|
const displayE = 'roomId is required';
|
|
1205
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1744
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getMessages', displayE);
|
|
1206
1745
|
done();
|
|
1207
1746
|
} catch (err) {
|
|
1208
1747
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1231,7 +1770,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1231
1770
|
a.createMessage(null, (data, error) => {
|
|
1232
1771
|
try {
|
|
1233
1772
|
const displayE = 'body is required';
|
|
1234
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1773
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-createMessage', displayE);
|
|
1235
1774
|
done();
|
|
1236
1775
|
} catch (err) {
|
|
1237
1776
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1260,7 +1799,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1260
1799
|
a.getMessage(null, (data, error) => {
|
|
1261
1800
|
try {
|
|
1262
1801
|
const displayE = 'messageId is required';
|
|
1263
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1802
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getMessage', displayE);
|
|
1264
1803
|
done();
|
|
1265
1804
|
} catch (err) {
|
|
1266
1805
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1289,7 +1828,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1289
1828
|
a.deleteMessage(null, (data, error) => {
|
|
1290
1829
|
try {
|
|
1291
1830
|
const displayE = 'messageId is required';
|
|
1292
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1831
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-deleteMessage', displayE);
|
|
1293
1832
|
done();
|
|
1294
1833
|
} catch (err) {
|
|
1295
1834
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1330,7 +1869,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1330
1869
|
a.createTeam(null, (data, error) => {
|
|
1331
1870
|
try {
|
|
1332
1871
|
const displayE = 'body is required';
|
|
1333
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1872
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-createTeam', displayE);
|
|
1334
1873
|
done();
|
|
1335
1874
|
} catch (err) {
|
|
1336
1875
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1359,7 +1898,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1359
1898
|
a.getTeam(null, (data, error) => {
|
|
1360
1899
|
try {
|
|
1361
1900
|
const displayE = 'teamId is required';
|
|
1362
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1901
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getTeam', displayE);
|
|
1363
1902
|
done();
|
|
1364
1903
|
} catch (err) {
|
|
1365
1904
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1388,7 +1927,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1388
1927
|
a.updateTeam(null, null, (data, error) => {
|
|
1389
1928
|
try {
|
|
1390
1929
|
const displayE = 'teamId is required';
|
|
1391
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1930
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updateTeam', displayE);
|
|
1392
1931
|
done();
|
|
1393
1932
|
} catch (err) {
|
|
1394
1933
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1405,7 +1944,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1405
1944
|
a.updateTeam('fakeparam', null, (data, error) => {
|
|
1406
1945
|
try {
|
|
1407
1946
|
const displayE = 'body is required';
|
|
1408
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1947
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updateTeam', displayE);
|
|
1409
1948
|
done();
|
|
1410
1949
|
} catch (err) {
|
|
1411
1950
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1434,7 +1973,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1434
1973
|
a.deleteTeam(null, (data, error) => {
|
|
1435
1974
|
try {
|
|
1436
1975
|
const displayE = 'teamId is required';
|
|
1437
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1976
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-deleteTeam', displayE);
|
|
1438
1977
|
done();
|
|
1439
1978
|
} catch (err) {
|
|
1440
1979
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1463,7 +2002,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1463
2002
|
a.getTeamMemberships(null, null, (data, error) => {
|
|
1464
2003
|
try {
|
|
1465
2004
|
const displayE = 'teamId is required';
|
|
1466
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2005
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getTeamMemberships', displayE);
|
|
1467
2006
|
done();
|
|
1468
2007
|
} catch (err) {
|
|
1469
2008
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1492,7 +2031,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1492
2031
|
a.createTeamMembership(null, (data, error) => {
|
|
1493
2032
|
try {
|
|
1494
2033
|
const displayE = 'body is required';
|
|
1495
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2034
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-createTeamMembership', displayE);
|
|
1496
2035
|
done();
|
|
1497
2036
|
} catch (err) {
|
|
1498
2037
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1521,7 +2060,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1521
2060
|
a.getTeamMembership(null, (data, error) => {
|
|
1522
2061
|
try {
|
|
1523
2062
|
const displayE = 'membershipId is required';
|
|
1524
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2063
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getTeamMembership', displayE);
|
|
1525
2064
|
done();
|
|
1526
2065
|
} catch (err) {
|
|
1527
2066
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1550,7 +2089,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1550
2089
|
a.updateTeamMembership(null, null, (data, error) => {
|
|
1551
2090
|
try {
|
|
1552
2091
|
const displayE = 'membershipId is required';
|
|
1553
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2092
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updateTeamMembership', displayE);
|
|
1554
2093
|
done();
|
|
1555
2094
|
} catch (err) {
|
|
1556
2095
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1567,7 +2106,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1567
2106
|
a.updateTeamMembership('fakeparam', null, (data, error) => {
|
|
1568
2107
|
try {
|
|
1569
2108
|
const displayE = 'body is required';
|
|
1570
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2109
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updateTeamMembership', displayE);
|
|
1571
2110
|
done();
|
|
1572
2111
|
} catch (err) {
|
|
1573
2112
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1596,7 +2135,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1596
2135
|
a.deleteTeamMembership(null, (data, error) => {
|
|
1597
2136
|
try {
|
|
1598
2137
|
const displayE = 'membershipId is required';
|
|
1599
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2138
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-deleteTeamMembership', displayE);
|
|
1600
2139
|
done();
|
|
1601
2140
|
} catch (err) {
|
|
1602
2141
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1637,7 +2176,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1637
2176
|
a.createWebhook(null, (data, error) => {
|
|
1638
2177
|
try {
|
|
1639
2178
|
const displayE = 'body is required';
|
|
1640
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2179
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-createWebhook', displayE);
|
|
1641
2180
|
done();
|
|
1642
2181
|
} catch (err) {
|
|
1643
2182
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1666,7 +2205,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1666
2205
|
a.getWebhook(null, (data, error) => {
|
|
1667
2206
|
try {
|
|
1668
2207
|
const displayE = 'webhookId is required';
|
|
1669
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2208
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getWebhook', displayE);
|
|
1670
2209
|
done();
|
|
1671
2210
|
} catch (err) {
|
|
1672
2211
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1695,7 +2234,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1695
2234
|
a.updateWebhook(null, null, (data, error) => {
|
|
1696
2235
|
try {
|
|
1697
2236
|
const displayE = 'webhookId is required';
|
|
1698
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2237
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updateWebhook', displayE);
|
|
1699
2238
|
done();
|
|
1700
2239
|
} catch (err) {
|
|
1701
2240
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1712,7 +2251,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1712
2251
|
a.updateWebhook('fakeparam', null, (data, error) => {
|
|
1713
2252
|
try {
|
|
1714
2253
|
const displayE = 'body is required';
|
|
1715
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2254
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updateWebhook', displayE);
|
|
1716
2255
|
done();
|
|
1717
2256
|
} catch (err) {
|
|
1718
2257
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1741,7 +2280,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1741
2280
|
a.deleteWebhook(null, (data, error) => {
|
|
1742
2281
|
try {
|
|
1743
2282
|
const displayE = 'webhookId is required';
|
|
1744
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2283
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-deleteWebhook', displayE);
|
|
1745
2284
|
done();
|
|
1746
2285
|
} catch (err) {
|
|
1747
2286
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1782,7 +2321,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1782
2321
|
a.getOrganization(null, (data, error) => {
|
|
1783
2322
|
try {
|
|
1784
2323
|
const displayE = 'orgId is required';
|
|
1785
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2324
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getOrganization', displayE);
|
|
1786
2325
|
done();
|
|
1787
2326
|
} catch (err) {
|
|
1788
2327
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1823,7 +2362,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1823
2362
|
a.getLicense(null, (data, error) => {
|
|
1824
2363
|
try {
|
|
1825
2364
|
const displayE = 'licenseId is required';
|
|
1826
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2365
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getLicense', displayE);
|
|
1827
2366
|
done();
|
|
1828
2367
|
} catch (err) {
|
|
1829
2368
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1864,7 +2403,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1864
2403
|
a.getRole(null, (data, error) => {
|
|
1865
2404
|
try {
|
|
1866
2405
|
const displayE = 'roleId is required';
|
|
1867
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2406
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getRole', displayE);
|
|
1868
2407
|
done();
|
|
1869
2408
|
} catch (err) {
|
|
1870
2409
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1893,7 +2432,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1893
2432
|
a.getContent(null, (data, error) => {
|
|
1894
2433
|
try {
|
|
1895
2434
|
const displayE = 'contentId is required';
|
|
1896
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2435
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getContent', displayE);
|
|
1897
2436
|
done();
|
|
1898
2437
|
} catch (err) {
|
|
1899
2438
|
log.error(`Test Failure: ${err}`);
|