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