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