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