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