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