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