@itentialopensource/adapter-webex_teams 0.5.6 → 0.7.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/AUTH.md +39 -0
- package/BROKER.md +199 -0
- package/CALLS.md +421 -0
- package/CHANGELOG.md +39 -24
- package/CODE_OF_CONDUCT.md +12 -17
- package/CONTRIBUTING.md +3 -148
- package/ENHANCE.md +69 -0
- package/PROPERTIES.md +641 -0
- package/README.md +239 -507
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +11 -0
- package/TROUBLESHOOT.md +47 -0
- package/adapter.js +387 -268
- package/adapterBase.js +854 -408
- package/changelogs/changelog.md +91 -0
- package/entities/.generic/action.json +110 -5
- package/entities/.generic/schema.json +6 -1
- package/error.json +12 -0
- package/metadata.json +60 -0
- package/package.json +28 -22
- package/pronghorn.json +691 -88
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +842 -6
- package/refs?service=git-upload-pack +0 -0
- package/report/adapter-openapi.json +1336 -0
- package/report/adapter-openapi.yaml +1054 -0
- package/report/adapterInfo.json +10 -0
- package/report/updateReport1653575821854.json +120 -0
- package/report/updateReport1691506975130.json +120 -0
- package/report/updateReport1692201585506.json +120 -0
- package/report/updateReport1692203006473.json +120 -0
- package/report/updateReport1694455098258.json +120 -0
- package/report/updateReport1694466795632.json +120 -0
- package/report/updateReport1698422054637.json +120 -0
- package/sampleProperties.json +156 -3
- package/storage/metrics.json +692 -0
- package/test/integration/adapterTestBasicGet.js +4 -6
- package/test/integration/adapterTestConnectivity.js +91 -42
- package/test/integration/adapterTestIntegration.js +167 -113
- package/test/unit/adapterBaseTestUnit.js +393 -310
- package/test/unit/adapterTestUnit.js +873 -249
- package/utils/adapterInfo.js +206 -0
- package/utils/addAuth.js +94 -0
- package/utils/artifactize.js +1 -1
- package/utils/basicGet.js +1 -14
- package/utils/checkMigrate.js +1 -1
- package/utils/entitiesToDB.js +179 -0
- package/utils/findPath.js +1 -1
- package/utils/methodDocumentor.js +273 -0
- package/utils/modify.js +14 -16
- package/utils/packModificationScript.js +2 -2
- package/utils/patches2bundledDeps.js +90 -0
- package/utils/pre-commit.sh +5 -0
- package/utils/removeHooks.js +20 -0
- package/utils/taskMover.js +309 -0
- package/utils/tbScript.js +129 -53
- package/utils/tbUtils.js +152 -35
- package/utils/testRunner.js +17 -17
- package/utils/troubleshootingAdapter.js +10 -31
- package/workflows/README.md +0 -3
|
@@ -4,36 +4,48 @@
|
|
|
4
4
|
/* global describe it log pronghornProps */
|
|
5
5
|
/* eslint global-require: warn */
|
|
6
6
|
/* eslint no-unused-vars: warn */
|
|
7
|
+
/* eslint import/no-dynamic-require:warn */
|
|
7
8
|
|
|
8
9
|
// include required items for testing & logging
|
|
9
10
|
const assert = require('assert');
|
|
10
|
-
const fs = require('fs-extra');
|
|
11
|
-
const mocha = require('mocha');
|
|
12
11
|
const path = require('path');
|
|
13
12
|
const util = require('util');
|
|
14
|
-
const winston = require('winston');
|
|
15
13
|
const execute = require('child_process').execSync;
|
|
14
|
+
const fs = require('fs-extra');
|
|
15
|
+
const mocha = require('mocha');
|
|
16
|
+
const winston = require('winston');
|
|
16
17
|
const { expect } = require('chai');
|
|
17
18
|
const { use } = require('chai');
|
|
18
19
|
const td = require('testdouble');
|
|
20
|
+
const Ajv = require('ajv');
|
|
19
21
|
|
|
22
|
+
const ajv = new Ajv({ strictSchema: false, allErrors: true, allowUnionTypes: true });
|
|
20
23
|
const anything = td.matchers.anything();
|
|
21
|
-
|
|
22
|
-
// stub and attemptTimeout are used throughout the code so set them here
|
|
23
24
|
let logLevel = 'none';
|
|
24
|
-
const stub = true;
|
|
25
25
|
const isRapidFail = false;
|
|
26
|
-
|
|
26
|
+
|
|
27
|
+
// read in the properties from the sampleProperties files
|
|
28
|
+
let adaptdir = __dirname;
|
|
29
|
+
if (adaptdir.endsWith('/test/integration')) {
|
|
30
|
+
adaptdir = adaptdir.substring(0, adaptdir.length - 17);
|
|
31
|
+
} else if (adaptdir.endsWith('/test/unit')) {
|
|
32
|
+
adaptdir = adaptdir.substring(0, adaptdir.length - 10);
|
|
33
|
+
}
|
|
34
|
+
const samProps = require(`${adaptdir}/sampleProperties.json`).properties;
|
|
27
35
|
|
|
28
36
|
// these variables can be changed to run in integrated mode so easier to set them here
|
|
29
37
|
// always check these in with bogus data!!!
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
samProps.stub = true;
|
|
39
|
+
samProps.host = 'replace.hostorip.here';
|
|
40
|
+
samProps.authentication.username = 'username';
|
|
41
|
+
samProps.authentication.password = 'password';
|
|
42
|
+
samProps.protocol = 'http';
|
|
43
|
+
samProps.port = 80;
|
|
44
|
+
samProps.ssl.enabled = false;
|
|
45
|
+
samProps.ssl.accept_invalid_cert = false;
|
|
46
|
+
samProps.request.attempt_timeout = 1200000;
|
|
47
|
+
const attemptTimeout = samProps.request.attempt_timeout;
|
|
48
|
+
const { stub } = samProps;
|
|
37
49
|
|
|
38
50
|
// these are the adapter properties. You generally should not need to alter
|
|
39
51
|
// any of these after they are initially set up
|
|
@@ -43,101 +55,9 @@ global.pronghornProps = {
|
|
|
43
55
|
},
|
|
44
56
|
adapterProps: {
|
|
45
57
|
adapters: [{
|
|
46
|
-
id: 'Test-
|
|
58
|
+
id: 'Test-webex_teams',
|
|
47
59
|
type: 'WebexTeams',
|
|
48
|
-
properties:
|
|
49
|
-
host,
|
|
50
|
-
port,
|
|
51
|
-
base_path: '//api',
|
|
52
|
-
version: 'v1.3.1',
|
|
53
|
-
cache_location: 'none',
|
|
54
|
-
encode_pathvars: true,
|
|
55
|
-
save_metric: false,
|
|
56
|
-
stub,
|
|
57
|
-
protocol,
|
|
58
|
-
authentication: {
|
|
59
|
-
auth_method: 'no_authentication',
|
|
60
|
-
username,
|
|
61
|
-
password,
|
|
62
|
-
token: '',
|
|
63
|
-
token_timeout: -1,
|
|
64
|
-
token_cache: 'local',
|
|
65
|
-
invalid_token_error: 401,
|
|
66
|
-
auth_field: 'header.headers.Authorization',
|
|
67
|
-
auth_field_format: 'Basic {b64}{username}:{password}{/b64}',
|
|
68
|
-
auth_logging: false
|
|
69
|
-
},
|
|
70
|
-
healthcheck: {
|
|
71
|
-
type: 'none',
|
|
72
|
-
frequency: 60000,
|
|
73
|
-
query_object: {}
|
|
74
|
-
},
|
|
75
|
-
throttle: {
|
|
76
|
-
throttle_enabled: false,
|
|
77
|
-
number_pronghorns: 1,
|
|
78
|
-
sync_async: 'sync',
|
|
79
|
-
max_in_queue: 1000,
|
|
80
|
-
concurrent_max: 1,
|
|
81
|
-
expire_timeout: 0,
|
|
82
|
-
avg_runtime: 200,
|
|
83
|
-
priorities: [
|
|
84
|
-
{
|
|
85
|
-
value: 0,
|
|
86
|
-
percent: 100
|
|
87
|
-
}
|
|
88
|
-
]
|
|
89
|
-
},
|
|
90
|
-
request: {
|
|
91
|
-
number_redirects: 0,
|
|
92
|
-
number_retries: 3,
|
|
93
|
-
limit_retry_error: 0,
|
|
94
|
-
failover_codes: [],
|
|
95
|
-
attempt_timeout: attemptTimeout,
|
|
96
|
-
global_request: {
|
|
97
|
-
payload: {},
|
|
98
|
-
uriOptions: {},
|
|
99
|
-
addlHeaders: {},
|
|
100
|
-
authData: {}
|
|
101
|
-
},
|
|
102
|
-
healthcheck_on_timeout: true,
|
|
103
|
-
return_raw: true,
|
|
104
|
-
archiving: false,
|
|
105
|
-
return_request: false
|
|
106
|
-
},
|
|
107
|
-
proxy: {
|
|
108
|
-
enabled: false,
|
|
109
|
-
host: '',
|
|
110
|
-
port: 1,
|
|
111
|
-
protocol: 'http',
|
|
112
|
-
username: '',
|
|
113
|
-
password: ''
|
|
114
|
-
},
|
|
115
|
-
ssl: {
|
|
116
|
-
ecdhCurve: '',
|
|
117
|
-
enabled: sslenable,
|
|
118
|
-
accept_invalid_cert: sslinvalid,
|
|
119
|
-
ca_file: '',
|
|
120
|
-
key_file: '',
|
|
121
|
-
cert_file: '',
|
|
122
|
-
secure_protocol: '',
|
|
123
|
-
ciphers: ''
|
|
124
|
-
},
|
|
125
|
-
mongo: {
|
|
126
|
-
host: '',
|
|
127
|
-
port: 0,
|
|
128
|
-
database: '',
|
|
129
|
-
username,
|
|
130
|
-
password: '',
|
|
131
|
-
replSet: '',
|
|
132
|
-
db_ssl: {
|
|
133
|
-
enabled: false,
|
|
134
|
-
accept_invalid_cert: false,
|
|
135
|
-
ca_file: '',
|
|
136
|
-
key_file: '',
|
|
137
|
-
cert_file: ''
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
60
|
+
properties: samProps
|
|
141
61
|
}]
|
|
142
62
|
}
|
|
143
63
|
};
|
|
@@ -198,7 +118,7 @@ function runErrorAsserts(data, error, code, origin, displayStr) {
|
|
|
198
118
|
}
|
|
199
119
|
|
|
200
120
|
// require the adapter that we are going to be using
|
|
201
|
-
const WebexTeams = require('../../adapter
|
|
121
|
+
const WebexTeams = require('../../adapter');
|
|
202
122
|
|
|
203
123
|
// delete the .DS_Store directory in entities -- otherwise this will cause errors
|
|
204
124
|
const dirPath = path.join(__dirname, '../../entities/.DS_Store');
|
|
@@ -240,6 +160,8 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
240
160
|
try {
|
|
241
161
|
assert.notEqual(null, a);
|
|
242
162
|
assert.notEqual(undefined, a);
|
|
163
|
+
const checkId = global.pronghornProps.adapterProps.adapters[0].id;
|
|
164
|
+
assert.equal(checkId, a.id);
|
|
243
165
|
assert.notEqual(null, a.allProps);
|
|
244
166
|
const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
|
|
245
167
|
assert.equal(check, a.healthcheckType);
|
|
@@ -266,10 +188,10 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
266
188
|
});
|
|
267
189
|
|
|
268
190
|
let wffunctions = [];
|
|
269
|
-
describe('#
|
|
191
|
+
describe('#iapGetAdapterWorkflowFunctions', () => {
|
|
270
192
|
it('should retrieve workflow functions', (done) => {
|
|
271
193
|
try {
|
|
272
|
-
wffunctions = a.
|
|
194
|
+
wffunctions = a.iapGetAdapterWorkflowFunctions([]);
|
|
273
195
|
|
|
274
196
|
try {
|
|
275
197
|
assert.notEqual(0, wffunctions.length);
|
|
@@ -300,19 +222,24 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
300
222
|
it('package.json should be validated', (done) => {
|
|
301
223
|
try {
|
|
302
224
|
const packageDotJson = require('../../package.json');
|
|
303
|
-
|
|
304
|
-
const
|
|
305
|
-
|
|
306
|
-
|
|
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']
|
|
307
234
|
};
|
|
308
|
-
const
|
|
235
|
+
const validate = ajv.compile(packageJsonSchema);
|
|
236
|
+
const isValid = validate(packageDotJson);
|
|
309
237
|
|
|
310
|
-
if (
|
|
311
|
-
log.error('The package.json contains
|
|
312
|
-
|
|
313
|
-
assert.equal(true, results.valid);
|
|
238
|
+
if (isValid === false) {
|
|
239
|
+
log.error('The package.json contains errors');
|
|
240
|
+
assert.equal(true, isValid);
|
|
314
241
|
} else {
|
|
315
|
-
assert.equal(true,
|
|
242
|
+
assert.equal(true, isValid);
|
|
316
243
|
}
|
|
317
244
|
|
|
318
245
|
done();
|
|
@@ -321,13 +248,102 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
321
248
|
done(error);
|
|
322
249
|
}
|
|
323
250
|
});
|
|
324
|
-
it('package.json should be customized', (done) => {
|
|
251
|
+
it('package.json standard fields should be customized', (done) => {
|
|
325
252
|
try {
|
|
326
253
|
const packageDotJson = require('../../package.json');
|
|
327
254
|
assert.notEqual(-1, packageDotJson.name.indexOf('webex_teams'));
|
|
328
255
|
assert.notEqual(undefined, packageDotJson.version);
|
|
329
256
|
assert.notEqual(null, packageDotJson.version);
|
|
330
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.6.3', 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);
|
|
331
347
|
done();
|
|
332
348
|
} catch (error) {
|
|
333
349
|
log.error(`Test Failure: ${error}`);
|
|
@@ -352,8 +368,49 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
352
368
|
try {
|
|
353
369
|
const pronghornDotJson = require('../../pronghorn.json');
|
|
354
370
|
assert.notEqual(-1, pronghornDotJson.id.indexOf('webex_teams'));
|
|
371
|
+
assert.equal('Adapter', pronghornDotJson.type);
|
|
355
372
|
assert.equal('WebexTeams', pronghornDotJson.export);
|
|
356
373
|
assert.equal('WebexTeams', 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'));
|
|
357
414
|
done();
|
|
358
415
|
} catch (error) {
|
|
359
416
|
log.error(`Test Failure: ${error}`);
|
|
@@ -474,6 +531,39 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
474
531
|
done(error);
|
|
475
532
|
}
|
|
476
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
|
+
});
|
|
477
567
|
});
|
|
478
568
|
|
|
479
569
|
describe('propertiesSchema.json', () => {
|
|
@@ -492,6 +582,124 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
492
582
|
try {
|
|
493
583
|
const propertiesDotJson = require('../../propertiesSchema.json');
|
|
494
584
|
assert.equal('adapter-webex_teams', 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);
|
|
495
703
|
done();
|
|
496
704
|
} catch (error) {
|
|
497
705
|
log.error(`Test Failure: ${error}`);
|
|
@@ -512,6 +720,50 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
512
720
|
done(error);
|
|
513
721
|
}
|
|
514
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
|
+
});
|
|
515
767
|
});
|
|
516
768
|
|
|
517
769
|
describe('sampleProperties.json', () => {
|
|
@@ -526,6 +778,123 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
526
778
|
done(error);
|
|
527
779
|
}
|
|
528
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('webex_teams'));
|
|
785
|
+
assert.equal('WebexTeams', sampleDotJson.type);
|
|
786
|
+
assert.notEqual(undefined, sampleDotJson.properties);
|
|
787
|
+
assert.notEqual(null, sampleDotJson.properties);
|
|
788
|
+
assert.notEqual('', sampleDotJson.properties);
|
|
789
|
+
assert.notEqual(undefined, sampleDotJson.properties.host);
|
|
790
|
+
assert.notEqual(undefined, sampleDotJson.properties.port);
|
|
791
|
+
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
792
|
+
assert.notEqual(undefined, sampleDotJson.properties.protocol);
|
|
793
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication);
|
|
794
|
+
assert.notEqual(null, sampleDotJson.properties.authentication);
|
|
795
|
+
assert.notEqual('', sampleDotJson.properties.authentication);
|
|
796
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_method);
|
|
797
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.username);
|
|
798
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.password);
|
|
799
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.token);
|
|
800
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.invalid_token_error);
|
|
801
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.token_timeout);
|
|
802
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.token_cache);
|
|
803
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field);
|
|
804
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field_format);
|
|
805
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_logging);
|
|
806
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.client_id);
|
|
807
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.client_secret);
|
|
808
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.grant_type);
|
|
809
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl);
|
|
810
|
+
assert.notEqual(null, sampleDotJson.properties.ssl);
|
|
811
|
+
assert.notEqual('', sampleDotJson.properties.ssl);
|
|
812
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.ecdhCurve);
|
|
813
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.enabled);
|
|
814
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.accept_invalid_cert);
|
|
815
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.ca_file);
|
|
816
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.key_file);
|
|
817
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.cert_file);
|
|
818
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.secure_protocol);
|
|
819
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.ciphers);
|
|
820
|
+
assert.notEqual(undefined, sampleDotJson.properties.base_path);
|
|
821
|
+
assert.notEqual(undefined, sampleDotJson.properties.version);
|
|
822
|
+
assert.notEqual(undefined, sampleDotJson.properties.cache_location);
|
|
823
|
+
assert.notEqual(undefined, sampleDotJson.properties.encode_pathvars);
|
|
824
|
+
assert.notEqual(undefined, sampleDotJson.properties.encode_queryvars);
|
|
825
|
+
assert.notEqual(undefined, sampleDotJson.properties.save_metric);
|
|
826
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck);
|
|
827
|
+
assert.notEqual(null, sampleDotJson.properties.healthcheck);
|
|
828
|
+
assert.notEqual('', sampleDotJson.properties.healthcheck);
|
|
829
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck.type);
|
|
830
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck.frequency);
|
|
831
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck.query_object);
|
|
832
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle);
|
|
833
|
+
assert.notEqual(null, sampleDotJson.properties.throttle);
|
|
834
|
+
assert.notEqual('', sampleDotJson.properties.throttle);
|
|
835
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.throttle_enabled);
|
|
836
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.number_pronghorns);
|
|
837
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.sync_async);
|
|
838
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.max_in_queue);
|
|
839
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.concurrent_max);
|
|
840
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.expire_timeout);
|
|
841
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.avg_runtime);
|
|
842
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.priorities);
|
|
843
|
+
assert.notEqual(undefined, sampleDotJson.properties.request);
|
|
844
|
+
assert.notEqual(null, sampleDotJson.properties.request);
|
|
845
|
+
assert.notEqual('', sampleDotJson.properties.request);
|
|
846
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.number_redirects);
|
|
847
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.number_retries);
|
|
848
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.limit_retry_error);
|
|
849
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.failover_codes);
|
|
850
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.attempt_timeout);
|
|
851
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request);
|
|
852
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.payload);
|
|
853
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.uriOptions);
|
|
854
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.addlHeaders);
|
|
855
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.authData);
|
|
856
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.healthcheck_on_timeout);
|
|
857
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.return_raw);
|
|
858
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.archiving);
|
|
859
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.return_request);
|
|
860
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy);
|
|
861
|
+
assert.notEqual(null, sampleDotJson.properties.proxy);
|
|
862
|
+
assert.notEqual('', sampleDotJson.properties.proxy);
|
|
863
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.enabled);
|
|
864
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.host);
|
|
865
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.port);
|
|
866
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.protocol);
|
|
867
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.username);
|
|
868
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.password);
|
|
869
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo);
|
|
870
|
+
assert.notEqual(null, sampleDotJson.properties.mongo);
|
|
871
|
+
assert.notEqual('', sampleDotJson.properties.mongo);
|
|
872
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.host);
|
|
873
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.port);
|
|
874
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.database);
|
|
875
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.username);
|
|
876
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.password);
|
|
877
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.replSet);
|
|
878
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl);
|
|
879
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.enabled);
|
|
880
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.accept_invalid_cert);
|
|
881
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.ca_file);
|
|
882
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.key_file);
|
|
883
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.cert_file);
|
|
884
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker);
|
|
885
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevice);
|
|
886
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevicesFiltered);
|
|
887
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.isAlive);
|
|
888
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getConfig);
|
|
889
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getCount);
|
|
890
|
+
assert.notEqual(undefined, sampleDotJson.properties.cache);
|
|
891
|
+
assert.notEqual(undefined, sampleDotJson.properties.cache.entities);
|
|
892
|
+
done();
|
|
893
|
+
} catch (error) {
|
|
894
|
+
log.error(`Test Failure: ${error}`);
|
|
895
|
+
done(error);
|
|
896
|
+
}
|
|
897
|
+
});
|
|
529
898
|
});
|
|
530
899
|
|
|
531
900
|
describe('#checkProperties', () => {
|
|
@@ -613,10 +982,10 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
613
982
|
});
|
|
614
983
|
});
|
|
615
984
|
|
|
616
|
-
describe('#
|
|
617
|
-
it('should have a
|
|
985
|
+
describe('#iapUpdateAdapterConfiguration', () => {
|
|
986
|
+
it('should have a iapUpdateAdapterConfiguration function', (done) => {
|
|
618
987
|
try {
|
|
619
|
-
assert.equal(true, typeof a.
|
|
988
|
+
assert.equal(true, typeof a.iapUpdateAdapterConfiguration === 'function');
|
|
620
989
|
done();
|
|
621
990
|
} catch (error) {
|
|
622
991
|
log.error(`Test Failure: ${error}`);
|
|
@@ -625,44 +994,34 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
625
994
|
});
|
|
626
995
|
});
|
|
627
996
|
|
|
628
|
-
describe('#
|
|
629
|
-
it('should have a
|
|
997
|
+
describe('#iapSuspendAdapter', () => {
|
|
998
|
+
it('should have a iapSuspendAdapter function', (done) => {
|
|
630
999
|
try {
|
|
631
|
-
assert.equal(true, typeof a.
|
|
1000
|
+
assert.equal(true, typeof a.iapSuspendAdapter === 'function');
|
|
632
1001
|
done();
|
|
633
1002
|
} catch (error) {
|
|
634
1003
|
log.error(`Test Failure: ${error}`);
|
|
635
1004
|
done(error);
|
|
636
1005
|
}
|
|
637
1006
|
});
|
|
638
|
-
|
|
1007
|
+
});
|
|
1008
|
+
|
|
1009
|
+
describe('#iapUnsuspendAdapter', () => {
|
|
1010
|
+
it('should have a iapUnsuspendAdapter function', (done) => {
|
|
639
1011
|
try {
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
assert.equal(undefined, error);
|
|
643
|
-
assert.notEqual(undefined, data);
|
|
644
|
-
assert.notEqual(null, data);
|
|
645
|
-
assert.equal(true, data.found);
|
|
646
|
-
assert.notEqual(undefined, data.foundIn);
|
|
647
|
-
assert.notEqual(null, data.foundIn);
|
|
648
|
-
assert.notEqual(0, data.foundIn.length);
|
|
649
|
-
done();
|
|
650
|
-
} catch (err) {
|
|
651
|
-
log.error(`Test Failure: ${err}`);
|
|
652
|
-
done(err);
|
|
653
|
-
}
|
|
654
|
-
});
|
|
1012
|
+
assert.equal(true, typeof a.iapUnsuspendAdapter === 'function');
|
|
1013
|
+
done();
|
|
655
1014
|
} catch (error) {
|
|
656
|
-
log.error(`
|
|
1015
|
+
log.error(`Test Failure: ${error}`);
|
|
657
1016
|
done(error);
|
|
658
1017
|
}
|
|
659
|
-
})
|
|
1018
|
+
});
|
|
660
1019
|
});
|
|
661
1020
|
|
|
662
|
-
describe('#
|
|
663
|
-
it('should have a
|
|
1021
|
+
describe('#iapGetAdapterQueue', () => {
|
|
1022
|
+
it('should have a iapGetAdapterQueue function', (done) => {
|
|
664
1023
|
try {
|
|
665
|
-
assert.equal(true, typeof a.
|
|
1024
|
+
assert.equal(true, typeof a.iapGetAdapterQueue === 'function');
|
|
666
1025
|
done();
|
|
667
1026
|
} catch (error) {
|
|
668
1027
|
log.error(`Test Failure: ${error}`);
|
|
@@ -671,22 +1030,44 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
671
1030
|
});
|
|
672
1031
|
});
|
|
673
1032
|
|
|
674
|
-
describe('#
|
|
675
|
-
it('should have a
|
|
1033
|
+
describe('#iapFindAdapterPath', () => {
|
|
1034
|
+
it('should have a iapFindAdapterPath function', (done) => {
|
|
676
1035
|
try {
|
|
677
|
-
assert.equal(true, typeof a.
|
|
1036
|
+
assert.equal(true, typeof a.iapFindAdapterPath === 'function');
|
|
678
1037
|
done();
|
|
679
1038
|
} catch (error) {
|
|
680
1039
|
log.error(`Test Failure: ${error}`);
|
|
681
1040
|
done(error);
|
|
682
1041
|
}
|
|
683
1042
|
});
|
|
1043
|
+
it('iapFindAdapterPath should find atleast one path that matches', (done) => {
|
|
1044
|
+
try {
|
|
1045
|
+
a.iapFindAdapterPath('{base_path}/{version}', (data, error) => {
|
|
1046
|
+
try {
|
|
1047
|
+
assert.equal(undefined, error);
|
|
1048
|
+
assert.notEqual(undefined, data);
|
|
1049
|
+
assert.notEqual(null, data);
|
|
1050
|
+
assert.equal(true, data.found);
|
|
1051
|
+
assert.notEqual(undefined, data.foundIn);
|
|
1052
|
+
assert.notEqual(null, data.foundIn);
|
|
1053
|
+
assert.notEqual(0, data.foundIn.length);
|
|
1054
|
+
done();
|
|
1055
|
+
} catch (err) {
|
|
1056
|
+
log.error(`Test Failure: ${err}`);
|
|
1057
|
+
done(err);
|
|
1058
|
+
}
|
|
1059
|
+
});
|
|
1060
|
+
} catch (error) {
|
|
1061
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1062
|
+
done(error);
|
|
1063
|
+
}
|
|
1064
|
+
}).timeout(attemptTimeout);
|
|
684
1065
|
});
|
|
685
1066
|
|
|
686
|
-
describe('#
|
|
687
|
-
it('should have a
|
|
1067
|
+
describe('#iapTroubleshootAdapter', () => {
|
|
1068
|
+
it('should have a iapTroubleshootAdapter function', (done) => {
|
|
688
1069
|
try {
|
|
689
|
-
assert.equal(true, typeof a.
|
|
1070
|
+
assert.equal(true, typeof a.iapTroubleshootAdapter === 'function');
|
|
690
1071
|
done();
|
|
691
1072
|
} catch (error) {
|
|
692
1073
|
log.error(`Test Failure: ${error}`);
|
|
@@ -695,10 +1076,10 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
695
1076
|
});
|
|
696
1077
|
});
|
|
697
1078
|
|
|
698
|
-
describe('#
|
|
699
|
-
it('should have a
|
|
1079
|
+
describe('#iapRunAdapterHealthcheck', () => {
|
|
1080
|
+
it('should have a iapRunAdapterHealthcheck function', (done) => {
|
|
700
1081
|
try {
|
|
701
|
-
assert.equal(true, typeof a.
|
|
1082
|
+
assert.equal(true, typeof a.iapRunAdapterHealthcheck === 'function');
|
|
702
1083
|
done();
|
|
703
1084
|
} catch (error) {
|
|
704
1085
|
log.error(`Test Failure: ${error}`);
|
|
@@ -707,10 +1088,10 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
707
1088
|
});
|
|
708
1089
|
});
|
|
709
1090
|
|
|
710
|
-
describe('#
|
|
711
|
-
it('should have a
|
|
1091
|
+
describe('#iapRunAdapterConnectivity', () => {
|
|
1092
|
+
it('should have a iapRunAdapterConnectivity function', (done) => {
|
|
712
1093
|
try {
|
|
713
|
-
assert.equal(true, typeof a.
|
|
1094
|
+
assert.equal(true, typeof a.iapRunAdapterConnectivity === 'function');
|
|
714
1095
|
done();
|
|
715
1096
|
} catch (error) {
|
|
716
1097
|
log.error(`Test Failure: ${error}`);
|
|
@@ -719,10 +1100,10 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
719
1100
|
});
|
|
720
1101
|
});
|
|
721
1102
|
|
|
722
|
-
describe('#
|
|
723
|
-
it('should have a
|
|
1103
|
+
describe('#iapRunAdapterBasicGet', () => {
|
|
1104
|
+
it('should have a iapRunAdapterBasicGet function', (done) => {
|
|
724
1105
|
try {
|
|
725
|
-
assert.equal(true, typeof a.
|
|
1106
|
+
assert.equal(true, typeof a.iapRunAdapterBasicGet === 'function');
|
|
726
1107
|
done();
|
|
727
1108
|
} catch (error) {
|
|
728
1109
|
log.error(`Test Failure: ${error}`);
|
|
@@ -731,10 +1112,10 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
731
1112
|
});
|
|
732
1113
|
});
|
|
733
1114
|
|
|
734
|
-
describe('#
|
|
735
|
-
it('should have a
|
|
1115
|
+
describe('#iapMoveAdapterEntitiesToDB', () => {
|
|
1116
|
+
it('should have a iapMoveAdapterEntitiesToDB function', (done) => {
|
|
736
1117
|
try {
|
|
737
|
-
assert.equal(true, typeof a.
|
|
1118
|
+
assert.equal(true, typeof a.iapMoveAdapterEntitiesToDB === 'function');
|
|
738
1119
|
done();
|
|
739
1120
|
} catch (error) {
|
|
740
1121
|
log.error(`Test Failure: ${error}`);
|
|
@@ -828,50 +1209,293 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
828
1209
|
}).timeout(attemptTimeout);
|
|
829
1210
|
});
|
|
830
1211
|
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
1212
|
+
describe('#iapDeactivateTasks', () => {
|
|
1213
|
+
it('should have a iapDeactivateTasks function', (done) => {
|
|
1214
|
+
try {
|
|
1215
|
+
assert.equal(true, typeof a.iapDeactivateTasks === 'function');
|
|
1216
|
+
done();
|
|
1217
|
+
} catch (error) {
|
|
1218
|
+
log.error(`Test Failure: ${error}`);
|
|
1219
|
+
done(error);
|
|
1220
|
+
}
|
|
1221
|
+
});
|
|
1222
|
+
});
|
|
1223
|
+
|
|
1224
|
+
describe('#iapActivateTasks', () => {
|
|
1225
|
+
it('should have a iapActivateTasks function', (done) => {
|
|
1226
|
+
try {
|
|
1227
|
+
assert.equal(true, typeof a.iapActivateTasks === 'function');
|
|
1228
|
+
done();
|
|
1229
|
+
} catch (error) {
|
|
1230
|
+
log.error(`Test Failure: ${error}`);
|
|
1231
|
+
done(error);
|
|
1232
|
+
}
|
|
1233
|
+
});
|
|
1234
|
+
});
|
|
1235
|
+
|
|
1236
|
+
describe('#iapPopulateEntityCache', () => {
|
|
1237
|
+
it('should have a iapPopulateEntityCache function', (done) => {
|
|
1238
|
+
try {
|
|
1239
|
+
assert.equal(true, typeof a.iapPopulateEntityCache === 'function');
|
|
1240
|
+
done();
|
|
1241
|
+
} catch (error) {
|
|
1242
|
+
log.error(`Test Failure: ${error}`);
|
|
1243
|
+
done(error);
|
|
1244
|
+
}
|
|
1245
|
+
});
|
|
1246
|
+
});
|
|
1247
|
+
|
|
1248
|
+
describe('#iapRetrieveEntitiesCache', () => {
|
|
1249
|
+
it('should have a iapRetrieveEntitiesCache function', (done) => {
|
|
1250
|
+
try {
|
|
1251
|
+
assert.equal(true, typeof a.iapRetrieveEntitiesCache === 'function');
|
|
1252
|
+
done();
|
|
1253
|
+
} catch (error) {
|
|
1254
|
+
log.error(`Test Failure: ${error}`);
|
|
1255
|
+
done(error);
|
|
1256
|
+
}
|
|
1257
|
+
});
|
|
1258
|
+
});
|
|
1259
|
+
|
|
1260
|
+
describe('#hasEntities', () => {
|
|
1261
|
+
it('should have a hasEntities function', (done) => {
|
|
1262
|
+
try {
|
|
1263
|
+
assert.equal(true, typeof a.hasEntities === 'function');
|
|
1264
|
+
done();
|
|
1265
|
+
} catch (error) {
|
|
1266
|
+
log.error(`Test Failure: ${error}`);
|
|
1267
|
+
done(error);
|
|
1268
|
+
}
|
|
1269
|
+
});
|
|
1270
|
+
});
|
|
1271
|
+
|
|
1272
|
+
describe('#getDevice', () => {
|
|
1273
|
+
it('should have a getDevice function', (done) => {
|
|
1274
|
+
try {
|
|
1275
|
+
assert.equal(true, typeof a.getDevice === 'function');
|
|
1276
|
+
done();
|
|
1277
|
+
} catch (error) {
|
|
1278
|
+
log.error(`Test Failure: ${error}`);
|
|
1279
|
+
done(error);
|
|
1280
|
+
}
|
|
1281
|
+
});
|
|
1282
|
+
});
|
|
1283
|
+
|
|
1284
|
+
describe('#getDevicesFiltered', () => {
|
|
1285
|
+
it('should have a getDevicesFiltered function', (done) => {
|
|
1286
|
+
try {
|
|
1287
|
+
assert.equal(true, typeof a.getDevicesFiltered === 'function');
|
|
1288
|
+
done();
|
|
1289
|
+
} catch (error) {
|
|
1290
|
+
log.error(`Test Failure: ${error}`);
|
|
1291
|
+
done(error);
|
|
1292
|
+
}
|
|
1293
|
+
});
|
|
1294
|
+
});
|
|
1295
|
+
|
|
1296
|
+
describe('#isAlive', () => {
|
|
1297
|
+
it('should have a isAlive function', (done) => {
|
|
1298
|
+
try {
|
|
1299
|
+
assert.equal(true, typeof a.isAlive === 'function');
|
|
1300
|
+
done();
|
|
1301
|
+
} catch (error) {
|
|
1302
|
+
log.error(`Test Failure: ${error}`);
|
|
1303
|
+
done(error);
|
|
1304
|
+
}
|
|
1305
|
+
});
|
|
1306
|
+
});
|
|
1307
|
+
|
|
1308
|
+
describe('#getConfig', () => {
|
|
1309
|
+
it('should have a getConfig function', (done) => {
|
|
1310
|
+
try {
|
|
1311
|
+
assert.equal(true, typeof a.getConfig === 'function');
|
|
1312
|
+
done();
|
|
1313
|
+
} catch (error) {
|
|
1314
|
+
log.error(`Test Failure: ${error}`);
|
|
1315
|
+
done(error);
|
|
1316
|
+
}
|
|
1317
|
+
});
|
|
1318
|
+
});
|
|
1319
|
+
|
|
1320
|
+
describe('#iapGetDeviceCount', () => {
|
|
1321
|
+
it('should have a iapGetDeviceCount function', (done) => {
|
|
1322
|
+
try {
|
|
1323
|
+
assert.equal(true, typeof a.iapGetDeviceCount === 'function');
|
|
1324
|
+
done();
|
|
1325
|
+
} catch (error) {
|
|
1326
|
+
log.error(`Test Failure: ${error}`);
|
|
1327
|
+
done(error);
|
|
1328
|
+
}
|
|
1329
|
+
});
|
|
1330
|
+
});
|
|
1331
|
+
|
|
1332
|
+
describe('#iapExpandedGenericAdapterRequest', () => {
|
|
1333
|
+
it('should have a iapExpandedGenericAdapterRequest function', (done) => {
|
|
1334
|
+
try {
|
|
1335
|
+
assert.equal(true, typeof a.iapExpandedGenericAdapterRequest === 'function');
|
|
1336
|
+
done();
|
|
1337
|
+
} catch (error) {
|
|
1338
|
+
log.error(`Test Failure: ${error}`);
|
|
1339
|
+
done(error);
|
|
1340
|
+
}
|
|
1341
|
+
});
|
|
1342
|
+
});
|
|
1343
|
+
|
|
1344
|
+
describe('#genericAdapterRequest', () => {
|
|
1345
|
+
it('should have a genericAdapterRequest function', (done) => {
|
|
1346
|
+
try {
|
|
1347
|
+
assert.equal(true, typeof a.genericAdapterRequest === 'function');
|
|
1348
|
+
done();
|
|
1349
|
+
} catch (error) {
|
|
1350
|
+
log.error(`Test Failure: ${error}`);
|
|
1351
|
+
done(error);
|
|
1352
|
+
}
|
|
1353
|
+
});
|
|
1354
|
+
});
|
|
1355
|
+
|
|
1356
|
+
describe('#genericAdapterRequestNoBasePath', () => {
|
|
1357
|
+
it('should have a genericAdapterRequestNoBasePath function', (done) => {
|
|
1358
|
+
try {
|
|
1359
|
+
assert.equal(true, typeof a.genericAdapterRequestNoBasePath === 'function');
|
|
1360
|
+
done();
|
|
1361
|
+
} catch (error) {
|
|
1362
|
+
log.error(`Test Failure: ${error}`);
|
|
1363
|
+
done(error);
|
|
1364
|
+
}
|
|
1365
|
+
});
|
|
1366
|
+
});
|
|
1367
|
+
|
|
1368
|
+
describe('#iapRunAdapterLint', () => {
|
|
1369
|
+
it('should have a iapRunAdapterLint function', (done) => {
|
|
1370
|
+
try {
|
|
1371
|
+
assert.equal(true, typeof a.iapRunAdapterLint === 'function');
|
|
1372
|
+
done();
|
|
1373
|
+
} catch (error) {
|
|
1374
|
+
log.error(`Test Failure: ${error}`);
|
|
1375
|
+
done(error);
|
|
1376
|
+
}
|
|
1377
|
+
});
|
|
1378
|
+
it('retrieve the lint results', (done) => {
|
|
1379
|
+
try {
|
|
1380
|
+
a.iapRunAdapterLint((data, error) => {
|
|
1381
|
+
try {
|
|
1382
|
+
assert.equal(undefined, error);
|
|
1383
|
+
assert.notEqual(undefined, data);
|
|
1384
|
+
assert.notEqual(null, data);
|
|
1385
|
+
assert.notEqual(undefined, data.status);
|
|
1386
|
+
assert.notEqual(null, data.status);
|
|
1387
|
+
assert.equal('SUCCESS', data.status);
|
|
1388
|
+
done();
|
|
1389
|
+
} catch (err) {
|
|
1390
|
+
log.error(`Test Failure: ${err}`);
|
|
1391
|
+
done(err);
|
|
1392
|
+
}
|
|
1393
|
+
});
|
|
1394
|
+
} catch (error) {
|
|
1395
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1396
|
+
done(error);
|
|
1397
|
+
}
|
|
1398
|
+
}).timeout(attemptTimeout);
|
|
1399
|
+
});
|
|
1400
|
+
|
|
1401
|
+
describe('#iapRunAdapterTests', () => {
|
|
1402
|
+
it('should have a iapRunAdapterTests function', (done) => {
|
|
1403
|
+
try {
|
|
1404
|
+
assert.equal(true, typeof a.iapRunAdapterTests === 'function');
|
|
1405
|
+
done();
|
|
1406
|
+
} catch (error) {
|
|
1407
|
+
log.error(`Test Failure: ${error}`);
|
|
1408
|
+
done(error);
|
|
1409
|
+
}
|
|
1410
|
+
});
|
|
1411
|
+
});
|
|
874
1412
|
|
|
1413
|
+
describe('#iapGetAdapterInventory', () => {
|
|
1414
|
+
it('should have a iapGetAdapterInventory function', (done) => {
|
|
1415
|
+
try {
|
|
1416
|
+
assert.equal(true, typeof a.iapGetAdapterInventory === 'function');
|
|
1417
|
+
done();
|
|
1418
|
+
} catch (error) {
|
|
1419
|
+
log.error(`Test Failure: ${error}`);
|
|
1420
|
+
done(error);
|
|
1421
|
+
}
|
|
1422
|
+
});
|
|
1423
|
+
it('retrieve the inventory', (done) => {
|
|
1424
|
+
try {
|
|
1425
|
+
a.iapGetAdapterInventory((data, error) => {
|
|
1426
|
+
try {
|
|
1427
|
+
assert.equal(undefined, error);
|
|
1428
|
+
assert.notEqual(undefined, data);
|
|
1429
|
+
assert.notEqual(null, data);
|
|
1430
|
+
done();
|
|
1431
|
+
} catch (err) {
|
|
1432
|
+
log.error(`Test Failure: ${err}`);
|
|
1433
|
+
done(err);
|
|
1434
|
+
}
|
|
1435
|
+
});
|
|
1436
|
+
} catch (error) {
|
|
1437
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1438
|
+
done(error);
|
|
1439
|
+
}
|
|
1440
|
+
}).timeout(attemptTimeout);
|
|
1441
|
+
});
|
|
1442
|
+
describe('metadata.json', () => {
|
|
1443
|
+
it('should have a metadata.json', (done) => {
|
|
1444
|
+
try {
|
|
1445
|
+
fs.exists('metadata.json', (val) => {
|
|
1446
|
+
assert.equal(true, val);
|
|
1447
|
+
done();
|
|
1448
|
+
});
|
|
1449
|
+
} catch (error) {
|
|
1450
|
+
log.error(`Test Failure: ${error}`);
|
|
1451
|
+
done(error);
|
|
1452
|
+
}
|
|
1453
|
+
});
|
|
1454
|
+
it('metadata.json is customized', (done) => {
|
|
1455
|
+
try {
|
|
1456
|
+
const metadataDotJson = require('../../metadata.json');
|
|
1457
|
+
assert.equal('adapter-webex_teams', metadataDotJson.name);
|
|
1458
|
+
assert.notEqual(undefined, metadataDotJson.webName);
|
|
1459
|
+
assert.notEqual(null, metadataDotJson.webName);
|
|
1460
|
+
assert.notEqual('', metadataDotJson.webName);
|
|
1461
|
+
assert.equal('Adapter', metadataDotJson.type);
|
|
1462
|
+
done();
|
|
1463
|
+
} catch (error) {
|
|
1464
|
+
log.error(`Test Failure: ${error}`);
|
|
1465
|
+
done(error);
|
|
1466
|
+
}
|
|
1467
|
+
});
|
|
1468
|
+
it('metadata.json contains accurate documentation', (done) => {
|
|
1469
|
+
try {
|
|
1470
|
+
const metadataDotJson = require('../../metadata.json');
|
|
1471
|
+
assert.notEqual(undefined, metadataDotJson.documentation);
|
|
1472
|
+
assert.equal('https://www.npmjs.com/package/@itentialopensource/adapter-webex_teams', metadataDotJson.documentation.npmLink);
|
|
1473
|
+
assert.equal('https://docs.itential.com/opensource/docs/troubleshooting-an-adapter', metadataDotJson.documentation.faqLink);
|
|
1474
|
+
assert.equal('https://gitlab.com/itentialopensource/adapters/contributing-guide', metadataDotJson.documentation.contributeLink);
|
|
1475
|
+
assert.equal('https://itential.atlassian.net/servicedesk/customer/portals', metadataDotJson.documentation.issueLink);
|
|
1476
|
+
done();
|
|
1477
|
+
} catch (error) {
|
|
1478
|
+
log.error(`Test Failure: ${error}`);
|
|
1479
|
+
done(error);
|
|
1480
|
+
}
|
|
1481
|
+
});
|
|
1482
|
+
it('metadata.json has related items', (done) => {
|
|
1483
|
+
try {
|
|
1484
|
+
const metadataDotJson = require('../../metadata.json');
|
|
1485
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems);
|
|
1486
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems.adapters);
|
|
1487
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems.integrations);
|
|
1488
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems.ecosystemApplications);
|
|
1489
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems.workflowProjects);
|
|
1490
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems.transformationProjects);
|
|
1491
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems.exampleProjects);
|
|
1492
|
+
done();
|
|
1493
|
+
} catch (error) {
|
|
1494
|
+
log.error(`Test Failure: ${error}`);
|
|
1495
|
+
done(error);
|
|
1496
|
+
}
|
|
1497
|
+
});
|
|
1498
|
+
});
|
|
875
1499
|
/*
|
|
876
1500
|
-----------------------------------------------------------------------
|
|
877
1501
|
-----------------------------------------------------------------------
|
|
@@ -908,7 +1532,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
908
1532
|
a.addPerson(null, (data, error) => {
|
|
909
1533
|
try {
|
|
910
1534
|
const displayE = 'body is required';
|
|
911
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1535
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-addPerson', displayE);
|
|
912
1536
|
done();
|
|
913
1537
|
} catch (err) {
|
|
914
1538
|
log.error(`Test Failure: ${err}`);
|
|
@@ -937,7 +1561,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
937
1561
|
a.getPerson(null, (data, error) => {
|
|
938
1562
|
try {
|
|
939
1563
|
const displayE = 'personId is required';
|
|
940
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1564
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getPerson', displayE);
|
|
941
1565
|
done();
|
|
942
1566
|
} catch (err) {
|
|
943
1567
|
log.error(`Test Failure: ${err}`);
|
|
@@ -966,7 +1590,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
966
1590
|
a.updatePerson(null, null, (data, error) => {
|
|
967
1591
|
try {
|
|
968
1592
|
const displayE = 'personId is required';
|
|
969
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1593
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updatePerson', displayE);
|
|
970
1594
|
done();
|
|
971
1595
|
} catch (err) {
|
|
972
1596
|
log.error(`Test Failure: ${err}`);
|
|
@@ -983,7 +1607,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
983
1607
|
a.updatePerson('fakeparam', null, (data, error) => {
|
|
984
1608
|
try {
|
|
985
1609
|
const displayE = 'body is required';
|
|
986
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1610
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updatePerson', displayE);
|
|
987
1611
|
done();
|
|
988
1612
|
} catch (err) {
|
|
989
1613
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1012,7 +1636,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1012
1636
|
a.deletePerson(null, (data, error) => {
|
|
1013
1637
|
try {
|
|
1014
1638
|
const displayE = 'personId is required';
|
|
1015
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1639
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-deletePerson', displayE);
|
|
1016
1640
|
done();
|
|
1017
1641
|
} catch (err) {
|
|
1018
1642
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1065,7 +1689,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1065
1689
|
a.createRoom(null, (data, error) => {
|
|
1066
1690
|
try {
|
|
1067
1691
|
const displayE = 'body is required';
|
|
1068
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1692
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-createRoom', displayE);
|
|
1069
1693
|
done();
|
|
1070
1694
|
} catch (err) {
|
|
1071
1695
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1094,7 +1718,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1094
1718
|
a.getRoom(null, (data, error) => {
|
|
1095
1719
|
try {
|
|
1096
1720
|
const displayE = 'roomId is required';
|
|
1097
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1721
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getRoom', displayE);
|
|
1098
1722
|
done();
|
|
1099
1723
|
} catch (err) {
|
|
1100
1724
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1123,7 +1747,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1123
1747
|
a.updateRoom(null, null, (data, error) => {
|
|
1124
1748
|
try {
|
|
1125
1749
|
const displayE = 'roomId is required';
|
|
1126
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1750
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updateRoom', displayE);
|
|
1127
1751
|
done();
|
|
1128
1752
|
} catch (err) {
|
|
1129
1753
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1140,7 +1764,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1140
1764
|
a.updateRoom('fakeparam', null, (data, error) => {
|
|
1141
1765
|
try {
|
|
1142
1766
|
const displayE = 'body is required';
|
|
1143
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1767
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updateRoom', displayE);
|
|
1144
1768
|
done();
|
|
1145
1769
|
} catch (err) {
|
|
1146
1770
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1169,7 +1793,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1169
1793
|
a.deleteRoom(null, (data, error) => {
|
|
1170
1794
|
try {
|
|
1171
1795
|
const displayE = 'roomId is required';
|
|
1172
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1796
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-deleteRoom', displayE);
|
|
1173
1797
|
done();
|
|
1174
1798
|
} catch (err) {
|
|
1175
1799
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1210,7 +1834,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1210
1834
|
a.createMembership(null, (data, error) => {
|
|
1211
1835
|
try {
|
|
1212
1836
|
const displayE = 'body is required';
|
|
1213
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1837
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-createMembership', displayE);
|
|
1214
1838
|
done();
|
|
1215
1839
|
} catch (err) {
|
|
1216
1840
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1239,7 +1863,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1239
1863
|
a.getMembership(null, (data, error) => {
|
|
1240
1864
|
try {
|
|
1241
1865
|
const displayE = 'membershipId is required';
|
|
1242
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1866
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getMembership', displayE);
|
|
1243
1867
|
done();
|
|
1244
1868
|
} catch (err) {
|
|
1245
1869
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1268,7 +1892,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1268
1892
|
a.updateMembership(null, null, (data, error) => {
|
|
1269
1893
|
try {
|
|
1270
1894
|
const displayE = 'membershipId is required';
|
|
1271
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1895
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updateMembership', displayE);
|
|
1272
1896
|
done();
|
|
1273
1897
|
} catch (err) {
|
|
1274
1898
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1285,7 +1909,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1285
1909
|
a.updateMembership('fakeparam', null, (data, error) => {
|
|
1286
1910
|
try {
|
|
1287
1911
|
const displayE = 'body is required';
|
|
1288
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1912
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updateMembership', displayE);
|
|
1289
1913
|
done();
|
|
1290
1914
|
} catch (err) {
|
|
1291
1915
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1314,7 +1938,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1314
1938
|
a.deleteMembership(null, (data, error) => {
|
|
1315
1939
|
try {
|
|
1316
1940
|
const displayE = 'membershipId is required';
|
|
1317
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1941
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-deleteMembership', displayE);
|
|
1318
1942
|
done();
|
|
1319
1943
|
} catch (err) {
|
|
1320
1944
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1343,7 +1967,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1343
1967
|
a.getMessages(null, null, null, null, null, (data, error) => {
|
|
1344
1968
|
try {
|
|
1345
1969
|
const displayE = 'roomId is required';
|
|
1346
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1970
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getMessages', displayE);
|
|
1347
1971
|
done();
|
|
1348
1972
|
} catch (err) {
|
|
1349
1973
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1372,7 +1996,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1372
1996
|
a.createMessage(null, (data, error) => {
|
|
1373
1997
|
try {
|
|
1374
1998
|
const displayE = 'body is required';
|
|
1375
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
1999
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-createMessage', displayE);
|
|
1376
2000
|
done();
|
|
1377
2001
|
} catch (err) {
|
|
1378
2002
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1401,7 +2025,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1401
2025
|
a.getMessage(null, (data, error) => {
|
|
1402
2026
|
try {
|
|
1403
2027
|
const displayE = 'messageId is required';
|
|
1404
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2028
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getMessage', displayE);
|
|
1405
2029
|
done();
|
|
1406
2030
|
} catch (err) {
|
|
1407
2031
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1430,7 +2054,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1430
2054
|
a.deleteMessage(null, (data, error) => {
|
|
1431
2055
|
try {
|
|
1432
2056
|
const displayE = 'messageId is required';
|
|
1433
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2057
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-deleteMessage', displayE);
|
|
1434
2058
|
done();
|
|
1435
2059
|
} catch (err) {
|
|
1436
2060
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1471,7 +2095,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1471
2095
|
a.createTeam(null, (data, error) => {
|
|
1472
2096
|
try {
|
|
1473
2097
|
const displayE = 'body is required';
|
|
1474
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2098
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-createTeam', displayE);
|
|
1475
2099
|
done();
|
|
1476
2100
|
} catch (err) {
|
|
1477
2101
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1500,7 +2124,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1500
2124
|
a.getTeam(null, (data, error) => {
|
|
1501
2125
|
try {
|
|
1502
2126
|
const displayE = 'teamId is required';
|
|
1503
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2127
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getTeam', displayE);
|
|
1504
2128
|
done();
|
|
1505
2129
|
} catch (err) {
|
|
1506
2130
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1529,7 +2153,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1529
2153
|
a.updateTeam(null, null, (data, error) => {
|
|
1530
2154
|
try {
|
|
1531
2155
|
const displayE = 'teamId is required';
|
|
1532
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2156
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updateTeam', displayE);
|
|
1533
2157
|
done();
|
|
1534
2158
|
} catch (err) {
|
|
1535
2159
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1546,7 +2170,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1546
2170
|
a.updateTeam('fakeparam', null, (data, error) => {
|
|
1547
2171
|
try {
|
|
1548
2172
|
const displayE = 'body is required';
|
|
1549
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2173
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updateTeam', displayE);
|
|
1550
2174
|
done();
|
|
1551
2175
|
} catch (err) {
|
|
1552
2176
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1575,7 +2199,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1575
2199
|
a.deleteTeam(null, (data, error) => {
|
|
1576
2200
|
try {
|
|
1577
2201
|
const displayE = 'teamId is required';
|
|
1578
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2202
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-deleteTeam', displayE);
|
|
1579
2203
|
done();
|
|
1580
2204
|
} catch (err) {
|
|
1581
2205
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1604,7 +2228,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1604
2228
|
a.getTeamMemberships(null, null, (data, error) => {
|
|
1605
2229
|
try {
|
|
1606
2230
|
const displayE = 'teamId is required';
|
|
1607
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2231
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getTeamMemberships', displayE);
|
|
1608
2232
|
done();
|
|
1609
2233
|
} catch (err) {
|
|
1610
2234
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1633,7 +2257,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1633
2257
|
a.createTeamMembership(null, (data, error) => {
|
|
1634
2258
|
try {
|
|
1635
2259
|
const displayE = 'body is required';
|
|
1636
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2260
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-createTeamMembership', displayE);
|
|
1637
2261
|
done();
|
|
1638
2262
|
} catch (err) {
|
|
1639
2263
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1662,7 +2286,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1662
2286
|
a.getTeamMembership(null, (data, error) => {
|
|
1663
2287
|
try {
|
|
1664
2288
|
const displayE = 'membershipId is required';
|
|
1665
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2289
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getTeamMembership', displayE);
|
|
1666
2290
|
done();
|
|
1667
2291
|
} catch (err) {
|
|
1668
2292
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1691,7 +2315,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1691
2315
|
a.updateTeamMembership(null, null, (data, error) => {
|
|
1692
2316
|
try {
|
|
1693
2317
|
const displayE = 'membershipId is required';
|
|
1694
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2318
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updateTeamMembership', displayE);
|
|
1695
2319
|
done();
|
|
1696
2320
|
} catch (err) {
|
|
1697
2321
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1708,7 +2332,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1708
2332
|
a.updateTeamMembership('fakeparam', null, (data, error) => {
|
|
1709
2333
|
try {
|
|
1710
2334
|
const displayE = 'body is required';
|
|
1711
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2335
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updateTeamMembership', displayE);
|
|
1712
2336
|
done();
|
|
1713
2337
|
} catch (err) {
|
|
1714
2338
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1737,7 +2361,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1737
2361
|
a.deleteTeamMembership(null, (data, error) => {
|
|
1738
2362
|
try {
|
|
1739
2363
|
const displayE = 'membershipId is required';
|
|
1740
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2364
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-deleteTeamMembership', displayE);
|
|
1741
2365
|
done();
|
|
1742
2366
|
} catch (err) {
|
|
1743
2367
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1778,7 +2402,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1778
2402
|
a.createWebhook(null, (data, error) => {
|
|
1779
2403
|
try {
|
|
1780
2404
|
const displayE = 'body is required';
|
|
1781
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2405
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-createWebhook', displayE);
|
|
1782
2406
|
done();
|
|
1783
2407
|
} catch (err) {
|
|
1784
2408
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1807,7 +2431,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1807
2431
|
a.getWebhook(null, (data, error) => {
|
|
1808
2432
|
try {
|
|
1809
2433
|
const displayE = 'webhookId is required';
|
|
1810
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2434
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getWebhook', displayE);
|
|
1811
2435
|
done();
|
|
1812
2436
|
} catch (err) {
|
|
1813
2437
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1836,7 +2460,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1836
2460
|
a.updateWebhook(null, null, (data, error) => {
|
|
1837
2461
|
try {
|
|
1838
2462
|
const displayE = 'webhookId is required';
|
|
1839
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2463
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updateWebhook', displayE);
|
|
1840
2464
|
done();
|
|
1841
2465
|
} catch (err) {
|
|
1842
2466
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1853,7 +2477,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1853
2477
|
a.updateWebhook('fakeparam', null, (data, error) => {
|
|
1854
2478
|
try {
|
|
1855
2479
|
const displayE = 'body is required';
|
|
1856
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2480
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-updateWebhook', displayE);
|
|
1857
2481
|
done();
|
|
1858
2482
|
} catch (err) {
|
|
1859
2483
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1882,7 +2506,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1882
2506
|
a.deleteWebhook(null, (data, error) => {
|
|
1883
2507
|
try {
|
|
1884
2508
|
const displayE = 'webhookId is required';
|
|
1885
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2509
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-deleteWebhook', displayE);
|
|
1886
2510
|
done();
|
|
1887
2511
|
} catch (err) {
|
|
1888
2512
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1923,7 +2547,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1923
2547
|
a.getOrganization(null, (data, error) => {
|
|
1924
2548
|
try {
|
|
1925
2549
|
const displayE = 'orgId is required';
|
|
1926
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2550
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getOrganization', displayE);
|
|
1927
2551
|
done();
|
|
1928
2552
|
} catch (err) {
|
|
1929
2553
|
log.error(`Test Failure: ${err}`);
|
|
@@ -1964,7 +2588,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
1964
2588
|
a.getLicense(null, (data, error) => {
|
|
1965
2589
|
try {
|
|
1966
2590
|
const displayE = 'licenseId is required';
|
|
1967
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2591
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getLicense', displayE);
|
|
1968
2592
|
done();
|
|
1969
2593
|
} catch (err) {
|
|
1970
2594
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2005,7 +2629,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
2005
2629
|
a.getRole(null, (data, error) => {
|
|
2006
2630
|
try {
|
|
2007
2631
|
const displayE = 'roleId is required';
|
|
2008
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2632
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getRole', displayE);
|
|
2009
2633
|
done();
|
|
2010
2634
|
} catch (err) {
|
|
2011
2635
|
log.error(`Test Failure: ${err}`);
|
|
@@ -2034,7 +2658,7 @@ describe('[unit] WebexTeams Adapter Test', () => {
|
|
|
2034
2658
|
a.getContent(null, (data, error) => {
|
|
2035
2659
|
try {
|
|
2036
2660
|
const displayE = 'contentId is required';
|
|
2037
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-
|
|
2661
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-webex_teams-adapter-getContent', displayE);
|
|
2038
2662
|
done();
|
|
2039
2663
|
} catch (err) {
|
|
2040
2664
|
log.error(`Test Failure: ${err}`);
|