@itentialopensource/adapter-tiger_connect 1.0.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 +6 -0
- package/.eslintrc.js +18 -0
- package/.gitlab/.gitkeep +0 -0
- package/.gitlab/issue_templates/.gitkeep +0 -0
- package/.gitlab/issue_templates/Default.md +17 -0
- package/.gitlab/issue_templates/bugReportTemplate.md +42 -0
- package/.gitlab/issue_templates/featureRequestTemplate.md +14 -0
- package/.jshintrc +0 -0
- package/AUTH.md +39 -0
- package/BROKER.md +199 -0
- package/CALLS.md +170 -0
- package/CHANGELOG.md +9 -0
- package/CODE_OF_CONDUCT.md +43 -0
- package/CONTRIBUTING.md +172 -0
- package/ENHANCE.md +69 -0
- package/LICENSE +201 -0
- package/PROPERTIES.md +641 -0
- package/README.md +337 -0
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +11 -0
- package/TROUBLESHOOT.md +47 -0
- package/adapter.js +5398 -0
- package/adapterBase.js +1787 -0
- package/entities/.generic/action.json +214 -0
- package/entities/.generic/schema.json +28 -0
- package/entities/.system/action.json +50 -0
- package/entities/.system/mockdatafiles/getToken-default.json +3 -0
- package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
- package/entities/.system/schema.json +19 -0
- package/entities/.system/schemaTokenReq.json +53 -0
- package/entities/.system/schemaTokenResp.json +53 -0
- package/entities/Events/action.json +65 -0
- package/entities/Events/schema.json +21 -0
- package/entities/Group/action.json +125 -0
- package/entities/Group/schema.json +24 -0
- package/entities/Messages/action.json +167 -0
- package/entities/Messages/schema.json +48 -0
- package/entities/Metadata/action.json +45 -0
- package/entities/Metadata/schema.json +20 -0
- package/entities/Organization/action.json +105 -0
- package/entities/Organization/schema.json +23 -0
- package/entities/Roster/action.json +65 -0
- package/entities/Roster/schema.json +21 -0
- package/entities/Scheduler/action.json +244 -0
- package/entities/Scheduler/schema.json +30 -0
- package/entities/Search/action.json +24 -0
- package/entities/Search/schema.json +19 -0
- package/entities/Users/action.json +209 -0
- package/entities/Users/schema.json +72 -0
- package/error.json +190 -0
- package/package.json +87 -0
- package/pronghorn.json +2645 -0
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +1248 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/TigerConnect.swagger-converted.json-OpenApi3Json.json +2843 -0
- package/report/creationReport.json +582 -0
- package/sampleProperties.json +195 -0
- package/test/integration/adapterTestBasicGet.js +83 -0
- package/test/integration/adapterTestConnectivity.js +93 -0
- package/test/integration/adapterTestIntegration.js +1684 -0
- package/test/unit/adapterBaseTestUnit.js +949 -0
- package/test/unit/adapterTestUnit.js +3033 -0
- package/utils/adapterInfo.js +206 -0
- package/utils/addAuth.js +94 -0
- package/utils/artifactize.js +146 -0
- package/utils/basicGet.js +50 -0
- package/utils/checkMigrate.js +63 -0
- package/utils/entitiesToDB.js +178 -0
- package/utils/findPath.js +74 -0
- package/utils/methodDocumentor.js +225 -0
- package/utils/modify.js +154 -0
- package/utils/packModificationScript.js +35 -0
- package/utils/patches2bundledDeps.js +90 -0
- package/utils/pre-commit.sh +32 -0
- package/utils/removeHooks.js +20 -0
- package/utils/setup.js +33 -0
- package/utils/tbScript.js +246 -0
- package/utils/tbUtils.js +490 -0
- package/utils/testRunner.js +298 -0
- package/utils/troubleshootingAdapter.js +195 -0
- package/workflows/README.md +3 -0
|
@@ -0,0 +1,3033 @@
|
|
|
1
|
+
/* @copyright Itential, LLC 2019 (pre-modifications) */
|
|
2
|
+
|
|
3
|
+
// Set globals
|
|
4
|
+
/* global describe it log pronghornProps */
|
|
5
|
+
/* eslint global-require: warn */
|
|
6
|
+
/* eslint no-unused-vars: warn */
|
|
7
|
+
/* eslint import/no-dynamic-require:warn */
|
|
8
|
+
|
|
9
|
+
// include required items for testing & logging
|
|
10
|
+
const assert = require('assert');
|
|
11
|
+
const fs = require('fs-extra');
|
|
12
|
+
const mocha = require('mocha');
|
|
13
|
+
const path = require('path');
|
|
14
|
+
const util = require('util');
|
|
15
|
+
const winston = require('winston');
|
|
16
|
+
const execute = require('child_process').execSync;
|
|
17
|
+
const { expect } = require('chai');
|
|
18
|
+
const { use } = require('chai');
|
|
19
|
+
const td = require('testdouble');
|
|
20
|
+
const Ajv = require('ajv');
|
|
21
|
+
|
|
22
|
+
const ajv = new Ajv({ allErrors: true, unknownFormats: 'ignore' });
|
|
23
|
+
const anything = td.matchers.anything();
|
|
24
|
+
let logLevel = 'none';
|
|
25
|
+
const isRapidFail = false;
|
|
26
|
+
|
|
27
|
+
// read in the properties from the sampleProperties files
|
|
28
|
+
let adaptdir = __dirname;
|
|
29
|
+
if (adaptdir.endsWith('/test/integration')) {
|
|
30
|
+
adaptdir = adaptdir.substring(0, adaptdir.length - 17);
|
|
31
|
+
} else if (adaptdir.endsWith('/test/unit')) {
|
|
32
|
+
adaptdir = adaptdir.substring(0, adaptdir.length - 10);
|
|
33
|
+
}
|
|
34
|
+
const samProps = require(`${adaptdir}/sampleProperties.json`).properties;
|
|
35
|
+
|
|
36
|
+
// these variables can be changed to run in integrated mode so easier to set them here
|
|
37
|
+
// always check these in with bogus data!!!
|
|
38
|
+
samProps.stub = true;
|
|
39
|
+
samProps.host = 'replace.hostorip.here';
|
|
40
|
+
samProps.authentication.username = 'username';
|
|
41
|
+
samProps.authentication.password = 'password';
|
|
42
|
+
samProps.protocol = 'http';
|
|
43
|
+
samProps.port = 80;
|
|
44
|
+
samProps.ssl.enabled = false;
|
|
45
|
+
samProps.ssl.accept_invalid_cert = false;
|
|
46
|
+
samProps.request.attempt_timeout = 1200000;
|
|
47
|
+
const attemptTimeout = samProps.request.attempt_timeout;
|
|
48
|
+
const { stub } = samProps;
|
|
49
|
+
|
|
50
|
+
// these are the adapter properties. You generally should not need to alter
|
|
51
|
+
// any of these after they are initially set up
|
|
52
|
+
global.pronghornProps = {
|
|
53
|
+
pathProps: {
|
|
54
|
+
encrypted: false
|
|
55
|
+
},
|
|
56
|
+
adapterProps: {
|
|
57
|
+
adapters: [{
|
|
58
|
+
id: 'Test-tiger_connect',
|
|
59
|
+
type: 'TigerConnect',
|
|
60
|
+
properties: samProps
|
|
61
|
+
}]
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
global.$HOME = `${__dirname}/../..`;
|
|
66
|
+
|
|
67
|
+
// set the log levels that Pronghorn uses, spam and trace are not defaulted in so without
|
|
68
|
+
// this you may error on log.trace calls.
|
|
69
|
+
const myCustomLevels = {
|
|
70
|
+
levels: {
|
|
71
|
+
spam: 6,
|
|
72
|
+
trace: 5,
|
|
73
|
+
debug: 4,
|
|
74
|
+
info: 3,
|
|
75
|
+
warn: 2,
|
|
76
|
+
error: 1,
|
|
77
|
+
none: 0
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// need to see if there is a log level passed in
|
|
82
|
+
process.argv.forEach((val) => {
|
|
83
|
+
// is there a log level defined to be passed in?
|
|
84
|
+
if (val.indexOf('--LOG') === 0) {
|
|
85
|
+
// get the desired log level
|
|
86
|
+
const inputVal = val.split('=')[1];
|
|
87
|
+
|
|
88
|
+
// validate the log level is supported, if so set it
|
|
89
|
+
if (Object.hasOwnProperty.call(myCustomLevels.levels, inputVal)) {
|
|
90
|
+
logLevel = inputVal;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// need to set global logging
|
|
96
|
+
global.log = winston.createLogger({
|
|
97
|
+
level: logLevel,
|
|
98
|
+
levels: myCustomLevels.levels,
|
|
99
|
+
transports: [
|
|
100
|
+
new winston.transports.Console()
|
|
101
|
+
]
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Runs the error asserts for the test
|
|
106
|
+
*/
|
|
107
|
+
function runErrorAsserts(data, error, code, origin, displayStr) {
|
|
108
|
+
assert.equal(null, data);
|
|
109
|
+
assert.notEqual(undefined, error);
|
|
110
|
+
assert.notEqual(null, error);
|
|
111
|
+
assert.notEqual(undefined, error.IAPerror);
|
|
112
|
+
assert.notEqual(null, error.IAPerror);
|
|
113
|
+
assert.notEqual(undefined, error.IAPerror.displayString);
|
|
114
|
+
assert.notEqual(null, error.IAPerror.displayString);
|
|
115
|
+
assert.equal(code, error.icode);
|
|
116
|
+
assert.equal(origin, error.IAPerror.origin);
|
|
117
|
+
assert.equal(displayStr, error.IAPerror.displayString);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// require the adapter that we are going to be using
|
|
121
|
+
const TigerConnect = require('../../adapter');
|
|
122
|
+
|
|
123
|
+
// delete the .DS_Store directory in entities -- otherwise this will cause errors
|
|
124
|
+
const dirPath = path.join(__dirname, '../../entities/.DS_Store');
|
|
125
|
+
if (fs.existsSync(dirPath)) {
|
|
126
|
+
try {
|
|
127
|
+
fs.removeSync(dirPath);
|
|
128
|
+
console.log('.DS_Store deleted');
|
|
129
|
+
} catch (e) {
|
|
130
|
+
console.log('Error when deleting .DS_Store:', e);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// begin the testing - these should be pretty well defined between the describe and the it!
|
|
135
|
+
describe('[unit] Tiger_connect Adapter Test', () => {
|
|
136
|
+
describe('TigerConnect Class Tests', () => {
|
|
137
|
+
const a = new TigerConnect(
|
|
138
|
+
pronghornProps.adapterProps.adapters[0].id,
|
|
139
|
+
pronghornProps.adapterProps.adapters[0].properties
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
if (isRapidFail) {
|
|
143
|
+
const state = {};
|
|
144
|
+
state.passed = true;
|
|
145
|
+
|
|
146
|
+
mocha.afterEach(function x() {
|
|
147
|
+
state.passed = state.passed
|
|
148
|
+
&& (this.currentTest.state === 'passed');
|
|
149
|
+
});
|
|
150
|
+
mocha.beforeEach(function x() {
|
|
151
|
+
if (!state.passed) {
|
|
152
|
+
return this.currentTest.skip();
|
|
153
|
+
}
|
|
154
|
+
return true;
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
describe('#class instance created', () => {
|
|
159
|
+
it('should be a class with properties', (done) => {
|
|
160
|
+
try {
|
|
161
|
+
assert.notEqual(null, a);
|
|
162
|
+
assert.notEqual(undefined, a);
|
|
163
|
+
const checkId = global.pronghornProps.adapterProps.adapters[0].id;
|
|
164
|
+
assert.equal(checkId, a.id);
|
|
165
|
+
assert.notEqual(null, a.allProps);
|
|
166
|
+
const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
|
|
167
|
+
assert.equal(check, a.healthcheckType);
|
|
168
|
+
done();
|
|
169
|
+
} catch (error) {
|
|
170
|
+
log.error(`Test Failure: ${error}`);
|
|
171
|
+
done(error);
|
|
172
|
+
}
|
|
173
|
+
}).timeout(attemptTimeout);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
describe('adapterBase.js', () => {
|
|
177
|
+
it('should have an adapterBase.js', (done) => {
|
|
178
|
+
try {
|
|
179
|
+
fs.exists('adapterBase.js', (val) => {
|
|
180
|
+
assert.equal(true, val);
|
|
181
|
+
done();
|
|
182
|
+
});
|
|
183
|
+
} catch (error) {
|
|
184
|
+
log.error(`Test Failure: ${error}`);
|
|
185
|
+
done(error);
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
let wffunctions = [];
|
|
191
|
+
describe('#iapGetAdapterWorkflowFunctions', () => {
|
|
192
|
+
it('should retrieve workflow functions', (done) => {
|
|
193
|
+
try {
|
|
194
|
+
wffunctions = a.iapGetAdapterWorkflowFunctions([]);
|
|
195
|
+
|
|
196
|
+
try {
|
|
197
|
+
assert.notEqual(0, wffunctions.length);
|
|
198
|
+
done();
|
|
199
|
+
} catch (err) {
|
|
200
|
+
log.error(`Test Failure: ${err}`);
|
|
201
|
+
done(err);
|
|
202
|
+
}
|
|
203
|
+
} catch (error) {
|
|
204
|
+
log.error(`Adapter Exception: ${error}`);
|
|
205
|
+
done(error);
|
|
206
|
+
}
|
|
207
|
+
}).timeout(attemptTimeout);
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
describe('package.json', () => {
|
|
211
|
+
it('should have a package.json', (done) => {
|
|
212
|
+
try {
|
|
213
|
+
fs.exists('package.json', (val) => {
|
|
214
|
+
assert.equal(true, val);
|
|
215
|
+
done();
|
|
216
|
+
});
|
|
217
|
+
} catch (error) {
|
|
218
|
+
log.error(`Test Failure: ${error}`);
|
|
219
|
+
done(error);
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
it('package.json should be validated', (done) => {
|
|
223
|
+
try {
|
|
224
|
+
const packageDotJson = require('../../package.json');
|
|
225
|
+
const { PJV } = require('package-json-validator');
|
|
226
|
+
const options = {
|
|
227
|
+
warnings: true, // show warnings
|
|
228
|
+
recommendations: true // show recommendations
|
|
229
|
+
};
|
|
230
|
+
const results = PJV.validate(JSON.stringify(packageDotJson), 'npm', options);
|
|
231
|
+
|
|
232
|
+
if (results.valid === false) {
|
|
233
|
+
log.error('The package.json contains the following errors: ');
|
|
234
|
+
log.error(util.inspect(results));
|
|
235
|
+
assert.equal(true, results.valid);
|
|
236
|
+
} else {
|
|
237
|
+
assert.equal(true, results.valid);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
done();
|
|
241
|
+
} catch (error) {
|
|
242
|
+
log.error(`Test Failure: ${error}`);
|
|
243
|
+
done(error);
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
it('package.json standard fields should be customized', (done) => {
|
|
247
|
+
try {
|
|
248
|
+
const packageDotJson = require('../../package.json');
|
|
249
|
+
assert.notEqual(-1, packageDotJson.name.indexOf('tiger_connect'));
|
|
250
|
+
assert.notEqual(undefined, packageDotJson.version);
|
|
251
|
+
assert.notEqual(null, packageDotJson.version);
|
|
252
|
+
assert.notEqual('', packageDotJson.version);
|
|
253
|
+
assert.notEqual(undefined, packageDotJson.description);
|
|
254
|
+
assert.notEqual(null, packageDotJson.description);
|
|
255
|
+
assert.notEqual('', packageDotJson.description);
|
|
256
|
+
assert.equal('adapter.js', packageDotJson.main);
|
|
257
|
+
assert.notEqual(undefined, packageDotJson.wizardVersion);
|
|
258
|
+
assert.notEqual(null, packageDotJson.wizardVersion);
|
|
259
|
+
assert.notEqual('', packageDotJson.wizardVersion);
|
|
260
|
+
assert.notEqual(undefined, packageDotJson.engineVersion);
|
|
261
|
+
assert.notEqual(null, packageDotJson.engineVersion);
|
|
262
|
+
assert.notEqual('', packageDotJson.engineVersion);
|
|
263
|
+
assert.equal('http', packageDotJson.adapterType);
|
|
264
|
+
done();
|
|
265
|
+
} catch (error) {
|
|
266
|
+
log.error(`Test Failure: ${error}`);
|
|
267
|
+
done(error);
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
it('package.json proper scripts should be provided', (done) => {
|
|
271
|
+
try {
|
|
272
|
+
const packageDotJson = require('../../package.json');
|
|
273
|
+
assert.notEqual(undefined, packageDotJson.scripts);
|
|
274
|
+
assert.notEqual(null, packageDotJson.scripts);
|
|
275
|
+
assert.notEqual('', packageDotJson.scripts);
|
|
276
|
+
assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js', packageDotJson.scripts.lint);
|
|
277
|
+
assert.equal('node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js --quiet', packageDotJson.scripts['lint:errors']);
|
|
278
|
+
assert.equal('mocha test/unit/adapterBaseTestUnit.js --LOG=error', packageDotJson.scripts['test:baseunit']);
|
|
279
|
+
assert.equal('mocha test/unit/adapterTestUnit.js --LOG=error', packageDotJson.scripts['test:unit']);
|
|
280
|
+
assert.equal('mocha test/integration/adapterTestIntegration.js --LOG=error', packageDotJson.scripts['test:integration']);
|
|
281
|
+
assert.equal('nyc --reporter html --reporter text mocha --reporter dot test/*', packageDotJson.scripts['test:cover']);
|
|
282
|
+
assert.equal('npm run test:baseunit && npm run test:unit && npm run test:integration', packageDotJson.scripts.test);
|
|
283
|
+
done();
|
|
284
|
+
} catch (error) {
|
|
285
|
+
log.error(`Test Failure: ${error}`);
|
|
286
|
+
done(error);
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
it('package.json proper directories should be provided', (done) => {
|
|
290
|
+
try {
|
|
291
|
+
const packageDotJson = require('../../package.json');
|
|
292
|
+
assert.notEqual(undefined, packageDotJson.repository);
|
|
293
|
+
assert.notEqual(null, packageDotJson.repository);
|
|
294
|
+
assert.notEqual('', packageDotJson.repository);
|
|
295
|
+
done();
|
|
296
|
+
} catch (error) {
|
|
297
|
+
log.error(`Test Failure: ${error}`);
|
|
298
|
+
done(error);
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
it('package.json proper dependencies should be provided', (done) => {
|
|
302
|
+
try {
|
|
303
|
+
const packageDotJson = require('../../package.json');
|
|
304
|
+
assert.notEqual(undefined, packageDotJson.dependencies);
|
|
305
|
+
assert.notEqual(null, packageDotJson.dependencies);
|
|
306
|
+
assert.notEqual('', packageDotJson.dependencies);
|
|
307
|
+
assert.equal('^6.12.0', packageDotJson.dependencies.ajv);
|
|
308
|
+
assert.equal('^0.21.0', packageDotJson.dependencies.axios);
|
|
309
|
+
assert.equal('^2.20.0', packageDotJson.dependencies.commander);
|
|
310
|
+
assert.equal('^8.1.0', packageDotJson.dependencies['fs-extra']);
|
|
311
|
+
assert.equal('^9.0.1', packageDotJson.dependencies.mocha);
|
|
312
|
+
assert.equal('^2.0.1', packageDotJson.dependencies['mocha-param']);
|
|
313
|
+
assert.equal('^0.5.3', packageDotJson.dependencies['network-diagnostics']);
|
|
314
|
+
assert.equal('^15.1.0', packageDotJson.dependencies.nyc);
|
|
315
|
+
assert.equal('^1.4.10', packageDotJson.dependencies['readline-sync']);
|
|
316
|
+
assert.equal('^7.3.2', packageDotJson.dependencies.semver);
|
|
317
|
+
assert.equal('^3.3.3', packageDotJson.dependencies.winston);
|
|
318
|
+
done();
|
|
319
|
+
} catch (error) {
|
|
320
|
+
log.error(`Test Failure: ${error}`);
|
|
321
|
+
done(error);
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
it('package.json proper dev dependencies should be provided', (done) => {
|
|
325
|
+
try {
|
|
326
|
+
const packageDotJson = require('../../package.json');
|
|
327
|
+
assert.notEqual(undefined, packageDotJson.devDependencies);
|
|
328
|
+
assert.notEqual(null, packageDotJson.devDependencies);
|
|
329
|
+
assert.notEqual('', packageDotJson.devDependencies);
|
|
330
|
+
assert.equal('^4.3.4', packageDotJson.devDependencies.chai);
|
|
331
|
+
assert.equal('^7.29.0', packageDotJson.devDependencies.eslint);
|
|
332
|
+
assert.equal('^14.2.1', packageDotJson.devDependencies['eslint-config-airbnb-base']);
|
|
333
|
+
assert.equal('^2.23.4', packageDotJson.devDependencies['eslint-plugin-import']);
|
|
334
|
+
assert.equal('^3.0.0', packageDotJson.devDependencies['eslint-plugin-json']);
|
|
335
|
+
assert.equal('^0.6.3', packageDotJson.devDependencies['package-json-validator']);
|
|
336
|
+
assert.equal('^3.16.1', packageDotJson.devDependencies.testdouble);
|
|
337
|
+
done();
|
|
338
|
+
} catch (error) {
|
|
339
|
+
log.error(`Test Failure: ${error}`);
|
|
340
|
+
done(error);
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
describe('pronghorn.json', () => {
|
|
346
|
+
it('should have a pronghorn.json', (done) => {
|
|
347
|
+
try {
|
|
348
|
+
fs.exists('pronghorn.json', (val) => {
|
|
349
|
+
assert.equal(true, val);
|
|
350
|
+
done();
|
|
351
|
+
});
|
|
352
|
+
} catch (error) {
|
|
353
|
+
log.error(`Test Failure: ${error}`);
|
|
354
|
+
done(error);
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
it('pronghorn.json should be customized', (done) => {
|
|
358
|
+
try {
|
|
359
|
+
const pronghornDotJson = require('../../pronghorn.json');
|
|
360
|
+
assert.notEqual(-1, pronghornDotJson.id.indexOf('tiger_connect'));
|
|
361
|
+
assert.equal('Adapter', pronghornDotJson.type);
|
|
362
|
+
assert.equal('TigerConnect', pronghornDotJson.export);
|
|
363
|
+
assert.equal('Tiger_connect', pronghornDotJson.title);
|
|
364
|
+
assert.equal('adapter.js', pronghornDotJson.src);
|
|
365
|
+
done();
|
|
366
|
+
} catch (error) {
|
|
367
|
+
log.error(`Test Failure: ${error}`);
|
|
368
|
+
done(error);
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
it('pronghorn.json should contain generic adapter methods', (done) => {
|
|
372
|
+
try {
|
|
373
|
+
const pronghornDotJson = require('../../pronghorn.json');
|
|
374
|
+
assert.notEqual(undefined, pronghornDotJson.methods);
|
|
375
|
+
assert.notEqual(null, pronghornDotJson.methods);
|
|
376
|
+
assert.notEqual('', pronghornDotJson.methods);
|
|
377
|
+
assert.equal(true, Array.isArray(pronghornDotJson.methods));
|
|
378
|
+
assert.notEqual(0, pronghornDotJson.methods.length);
|
|
379
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUpdateAdapterConfiguration'));
|
|
380
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapFindAdapterPath'));
|
|
381
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapTroubleshootAdapter'));
|
|
382
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterHealthcheck'));
|
|
383
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterConnectivity'));
|
|
384
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterBasicGet'));
|
|
385
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapSuspendAdapter'));
|
|
386
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUnsuspendAdapter'));
|
|
387
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapGetAdapterQueue'));
|
|
388
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequest'));
|
|
389
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequestNoBasePath'));
|
|
390
|
+
done();
|
|
391
|
+
} catch (error) {
|
|
392
|
+
log.error(`Test Failure: ${error}`);
|
|
393
|
+
done(error);
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
it('pronghorn.json should only expose workflow functions', (done) => {
|
|
397
|
+
try {
|
|
398
|
+
const pronghornDotJson = require('../../pronghorn.json');
|
|
399
|
+
|
|
400
|
+
for (let m = 0; m < pronghornDotJson.methods.length; m += 1) {
|
|
401
|
+
let found = false;
|
|
402
|
+
let paramissue = false;
|
|
403
|
+
|
|
404
|
+
for (let w = 0; w < wffunctions.length; w += 1) {
|
|
405
|
+
if (pronghornDotJson.methods[m].name === wffunctions[w]) {
|
|
406
|
+
found = true;
|
|
407
|
+
const methLine = execute(`grep " ${wffunctions[w]}(" adapter.js | grep "callback) {"`).toString();
|
|
408
|
+
let wfparams = [];
|
|
409
|
+
|
|
410
|
+
if (methLine && methLine.indexOf('(') >= 0 && methLine.indexOf(')') >= 0) {
|
|
411
|
+
const temp = methLine.substring(methLine.indexOf('(') + 1, methLine.lastIndexOf(')'));
|
|
412
|
+
wfparams = temp.split(',');
|
|
413
|
+
|
|
414
|
+
for (let t = 0; t < wfparams.length; t += 1) {
|
|
415
|
+
// remove default value from the parameter name
|
|
416
|
+
wfparams[t] = wfparams[t].substring(0, wfparams[t].search(/=/) > 0 ? wfparams[t].search(/#|\?|=/) : wfparams[t].length);
|
|
417
|
+
// remove spaces
|
|
418
|
+
wfparams[t] = wfparams[t].trim();
|
|
419
|
+
|
|
420
|
+
if (wfparams[t] === 'callback') {
|
|
421
|
+
wfparams.splice(t, 1);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
// if there are inputs defined but not on the method line
|
|
427
|
+
if (wfparams.length === 0 && (pronghornDotJson.methods[m].input
|
|
428
|
+
&& pronghornDotJson.methods[m].input.length > 0)) {
|
|
429
|
+
paramissue = true;
|
|
430
|
+
} else if (wfparams.length > 0 && (!pronghornDotJson.methods[m].input
|
|
431
|
+
|| pronghornDotJson.methods[m].input.length === 0)) {
|
|
432
|
+
// if there are no inputs defined but there are on the method line
|
|
433
|
+
paramissue = true;
|
|
434
|
+
} else {
|
|
435
|
+
for (let p = 0; p < pronghornDotJson.methods[m].input.length; p += 1) {
|
|
436
|
+
let pfound = false;
|
|
437
|
+
for (let wfp = 0; wfp < wfparams.length; wfp += 1) {
|
|
438
|
+
if (pronghornDotJson.methods[m].input[p].name.toUpperCase() === wfparams[wfp].toUpperCase()) {
|
|
439
|
+
pfound = true;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
if (!pfound) {
|
|
444
|
+
paramissue = true;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
for (let wfp = 0; wfp < wfparams.length; wfp += 1) {
|
|
448
|
+
let pfound = false;
|
|
449
|
+
for (let p = 0; p < pronghornDotJson.methods[m].input.length; p += 1) {
|
|
450
|
+
if (pronghornDotJson.methods[m].input[p].name.toUpperCase() === wfparams[wfp].toUpperCase()) {
|
|
451
|
+
pfound = true;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
if (!pfound) {
|
|
456
|
+
paramissue = true;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
break;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
if (!found) {
|
|
466
|
+
// this is the reason to go through both loops - log which ones are not found so
|
|
467
|
+
// they can be worked
|
|
468
|
+
log.error(`${pronghornDotJson.methods[m].name} not found in workflow functions`);
|
|
469
|
+
}
|
|
470
|
+
if (paramissue) {
|
|
471
|
+
// this is the reason to go through both loops - log which ones are not found so
|
|
472
|
+
// they can be worked
|
|
473
|
+
log.error(`${pronghornDotJson.methods[m].name} has a parameter mismatch`);
|
|
474
|
+
}
|
|
475
|
+
assert.equal(true, found);
|
|
476
|
+
assert.equal(false, paramissue);
|
|
477
|
+
}
|
|
478
|
+
done();
|
|
479
|
+
} catch (error) {
|
|
480
|
+
log.error(`Adapter Exception: ${error}`);
|
|
481
|
+
done(error);
|
|
482
|
+
}
|
|
483
|
+
}).timeout(attemptTimeout);
|
|
484
|
+
it('pronghorn.json should expose all workflow functions', (done) => {
|
|
485
|
+
try {
|
|
486
|
+
const pronghornDotJson = require('../../pronghorn.json');
|
|
487
|
+
for (let w = 0; w < wffunctions.length; w += 1) {
|
|
488
|
+
let found = false;
|
|
489
|
+
|
|
490
|
+
for (let m = 0; m < pronghornDotJson.methods.length; m += 1) {
|
|
491
|
+
if (pronghornDotJson.methods[m].name === wffunctions[w]) {
|
|
492
|
+
found = true;
|
|
493
|
+
break;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
if (!found) {
|
|
498
|
+
// this is the reason to go through both loops - log which ones are not found so
|
|
499
|
+
// they can be worked
|
|
500
|
+
log.error(`${wffunctions[w]} not found in pronghorn.json`);
|
|
501
|
+
}
|
|
502
|
+
assert.equal(true, found);
|
|
503
|
+
}
|
|
504
|
+
done();
|
|
505
|
+
} catch (error) {
|
|
506
|
+
log.error(`Adapter Exception: ${error}`);
|
|
507
|
+
done(error);
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
it('pronghorn.json verify input/output schema objects', (done) => {
|
|
511
|
+
const verifySchema = (methodName, schema) => {
|
|
512
|
+
try {
|
|
513
|
+
ajv.compile(schema);
|
|
514
|
+
} catch (error) {
|
|
515
|
+
const errorMessage = `Invalid schema found in '${methodName}' method.
|
|
516
|
+
Schema => ${JSON.stringify(schema)}.
|
|
517
|
+
Details => ${error.message}`;
|
|
518
|
+
throw new Error(errorMessage);
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
try {
|
|
523
|
+
const pronghornDotJson = require('../../pronghorn.json');
|
|
524
|
+
const { methods } = pronghornDotJson;
|
|
525
|
+
for (let i = 0; i < methods.length; i += 1) {
|
|
526
|
+
for (let j = 0; j < methods[i].input.length; j += 1) {
|
|
527
|
+
const inputSchema = methods[i].input[j].schema;
|
|
528
|
+
if (inputSchema) {
|
|
529
|
+
verifySchema(methods[i].name, inputSchema);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
const outputSchema = methods[i].output.schema;
|
|
533
|
+
if (outputSchema) {
|
|
534
|
+
verifySchema(methods[i].name, outputSchema);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
done();
|
|
538
|
+
} catch (error) {
|
|
539
|
+
log.error(`Adapter Exception: ${error}`);
|
|
540
|
+
done(error);
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
describe('propertiesSchema.json', () => {
|
|
546
|
+
it('should have a propertiesSchema.json', (done) => {
|
|
547
|
+
try {
|
|
548
|
+
fs.exists('propertiesSchema.json', (val) => {
|
|
549
|
+
assert.equal(true, val);
|
|
550
|
+
done();
|
|
551
|
+
});
|
|
552
|
+
} catch (error) {
|
|
553
|
+
log.error(`Test Failure: ${error}`);
|
|
554
|
+
done(error);
|
|
555
|
+
}
|
|
556
|
+
});
|
|
557
|
+
it('propertiesSchema.json should be customized', (done) => {
|
|
558
|
+
try {
|
|
559
|
+
const propertiesDotJson = require('../../propertiesSchema.json');
|
|
560
|
+
assert.equal('adapter-tiger_connect', propertiesDotJson.$id);
|
|
561
|
+
assert.equal('object', propertiesDotJson.type);
|
|
562
|
+
assert.equal('http://json-schema.org/draft-07/schema#', propertiesDotJson.$schema);
|
|
563
|
+
done();
|
|
564
|
+
} catch (error) {
|
|
565
|
+
log.error(`Test Failure: ${error}`);
|
|
566
|
+
done(error);
|
|
567
|
+
}
|
|
568
|
+
});
|
|
569
|
+
it('propertiesSchema.json should contain generic adapter properties', (done) => {
|
|
570
|
+
try {
|
|
571
|
+
const propertiesDotJson = require('../../propertiesSchema.json');
|
|
572
|
+
assert.notEqual(undefined, propertiesDotJson.properties);
|
|
573
|
+
assert.notEqual(null, propertiesDotJson.properties);
|
|
574
|
+
assert.notEqual('', propertiesDotJson.properties);
|
|
575
|
+
assert.equal('string', propertiesDotJson.properties.host.type);
|
|
576
|
+
assert.equal('integer', propertiesDotJson.properties.port.type);
|
|
577
|
+
assert.equal('boolean', propertiesDotJson.properties.stub.type);
|
|
578
|
+
assert.equal('string', propertiesDotJson.properties.protocol.type);
|
|
579
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.authentication);
|
|
580
|
+
assert.notEqual(null, propertiesDotJson.definitions.authentication);
|
|
581
|
+
assert.notEqual('', propertiesDotJson.definitions.authentication);
|
|
582
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.auth_method.type);
|
|
583
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.username.type);
|
|
584
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.password.type);
|
|
585
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.token.type);
|
|
586
|
+
assert.equal('integer', propertiesDotJson.definitions.authentication.properties.invalid_token_error.type);
|
|
587
|
+
assert.equal('integer', propertiesDotJson.definitions.authentication.properties.token_timeout.type);
|
|
588
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.token_cache.type);
|
|
589
|
+
assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field.type));
|
|
590
|
+
assert.equal(true, Array.isArray(propertiesDotJson.definitions.authentication.properties.auth_field_format.type));
|
|
591
|
+
assert.equal('boolean', propertiesDotJson.definitions.authentication.properties.auth_logging.type);
|
|
592
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_id.type);
|
|
593
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_secret.type);
|
|
594
|
+
assert.equal('string', propertiesDotJson.definitions.authentication.properties.grant_type.type);
|
|
595
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.ssl);
|
|
596
|
+
assert.notEqual(null, propertiesDotJson.definitions.ssl);
|
|
597
|
+
assert.notEqual('', propertiesDotJson.definitions.ssl);
|
|
598
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ecdhCurve.type);
|
|
599
|
+
assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.enabled.type);
|
|
600
|
+
assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.accept_invalid_cert.type);
|
|
601
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ca_file.type);
|
|
602
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.key_file.type);
|
|
603
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.cert_file.type);
|
|
604
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.secure_protocol.type);
|
|
605
|
+
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ciphers.type);
|
|
606
|
+
assert.equal('string', propertiesDotJson.properties.base_path.type);
|
|
607
|
+
assert.equal('string', propertiesDotJson.properties.version.type);
|
|
608
|
+
assert.equal('string', propertiesDotJson.properties.cache_location.type);
|
|
609
|
+
assert.equal('boolean', propertiesDotJson.properties.encode_pathvars.type);
|
|
610
|
+
assert.equal('boolean', propertiesDotJson.properties.encode_queryvars.type);
|
|
611
|
+
assert.equal(true, Array.isArray(propertiesDotJson.properties.save_metric.type));
|
|
612
|
+
assert.notEqual(undefined, propertiesDotJson.definitions);
|
|
613
|
+
assert.notEqual(null, propertiesDotJson.definitions);
|
|
614
|
+
assert.notEqual('', propertiesDotJson.definitions);
|
|
615
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.healthcheck);
|
|
616
|
+
assert.notEqual(null, propertiesDotJson.definitions.healthcheck);
|
|
617
|
+
assert.notEqual('', propertiesDotJson.definitions.healthcheck);
|
|
618
|
+
assert.equal('string', propertiesDotJson.definitions.healthcheck.properties.type.type);
|
|
619
|
+
assert.equal('integer', propertiesDotJson.definitions.healthcheck.properties.frequency.type);
|
|
620
|
+
assert.equal('object', propertiesDotJson.definitions.healthcheck.properties.query_object.type);
|
|
621
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.throttle);
|
|
622
|
+
assert.notEqual(null, propertiesDotJson.definitions.throttle);
|
|
623
|
+
assert.notEqual('', propertiesDotJson.definitions.throttle);
|
|
624
|
+
assert.equal('boolean', propertiesDotJson.definitions.throttle.properties.throttle_enabled.type);
|
|
625
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.number_pronghorns.type);
|
|
626
|
+
assert.equal('string', propertiesDotJson.definitions.throttle.properties.sync_async.type);
|
|
627
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.max_in_queue.type);
|
|
628
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.concurrent_max.type);
|
|
629
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.expire_timeout.type);
|
|
630
|
+
assert.equal('integer', propertiesDotJson.definitions.throttle.properties.avg_runtime.type);
|
|
631
|
+
assert.equal('array', propertiesDotJson.definitions.throttle.properties.priorities.type);
|
|
632
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.request);
|
|
633
|
+
assert.notEqual(null, propertiesDotJson.definitions.request);
|
|
634
|
+
assert.notEqual('', propertiesDotJson.definitions.request);
|
|
635
|
+
assert.equal('integer', propertiesDotJson.definitions.request.properties.number_redirects.type);
|
|
636
|
+
assert.equal('integer', propertiesDotJson.definitions.request.properties.number_retries.type);
|
|
637
|
+
assert.equal(true, Array.isArray(propertiesDotJson.definitions.request.properties.limit_retry_error.type));
|
|
638
|
+
assert.equal('array', propertiesDotJson.definitions.request.properties.failover_codes.type);
|
|
639
|
+
assert.equal('integer', propertiesDotJson.definitions.request.properties.attempt_timeout.type);
|
|
640
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.type);
|
|
641
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.payload.type);
|
|
642
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.uriOptions.type);
|
|
643
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.addlHeaders.type);
|
|
644
|
+
assert.equal('object', propertiesDotJson.definitions.request.properties.global_request.properties.authData.type);
|
|
645
|
+
assert.equal('boolean', propertiesDotJson.definitions.request.properties.healthcheck_on_timeout.type);
|
|
646
|
+
assert.equal('boolean', propertiesDotJson.definitions.request.properties.return_raw.type);
|
|
647
|
+
assert.equal('boolean', propertiesDotJson.definitions.request.properties.archiving.type);
|
|
648
|
+
assert.equal('boolean', propertiesDotJson.definitions.request.properties.return_request.type);
|
|
649
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.proxy);
|
|
650
|
+
assert.notEqual(null, propertiesDotJson.definitions.proxy);
|
|
651
|
+
assert.notEqual('', propertiesDotJson.definitions.proxy);
|
|
652
|
+
assert.equal('boolean', propertiesDotJson.definitions.proxy.properties.enabled.type);
|
|
653
|
+
assert.equal('string', propertiesDotJson.definitions.proxy.properties.host.type);
|
|
654
|
+
assert.equal('integer', propertiesDotJson.definitions.proxy.properties.port.type);
|
|
655
|
+
assert.equal('string', propertiesDotJson.definitions.proxy.properties.protocol.type);
|
|
656
|
+
assert.equal('string', propertiesDotJson.definitions.proxy.properties.username.type);
|
|
657
|
+
assert.equal('string', propertiesDotJson.definitions.proxy.properties.password.type);
|
|
658
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.mongo);
|
|
659
|
+
assert.notEqual(null, propertiesDotJson.definitions.mongo);
|
|
660
|
+
assert.notEqual('', propertiesDotJson.definitions.mongo);
|
|
661
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.host.type);
|
|
662
|
+
assert.equal('integer', propertiesDotJson.definitions.mongo.properties.port.type);
|
|
663
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.database.type);
|
|
664
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.username.type);
|
|
665
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.password.type);
|
|
666
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.replSet.type);
|
|
667
|
+
assert.equal('object', propertiesDotJson.definitions.mongo.properties.db_ssl.type);
|
|
668
|
+
assert.equal('boolean', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.enabled.type);
|
|
669
|
+
assert.equal('boolean', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.accept_invalid_cert.type);
|
|
670
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.ca_file.type);
|
|
671
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.key_file.type);
|
|
672
|
+
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.cert_file.type);
|
|
673
|
+
assert.notEqual('', propertiesDotJson.definitions.devicebroker);
|
|
674
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevice.type);
|
|
675
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevicesFiltered.type);
|
|
676
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.isAlive.type);
|
|
677
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getConfig.type);
|
|
678
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getCount.type);
|
|
679
|
+
done();
|
|
680
|
+
} catch (error) {
|
|
681
|
+
log.error(`Test Failure: ${error}`);
|
|
682
|
+
done(error);
|
|
683
|
+
}
|
|
684
|
+
});
|
|
685
|
+
});
|
|
686
|
+
|
|
687
|
+
describe('error.json', () => {
|
|
688
|
+
it('should have an error.json', (done) => {
|
|
689
|
+
try {
|
|
690
|
+
fs.exists('error.json', (val) => {
|
|
691
|
+
assert.equal(true, val);
|
|
692
|
+
done();
|
|
693
|
+
});
|
|
694
|
+
} catch (error) {
|
|
695
|
+
log.error(`Test Failure: ${error}`);
|
|
696
|
+
done(error);
|
|
697
|
+
}
|
|
698
|
+
});
|
|
699
|
+
it('error.json should have standard adapter errors', (done) => {
|
|
700
|
+
try {
|
|
701
|
+
const errorDotJson = require('../../error.json');
|
|
702
|
+
assert.notEqual(undefined, errorDotJson.errors);
|
|
703
|
+
assert.notEqual(null, errorDotJson.errors);
|
|
704
|
+
assert.notEqual('', errorDotJson.errors);
|
|
705
|
+
assert.equal(true, Array.isArray(errorDotJson.errors));
|
|
706
|
+
assert.notEqual(0, errorDotJson.errors.length);
|
|
707
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.100'));
|
|
708
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.101'));
|
|
709
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.102'));
|
|
710
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.110'));
|
|
711
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.111'));
|
|
712
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.112'));
|
|
713
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.113'));
|
|
714
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.114'));
|
|
715
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.115'));
|
|
716
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.116'));
|
|
717
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.300'));
|
|
718
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.301'));
|
|
719
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.302'));
|
|
720
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.303'));
|
|
721
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.304'));
|
|
722
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.305'));
|
|
723
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.310'));
|
|
724
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.311'));
|
|
725
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.312'));
|
|
726
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.320'));
|
|
727
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.321'));
|
|
728
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.400'));
|
|
729
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.401'));
|
|
730
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.402'));
|
|
731
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.500'));
|
|
732
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.501'));
|
|
733
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.502'));
|
|
734
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.503'));
|
|
735
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.600'));
|
|
736
|
+
assert.notEqual(undefined, errorDotJson.errors.find((e) => e.icode === 'AD.900'));
|
|
737
|
+
done();
|
|
738
|
+
} catch (error) {
|
|
739
|
+
log.error(`Test Failure: ${error}`);
|
|
740
|
+
done(error);
|
|
741
|
+
}
|
|
742
|
+
});
|
|
743
|
+
});
|
|
744
|
+
|
|
745
|
+
describe('sampleProperties.json', () => {
|
|
746
|
+
it('should have a sampleProperties.json', (done) => {
|
|
747
|
+
try {
|
|
748
|
+
fs.exists('sampleProperties.json', (val) => {
|
|
749
|
+
assert.equal(true, val);
|
|
750
|
+
done();
|
|
751
|
+
});
|
|
752
|
+
} catch (error) {
|
|
753
|
+
log.error(`Test Failure: ${error}`);
|
|
754
|
+
done(error);
|
|
755
|
+
}
|
|
756
|
+
});
|
|
757
|
+
it('sampleProperties.json should contain generic adapter properties', (done) => {
|
|
758
|
+
try {
|
|
759
|
+
const sampleDotJson = require('../../sampleProperties.json');
|
|
760
|
+
assert.notEqual(-1, sampleDotJson.id.indexOf('tiger_connect'));
|
|
761
|
+
assert.equal('TigerConnect', sampleDotJson.type);
|
|
762
|
+
assert.notEqual(undefined, sampleDotJson.properties);
|
|
763
|
+
assert.notEqual(null, sampleDotJson.properties);
|
|
764
|
+
assert.notEqual('', sampleDotJson.properties);
|
|
765
|
+
assert.notEqual(undefined, sampleDotJson.properties.host);
|
|
766
|
+
assert.notEqual(undefined, sampleDotJson.properties.port);
|
|
767
|
+
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
768
|
+
assert.notEqual(undefined, sampleDotJson.properties.protocol);
|
|
769
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication);
|
|
770
|
+
assert.notEqual(null, sampleDotJson.properties.authentication);
|
|
771
|
+
assert.notEqual('', sampleDotJson.properties.authentication);
|
|
772
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_method);
|
|
773
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.username);
|
|
774
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.password);
|
|
775
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.token);
|
|
776
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.invalid_token_error);
|
|
777
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.token_timeout);
|
|
778
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.token_cache);
|
|
779
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field);
|
|
780
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_field_format);
|
|
781
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.auth_logging);
|
|
782
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.client_id);
|
|
783
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.client_secret);
|
|
784
|
+
assert.notEqual(undefined, sampleDotJson.properties.authentication.grant_type);
|
|
785
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl);
|
|
786
|
+
assert.notEqual(null, sampleDotJson.properties.ssl);
|
|
787
|
+
assert.notEqual('', sampleDotJson.properties.ssl);
|
|
788
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.ecdhCurve);
|
|
789
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.enabled);
|
|
790
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.accept_invalid_cert);
|
|
791
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.ca_file);
|
|
792
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.key_file);
|
|
793
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.cert_file);
|
|
794
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.secure_protocol);
|
|
795
|
+
assert.notEqual(undefined, sampleDotJson.properties.ssl.ciphers);
|
|
796
|
+
assert.notEqual(undefined, sampleDotJson.properties.base_path);
|
|
797
|
+
assert.notEqual(undefined, sampleDotJson.properties.version);
|
|
798
|
+
assert.notEqual(undefined, sampleDotJson.properties.cache_location);
|
|
799
|
+
assert.notEqual(undefined, sampleDotJson.properties.encode_pathvars);
|
|
800
|
+
assert.notEqual(undefined, sampleDotJson.properties.encode_queryvars);
|
|
801
|
+
assert.notEqual(undefined, sampleDotJson.properties.save_metric);
|
|
802
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck);
|
|
803
|
+
assert.notEqual(null, sampleDotJson.properties.healthcheck);
|
|
804
|
+
assert.notEqual('', sampleDotJson.properties.healthcheck);
|
|
805
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck.type);
|
|
806
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck.frequency);
|
|
807
|
+
assert.notEqual(undefined, sampleDotJson.properties.healthcheck.query_object);
|
|
808
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle);
|
|
809
|
+
assert.notEqual(null, sampleDotJson.properties.throttle);
|
|
810
|
+
assert.notEqual('', sampleDotJson.properties.throttle);
|
|
811
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.throttle_enabled);
|
|
812
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.number_pronghorns);
|
|
813
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.sync_async);
|
|
814
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.max_in_queue);
|
|
815
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.concurrent_max);
|
|
816
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.expire_timeout);
|
|
817
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.avg_runtime);
|
|
818
|
+
assert.notEqual(undefined, sampleDotJson.properties.throttle.priorities);
|
|
819
|
+
assert.notEqual(undefined, sampleDotJson.properties.request);
|
|
820
|
+
assert.notEqual(null, sampleDotJson.properties.request);
|
|
821
|
+
assert.notEqual('', sampleDotJson.properties.request);
|
|
822
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.number_redirects);
|
|
823
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.number_retries);
|
|
824
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.limit_retry_error);
|
|
825
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.failover_codes);
|
|
826
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.attempt_timeout);
|
|
827
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request);
|
|
828
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.payload);
|
|
829
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.uriOptions);
|
|
830
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.addlHeaders);
|
|
831
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.global_request.authData);
|
|
832
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.healthcheck_on_timeout);
|
|
833
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.return_raw);
|
|
834
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.archiving);
|
|
835
|
+
assert.notEqual(undefined, sampleDotJson.properties.request.return_request);
|
|
836
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy);
|
|
837
|
+
assert.notEqual(null, sampleDotJson.properties.proxy);
|
|
838
|
+
assert.notEqual('', sampleDotJson.properties.proxy);
|
|
839
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.enabled);
|
|
840
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.host);
|
|
841
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.port);
|
|
842
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.protocol);
|
|
843
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.username);
|
|
844
|
+
assert.notEqual(undefined, sampleDotJson.properties.proxy.password);
|
|
845
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo);
|
|
846
|
+
assert.notEqual(null, sampleDotJson.properties.mongo);
|
|
847
|
+
assert.notEqual('', sampleDotJson.properties.mongo);
|
|
848
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.host);
|
|
849
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.port);
|
|
850
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.database);
|
|
851
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.username);
|
|
852
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.password);
|
|
853
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.replSet);
|
|
854
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl);
|
|
855
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.enabled);
|
|
856
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.accept_invalid_cert);
|
|
857
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.ca_file);
|
|
858
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.key_file);
|
|
859
|
+
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.cert_file);
|
|
860
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker);
|
|
861
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevice);
|
|
862
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevicesFiltered);
|
|
863
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.isAlive);
|
|
864
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getConfig);
|
|
865
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getCount);
|
|
866
|
+
done();
|
|
867
|
+
} catch (error) {
|
|
868
|
+
log.error(`Test Failure: ${error}`);
|
|
869
|
+
done(error);
|
|
870
|
+
}
|
|
871
|
+
});
|
|
872
|
+
});
|
|
873
|
+
|
|
874
|
+
describe('#checkProperties', () => {
|
|
875
|
+
it('should have a checkProperties function', (done) => {
|
|
876
|
+
try {
|
|
877
|
+
assert.equal(true, typeof a.checkProperties === 'function');
|
|
878
|
+
done();
|
|
879
|
+
} catch (error) {
|
|
880
|
+
log.error(`Test Failure: ${error}`);
|
|
881
|
+
done(error);
|
|
882
|
+
}
|
|
883
|
+
});
|
|
884
|
+
it('the sample properties should be good - if failure change the log level', (done) => {
|
|
885
|
+
try {
|
|
886
|
+
const samplePropsJson = require('../../sampleProperties.json');
|
|
887
|
+
const clean = a.checkProperties(samplePropsJson.properties);
|
|
888
|
+
|
|
889
|
+
try {
|
|
890
|
+
assert.notEqual(0, Object.keys(clean));
|
|
891
|
+
assert.equal(undefined, clean.exception);
|
|
892
|
+
assert.notEqual(undefined, clean.host);
|
|
893
|
+
assert.notEqual(null, clean.host);
|
|
894
|
+
assert.notEqual('', clean.host);
|
|
895
|
+
done();
|
|
896
|
+
} catch (err) {
|
|
897
|
+
log.error(`Test Failure: ${err}`);
|
|
898
|
+
done(err);
|
|
899
|
+
}
|
|
900
|
+
} catch (error) {
|
|
901
|
+
log.error(`Adapter Exception: ${error}`);
|
|
902
|
+
done(error);
|
|
903
|
+
}
|
|
904
|
+
}).timeout(attemptTimeout);
|
|
905
|
+
});
|
|
906
|
+
|
|
907
|
+
describe('README.md', () => {
|
|
908
|
+
it('should have a README', (done) => {
|
|
909
|
+
try {
|
|
910
|
+
fs.exists('README.md', (val) => {
|
|
911
|
+
assert.equal(true, val);
|
|
912
|
+
done();
|
|
913
|
+
});
|
|
914
|
+
} catch (error) {
|
|
915
|
+
log.error(`Test Failure: ${error}`);
|
|
916
|
+
done(error);
|
|
917
|
+
}
|
|
918
|
+
});
|
|
919
|
+
it('README.md should be customized', (done) => {
|
|
920
|
+
try {
|
|
921
|
+
fs.readFile('README.md', 'utf8', (err, data) => {
|
|
922
|
+
assert.equal(-1, data.indexOf('[System]'));
|
|
923
|
+
assert.equal(-1, data.indexOf('[system]'));
|
|
924
|
+
assert.equal(-1, data.indexOf('[version]'));
|
|
925
|
+
assert.equal(-1, data.indexOf('[namespace]'));
|
|
926
|
+
done();
|
|
927
|
+
});
|
|
928
|
+
} catch (error) {
|
|
929
|
+
log.error(`Test Failure: ${error}`);
|
|
930
|
+
done(error);
|
|
931
|
+
}
|
|
932
|
+
});
|
|
933
|
+
});
|
|
934
|
+
|
|
935
|
+
describe('#connect', () => {
|
|
936
|
+
it('should have a connect function', (done) => {
|
|
937
|
+
try {
|
|
938
|
+
assert.equal(true, typeof a.connect === 'function');
|
|
939
|
+
done();
|
|
940
|
+
} catch (error) {
|
|
941
|
+
log.error(`Test Failure: ${error}`);
|
|
942
|
+
done(error);
|
|
943
|
+
}
|
|
944
|
+
});
|
|
945
|
+
});
|
|
946
|
+
|
|
947
|
+
describe('#healthCheck', () => {
|
|
948
|
+
it('should have a healthCheck function', (done) => {
|
|
949
|
+
try {
|
|
950
|
+
assert.equal(true, typeof a.healthCheck === 'function');
|
|
951
|
+
done();
|
|
952
|
+
} catch (error) {
|
|
953
|
+
log.error(`Test Failure: ${error}`);
|
|
954
|
+
done(error);
|
|
955
|
+
}
|
|
956
|
+
});
|
|
957
|
+
});
|
|
958
|
+
|
|
959
|
+
describe('#iapUpdateAdapterConfiguration', () => {
|
|
960
|
+
it('should have a iapUpdateAdapterConfiguration function', (done) => {
|
|
961
|
+
try {
|
|
962
|
+
assert.equal(true, typeof a.iapUpdateAdapterConfiguration === 'function');
|
|
963
|
+
done();
|
|
964
|
+
} catch (error) {
|
|
965
|
+
log.error(`Test Failure: ${error}`);
|
|
966
|
+
done(error);
|
|
967
|
+
}
|
|
968
|
+
});
|
|
969
|
+
});
|
|
970
|
+
|
|
971
|
+
describe('#iapFindAdapterPath', () => {
|
|
972
|
+
it('should have a iapFindAdapterPath function', (done) => {
|
|
973
|
+
try {
|
|
974
|
+
assert.equal(true, typeof a.iapFindAdapterPath === 'function');
|
|
975
|
+
done();
|
|
976
|
+
} catch (error) {
|
|
977
|
+
log.error(`Test Failure: ${error}`);
|
|
978
|
+
done(error);
|
|
979
|
+
}
|
|
980
|
+
});
|
|
981
|
+
it('iapFindAdapterPath should find atleast one path that matches', (done) => {
|
|
982
|
+
try {
|
|
983
|
+
a.iapFindAdapterPath('{base_path}/{version}', (data, error) => {
|
|
984
|
+
try {
|
|
985
|
+
assert.equal(undefined, error);
|
|
986
|
+
assert.notEqual(undefined, data);
|
|
987
|
+
assert.notEqual(null, data);
|
|
988
|
+
assert.equal(true, data.found);
|
|
989
|
+
assert.notEqual(undefined, data.foundIn);
|
|
990
|
+
assert.notEqual(null, data.foundIn);
|
|
991
|
+
assert.notEqual(0, data.foundIn.length);
|
|
992
|
+
done();
|
|
993
|
+
} catch (err) {
|
|
994
|
+
log.error(`Test Failure: ${err}`);
|
|
995
|
+
done(err);
|
|
996
|
+
}
|
|
997
|
+
});
|
|
998
|
+
} catch (error) {
|
|
999
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1000
|
+
done(error);
|
|
1001
|
+
}
|
|
1002
|
+
}).timeout(attemptTimeout);
|
|
1003
|
+
});
|
|
1004
|
+
|
|
1005
|
+
describe('#iapSuspendAdapter', () => {
|
|
1006
|
+
it('should have a iapSuspendAdapter function', (done) => {
|
|
1007
|
+
try {
|
|
1008
|
+
assert.equal(true, typeof a.iapSuspendAdapter === 'function');
|
|
1009
|
+
done();
|
|
1010
|
+
} catch (error) {
|
|
1011
|
+
log.error(`Test Failure: ${error}`);
|
|
1012
|
+
done(error);
|
|
1013
|
+
}
|
|
1014
|
+
});
|
|
1015
|
+
});
|
|
1016
|
+
|
|
1017
|
+
describe('#iapUnsuspendAdapter', () => {
|
|
1018
|
+
it('should have a iapUnsuspendAdapter function', (done) => {
|
|
1019
|
+
try {
|
|
1020
|
+
assert.equal(true, typeof a.iapUnsuspendAdapter === 'function');
|
|
1021
|
+
done();
|
|
1022
|
+
} catch (error) {
|
|
1023
|
+
log.error(`Test Failure: ${error}`);
|
|
1024
|
+
done(error);
|
|
1025
|
+
}
|
|
1026
|
+
});
|
|
1027
|
+
});
|
|
1028
|
+
|
|
1029
|
+
describe('#iapGetAdapterQueue', () => {
|
|
1030
|
+
it('should have a iapGetAdapterQueue function', (done) => {
|
|
1031
|
+
try {
|
|
1032
|
+
assert.equal(true, typeof a.iapGetAdapterQueue === 'function');
|
|
1033
|
+
done();
|
|
1034
|
+
} catch (error) {
|
|
1035
|
+
log.error(`Test Failure: ${error}`);
|
|
1036
|
+
done(error);
|
|
1037
|
+
}
|
|
1038
|
+
});
|
|
1039
|
+
});
|
|
1040
|
+
|
|
1041
|
+
describe('#iapTroubleshootAdapter', () => {
|
|
1042
|
+
it('should have a iapTroubleshootAdapter function', (done) => {
|
|
1043
|
+
try {
|
|
1044
|
+
assert.equal(true, typeof a.iapTroubleshootAdapter === 'function');
|
|
1045
|
+
done();
|
|
1046
|
+
} catch (error) {
|
|
1047
|
+
log.error(`Test Failure: ${error}`);
|
|
1048
|
+
done(error);
|
|
1049
|
+
}
|
|
1050
|
+
});
|
|
1051
|
+
});
|
|
1052
|
+
|
|
1053
|
+
describe('#iapRunAdapterHealthcheck', () => {
|
|
1054
|
+
it('should have a iapRunAdapterHealthcheck function', (done) => {
|
|
1055
|
+
try {
|
|
1056
|
+
assert.equal(true, typeof a.iapRunAdapterHealthcheck === 'function');
|
|
1057
|
+
done();
|
|
1058
|
+
} catch (error) {
|
|
1059
|
+
log.error(`Test Failure: ${error}`);
|
|
1060
|
+
done(error);
|
|
1061
|
+
}
|
|
1062
|
+
});
|
|
1063
|
+
});
|
|
1064
|
+
|
|
1065
|
+
describe('#iapRunAdapterConnectivity', () => {
|
|
1066
|
+
it('should have a iapRunAdapterConnectivity function', (done) => {
|
|
1067
|
+
try {
|
|
1068
|
+
assert.equal(true, typeof a.iapRunAdapterConnectivity === 'function');
|
|
1069
|
+
done();
|
|
1070
|
+
} catch (error) {
|
|
1071
|
+
log.error(`Test Failure: ${error}`);
|
|
1072
|
+
done(error);
|
|
1073
|
+
}
|
|
1074
|
+
});
|
|
1075
|
+
});
|
|
1076
|
+
|
|
1077
|
+
describe('#iapRunAdapterBasicGet', () => {
|
|
1078
|
+
it('should have a iapRunAdapterBasicGet function', (done) => {
|
|
1079
|
+
try {
|
|
1080
|
+
assert.equal(true, typeof a.iapRunAdapterBasicGet === 'function');
|
|
1081
|
+
done();
|
|
1082
|
+
} catch (error) {
|
|
1083
|
+
log.error(`Test Failure: ${error}`);
|
|
1084
|
+
done(error);
|
|
1085
|
+
}
|
|
1086
|
+
});
|
|
1087
|
+
});
|
|
1088
|
+
|
|
1089
|
+
describe('#iapMoveAdapterEntitiesToDB', () => {
|
|
1090
|
+
it('should have a iapMoveAdapterEntitiesToDB function', (done) => {
|
|
1091
|
+
try {
|
|
1092
|
+
assert.equal(true, typeof a.iapMoveAdapterEntitiesToDB === 'function');
|
|
1093
|
+
done();
|
|
1094
|
+
} catch (error) {
|
|
1095
|
+
log.error(`Test Failure: ${error}`);
|
|
1096
|
+
done(error);
|
|
1097
|
+
}
|
|
1098
|
+
});
|
|
1099
|
+
});
|
|
1100
|
+
|
|
1101
|
+
describe('#checkActionFiles', () => {
|
|
1102
|
+
it('should have a checkActionFiles function', (done) => {
|
|
1103
|
+
try {
|
|
1104
|
+
assert.equal(true, typeof a.checkActionFiles === 'function');
|
|
1105
|
+
done();
|
|
1106
|
+
} catch (error) {
|
|
1107
|
+
log.error(`Test Failure: ${error}`);
|
|
1108
|
+
done(error);
|
|
1109
|
+
}
|
|
1110
|
+
});
|
|
1111
|
+
it('the action files should be good - if failure change the log level as most issues are warnings', (done) => {
|
|
1112
|
+
try {
|
|
1113
|
+
const clean = a.checkActionFiles();
|
|
1114
|
+
|
|
1115
|
+
try {
|
|
1116
|
+
for (let c = 0; c < clean.length; c += 1) {
|
|
1117
|
+
log.error(clean[c]);
|
|
1118
|
+
}
|
|
1119
|
+
assert.equal(0, clean.length);
|
|
1120
|
+
done();
|
|
1121
|
+
} catch (err) {
|
|
1122
|
+
log.error(`Test Failure: ${err}`);
|
|
1123
|
+
done(err);
|
|
1124
|
+
}
|
|
1125
|
+
} catch (error) {
|
|
1126
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1127
|
+
done(error);
|
|
1128
|
+
}
|
|
1129
|
+
}).timeout(attemptTimeout);
|
|
1130
|
+
});
|
|
1131
|
+
|
|
1132
|
+
describe('#encryptProperty', () => {
|
|
1133
|
+
it('should have a encryptProperty function', (done) => {
|
|
1134
|
+
try {
|
|
1135
|
+
assert.equal(true, typeof a.encryptProperty === 'function');
|
|
1136
|
+
done();
|
|
1137
|
+
} catch (error) {
|
|
1138
|
+
log.error(`Test Failure: ${error}`);
|
|
1139
|
+
done(error);
|
|
1140
|
+
}
|
|
1141
|
+
});
|
|
1142
|
+
it('should get base64 encoded property', (done) => {
|
|
1143
|
+
try {
|
|
1144
|
+
a.encryptProperty('testing', 'base64', (data, error) => {
|
|
1145
|
+
try {
|
|
1146
|
+
assert.equal(undefined, error);
|
|
1147
|
+
assert.notEqual(undefined, data);
|
|
1148
|
+
assert.notEqual(null, data);
|
|
1149
|
+
assert.notEqual(undefined, data.response);
|
|
1150
|
+
assert.notEqual(null, data.response);
|
|
1151
|
+
assert.equal(0, data.response.indexOf('{code}'));
|
|
1152
|
+
done();
|
|
1153
|
+
} catch (err) {
|
|
1154
|
+
log.error(`Test Failure: ${err}`);
|
|
1155
|
+
done(err);
|
|
1156
|
+
}
|
|
1157
|
+
});
|
|
1158
|
+
} catch (error) {
|
|
1159
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1160
|
+
done(error);
|
|
1161
|
+
}
|
|
1162
|
+
}).timeout(attemptTimeout);
|
|
1163
|
+
it('should get encrypted property', (done) => {
|
|
1164
|
+
try {
|
|
1165
|
+
a.encryptProperty('testing', 'encrypt', (data, error) => {
|
|
1166
|
+
try {
|
|
1167
|
+
assert.equal(undefined, error);
|
|
1168
|
+
assert.notEqual(undefined, data);
|
|
1169
|
+
assert.notEqual(null, data);
|
|
1170
|
+
assert.notEqual(undefined, data.response);
|
|
1171
|
+
assert.notEqual(null, data.response);
|
|
1172
|
+
assert.equal(0, data.response.indexOf('{crypt}'));
|
|
1173
|
+
done();
|
|
1174
|
+
} catch (err) {
|
|
1175
|
+
log.error(`Test Failure: ${err}`);
|
|
1176
|
+
done(err);
|
|
1177
|
+
}
|
|
1178
|
+
});
|
|
1179
|
+
} catch (error) {
|
|
1180
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1181
|
+
done(error);
|
|
1182
|
+
}
|
|
1183
|
+
}).timeout(attemptTimeout);
|
|
1184
|
+
});
|
|
1185
|
+
|
|
1186
|
+
// describe('#iapHasAdapterEntity', () => {
|
|
1187
|
+
// it('should have a iapHasAdapterEntity function', (done) => {
|
|
1188
|
+
// try {
|
|
1189
|
+
// assert.equal(true, typeof a.iapHasAdapterEntity === 'function');
|
|
1190
|
+
// done();
|
|
1191
|
+
// } catch (error) {
|
|
1192
|
+
// log.error(`Test Failure: ${error}`);
|
|
1193
|
+
// done(error);
|
|
1194
|
+
// }
|
|
1195
|
+
// });
|
|
1196
|
+
// it('should find entity', (done) => {
|
|
1197
|
+
// try {
|
|
1198
|
+
// a.iapHasAdapterEntity('template_entity', // 'a9e9c33dc61122760072455df62663d2', (data) => {
|
|
1199
|
+
// try {
|
|
1200
|
+
// assert.equal(true, data[0]);
|
|
1201
|
+
// done();
|
|
1202
|
+
// } catch (err) {
|
|
1203
|
+
// log.error(`Test Failure: ${err}`);
|
|
1204
|
+
// done(err);
|
|
1205
|
+
// }
|
|
1206
|
+
// });
|
|
1207
|
+
// } catch (error) {
|
|
1208
|
+
// log.error(`Adapter Exception: ${error}`);
|
|
1209
|
+
// done(error);
|
|
1210
|
+
// }
|
|
1211
|
+
// }).timeout(attemptTimeout);
|
|
1212
|
+
// it('should not find entity', (done) => {
|
|
1213
|
+
// try {
|
|
1214
|
+
// a.iapHasAdapterEntity('template_entity', 'blah', (data) => {
|
|
1215
|
+
// try {
|
|
1216
|
+
// assert.equal(false, data[0]);
|
|
1217
|
+
// done();
|
|
1218
|
+
// } catch (err) {
|
|
1219
|
+
// log.error(`Test Failure: ${err}`);
|
|
1220
|
+
// done(err);
|
|
1221
|
+
// }
|
|
1222
|
+
// });
|
|
1223
|
+
// } catch (error) {
|
|
1224
|
+
// log.error(`Adapter Exception: ${error}`);
|
|
1225
|
+
// done(error);
|
|
1226
|
+
// }
|
|
1227
|
+
// }).timeout(attemptTimeout);
|
|
1228
|
+
// });
|
|
1229
|
+
|
|
1230
|
+
describe('#hasEntities', () => {
|
|
1231
|
+
it('should have a hasEntities function', (done) => {
|
|
1232
|
+
try {
|
|
1233
|
+
assert.equal(true, typeof a.hasEntities === 'function');
|
|
1234
|
+
done();
|
|
1235
|
+
} catch (error) {
|
|
1236
|
+
log.error(`Test Failure: ${error}`);
|
|
1237
|
+
done(error);
|
|
1238
|
+
}
|
|
1239
|
+
});
|
|
1240
|
+
});
|
|
1241
|
+
|
|
1242
|
+
describe('#getDevice', () => {
|
|
1243
|
+
it('should have a getDevice function', (done) => {
|
|
1244
|
+
try {
|
|
1245
|
+
assert.equal(true, typeof a.getDevice === 'function');
|
|
1246
|
+
done();
|
|
1247
|
+
} catch (error) {
|
|
1248
|
+
log.error(`Test Failure: ${error}`);
|
|
1249
|
+
done(error);
|
|
1250
|
+
}
|
|
1251
|
+
});
|
|
1252
|
+
});
|
|
1253
|
+
|
|
1254
|
+
describe('#getDevicesFiltered', () => {
|
|
1255
|
+
it('should have a getDevicesFiltered function', (done) => {
|
|
1256
|
+
try {
|
|
1257
|
+
assert.equal(true, typeof a.getDevicesFiltered === 'function');
|
|
1258
|
+
done();
|
|
1259
|
+
} catch (error) {
|
|
1260
|
+
log.error(`Test Failure: ${error}`);
|
|
1261
|
+
done(error);
|
|
1262
|
+
}
|
|
1263
|
+
});
|
|
1264
|
+
});
|
|
1265
|
+
|
|
1266
|
+
describe('#isAlive', () => {
|
|
1267
|
+
it('should have a isAlive function', (done) => {
|
|
1268
|
+
try {
|
|
1269
|
+
assert.equal(true, typeof a.isAlive === 'function');
|
|
1270
|
+
done();
|
|
1271
|
+
} catch (error) {
|
|
1272
|
+
log.error(`Test Failure: ${error}`);
|
|
1273
|
+
done(error);
|
|
1274
|
+
}
|
|
1275
|
+
});
|
|
1276
|
+
});
|
|
1277
|
+
|
|
1278
|
+
describe('#getConfig', () => {
|
|
1279
|
+
it('should have a getConfig function', (done) => {
|
|
1280
|
+
try {
|
|
1281
|
+
assert.equal(true, typeof a.getConfig === 'function');
|
|
1282
|
+
done();
|
|
1283
|
+
} catch (error) {
|
|
1284
|
+
log.error(`Test Failure: ${error}`);
|
|
1285
|
+
done(error);
|
|
1286
|
+
}
|
|
1287
|
+
});
|
|
1288
|
+
});
|
|
1289
|
+
|
|
1290
|
+
describe('#iapGetDeviceCount', () => {
|
|
1291
|
+
it('should have a iapGetDeviceCount function', (done) => {
|
|
1292
|
+
try {
|
|
1293
|
+
assert.equal(true, typeof a.iapGetDeviceCount === 'function');
|
|
1294
|
+
done();
|
|
1295
|
+
} catch (error) {
|
|
1296
|
+
log.error(`Test Failure: ${error}`);
|
|
1297
|
+
done(error);
|
|
1298
|
+
}
|
|
1299
|
+
});
|
|
1300
|
+
});
|
|
1301
|
+
|
|
1302
|
+
/*
|
|
1303
|
+
-----------------------------------------------------------------------
|
|
1304
|
+
-----------------------------------------------------------------------
|
|
1305
|
+
*** All code above this comment will be replaced during a migration ***
|
|
1306
|
+
******************* DO NOT REMOVE THIS COMMENT BLOCK ******************
|
|
1307
|
+
-----------------------------------------------------------------------
|
|
1308
|
+
-----------------------------------------------------------------------
|
|
1309
|
+
*/
|
|
1310
|
+
|
|
1311
|
+
describe('#postCreateNewGroup - errors', () => {
|
|
1312
|
+
it('should have a postCreateNewGroup function', (done) => {
|
|
1313
|
+
try {
|
|
1314
|
+
assert.equal(true, typeof a.postCreateNewGroup === 'function');
|
|
1315
|
+
done();
|
|
1316
|
+
} catch (error) {
|
|
1317
|
+
log.error(`Test Failure: ${error}`);
|
|
1318
|
+
done(error);
|
|
1319
|
+
}
|
|
1320
|
+
}).timeout(attemptTimeout);
|
|
1321
|
+
it('should error if - missing body', (done) => {
|
|
1322
|
+
try {
|
|
1323
|
+
a.postCreateNewGroup(null, (data, error) => {
|
|
1324
|
+
try {
|
|
1325
|
+
const displayE = 'body is required';
|
|
1326
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postCreateNewGroup', displayE);
|
|
1327
|
+
done();
|
|
1328
|
+
} catch (err) {
|
|
1329
|
+
log.error(`Test Failure: ${err}`);
|
|
1330
|
+
done(err);
|
|
1331
|
+
}
|
|
1332
|
+
});
|
|
1333
|
+
} catch (error) {
|
|
1334
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1335
|
+
done(error);
|
|
1336
|
+
}
|
|
1337
|
+
}).timeout(attemptTimeout);
|
|
1338
|
+
});
|
|
1339
|
+
|
|
1340
|
+
describe('#getGroupInfo - errors', () => {
|
|
1341
|
+
it('should have a getGroupInfo function', (done) => {
|
|
1342
|
+
try {
|
|
1343
|
+
assert.equal(true, typeof a.getGroupInfo === 'function');
|
|
1344
|
+
done();
|
|
1345
|
+
} catch (error) {
|
|
1346
|
+
log.error(`Test Failure: ${error}`);
|
|
1347
|
+
done(error);
|
|
1348
|
+
}
|
|
1349
|
+
}).timeout(attemptTimeout);
|
|
1350
|
+
it('should error if - missing groupid', (done) => {
|
|
1351
|
+
try {
|
|
1352
|
+
a.getGroupInfo(null, (data, error) => {
|
|
1353
|
+
try {
|
|
1354
|
+
const displayE = 'groupid is required';
|
|
1355
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-getGroupInfo', displayE);
|
|
1356
|
+
done();
|
|
1357
|
+
} catch (err) {
|
|
1358
|
+
log.error(`Test Failure: ${err}`);
|
|
1359
|
+
done(err);
|
|
1360
|
+
}
|
|
1361
|
+
});
|
|
1362
|
+
} catch (error) {
|
|
1363
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1364
|
+
done(error);
|
|
1365
|
+
}
|
|
1366
|
+
}).timeout(attemptTimeout);
|
|
1367
|
+
});
|
|
1368
|
+
|
|
1369
|
+
describe('#deleteGroup - errors', () => {
|
|
1370
|
+
it('should have a deleteGroup function', (done) => {
|
|
1371
|
+
try {
|
|
1372
|
+
assert.equal(true, typeof a.deleteGroup === 'function');
|
|
1373
|
+
done();
|
|
1374
|
+
} catch (error) {
|
|
1375
|
+
log.error(`Test Failure: ${error}`);
|
|
1376
|
+
done(error);
|
|
1377
|
+
}
|
|
1378
|
+
}).timeout(attemptTimeout);
|
|
1379
|
+
it('should error if - missing groupid', (done) => {
|
|
1380
|
+
try {
|
|
1381
|
+
a.deleteGroup(null, (data, error) => {
|
|
1382
|
+
try {
|
|
1383
|
+
const displayE = 'groupid is required';
|
|
1384
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-deleteGroup', displayE);
|
|
1385
|
+
done();
|
|
1386
|
+
} catch (err) {
|
|
1387
|
+
log.error(`Test Failure: ${err}`);
|
|
1388
|
+
done(err);
|
|
1389
|
+
}
|
|
1390
|
+
});
|
|
1391
|
+
} catch (error) {
|
|
1392
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1393
|
+
done(error);
|
|
1394
|
+
}
|
|
1395
|
+
}).timeout(attemptTimeout);
|
|
1396
|
+
});
|
|
1397
|
+
|
|
1398
|
+
describe('#postUpdateGroup - errors', () => {
|
|
1399
|
+
it('should have a postUpdateGroup function', (done) => {
|
|
1400
|
+
try {
|
|
1401
|
+
assert.equal(true, typeof a.postUpdateGroup === 'function');
|
|
1402
|
+
done();
|
|
1403
|
+
} catch (error) {
|
|
1404
|
+
log.error(`Test Failure: ${error}`);
|
|
1405
|
+
done(error);
|
|
1406
|
+
}
|
|
1407
|
+
}).timeout(attemptTimeout);
|
|
1408
|
+
it('should error if - missing groupid', (done) => {
|
|
1409
|
+
try {
|
|
1410
|
+
a.postUpdateGroup(null, null, (data, error) => {
|
|
1411
|
+
try {
|
|
1412
|
+
const displayE = 'groupid is required';
|
|
1413
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postUpdateGroup', displayE);
|
|
1414
|
+
done();
|
|
1415
|
+
} catch (err) {
|
|
1416
|
+
log.error(`Test Failure: ${err}`);
|
|
1417
|
+
done(err);
|
|
1418
|
+
}
|
|
1419
|
+
});
|
|
1420
|
+
} catch (error) {
|
|
1421
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1422
|
+
done(error);
|
|
1423
|
+
}
|
|
1424
|
+
}).timeout(attemptTimeout);
|
|
1425
|
+
it('should error if - missing body', (done) => {
|
|
1426
|
+
try {
|
|
1427
|
+
a.postUpdateGroup('fakeparam', null, (data, error) => {
|
|
1428
|
+
try {
|
|
1429
|
+
const displayE = 'body is required';
|
|
1430
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postUpdateGroup', displayE);
|
|
1431
|
+
done();
|
|
1432
|
+
} catch (err) {
|
|
1433
|
+
log.error(`Test Failure: ${err}`);
|
|
1434
|
+
done(err);
|
|
1435
|
+
}
|
|
1436
|
+
});
|
|
1437
|
+
} catch (error) {
|
|
1438
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1439
|
+
done(error);
|
|
1440
|
+
}
|
|
1441
|
+
}).timeout(attemptTimeout);
|
|
1442
|
+
});
|
|
1443
|
+
|
|
1444
|
+
describe('#postAddMemberToGroup - errors', () => {
|
|
1445
|
+
it('should have a postAddMemberToGroup function', (done) => {
|
|
1446
|
+
try {
|
|
1447
|
+
assert.equal(true, typeof a.postAddMemberToGroup === 'function');
|
|
1448
|
+
done();
|
|
1449
|
+
} catch (error) {
|
|
1450
|
+
log.error(`Test Failure: ${error}`);
|
|
1451
|
+
done(error);
|
|
1452
|
+
}
|
|
1453
|
+
}).timeout(attemptTimeout);
|
|
1454
|
+
it('should error if - missing groupid', (done) => {
|
|
1455
|
+
try {
|
|
1456
|
+
a.postAddMemberToGroup(null, null, (data, error) => {
|
|
1457
|
+
try {
|
|
1458
|
+
const displayE = 'groupid is required';
|
|
1459
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postAddMemberToGroup', displayE);
|
|
1460
|
+
done();
|
|
1461
|
+
} catch (err) {
|
|
1462
|
+
log.error(`Test Failure: ${err}`);
|
|
1463
|
+
done(err);
|
|
1464
|
+
}
|
|
1465
|
+
});
|
|
1466
|
+
} catch (error) {
|
|
1467
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1468
|
+
done(error);
|
|
1469
|
+
}
|
|
1470
|
+
}).timeout(attemptTimeout);
|
|
1471
|
+
it('should error if - missing members', (done) => {
|
|
1472
|
+
try {
|
|
1473
|
+
a.postAddMemberToGroup('fakeparam', null, (data, error) => {
|
|
1474
|
+
try {
|
|
1475
|
+
const displayE = 'members is required';
|
|
1476
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postAddMemberToGroup', displayE);
|
|
1477
|
+
done();
|
|
1478
|
+
} catch (err) {
|
|
1479
|
+
log.error(`Test Failure: ${err}`);
|
|
1480
|
+
done(err);
|
|
1481
|
+
}
|
|
1482
|
+
});
|
|
1483
|
+
} catch (error) {
|
|
1484
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1485
|
+
done(error);
|
|
1486
|
+
}
|
|
1487
|
+
}).timeout(attemptTimeout);
|
|
1488
|
+
});
|
|
1489
|
+
|
|
1490
|
+
describe('#postRemoveGroupMember - errors', () => {
|
|
1491
|
+
it('should have a postRemoveGroupMember function', (done) => {
|
|
1492
|
+
try {
|
|
1493
|
+
assert.equal(true, typeof a.postRemoveGroupMember === 'function');
|
|
1494
|
+
done();
|
|
1495
|
+
} catch (error) {
|
|
1496
|
+
log.error(`Test Failure: ${error}`);
|
|
1497
|
+
done(error);
|
|
1498
|
+
}
|
|
1499
|
+
}).timeout(attemptTimeout);
|
|
1500
|
+
it('should error if - missing members', (done) => {
|
|
1501
|
+
try {
|
|
1502
|
+
a.postRemoveGroupMember(null, (data, error) => {
|
|
1503
|
+
try {
|
|
1504
|
+
const displayE = 'members is required';
|
|
1505
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postRemoveGroupMember', displayE);
|
|
1506
|
+
done();
|
|
1507
|
+
} catch (err) {
|
|
1508
|
+
log.error(`Test Failure: ${err}`);
|
|
1509
|
+
done(err);
|
|
1510
|
+
}
|
|
1511
|
+
});
|
|
1512
|
+
} catch (error) {
|
|
1513
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1514
|
+
done(error);
|
|
1515
|
+
}
|
|
1516
|
+
}).timeout(attemptTimeout);
|
|
1517
|
+
});
|
|
1518
|
+
|
|
1519
|
+
describe('#postNewMsgAfterConnection - errors', () => {
|
|
1520
|
+
it('should have a postNewMsgAfterConnection function', (done) => {
|
|
1521
|
+
try {
|
|
1522
|
+
assert.equal(true, typeof a.postNewMsgAfterConnection === 'function');
|
|
1523
|
+
done();
|
|
1524
|
+
} catch (error) {
|
|
1525
|
+
log.error(`Test Failure: ${error}`);
|
|
1526
|
+
done(error);
|
|
1527
|
+
}
|
|
1528
|
+
}).timeout(attemptTimeout);
|
|
1529
|
+
it('should error if - missing recipient', (done) => {
|
|
1530
|
+
try {
|
|
1531
|
+
a.postNewMsgAfterConnection(null, null, null, (data, error) => {
|
|
1532
|
+
try {
|
|
1533
|
+
const displayE = 'recipient is required';
|
|
1534
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postNewMsgAfterConnection', displayE);
|
|
1535
|
+
done();
|
|
1536
|
+
} catch (err) {
|
|
1537
|
+
log.error(`Test Failure: ${err}`);
|
|
1538
|
+
done(err);
|
|
1539
|
+
}
|
|
1540
|
+
});
|
|
1541
|
+
} catch (error) {
|
|
1542
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1543
|
+
done(error);
|
|
1544
|
+
}
|
|
1545
|
+
}).timeout(attemptTimeout);
|
|
1546
|
+
it('should error if - missing ttl', (done) => {
|
|
1547
|
+
try {
|
|
1548
|
+
a.postNewMsgAfterConnection('fakeparam', null, null, (data, error) => {
|
|
1549
|
+
try {
|
|
1550
|
+
const displayE = 'ttl is required';
|
|
1551
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postNewMsgAfterConnection', displayE);
|
|
1552
|
+
done();
|
|
1553
|
+
} catch (err) {
|
|
1554
|
+
log.error(`Test Failure: ${err}`);
|
|
1555
|
+
done(err);
|
|
1556
|
+
}
|
|
1557
|
+
});
|
|
1558
|
+
} catch (error) {
|
|
1559
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1560
|
+
done(error);
|
|
1561
|
+
}
|
|
1562
|
+
}).timeout(attemptTimeout);
|
|
1563
|
+
it('should error if - missing bodyFormData', (done) => {
|
|
1564
|
+
try {
|
|
1565
|
+
a.postNewMsgAfterConnection('fakeparam', 'fakeparam', null, (data, error) => {
|
|
1566
|
+
try {
|
|
1567
|
+
const displayE = 'bodyFormData is required';
|
|
1568
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postNewMsgAfterConnection', displayE);
|
|
1569
|
+
done();
|
|
1570
|
+
} catch (err) {
|
|
1571
|
+
log.error(`Test Failure: ${err}`);
|
|
1572
|
+
done(err);
|
|
1573
|
+
}
|
|
1574
|
+
});
|
|
1575
|
+
} catch (error) {
|
|
1576
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1577
|
+
done(error);
|
|
1578
|
+
}
|
|
1579
|
+
}).timeout(attemptTimeout);
|
|
1580
|
+
});
|
|
1581
|
+
|
|
1582
|
+
describe('#getMsgInfo - errors', () => {
|
|
1583
|
+
it('should have a getMsgInfo function', (done) => {
|
|
1584
|
+
try {
|
|
1585
|
+
assert.equal(true, typeof a.getMsgInfo === 'function');
|
|
1586
|
+
done();
|
|
1587
|
+
} catch (error) {
|
|
1588
|
+
log.error(`Test Failure: ${error}`);
|
|
1589
|
+
done(error);
|
|
1590
|
+
}
|
|
1591
|
+
}).timeout(attemptTimeout);
|
|
1592
|
+
it('should error if - missing messageid', (done) => {
|
|
1593
|
+
try {
|
|
1594
|
+
a.getMsgInfo(null, (data, error) => {
|
|
1595
|
+
try {
|
|
1596
|
+
const displayE = 'messageid is required';
|
|
1597
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-getMsgInfo', displayE);
|
|
1598
|
+
done();
|
|
1599
|
+
} catch (err) {
|
|
1600
|
+
log.error(`Test Failure: ${err}`);
|
|
1601
|
+
done(err);
|
|
1602
|
+
}
|
|
1603
|
+
});
|
|
1604
|
+
} catch (error) {
|
|
1605
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1606
|
+
done(error);
|
|
1607
|
+
}
|
|
1608
|
+
}).timeout(attemptTimeout);
|
|
1609
|
+
});
|
|
1610
|
+
|
|
1611
|
+
describe('#getMsgRecipientInfo - errors', () => {
|
|
1612
|
+
it('should have a getMsgRecipientInfo function', (done) => {
|
|
1613
|
+
try {
|
|
1614
|
+
assert.equal(true, typeof a.getMsgRecipientInfo === 'function');
|
|
1615
|
+
done();
|
|
1616
|
+
} catch (error) {
|
|
1617
|
+
log.error(`Test Failure: ${error}`);
|
|
1618
|
+
done(error);
|
|
1619
|
+
}
|
|
1620
|
+
}).timeout(attemptTimeout);
|
|
1621
|
+
it('should error if - missing messageid', (done) => {
|
|
1622
|
+
try {
|
|
1623
|
+
a.getMsgRecipientInfo(null, (data, error) => {
|
|
1624
|
+
try {
|
|
1625
|
+
const displayE = 'messageid is required';
|
|
1626
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-getMsgRecipientInfo', displayE);
|
|
1627
|
+
done();
|
|
1628
|
+
} catch (err) {
|
|
1629
|
+
log.error(`Test Failure: ${err}`);
|
|
1630
|
+
done(err);
|
|
1631
|
+
}
|
|
1632
|
+
});
|
|
1633
|
+
} catch (error) {
|
|
1634
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1635
|
+
done(error);
|
|
1636
|
+
}
|
|
1637
|
+
}).timeout(attemptTimeout);
|
|
1638
|
+
});
|
|
1639
|
+
|
|
1640
|
+
describe('#postSetMsgStatus - errors', () => {
|
|
1641
|
+
it('should have a postSetMsgStatus function', (done) => {
|
|
1642
|
+
try {
|
|
1643
|
+
assert.equal(true, typeof a.postSetMsgStatus === 'function');
|
|
1644
|
+
done();
|
|
1645
|
+
} catch (error) {
|
|
1646
|
+
log.error(`Test Failure: ${error}`);
|
|
1647
|
+
done(error);
|
|
1648
|
+
}
|
|
1649
|
+
}).timeout(attemptTimeout);
|
|
1650
|
+
it('should error if - missing read', (done) => {
|
|
1651
|
+
try {
|
|
1652
|
+
a.postSetMsgStatus(null, null, (data, error) => {
|
|
1653
|
+
try {
|
|
1654
|
+
const displayE = 'read is required';
|
|
1655
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postSetMsgStatus', displayE);
|
|
1656
|
+
done();
|
|
1657
|
+
} catch (err) {
|
|
1658
|
+
log.error(`Test Failure: ${err}`);
|
|
1659
|
+
done(err);
|
|
1660
|
+
}
|
|
1661
|
+
});
|
|
1662
|
+
} catch (error) {
|
|
1663
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1664
|
+
done(error);
|
|
1665
|
+
}
|
|
1666
|
+
}).timeout(attemptTimeout);
|
|
1667
|
+
it('should error if - missing delivered', (done) => {
|
|
1668
|
+
try {
|
|
1669
|
+
a.postSetMsgStatus('fakeparam', null, (data, error) => {
|
|
1670
|
+
try {
|
|
1671
|
+
const displayE = 'delivered is required';
|
|
1672
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postSetMsgStatus', displayE);
|
|
1673
|
+
done();
|
|
1674
|
+
} catch (err) {
|
|
1675
|
+
log.error(`Test Failure: ${err}`);
|
|
1676
|
+
done(err);
|
|
1677
|
+
}
|
|
1678
|
+
});
|
|
1679
|
+
} catch (error) {
|
|
1680
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1681
|
+
done(error);
|
|
1682
|
+
}
|
|
1683
|
+
}).timeout(attemptTimeout);
|
|
1684
|
+
});
|
|
1685
|
+
|
|
1686
|
+
describe('#deleteMsg - errors', () => {
|
|
1687
|
+
it('should have a deleteMsg function', (done) => {
|
|
1688
|
+
try {
|
|
1689
|
+
assert.equal(true, typeof a.deleteMsg === 'function');
|
|
1690
|
+
done();
|
|
1691
|
+
} catch (error) {
|
|
1692
|
+
log.error(`Test Failure: ${error}`);
|
|
1693
|
+
done(error);
|
|
1694
|
+
}
|
|
1695
|
+
}).timeout(attemptTimeout);
|
|
1696
|
+
it('should error if - missing messageid', (done) => {
|
|
1697
|
+
try {
|
|
1698
|
+
a.deleteMsg(null, (data, error) => {
|
|
1699
|
+
try {
|
|
1700
|
+
const displayE = 'messageid is required';
|
|
1701
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-deleteMsg', displayE);
|
|
1702
|
+
done();
|
|
1703
|
+
} catch (err) {
|
|
1704
|
+
log.error(`Test Failure: ${err}`);
|
|
1705
|
+
done(err);
|
|
1706
|
+
}
|
|
1707
|
+
});
|
|
1708
|
+
} catch (error) {
|
|
1709
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1710
|
+
done(error);
|
|
1711
|
+
}
|
|
1712
|
+
}).timeout(attemptTimeout);
|
|
1713
|
+
});
|
|
1714
|
+
|
|
1715
|
+
describe('#getMsgAttachment - errors', () => {
|
|
1716
|
+
it('should have a getMsgAttachment function', (done) => {
|
|
1717
|
+
try {
|
|
1718
|
+
assert.equal(true, typeof a.getMsgAttachment === 'function');
|
|
1719
|
+
done();
|
|
1720
|
+
} catch (error) {
|
|
1721
|
+
log.error(`Test Failure: ${error}`);
|
|
1722
|
+
done(error);
|
|
1723
|
+
}
|
|
1724
|
+
}).timeout(attemptTimeout);
|
|
1725
|
+
});
|
|
1726
|
+
|
|
1727
|
+
describe('#postNotifyUserAbtNewMsg - errors', () => {
|
|
1728
|
+
it('should have a postNotifyUserAbtNewMsg function', (done) => {
|
|
1729
|
+
try {
|
|
1730
|
+
assert.equal(true, typeof a.postNotifyUserAbtNewMsg === 'function');
|
|
1731
|
+
done();
|
|
1732
|
+
} catch (error) {
|
|
1733
|
+
log.error(`Test Failure: ${error}`);
|
|
1734
|
+
done(error);
|
|
1735
|
+
}
|
|
1736
|
+
}).timeout(attemptTimeout);
|
|
1737
|
+
it('should error if - missing recipient', (done) => {
|
|
1738
|
+
try {
|
|
1739
|
+
a.postNotifyUserAbtNewMsg(null, (data, error) => {
|
|
1740
|
+
try {
|
|
1741
|
+
const displayE = 'recipient is required';
|
|
1742
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postNotifyUserAbtNewMsg', displayE);
|
|
1743
|
+
done();
|
|
1744
|
+
} catch (err) {
|
|
1745
|
+
log.error(`Test Failure: ${err}`);
|
|
1746
|
+
done(err);
|
|
1747
|
+
}
|
|
1748
|
+
});
|
|
1749
|
+
} catch (error) {
|
|
1750
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1751
|
+
done(error);
|
|
1752
|
+
}
|
|
1753
|
+
}).timeout(attemptTimeout);
|
|
1754
|
+
});
|
|
1755
|
+
|
|
1756
|
+
describe('#deleteUserNotifyAbtNewMsg - errors', () => {
|
|
1757
|
+
it('should have a deleteUserNotifyAbtNewMsg function', (done) => {
|
|
1758
|
+
try {
|
|
1759
|
+
assert.equal(true, typeof a.deleteUserNotifyAbtNewMsg === 'function');
|
|
1760
|
+
done();
|
|
1761
|
+
} catch (error) {
|
|
1762
|
+
log.error(`Test Failure: ${error}`);
|
|
1763
|
+
done(error);
|
|
1764
|
+
}
|
|
1765
|
+
}).timeout(attemptTimeout);
|
|
1766
|
+
it('should error if - missing recipient', (done) => {
|
|
1767
|
+
try {
|
|
1768
|
+
a.deleteUserNotifyAbtNewMsg(null, (data, error) => {
|
|
1769
|
+
try {
|
|
1770
|
+
const displayE = 'recipient is required';
|
|
1771
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-deleteUserNotifyAbtNewMsg', displayE);
|
|
1772
|
+
done();
|
|
1773
|
+
} catch (err) {
|
|
1774
|
+
log.error(`Test Failure: ${err}`);
|
|
1775
|
+
done(err);
|
|
1776
|
+
}
|
|
1777
|
+
});
|
|
1778
|
+
} catch (error) {
|
|
1779
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1780
|
+
done(error);
|
|
1781
|
+
}
|
|
1782
|
+
}).timeout(attemptTimeout);
|
|
1783
|
+
});
|
|
1784
|
+
|
|
1785
|
+
describe('#getMetadata - errors', () => {
|
|
1786
|
+
it('should have a getMetadata function', (done) => {
|
|
1787
|
+
try {
|
|
1788
|
+
assert.equal(true, typeof a.getMetadata === 'function');
|
|
1789
|
+
done();
|
|
1790
|
+
} catch (error) {
|
|
1791
|
+
log.error(`Test Failure: ${error}`);
|
|
1792
|
+
done(error);
|
|
1793
|
+
}
|
|
1794
|
+
}).timeout(attemptTimeout);
|
|
1795
|
+
it('should error if - missing entity', (done) => {
|
|
1796
|
+
try {
|
|
1797
|
+
a.getMetadata(null, (data, error) => {
|
|
1798
|
+
try {
|
|
1799
|
+
const displayE = 'entity is required';
|
|
1800
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-getMetadata', displayE);
|
|
1801
|
+
done();
|
|
1802
|
+
} catch (err) {
|
|
1803
|
+
log.error(`Test Failure: ${err}`);
|
|
1804
|
+
done(err);
|
|
1805
|
+
}
|
|
1806
|
+
});
|
|
1807
|
+
} catch (error) {
|
|
1808
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1809
|
+
done(error);
|
|
1810
|
+
}
|
|
1811
|
+
}).timeout(attemptTimeout);
|
|
1812
|
+
});
|
|
1813
|
+
|
|
1814
|
+
describe('#postMetadata - errors', () => {
|
|
1815
|
+
it('should have a postMetadata function', (done) => {
|
|
1816
|
+
try {
|
|
1817
|
+
assert.equal(true, typeof a.postMetadata === 'function');
|
|
1818
|
+
done();
|
|
1819
|
+
} catch (error) {
|
|
1820
|
+
log.error(`Test Failure: ${error}`);
|
|
1821
|
+
done(error);
|
|
1822
|
+
}
|
|
1823
|
+
}).timeout(attemptTimeout);
|
|
1824
|
+
it('should error if - missing entity', (done) => {
|
|
1825
|
+
try {
|
|
1826
|
+
a.postMetadata(null, (data, error) => {
|
|
1827
|
+
try {
|
|
1828
|
+
const displayE = 'entity is required';
|
|
1829
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postMetadata', displayE);
|
|
1830
|
+
done();
|
|
1831
|
+
} catch (err) {
|
|
1832
|
+
log.error(`Test Failure: ${err}`);
|
|
1833
|
+
done(err);
|
|
1834
|
+
}
|
|
1835
|
+
});
|
|
1836
|
+
} catch (error) {
|
|
1837
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1838
|
+
done(error);
|
|
1839
|
+
}
|
|
1840
|
+
}).timeout(attemptTimeout);
|
|
1841
|
+
});
|
|
1842
|
+
|
|
1843
|
+
describe('#getRecentConversationList - errors', () => {
|
|
1844
|
+
it('should have a getRecentConversationList function', (done) => {
|
|
1845
|
+
try {
|
|
1846
|
+
assert.equal(true, typeof a.getRecentConversationList === 'function');
|
|
1847
|
+
done();
|
|
1848
|
+
} catch (error) {
|
|
1849
|
+
log.error(`Test Failure: ${error}`);
|
|
1850
|
+
done(error);
|
|
1851
|
+
}
|
|
1852
|
+
}).timeout(attemptTimeout);
|
|
1853
|
+
});
|
|
1854
|
+
|
|
1855
|
+
describe('#postUsersOrListsToRoster - errors', () => {
|
|
1856
|
+
it('should have a postUsersOrListsToRoster function', (done) => {
|
|
1857
|
+
try {
|
|
1858
|
+
assert.equal(true, typeof a.postUsersOrListsToRoster === 'function');
|
|
1859
|
+
done();
|
|
1860
|
+
} catch (error) {
|
|
1861
|
+
log.error(`Test Failure: ${error}`);
|
|
1862
|
+
done(error);
|
|
1863
|
+
}
|
|
1864
|
+
}).timeout(attemptTimeout);
|
|
1865
|
+
it('should error if - missing entity', (done) => {
|
|
1866
|
+
try {
|
|
1867
|
+
a.postUsersOrListsToRoster(null, null, (data, error) => {
|
|
1868
|
+
try {
|
|
1869
|
+
const displayE = 'entity is required';
|
|
1870
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postUsersOrListsToRoster', displayE);
|
|
1871
|
+
done();
|
|
1872
|
+
} catch (err) {
|
|
1873
|
+
log.error(`Test Failure: ${err}`);
|
|
1874
|
+
done(err);
|
|
1875
|
+
}
|
|
1876
|
+
});
|
|
1877
|
+
} catch (error) {
|
|
1878
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1879
|
+
done(error);
|
|
1880
|
+
}
|
|
1881
|
+
}).timeout(attemptTimeout);
|
|
1882
|
+
it('should error if - missing type', (done) => {
|
|
1883
|
+
try {
|
|
1884
|
+
a.postUsersOrListsToRoster('fakeparam', null, (data, error) => {
|
|
1885
|
+
try {
|
|
1886
|
+
const displayE = 'type is required';
|
|
1887
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postUsersOrListsToRoster', displayE);
|
|
1888
|
+
done();
|
|
1889
|
+
} catch (err) {
|
|
1890
|
+
log.error(`Test Failure: ${err}`);
|
|
1891
|
+
done(err);
|
|
1892
|
+
}
|
|
1893
|
+
});
|
|
1894
|
+
} catch (error) {
|
|
1895
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1896
|
+
done(error);
|
|
1897
|
+
}
|
|
1898
|
+
}).timeout(attemptTimeout);
|
|
1899
|
+
});
|
|
1900
|
+
|
|
1901
|
+
describe('#deleteConversation - errors', () => {
|
|
1902
|
+
it('should have a deleteConversation function', (done) => {
|
|
1903
|
+
try {
|
|
1904
|
+
assert.equal(true, typeof a.deleteConversation === 'function');
|
|
1905
|
+
done();
|
|
1906
|
+
} catch (error) {
|
|
1907
|
+
log.error(`Test Failure: ${error}`);
|
|
1908
|
+
done(error);
|
|
1909
|
+
}
|
|
1910
|
+
}).timeout(attemptTimeout);
|
|
1911
|
+
it('should error if - missing entity', (done) => {
|
|
1912
|
+
try {
|
|
1913
|
+
a.deleteConversation(null, (data, error) => {
|
|
1914
|
+
try {
|
|
1915
|
+
const displayE = 'entity is required';
|
|
1916
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-deleteConversation', displayE);
|
|
1917
|
+
done();
|
|
1918
|
+
} catch (err) {
|
|
1919
|
+
log.error(`Test Failure: ${err}`);
|
|
1920
|
+
done(err);
|
|
1921
|
+
}
|
|
1922
|
+
});
|
|
1923
|
+
} catch (error) {
|
|
1924
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1925
|
+
done(error);
|
|
1926
|
+
}
|
|
1927
|
+
}).timeout(attemptTimeout);
|
|
1928
|
+
});
|
|
1929
|
+
|
|
1930
|
+
describe('#getUserInfo - errors', () => {
|
|
1931
|
+
it('should have a getUserInfo function', (done) => {
|
|
1932
|
+
try {
|
|
1933
|
+
assert.equal(true, typeof a.getUserInfo === 'function');
|
|
1934
|
+
done();
|
|
1935
|
+
} catch (error) {
|
|
1936
|
+
log.error(`Test Failure: ${error}`);
|
|
1937
|
+
done(error);
|
|
1938
|
+
}
|
|
1939
|
+
}).timeout(attemptTimeout);
|
|
1940
|
+
it('should error if - missing userid', (done) => {
|
|
1941
|
+
try {
|
|
1942
|
+
a.getUserInfo(null, (data, error) => {
|
|
1943
|
+
try {
|
|
1944
|
+
const displayE = 'userid is required';
|
|
1945
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-getUserInfo', displayE);
|
|
1946
|
+
done();
|
|
1947
|
+
} catch (err) {
|
|
1948
|
+
log.error(`Test Failure: ${err}`);
|
|
1949
|
+
done(err);
|
|
1950
|
+
}
|
|
1951
|
+
});
|
|
1952
|
+
} catch (error) {
|
|
1953
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1954
|
+
done(error);
|
|
1955
|
+
}
|
|
1956
|
+
}).timeout(attemptTimeout);
|
|
1957
|
+
});
|
|
1958
|
+
|
|
1959
|
+
describe('#getUnreadMsgCountAcrossAllOrg - errors', () => {
|
|
1960
|
+
it('should have a getUnreadMsgCountAcrossAllOrg function', (done) => {
|
|
1961
|
+
try {
|
|
1962
|
+
assert.equal(true, typeof a.getUnreadMsgCountAcrossAllOrg === 'function');
|
|
1963
|
+
done();
|
|
1964
|
+
} catch (error) {
|
|
1965
|
+
log.error(`Test Failure: ${error}`);
|
|
1966
|
+
done(error);
|
|
1967
|
+
}
|
|
1968
|
+
}).timeout(attemptTimeout);
|
|
1969
|
+
it('should error if - missing userid', (done) => {
|
|
1970
|
+
try {
|
|
1971
|
+
a.getUnreadMsgCountAcrossAllOrg(null, (data, error) => {
|
|
1972
|
+
try {
|
|
1973
|
+
const displayE = 'userid is required';
|
|
1974
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-getUnreadMsgCountAcrossAllOrg', displayE);
|
|
1975
|
+
done();
|
|
1976
|
+
} catch (err) {
|
|
1977
|
+
log.error(`Test Failure: ${err}`);
|
|
1978
|
+
done(err);
|
|
1979
|
+
}
|
|
1980
|
+
});
|
|
1981
|
+
} catch (error) {
|
|
1982
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1983
|
+
done(error);
|
|
1984
|
+
}
|
|
1985
|
+
}).timeout(attemptTimeout);
|
|
1986
|
+
});
|
|
1987
|
+
|
|
1988
|
+
describe('#getUnreadMsgCountForUserForSingleOrg - errors', () => {
|
|
1989
|
+
it('should have a getUnreadMsgCountForUserForSingleOrg function', (done) => {
|
|
1990
|
+
try {
|
|
1991
|
+
assert.equal(true, typeof a.getUnreadMsgCountForUserForSingleOrg === 'function');
|
|
1992
|
+
done();
|
|
1993
|
+
} catch (error) {
|
|
1994
|
+
log.error(`Test Failure: ${error}`);
|
|
1995
|
+
done(error);
|
|
1996
|
+
}
|
|
1997
|
+
}).timeout(attemptTimeout);
|
|
1998
|
+
it('should error if - missing userid', (done) => {
|
|
1999
|
+
try {
|
|
2000
|
+
a.getUnreadMsgCountForUserForSingleOrg(null, null, (data, error) => {
|
|
2001
|
+
try {
|
|
2002
|
+
const displayE = 'userid is required';
|
|
2003
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-getUnreadMsgCountForUserForSingleOrg', displayE);
|
|
2004
|
+
done();
|
|
2005
|
+
} catch (err) {
|
|
2006
|
+
log.error(`Test Failure: ${err}`);
|
|
2007
|
+
done(err);
|
|
2008
|
+
}
|
|
2009
|
+
});
|
|
2010
|
+
} catch (error) {
|
|
2011
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2012
|
+
done(error);
|
|
2013
|
+
}
|
|
2014
|
+
}).timeout(attemptTimeout);
|
|
2015
|
+
it('should error if - missing organization', (done) => {
|
|
2016
|
+
try {
|
|
2017
|
+
a.getUnreadMsgCountForUserForSingleOrg('fakeparam', null, (data, error) => {
|
|
2018
|
+
try {
|
|
2019
|
+
const displayE = 'organization is required';
|
|
2020
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-getUnreadMsgCountForUserForSingleOrg', displayE);
|
|
2021
|
+
done();
|
|
2022
|
+
} catch (err) {
|
|
2023
|
+
log.error(`Test Failure: ${err}`);
|
|
2024
|
+
done(err);
|
|
2025
|
+
}
|
|
2026
|
+
});
|
|
2027
|
+
} catch (error) {
|
|
2028
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2029
|
+
done(error);
|
|
2030
|
+
}
|
|
2031
|
+
}).timeout(attemptTimeout);
|
|
2032
|
+
});
|
|
2033
|
+
|
|
2034
|
+
describe('#getUserBasicDetails - errors', () => {
|
|
2035
|
+
it('should have a getUserBasicDetails function', (done) => {
|
|
2036
|
+
try {
|
|
2037
|
+
assert.equal(true, typeof a.getUserBasicDetails === 'function');
|
|
2038
|
+
done();
|
|
2039
|
+
} catch (error) {
|
|
2040
|
+
log.error(`Test Failure: ${error}`);
|
|
2041
|
+
done(error);
|
|
2042
|
+
}
|
|
2043
|
+
}).timeout(attemptTimeout);
|
|
2044
|
+
it('should error if - missing userid', (done) => {
|
|
2045
|
+
try {
|
|
2046
|
+
a.getUserBasicDetails(null, (data, error) => {
|
|
2047
|
+
try {
|
|
2048
|
+
const displayE = 'userid is required';
|
|
2049
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-getUserBasicDetails', displayE);
|
|
2050
|
+
done();
|
|
2051
|
+
} catch (err) {
|
|
2052
|
+
log.error(`Test Failure: ${err}`);
|
|
2053
|
+
done(err);
|
|
2054
|
+
}
|
|
2055
|
+
});
|
|
2056
|
+
} catch (error) {
|
|
2057
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2058
|
+
done(error);
|
|
2059
|
+
}
|
|
2060
|
+
}).timeout(attemptTimeout);
|
|
2061
|
+
});
|
|
2062
|
+
|
|
2063
|
+
describe('#postAddUserToOrg - errors', () => {
|
|
2064
|
+
it('should have a postAddUserToOrg function', (done) => {
|
|
2065
|
+
try {
|
|
2066
|
+
assert.equal(true, typeof a.postAddUserToOrg === 'function');
|
|
2067
|
+
done();
|
|
2068
|
+
} catch (error) {
|
|
2069
|
+
log.error(`Test Failure: ${error}`);
|
|
2070
|
+
done(error);
|
|
2071
|
+
}
|
|
2072
|
+
}).timeout(attemptTimeout);
|
|
2073
|
+
it('should error if - missing userid', (done) => {
|
|
2074
|
+
try {
|
|
2075
|
+
a.postAddUserToOrg(null, null, (data, error) => {
|
|
2076
|
+
try {
|
|
2077
|
+
const displayE = 'userid is required';
|
|
2078
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postAddUserToOrg', displayE);
|
|
2079
|
+
done();
|
|
2080
|
+
} catch (err) {
|
|
2081
|
+
log.error(`Test Failure: ${err}`);
|
|
2082
|
+
done(err);
|
|
2083
|
+
}
|
|
2084
|
+
});
|
|
2085
|
+
} catch (error) {
|
|
2086
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2087
|
+
done(error);
|
|
2088
|
+
}
|
|
2089
|
+
}).timeout(attemptTimeout);
|
|
2090
|
+
it('should error if - missing organizationKey', (done) => {
|
|
2091
|
+
try {
|
|
2092
|
+
a.postAddUserToOrg('fakeparam', null, (data, error) => {
|
|
2093
|
+
try {
|
|
2094
|
+
const displayE = 'organizationKey is required';
|
|
2095
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postAddUserToOrg', displayE);
|
|
2096
|
+
done();
|
|
2097
|
+
} catch (err) {
|
|
2098
|
+
log.error(`Test Failure: ${err}`);
|
|
2099
|
+
done(err);
|
|
2100
|
+
}
|
|
2101
|
+
});
|
|
2102
|
+
} catch (error) {
|
|
2103
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2104
|
+
done(error);
|
|
2105
|
+
}
|
|
2106
|
+
}).timeout(attemptTimeout);
|
|
2107
|
+
});
|
|
2108
|
+
|
|
2109
|
+
describe('#deleteUserFromOrg - errors', () => {
|
|
2110
|
+
it('should have a deleteUserFromOrg function', (done) => {
|
|
2111
|
+
try {
|
|
2112
|
+
assert.equal(true, typeof a.deleteUserFromOrg === 'function');
|
|
2113
|
+
done();
|
|
2114
|
+
} catch (error) {
|
|
2115
|
+
log.error(`Test Failure: ${error}`);
|
|
2116
|
+
done(error);
|
|
2117
|
+
}
|
|
2118
|
+
}).timeout(attemptTimeout);
|
|
2119
|
+
it('should error if - missing userid', (done) => {
|
|
2120
|
+
try {
|
|
2121
|
+
a.deleteUserFromOrg(null, null, (data, error) => {
|
|
2122
|
+
try {
|
|
2123
|
+
const displayE = 'userid is required';
|
|
2124
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-deleteUserFromOrg', displayE);
|
|
2125
|
+
done();
|
|
2126
|
+
} catch (err) {
|
|
2127
|
+
log.error(`Test Failure: ${err}`);
|
|
2128
|
+
done(err);
|
|
2129
|
+
}
|
|
2130
|
+
});
|
|
2131
|
+
} catch (error) {
|
|
2132
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2133
|
+
done(error);
|
|
2134
|
+
}
|
|
2135
|
+
}).timeout(attemptTimeout);
|
|
2136
|
+
it('should error if - missing organization', (done) => {
|
|
2137
|
+
try {
|
|
2138
|
+
a.deleteUserFromOrg('fakeparam', null, (data, error) => {
|
|
2139
|
+
try {
|
|
2140
|
+
const displayE = 'organization is required';
|
|
2141
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-deleteUserFromOrg', displayE);
|
|
2142
|
+
done();
|
|
2143
|
+
} catch (err) {
|
|
2144
|
+
log.error(`Test Failure: ${err}`);
|
|
2145
|
+
done(err);
|
|
2146
|
+
}
|
|
2147
|
+
});
|
|
2148
|
+
} catch (error) {
|
|
2149
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2150
|
+
done(error);
|
|
2151
|
+
}
|
|
2152
|
+
}).timeout(attemptTimeout);
|
|
2153
|
+
});
|
|
2154
|
+
|
|
2155
|
+
describe('#getUserRole - errors', () => {
|
|
2156
|
+
it('should have a getUserRole function', (done) => {
|
|
2157
|
+
try {
|
|
2158
|
+
assert.equal(true, typeof a.getUserRole === 'function');
|
|
2159
|
+
done();
|
|
2160
|
+
} catch (error) {
|
|
2161
|
+
log.error(`Test Failure: ${error}`);
|
|
2162
|
+
done(error);
|
|
2163
|
+
}
|
|
2164
|
+
}).timeout(attemptTimeout);
|
|
2165
|
+
it('should error if - missing userid', (done) => {
|
|
2166
|
+
try {
|
|
2167
|
+
a.getUserRole(null, null, (data, error) => {
|
|
2168
|
+
try {
|
|
2169
|
+
const displayE = 'userid is required';
|
|
2170
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-getUserRole', displayE);
|
|
2171
|
+
done();
|
|
2172
|
+
} catch (err) {
|
|
2173
|
+
log.error(`Test Failure: ${err}`);
|
|
2174
|
+
done(err);
|
|
2175
|
+
}
|
|
2176
|
+
});
|
|
2177
|
+
} catch (error) {
|
|
2178
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2179
|
+
done(error);
|
|
2180
|
+
}
|
|
2181
|
+
}).timeout(attemptTimeout);
|
|
2182
|
+
it('should error if - missing organization', (done) => {
|
|
2183
|
+
try {
|
|
2184
|
+
a.getUserRole('fakeparam', null, (data, error) => {
|
|
2185
|
+
try {
|
|
2186
|
+
const displayE = 'organization is required';
|
|
2187
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-getUserRole', displayE);
|
|
2188
|
+
done();
|
|
2189
|
+
} catch (err) {
|
|
2190
|
+
log.error(`Test Failure: ${err}`);
|
|
2191
|
+
done(err);
|
|
2192
|
+
}
|
|
2193
|
+
});
|
|
2194
|
+
} catch (error) {
|
|
2195
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2196
|
+
done(error);
|
|
2197
|
+
}
|
|
2198
|
+
}).timeout(attemptTimeout);
|
|
2199
|
+
});
|
|
2200
|
+
|
|
2201
|
+
describe('#postSpecificRoleToUser - errors', () => {
|
|
2202
|
+
it('should have a postSpecificRoleToUser function', (done) => {
|
|
2203
|
+
try {
|
|
2204
|
+
assert.equal(true, typeof a.postSpecificRoleToUser === 'function');
|
|
2205
|
+
done();
|
|
2206
|
+
} catch (error) {
|
|
2207
|
+
log.error(`Test Failure: ${error}`);
|
|
2208
|
+
done(error);
|
|
2209
|
+
}
|
|
2210
|
+
}).timeout(attemptTimeout);
|
|
2211
|
+
it('should error if - missing userid', (done) => {
|
|
2212
|
+
try {
|
|
2213
|
+
a.postSpecificRoleToUser(null, null, null, (data, error) => {
|
|
2214
|
+
try {
|
|
2215
|
+
const displayE = 'userid is required';
|
|
2216
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postSpecificRoleToUser', displayE);
|
|
2217
|
+
done();
|
|
2218
|
+
} catch (err) {
|
|
2219
|
+
log.error(`Test Failure: ${err}`);
|
|
2220
|
+
done(err);
|
|
2221
|
+
}
|
|
2222
|
+
});
|
|
2223
|
+
} catch (error) {
|
|
2224
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2225
|
+
done(error);
|
|
2226
|
+
}
|
|
2227
|
+
}).timeout(attemptTimeout);
|
|
2228
|
+
it('should error if - missing organization', (done) => {
|
|
2229
|
+
try {
|
|
2230
|
+
a.postSpecificRoleToUser('fakeparam', null, null, (data, error) => {
|
|
2231
|
+
try {
|
|
2232
|
+
const displayE = 'organization is required';
|
|
2233
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postSpecificRoleToUser', displayE);
|
|
2234
|
+
done();
|
|
2235
|
+
} catch (err) {
|
|
2236
|
+
log.error(`Test Failure: ${err}`);
|
|
2237
|
+
done(err);
|
|
2238
|
+
}
|
|
2239
|
+
});
|
|
2240
|
+
} catch (error) {
|
|
2241
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2242
|
+
done(error);
|
|
2243
|
+
}
|
|
2244
|
+
}).timeout(attemptTimeout);
|
|
2245
|
+
it('should error if - missing role', (done) => {
|
|
2246
|
+
try {
|
|
2247
|
+
a.postSpecificRoleToUser('fakeparam', 'fakeparam', null, (data, error) => {
|
|
2248
|
+
try {
|
|
2249
|
+
const displayE = 'role is required';
|
|
2250
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postSpecificRoleToUser', displayE);
|
|
2251
|
+
done();
|
|
2252
|
+
} catch (err) {
|
|
2253
|
+
log.error(`Test Failure: ${err}`);
|
|
2254
|
+
done(err);
|
|
2255
|
+
}
|
|
2256
|
+
});
|
|
2257
|
+
} catch (error) {
|
|
2258
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2259
|
+
done(error);
|
|
2260
|
+
}
|
|
2261
|
+
}).timeout(attemptTimeout);
|
|
2262
|
+
});
|
|
2263
|
+
|
|
2264
|
+
describe('#deleteUserRole - errors', () => {
|
|
2265
|
+
it('should have a deleteUserRole function', (done) => {
|
|
2266
|
+
try {
|
|
2267
|
+
assert.equal(true, typeof a.deleteUserRole === 'function');
|
|
2268
|
+
done();
|
|
2269
|
+
} catch (error) {
|
|
2270
|
+
log.error(`Test Failure: ${error}`);
|
|
2271
|
+
done(error);
|
|
2272
|
+
}
|
|
2273
|
+
}).timeout(attemptTimeout);
|
|
2274
|
+
it('should error if - missing userid', (done) => {
|
|
2275
|
+
try {
|
|
2276
|
+
a.deleteUserRole(null, null, null, (data, error) => {
|
|
2277
|
+
try {
|
|
2278
|
+
const displayE = 'userid is required';
|
|
2279
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-deleteUserRole', displayE);
|
|
2280
|
+
done();
|
|
2281
|
+
} catch (err) {
|
|
2282
|
+
log.error(`Test Failure: ${err}`);
|
|
2283
|
+
done(err);
|
|
2284
|
+
}
|
|
2285
|
+
});
|
|
2286
|
+
} catch (error) {
|
|
2287
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2288
|
+
done(error);
|
|
2289
|
+
}
|
|
2290
|
+
}).timeout(attemptTimeout);
|
|
2291
|
+
it('should error if - missing organization', (done) => {
|
|
2292
|
+
try {
|
|
2293
|
+
a.deleteUserRole('fakeparam', null, null, (data, error) => {
|
|
2294
|
+
try {
|
|
2295
|
+
const displayE = 'organization is required';
|
|
2296
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-deleteUserRole', displayE);
|
|
2297
|
+
done();
|
|
2298
|
+
} catch (err) {
|
|
2299
|
+
log.error(`Test Failure: ${err}`);
|
|
2300
|
+
done(err);
|
|
2301
|
+
}
|
|
2302
|
+
});
|
|
2303
|
+
} catch (error) {
|
|
2304
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2305
|
+
done(error);
|
|
2306
|
+
}
|
|
2307
|
+
}).timeout(attemptTimeout);
|
|
2308
|
+
it('should error if - missing role', (done) => {
|
|
2309
|
+
try {
|
|
2310
|
+
a.deleteUserRole('fakeparam', 'fakeparam', null, (data, error) => {
|
|
2311
|
+
try {
|
|
2312
|
+
const displayE = 'role is required';
|
|
2313
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-deleteUserRole', displayE);
|
|
2314
|
+
done();
|
|
2315
|
+
} catch (err) {
|
|
2316
|
+
log.error(`Test Failure: ${err}`);
|
|
2317
|
+
done(err);
|
|
2318
|
+
}
|
|
2319
|
+
});
|
|
2320
|
+
} catch (error) {
|
|
2321
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2322
|
+
done(error);
|
|
2323
|
+
}
|
|
2324
|
+
}).timeout(attemptTimeout);
|
|
2325
|
+
});
|
|
2326
|
+
|
|
2327
|
+
describe('#postUpdateUsers - errors', () => {
|
|
2328
|
+
it('should have a postUpdateUsers function', (done) => {
|
|
2329
|
+
try {
|
|
2330
|
+
assert.equal(true, typeof a.postUpdateUsers === 'function');
|
|
2331
|
+
done();
|
|
2332
|
+
} catch (error) {
|
|
2333
|
+
log.error(`Test Failure: ${error}`);
|
|
2334
|
+
done(error);
|
|
2335
|
+
}
|
|
2336
|
+
}).timeout(attemptTimeout);
|
|
2337
|
+
it('should error if - missing uniqueId', (done) => {
|
|
2338
|
+
try {
|
|
2339
|
+
a.postUpdateUsers(null, null, null, null, null, (data, error) => {
|
|
2340
|
+
try {
|
|
2341
|
+
const displayE = 'uniqueId is required';
|
|
2342
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postUpdateUsers', displayE);
|
|
2343
|
+
done();
|
|
2344
|
+
} catch (err) {
|
|
2345
|
+
log.error(`Test Failure: ${err}`);
|
|
2346
|
+
done(err);
|
|
2347
|
+
}
|
|
2348
|
+
});
|
|
2349
|
+
} catch (error) {
|
|
2350
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2351
|
+
done(error);
|
|
2352
|
+
}
|
|
2353
|
+
}).timeout(attemptTimeout);
|
|
2354
|
+
it('should error if - missing emails', (done) => {
|
|
2355
|
+
try {
|
|
2356
|
+
a.postUpdateUsers('fakeparam', null, null, null, null, (data, error) => {
|
|
2357
|
+
try {
|
|
2358
|
+
const displayE = 'emails is required';
|
|
2359
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postUpdateUsers', displayE);
|
|
2360
|
+
done();
|
|
2361
|
+
} catch (err) {
|
|
2362
|
+
log.error(`Test Failure: ${err}`);
|
|
2363
|
+
done(err);
|
|
2364
|
+
}
|
|
2365
|
+
});
|
|
2366
|
+
} catch (error) {
|
|
2367
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2368
|
+
done(error);
|
|
2369
|
+
}
|
|
2370
|
+
}).timeout(attemptTimeout);
|
|
2371
|
+
it('should error if - missing phones', (done) => {
|
|
2372
|
+
try {
|
|
2373
|
+
a.postUpdateUsers('fakeparam', 'fakeparam', null, null, null, (data, error) => {
|
|
2374
|
+
try {
|
|
2375
|
+
const displayE = 'phones is required';
|
|
2376
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postUpdateUsers', displayE);
|
|
2377
|
+
done();
|
|
2378
|
+
} catch (err) {
|
|
2379
|
+
log.error(`Test Failure: ${err}`);
|
|
2380
|
+
done(err);
|
|
2381
|
+
}
|
|
2382
|
+
});
|
|
2383
|
+
} catch (error) {
|
|
2384
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2385
|
+
done(error);
|
|
2386
|
+
}
|
|
2387
|
+
}).timeout(attemptTimeout);
|
|
2388
|
+
it('should error if - missing firstName', (done) => {
|
|
2389
|
+
try {
|
|
2390
|
+
a.postUpdateUsers('fakeparam', 'fakeparam', 'fakeparam', null, null, (data, error) => {
|
|
2391
|
+
try {
|
|
2392
|
+
const displayE = 'firstName is required';
|
|
2393
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postUpdateUsers', displayE);
|
|
2394
|
+
done();
|
|
2395
|
+
} catch (err) {
|
|
2396
|
+
log.error(`Test Failure: ${err}`);
|
|
2397
|
+
done(err);
|
|
2398
|
+
}
|
|
2399
|
+
});
|
|
2400
|
+
} catch (error) {
|
|
2401
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2402
|
+
done(error);
|
|
2403
|
+
}
|
|
2404
|
+
}).timeout(attemptTimeout);
|
|
2405
|
+
it('should error if - missing lastName', (done) => {
|
|
2406
|
+
try {
|
|
2407
|
+
a.postUpdateUsers('fakeparam', 'fakeparam', 'fakeparam', 'fakeparam', null, (data, error) => {
|
|
2408
|
+
try {
|
|
2409
|
+
const displayE = 'lastName is required';
|
|
2410
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postUpdateUsers', displayE);
|
|
2411
|
+
done();
|
|
2412
|
+
} catch (err) {
|
|
2413
|
+
log.error(`Test Failure: ${err}`);
|
|
2414
|
+
done(err);
|
|
2415
|
+
}
|
|
2416
|
+
});
|
|
2417
|
+
} catch (error) {
|
|
2418
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2419
|
+
done(error);
|
|
2420
|
+
}
|
|
2421
|
+
}).timeout(attemptTimeout);
|
|
2422
|
+
});
|
|
2423
|
+
|
|
2424
|
+
describe('#getSseEventStream - errors', () => {
|
|
2425
|
+
it('should have a getSseEventStream function', (done) => {
|
|
2426
|
+
try {
|
|
2427
|
+
assert.equal(true, typeof a.getSseEventStream === 'function');
|
|
2428
|
+
done();
|
|
2429
|
+
} catch (error) {
|
|
2430
|
+
log.error(`Test Failure: ${error}`);
|
|
2431
|
+
done(error);
|
|
2432
|
+
}
|
|
2433
|
+
}).timeout(attemptTimeout);
|
|
2434
|
+
});
|
|
2435
|
+
|
|
2436
|
+
describe('#deleteEventsConnections - errors', () => {
|
|
2437
|
+
it('should have a deleteEventsConnections function', (done) => {
|
|
2438
|
+
try {
|
|
2439
|
+
assert.equal(true, typeof a.deleteEventsConnections === 'function');
|
|
2440
|
+
done();
|
|
2441
|
+
} catch (error) {
|
|
2442
|
+
log.error(`Test Failure: ${error}`);
|
|
2443
|
+
done(error);
|
|
2444
|
+
}
|
|
2445
|
+
}).timeout(attemptTimeout);
|
|
2446
|
+
});
|
|
2447
|
+
|
|
2448
|
+
describe('#postAckEvents - errors', () => {
|
|
2449
|
+
it('should have a postAckEvents function', (done) => {
|
|
2450
|
+
try {
|
|
2451
|
+
assert.equal(true, typeof a.postAckEvents === 'function');
|
|
2452
|
+
done();
|
|
2453
|
+
} catch (error) {
|
|
2454
|
+
log.error(`Test Failure: ${error}`);
|
|
2455
|
+
done(error);
|
|
2456
|
+
}
|
|
2457
|
+
}).timeout(attemptTimeout);
|
|
2458
|
+
it('should error if - missing events', (done) => {
|
|
2459
|
+
try {
|
|
2460
|
+
a.postAckEvents(null, (data, error) => {
|
|
2461
|
+
try {
|
|
2462
|
+
const displayE = 'events is required';
|
|
2463
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postAckEvents', displayE);
|
|
2464
|
+
done();
|
|
2465
|
+
} catch (err) {
|
|
2466
|
+
log.error(`Test Failure: ${err}`);
|
|
2467
|
+
done(err);
|
|
2468
|
+
}
|
|
2469
|
+
});
|
|
2470
|
+
} catch (error) {
|
|
2471
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2472
|
+
done(error);
|
|
2473
|
+
}
|
|
2474
|
+
}).timeout(attemptTimeout);
|
|
2475
|
+
});
|
|
2476
|
+
|
|
2477
|
+
describe('#postCreateTigerTxtOrg - errors', () => {
|
|
2478
|
+
it('should have a postCreateTigerTxtOrg function', (done) => {
|
|
2479
|
+
try {
|
|
2480
|
+
assert.equal(true, typeof a.postCreateTigerTxtOrg === 'function');
|
|
2481
|
+
done();
|
|
2482
|
+
} catch (error) {
|
|
2483
|
+
log.error(`Test Failure: ${error}`);
|
|
2484
|
+
done(error);
|
|
2485
|
+
}
|
|
2486
|
+
}).timeout(attemptTimeout);
|
|
2487
|
+
it('should error if - missing name', (done) => {
|
|
2488
|
+
try {
|
|
2489
|
+
a.postCreateTigerTxtOrg(null, null, (data, error) => {
|
|
2490
|
+
try {
|
|
2491
|
+
const displayE = 'name is required';
|
|
2492
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postCreateTigerTxtOrg', displayE);
|
|
2493
|
+
done();
|
|
2494
|
+
} catch (err) {
|
|
2495
|
+
log.error(`Test Failure: ${err}`);
|
|
2496
|
+
done(err);
|
|
2497
|
+
}
|
|
2498
|
+
});
|
|
2499
|
+
} catch (error) {
|
|
2500
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2501
|
+
done(error);
|
|
2502
|
+
}
|
|
2503
|
+
}).timeout(attemptTimeout);
|
|
2504
|
+
it('should error if - missing billing', (done) => {
|
|
2505
|
+
try {
|
|
2506
|
+
a.postCreateTigerTxtOrg('fakeparam', null, (data, error) => {
|
|
2507
|
+
try {
|
|
2508
|
+
const displayE = 'billing is required';
|
|
2509
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postCreateTigerTxtOrg', displayE);
|
|
2510
|
+
done();
|
|
2511
|
+
} catch (err) {
|
|
2512
|
+
log.error(`Test Failure: ${err}`);
|
|
2513
|
+
done(err);
|
|
2514
|
+
}
|
|
2515
|
+
});
|
|
2516
|
+
} catch (error) {
|
|
2517
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2518
|
+
done(error);
|
|
2519
|
+
}
|
|
2520
|
+
}).timeout(attemptTimeout);
|
|
2521
|
+
});
|
|
2522
|
+
|
|
2523
|
+
describe('#postUpdateTigerTxtOrg - errors', () => {
|
|
2524
|
+
it('should have a postUpdateTigerTxtOrg function', (done) => {
|
|
2525
|
+
try {
|
|
2526
|
+
assert.equal(true, typeof a.postUpdateTigerTxtOrg === 'function');
|
|
2527
|
+
done();
|
|
2528
|
+
} catch (error) {
|
|
2529
|
+
log.error(`Test Failure: ${error}`);
|
|
2530
|
+
done(error);
|
|
2531
|
+
}
|
|
2532
|
+
}).timeout(attemptTimeout);
|
|
2533
|
+
it('should error if - missing organization', (done) => {
|
|
2534
|
+
try {
|
|
2535
|
+
a.postUpdateTigerTxtOrg(null, null, (data, error) => {
|
|
2536
|
+
try {
|
|
2537
|
+
const displayE = 'organization is required';
|
|
2538
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postUpdateTigerTxtOrg', displayE);
|
|
2539
|
+
done();
|
|
2540
|
+
} catch (err) {
|
|
2541
|
+
log.error(`Test Failure: ${err}`);
|
|
2542
|
+
done(err);
|
|
2543
|
+
}
|
|
2544
|
+
});
|
|
2545
|
+
} catch (error) {
|
|
2546
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2547
|
+
done(error);
|
|
2548
|
+
}
|
|
2549
|
+
}).timeout(attemptTimeout);
|
|
2550
|
+
it('should error if - missing name', (done) => {
|
|
2551
|
+
try {
|
|
2552
|
+
a.postUpdateTigerTxtOrg('fakeparam', null, (data, error) => {
|
|
2553
|
+
try {
|
|
2554
|
+
const displayE = 'name is required';
|
|
2555
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postUpdateTigerTxtOrg', displayE);
|
|
2556
|
+
done();
|
|
2557
|
+
} catch (err) {
|
|
2558
|
+
log.error(`Test Failure: ${err}`);
|
|
2559
|
+
done(err);
|
|
2560
|
+
}
|
|
2561
|
+
});
|
|
2562
|
+
} catch (error) {
|
|
2563
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2564
|
+
done(error);
|
|
2565
|
+
}
|
|
2566
|
+
}).timeout(attemptTimeout);
|
|
2567
|
+
});
|
|
2568
|
+
|
|
2569
|
+
describe('#getTigerTxtOrgInfo - errors', () => {
|
|
2570
|
+
it('should have a getTigerTxtOrgInfo function', (done) => {
|
|
2571
|
+
try {
|
|
2572
|
+
assert.equal(true, typeof a.getTigerTxtOrgInfo === 'function');
|
|
2573
|
+
done();
|
|
2574
|
+
} catch (error) {
|
|
2575
|
+
log.error(`Test Failure: ${error}`);
|
|
2576
|
+
done(error);
|
|
2577
|
+
}
|
|
2578
|
+
}).timeout(attemptTimeout);
|
|
2579
|
+
it('should error if - missing organization', (done) => {
|
|
2580
|
+
try {
|
|
2581
|
+
a.getTigerTxtOrgInfo(null, (data, error) => {
|
|
2582
|
+
try {
|
|
2583
|
+
const displayE = 'organization is required';
|
|
2584
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-getTigerTxtOrgInfo', displayE);
|
|
2585
|
+
done();
|
|
2586
|
+
} catch (err) {
|
|
2587
|
+
log.error(`Test Failure: ${err}`);
|
|
2588
|
+
done(err);
|
|
2589
|
+
}
|
|
2590
|
+
});
|
|
2591
|
+
} catch (error) {
|
|
2592
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2593
|
+
done(error);
|
|
2594
|
+
}
|
|
2595
|
+
}).timeout(attemptTimeout);
|
|
2596
|
+
});
|
|
2597
|
+
|
|
2598
|
+
describe('#postCreateCustomDirectoryForOrg - errors', () => {
|
|
2599
|
+
it('should have a postCreateCustomDirectoryForOrg function', (done) => {
|
|
2600
|
+
try {
|
|
2601
|
+
assert.equal(true, typeof a.postCreateCustomDirectoryForOrg === 'function');
|
|
2602
|
+
done();
|
|
2603
|
+
} catch (error) {
|
|
2604
|
+
log.error(`Test Failure: ${error}`);
|
|
2605
|
+
done(error);
|
|
2606
|
+
}
|
|
2607
|
+
}).timeout(attemptTimeout);
|
|
2608
|
+
it('should error if - missing organization', (done) => {
|
|
2609
|
+
try {
|
|
2610
|
+
a.postCreateCustomDirectoryForOrg(null, (data, error) => {
|
|
2611
|
+
try {
|
|
2612
|
+
const displayE = 'organization is required';
|
|
2613
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postCreateCustomDirectoryForOrg', displayE);
|
|
2614
|
+
done();
|
|
2615
|
+
} catch (err) {
|
|
2616
|
+
log.error(`Test Failure: ${err}`);
|
|
2617
|
+
done(err);
|
|
2618
|
+
}
|
|
2619
|
+
});
|
|
2620
|
+
} catch (error) {
|
|
2621
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2622
|
+
done(error);
|
|
2623
|
+
}
|
|
2624
|
+
}).timeout(attemptTimeout);
|
|
2625
|
+
});
|
|
2626
|
+
|
|
2627
|
+
describe('#deleteTigerTxtOrg - errors', () => {
|
|
2628
|
+
it('should have a deleteTigerTxtOrg function', (done) => {
|
|
2629
|
+
try {
|
|
2630
|
+
assert.equal(true, typeof a.deleteTigerTxtOrg === 'function');
|
|
2631
|
+
done();
|
|
2632
|
+
} catch (error) {
|
|
2633
|
+
log.error(`Test Failure: ${error}`);
|
|
2634
|
+
done(error);
|
|
2635
|
+
}
|
|
2636
|
+
}).timeout(attemptTimeout);
|
|
2637
|
+
it('should error if - missing organizationid', (done) => {
|
|
2638
|
+
try {
|
|
2639
|
+
a.deleteTigerTxtOrg(null, (data, error) => {
|
|
2640
|
+
try {
|
|
2641
|
+
const displayE = 'organizationid is required';
|
|
2642
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-deleteTigerTxtOrg', displayE);
|
|
2643
|
+
done();
|
|
2644
|
+
} catch (err) {
|
|
2645
|
+
log.error(`Test Failure: ${err}`);
|
|
2646
|
+
done(err);
|
|
2647
|
+
}
|
|
2648
|
+
});
|
|
2649
|
+
} catch (error) {
|
|
2650
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2651
|
+
done(error);
|
|
2652
|
+
}
|
|
2653
|
+
}).timeout(attemptTimeout);
|
|
2654
|
+
});
|
|
2655
|
+
|
|
2656
|
+
describe('#postReturnIntegrationInfo - errors', () => {
|
|
2657
|
+
it('should have a postReturnIntegrationInfo function', (done) => {
|
|
2658
|
+
try {
|
|
2659
|
+
assert.equal(true, typeof a.postReturnIntegrationInfo === 'function');
|
|
2660
|
+
done();
|
|
2661
|
+
} catch (error) {
|
|
2662
|
+
log.error(`Test Failure: ${error}`);
|
|
2663
|
+
done(error);
|
|
2664
|
+
}
|
|
2665
|
+
}).timeout(attemptTimeout);
|
|
2666
|
+
it('should error if - missing body', (done) => {
|
|
2667
|
+
try {
|
|
2668
|
+
a.postReturnIntegrationInfo(null, (data, error) => {
|
|
2669
|
+
try {
|
|
2670
|
+
const displayE = 'body is required';
|
|
2671
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postReturnIntegrationInfo', displayE);
|
|
2672
|
+
done();
|
|
2673
|
+
} catch (err) {
|
|
2674
|
+
log.error(`Test Failure: ${err}`);
|
|
2675
|
+
done(err);
|
|
2676
|
+
}
|
|
2677
|
+
});
|
|
2678
|
+
} catch (error) {
|
|
2679
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2680
|
+
done(error);
|
|
2681
|
+
}
|
|
2682
|
+
}).timeout(attemptTimeout);
|
|
2683
|
+
});
|
|
2684
|
+
|
|
2685
|
+
describe('#postDeleteAllMappingsOnDeletingIntegration - errors', () => {
|
|
2686
|
+
it('should have a postDeleteAllMappingsOnDeletingIntegration function', (done) => {
|
|
2687
|
+
try {
|
|
2688
|
+
assert.equal(true, typeof a.postDeleteAllMappingsOnDeletingIntegration === 'function');
|
|
2689
|
+
done();
|
|
2690
|
+
} catch (error) {
|
|
2691
|
+
log.error(`Test Failure: ${error}`);
|
|
2692
|
+
done(error);
|
|
2693
|
+
}
|
|
2694
|
+
}).timeout(attemptTimeout);
|
|
2695
|
+
it('should error if - missing body', (done) => {
|
|
2696
|
+
try {
|
|
2697
|
+
a.postDeleteAllMappingsOnDeletingIntegration(null, (data, error) => {
|
|
2698
|
+
try {
|
|
2699
|
+
const displayE = 'body is required';
|
|
2700
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postDeleteAllMappingsOnDeletingIntegration', displayE);
|
|
2701
|
+
done();
|
|
2702
|
+
} catch (err) {
|
|
2703
|
+
log.error(`Test Failure: ${err}`);
|
|
2704
|
+
done(err);
|
|
2705
|
+
}
|
|
2706
|
+
});
|
|
2707
|
+
} catch (error) {
|
|
2708
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2709
|
+
done(error);
|
|
2710
|
+
}
|
|
2711
|
+
}).timeout(attemptTimeout);
|
|
2712
|
+
});
|
|
2713
|
+
|
|
2714
|
+
describe('#postDifferentIntegrationIDOfOrg - errors', () => {
|
|
2715
|
+
it('should have a postDifferentIntegrationIDOfOrg function', (done) => {
|
|
2716
|
+
try {
|
|
2717
|
+
assert.equal(true, typeof a.postDifferentIntegrationIDOfOrg === 'function');
|
|
2718
|
+
done();
|
|
2719
|
+
} catch (error) {
|
|
2720
|
+
log.error(`Test Failure: ${error}`);
|
|
2721
|
+
done(error);
|
|
2722
|
+
}
|
|
2723
|
+
}).timeout(attemptTimeout);
|
|
2724
|
+
it('should error if - missing body', (done) => {
|
|
2725
|
+
try {
|
|
2726
|
+
a.postDifferentIntegrationIDOfOrg(null, (data, error) => {
|
|
2727
|
+
try {
|
|
2728
|
+
const displayE = 'body is required';
|
|
2729
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postDifferentIntegrationIDOfOrg', displayE);
|
|
2730
|
+
done();
|
|
2731
|
+
} catch (err) {
|
|
2732
|
+
log.error(`Test Failure: ${err}`);
|
|
2733
|
+
done(err);
|
|
2734
|
+
}
|
|
2735
|
+
});
|
|
2736
|
+
} catch (error) {
|
|
2737
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2738
|
+
done(error);
|
|
2739
|
+
}
|
|
2740
|
+
}).timeout(attemptTimeout);
|
|
2741
|
+
});
|
|
2742
|
+
|
|
2743
|
+
describe('#postAccessOrganizationKey - errors', () => {
|
|
2744
|
+
it('should have a postAccessOrganizationKey function', (done) => {
|
|
2745
|
+
try {
|
|
2746
|
+
assert.equal(true, typeof a.postAccessOrganizationKey === 'function');
|
|
2747
|
+
done();
|
|
2748
|
+
} catch (error) {
|
|
2749
|
+
log.error(`Test Failure: ${error}`);
|
|
2750
|
+
done(error);
|
|
2751
|
+
}
|
|
2752
|
+
}).timeout(attemptTimeout);
|
|
2753
|
+
it('should error if - missing body', (done) => {
|
|
2754
|
+
try {
|
|
2755
|
+
a.postAccessOrganizationKey(null, (data, error) => {
|
|
2756
|
+
try {
|
|
2757
|
+
const displayE = 'body is required';
|
|
2758
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postAccessOrganizationKey', displayE);
|
|
2759
|
+
done();
|
|
2760
|
+
} catch (err) {
|
|
2761
|
+
log.error(`Test Failure: ${err}`);
|
|
2762
|
+
done(err);
|
|
2763
|
+
}
|
|
2764
|
+
});
|
|
2765
|
+
} catch (error) {
|
|
2766
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2767
|
+
done(error);
|
|
2768
|
+
}
|
|
2769
|
+
}).timeout(attemptTimeout);
|
|
2770
|
+
});
|
|
2771
|
+
|
|
2772
|
+
describe('#postReturnAllMappings - errors', () => {
|
|
2773
|
+
it('should have a postReturnAllMappings function', (done) => {
|
|
2774
|
+
try {
|
|
2775
|
+
assert.equal(true, typeof a.postReturnAllMappings === 'function');
|
|
2776
|
+
done();
|
|
2777
|
+
} catch (error) {
|
|
2778
|
+
log.error(`Test Failure: ${error}`);
|
|
2779
|
+
done(error);
|
|
2780
|
+
}
|
|
2781
|
+
}).timeout(attemptTimeout);
|
|
2782
|
+
it('should error if - missing body', (done) => {
|
|
2783
|
+
try {
|
|
2784
|
+
a.postReturnAllMappings(null, (data, error) => {
|
|
2785
|
+
try {
|
|
2786
|
+
const displayE = 'body is required';
|
|
2787
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postReturnAllMappings', displayE);
|
|
2788
|
+
done();
|
|
2789
|
+
} catch (err) {
|
|
2790
|
+
log.error(`Test Failure: ${err}`);
|
|
2791
|
+
done(err);
|
|
2792
|
+
}
|
|
2793
|
+
});
|
|
2794
|
+
} catch (error) {
|
|
2795
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2796
|
+
done(error);
|
|
2797
|
+
}
|
|
2798
|
+
}).timeout(attemptTimeout);
|
|
2799
|
+
});
|
|
2800
|
+
|
|
2801
|
+
describe('#postUserOrRolesMappings - errors', () => {
|
|
2802
|
+
it('should have a postUserOrRolesMappings function', (done) => {
|
|
2803
|
+
try {
|
|
2804
|
+
assert.equal(true, typeof a.postUserOrRolesMappings === 'function');
|
|
2805
|
+
done();
|
|
2806
|
+
} catch (error) {
|
|
2807
|
+
log.error(`Test Failure: ${error}`);
|
|
2808
|
+
done(error);
|
|
2809
|
+
}
|
|
2810
|
+
}).timeout(attemptTimeout);
|
|
2811
|
+
it('should error if - missing body', (done) => {
|
|
2812
|
+
try {
|
|
2813
|
+
a.postUserOrRolesMappings(null, (data, error) => {
|
|
2814
|
+
try {
|
|
2815
|
+
const displayE = 'body is required';
|
|
2816
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postUserOrRolesMappings', displayE);
|
|
2817
|
+
done();
|
|
2818
|
+
} catch (err) {
|
|
2819
|
+
log.error(`Test Failure: ${err}`);
|
|
2820
|
+
done(err);
|
|
2821
|
+
}
|
|
2822
|
+
});
|
|
2823
|
+
} catch (error) {
|
|
2824
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2825
|
+
done(error);
|
|
2826
|
+
}
|
|
2827
|
+
}).timeout(attemptTimeout);
|
|
2828
|
+
});
|
|
2829
|
+
|
|
2830
|
+
describe('#postDeleteAllMapings - errors', () => {
|
|
2831
|
+
it('should have a postDeleteAllMapings function', (done) => {
|
|
2832
|
+
try {
|
|
2833
|
+
assert.equal(true, typeof a.postDeleteAllMapings === 'function');
|
|
2834
|
+
done();
|
|
2835
|
+
} catch (error) {
|
|
2836
|
+
log.error(`Test Failure: ${error}`);
|
|
2837
|
+
done(error);
|
|
2838
|
+
}
|
|
2839
|
+
}).timeout(attemptTimeout);
|
|
2840
|
+
it('should error if - missing body', (done) => {
|
|
2841
|
+
try {
|
|
2842
|
+
a.postDeleteAllMapings(null, (data, error) => {
|
|
2843
|
+
try {
|
|
2844
|
+
const displayE = 'body is required';
|
|
2845
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postDeleteAllMapings', displayE);
|
|
2846
|
+
done();
|
|
2847
|
+
} catch (err) {
|
|
2848
|
+
log.error(`Test Failure: ${err}`);
|
|
2849
|
+
done(err);
|
|
2850
|
+
}
|
|
2851
|
+
});
|
|
2852
|
+
} catch (error) {
|
|
2853
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2854
|
+
done(error);
|
|
2855
|
+
}
|
|
2856
|
+
}).timeout(attemptTimeout);
|
|
2857
|
+
});
|
|
2858
|
+
|
|
2859
|
+
describe('#postGetIntegrationInfo - errors', () => {
|
|
2860
|
+
it('should have a postGetIntegrationInfo function', (done) => {
|
|
2861
|
+
try {
|
|
2862
|
+
assert.equal(true, typeof a.postGetIntegrationInfo === 'function');
|
|
2863
|
+
done();
|
|
2864
|
+
} catch (error) {
|
|
2865
|
+
log.error(`Test Failure: ${error}`);
|
|
2866
|
+
done(error);
|
|
2867
|
+
}
|
|
2868
|
+
}).timeout(attemptTimeout);
|
|
2869
|
+
it('should error if - missing body', (done) => {
|
|
2870
|
+
try {
|
|
2871
|
+
a.postGetIntegrationInfo(null, (data, error) => {
|
|
2872
|
+
try {
|
|
2873
|
+
const displayE = 'body is required';
|
|
2874
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postGetIntegrationInfo', displayE);
|
|
2875
|
+
done();
|
|
2876
|
+
} catch (err) {
|
|
2877
|
+
log.error(`Test Failure: ${err}`);
|
|
2878
|
+
done(err);
|
|
2879
|
+
}
|
|
2880
|
+
});
|
|
2881
|
+
} catch (error) {
|
|
2882
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2883
|
+
done(error);
|
|
2884
|
+
}
|
|
2885
|
+
}).timeout(attemptTimeout);
|
|
2886
|
+
});
|
|
2887
|
+
|
|
2888
|
+
describe('#postSubmitPayloadOfCSVInfo - errors', () => {
|
|
2889
|
+
it('should have a postSubmitPayloadOfCSVInfo function', (done) => {
|
|
2890
|
+
try {
|
|
2891
|
+
assert.equal(true, typeof a.postSubmitPayloadOfCSVInfo === 'function');
|
|
2892
|
+
done();
|
|
2893
|
+
} catch (error) {
|
|
2894
|
+
log.error(`Test Failure: ${error}`);
|
|
2895
|
+
done(error);
|
|
2896
|
+
}
|
|
2897
|
+
}).timeout(attemptTimeout);
|
|
2898
|
+
it('should error if - missing body', (done) => {
|
|
2899
|
+
try {
|
|
2900
|
+
a.postSubmitPayloadOfCSVInfo(null, (data, error) => {
|
|
2901
|
+
try {
|
|
2902
|
+
const displayE = 'body is required';
|
|
2903
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postSubmitPayloadOfCSVInfo', displayE);
|
|
2904
|
+
done();
|
|
2905
|
+
} catch (err) {
|
|
2906
|
+
log.error(`Test Failure: ${err}`);
|
|
2907
|
+
done(err);
|
|
2908
|
+
}
|
|
2909
|
+
});
|
|
2910
|
+
} catch (error) {
|
|
2911
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2912
|
+
done(error);
|
|
2913
|
+
}
|
|
2914
|
+
}).timeout(attemptTimeout);
|
|
2915
|
+
});
|
|
2916
|
+
|
|
2917
|
+
describe('#postpostSubmitPayloadOfCSVInfo - errors', () => {
|
|
2918
|
+
it('should have a postpostSubmitPayloadOfCSVInfo function', (done) => {
|
|
2919
|
+
try {
|
|
2920
|
+
assert.equal(true, typeof a.postpostSubmitPayloadOfCSVInfo === 'function');
|
|
2921
|
+
done();
|
|
2922
|
+
} catch (error) {
|
|
2923
|
+
log.error(`Test Failure: ${error}`);
|
|
2924
|
+
done(error);
|
|
2925
|
+
}
|
|
2926
|
+
}).timeout(attemptTimeout);
|
|
2927
|
+
it('should error if - missing body', (done) => {
|
|
2928
|
+
try {
|
|
2929
|
+
a.postpostSubmitPayloadOfCSVInfo(null, (data, error) => {
|
|
2930
|
+
try {
|
|
2931
|
+
const displayE = 'body is required';
|
|
2932
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postpostSubmitPayloadOfCSVInfo', displayE);
|
|
2933
|
+
done();
|
|
2934
|
+
} catch (err) {
|
|
2935
|
+
log.error(`Test Failure: ${err}`);
|
|
2936
|
+
done(err);
|
|
2937
|
+
}
|
|
2938
|
+
});
|
|
2939
|
+
} catch (error) {
|
|
2940
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2941
|
+
done(error);
|
|
2942
|
+
}
|
|
2943
|
+
}).timeout(attemptTimeout);
|
|
2944
|
+
});
|
|
2945
|
+
|
|
2946
|
+
describe('#postRetrieveLastCsvFile - errors', () => {
|
|
2947
|
+
it('should have a postRetrieveLastCsvFile function', (done) => {
|
|
2948
|
+
try {
|
|
2949
|
+
assert.equal(true, typeof a.postRetrieveLastCsvFile === 'function');
|
|
2950
|
+
done();
|
|
2951
|
+
} catch (error) {
|
|
2952
|
+
log.error(`Test Failure: ${error}`);
|
|
2953
|
+
done(error);
|
|
2954
|
+
}
|
|
2955
|
+
}).timeout(attemptTimeout);
|
|
2956
|
+
it('should error if - missing body', (done) => {
|
|
2957
|
+
try {
|
|
2958
|
+
a.postRetrieveLastCsvFile(null, (data, error) => {
|
|
2959
|
+
try {
|
|
2960
|
+
const displayE = 'body is required';
|
|
2961
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postRetrieveLastCsvFile', displayE);
|
|
2962
|
+
done();
|
|
2963
|
+
} catch (err) {
|
|
2964
|
+
log.error(`Test Failure: ${err}`);
|
|
2965
|
+
done(err);
|
|
2966
|
+
}
|
|
2967
|
+
});
|
|
2968
|
+
} catch (error) {
|
|
2969
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2970
|
+
done(error);
|
|
2971
|
+
}
|
|
2972
|
+
}).timeout(attemptTimeout);
|
|
2973
|
+
});
|
|
2974
|
+
|
|
2975
|
+
describe('#postSubmitPayloadOfShiftInfo - errors', () => {
|
|
2976
|
+
it('should have a postSubmitPayloadOfShiftInfo function', (done) => {
|
|
2977
|
+
try {
|
|
2978
|
+
assert.equal(true, typeof a.postSubmitPayloadOfShiftInfo === 'function');
|
|
2979
|
+
done();
|
|
2980
|
+
} catch (error) {
|
|
2981
|
+
log.error(`Test Failure: ${error}`);
|
|
2982
|
+
done(error);
|
|
2983
|
+
}
|
|
2984
|
+
}).timeout(attemptTimeout);
|
|
2985
|
+
it('should error if - missing body', (done) => {
|
|
2986
|
+
try {
|
|
2987
|
+
a.postSubmitPayloadOfShiftInfo(null, (data, error) => {
|
|
2988
|
+
try {
|
|
2989
|
+
const displayE = 'body is required';
|
|
2990
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postSubmitPayloadOfShiftInfo', displayE);
|
|
2991
|
+
done();
|
|
2992
|
+
} catch (err) {
|
|
2993
|
+
log.error(`Test Failure: ${err}`);
|
|
2994
|
+
done(err);
|
|
2995
|
+
}
|
|
2996
|
+
});
|
|
2997
|
+
} catch (error) {
|
|
2998
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2999
|
+
done(error);
|
|
3000
|
+
}
|
|
3001
|
+
}).timeout(attemptTimeout);
|
|
3002
|
+
});
|
|
3003
|
+
|
|
3004
|
+
describe('#postSearchEntities - errors', () => {
|
|
3005
|
+
it('should have a postSearchEntities function', (done) => {
|
|
3006
|
+
try {
|
|
3007
|
+
assert.equal(true, typeof a.postSearchEntities === 'function');
|
|
3008
|
+
done();
|
|
3009
|
+
} catch (error) {
|
|
3010
|
+
log.error(`Test Failure: ${error}`);
|
|
3011
|
+
done(error);
|
|
3012
|
+
}
|
|
3013
|
+
}).timeout(attemptTimeout);
|
|
3014
|
+
it('should error if - missing body', (done) => {
|
|
3015
|
+
try {
|
|
3016
|
+
a.postSearchEntities(null, (data, error) => {
|
|
3017
|
+
try {
|
|
3018
|
+
const displayE = 'body is required';
|
|
3019
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-tiger_connect-adapter-postSearchEntities', displayE);
|
|
3020
|
+
done();
|
|
3021
|
+
} catch (err) {
|
|
3022
|
+
log.error(`Test Failure: ${err}`);
|
|
3023
|
+
done(err);
|
|
3024
|
+
}
|
|
3025
|
+
});
|
|
3026
|
+
} catch (error) {
|
|
3027
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3028
|
+
done(error);
|
|
3029
|
+
}
|
|
3030
|
+
}).timeout(attemptTimeout);
|
|
3031
|
+
});
|
|
3032
|
+
});
|
|
3033
|
+
});
|