@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,2777 @@
|
|
|
1
|
+
/* @copyright Itential, LLC 2019 (pre-modifications) */
|
|
2
|
+
|
|
3
|
+
// Set globals
|
|
4
|
+
/* global describe it log pronghornProps */
|
|
5
|
+
/* eslint no-unused-vars: warn */
|
|
6
|
+
/* eslint no-underscore-dangle: warn */
|
|
7
|
+
/* eslint import/no-dynamic-require:warn */
|
|
8
|
+
|
|
9
|
+
// include required items for testing & logging
|
|
10
|
+
const assert = require('assert');
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
const util = require('util');
|
|
14
|
+
const mocha = require('mocha');
|
|
15
|
+
const winston = require('winston');
|
|
16
|
+
const { expect } = require('chai');
|
|
17
|
+
const { use } = require('chai');
|
|
18
|
+
const td = require('testdouble');
|
|
19
|
+
|
|
20
|
+
const anything = td.matchers.anything();
|
|
21
|
+
|
|
22
|
+
// stub and attemptTimeout are used throughout the code so set them here
|
|
23
|
+
let logLevel = 'none';
|
|
24
|
+
const isRapidFail = false;
|
|
25
|
+
const isSaveMockData = 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
|
+
if (samProps.request.attempt_timeout < 30000) {
|
|
47
|
+
samProps.request.attempt_timeout = 30000;
|
|
48
|
+
}
|
|
49
|
+
const attemptTimeout = samProps.request.attempt_timeout;
|
|
50
|
+
const { stub } = samProps;
|
|
51
|
+
|
|
52
|
+
// these are the adapter properties. You generally should not need to alter
|
|
53
|
+
// any of these after they are initially set up
|
|
54
|
+
global.pronghornProps = {
|
|
55
|
+
pathProps: {
|
|
56
|
+
encrypted: false
|
|
57
|
+
},
|
|
58
|
+
adapterProps: {
|
|
59
|
+
adapters: [{
|
|
60
|
+
id: 'Test-viavi_xpertrak',
|
|
61
|
+
type: 'ViaviXpertrak',
|
|
62
|
+
properties: samProps
|
|
63
|
+
}]
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
global.$HOME = `${__dirname}/../..`;
|
|
68
|
+
|
|
69
|
+
// set the log levels that Pronghorn uses, spam and trace are not defaulted in so without
|
|
70
|
+
// this you may error on log.trace calls.
|
|
71
|
+
const myCustomLevels = {
|
|
72
|
+
levels: {
|
|
73
|
+
spam: 6,
|
|
74
|
+
trace: 5,
|
|
75
|
+
debug: 4,
|
|
76
|
+
info: 3,
|
|
77
|
+
warn: 2,
|
|
78
|
+
error: 1,
|
|
79
|
+
none: 0
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// need to see if there is a log level passed in
|
|
84
|
+
process.argv.forEach((val) => {
|
|
85
|
+
// is there a log level defined to be passed in?
|
|
86
|
+
if (val.indexOf('--LOG') === 0) {
|
|
87
|
+
// get the desired log level
|
|
88
|
+
const inputVal = val.split('=')[1];
|
|
89
|
+
|
|
90
|
+
// validate the log level is supported, if so set it
|
|
91
|
+
if (Object.hasOwnProperty.call(myCustomLevels.levels, inputVal)) {
|
|
92
|
+
logLevel = inputVal;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// need to set global logging
|
|
98
|
+
global.log = winston.createLogger({
|
|
99
|
+
level: logLevel,
|
|
100
|
+
levels: myCustomLevels.levels,
|
|
101
|
+
transports: [
|
|
102
|
+
new winston.transports.Console()
|
|
103
|
+
]
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Runs the common asserts for test
|
|
108
|
+
*/
|
|
109
|
+
function runCommonAsserts(data, error) {
|
|
110
|
+
assert.equal(undefined, error);
|
|
111
|
+
assert.notEqual(undefined, data);
|
|
112
|
+
assert.notEqual(null, data);
|
|
113
|
+
assert.notEqual(undefined, data.response);
|
|
114
|
+
assert.notEqual(null, data.response);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Runs the error asserts for the test
|
|
119
|
+
*/
|
|
120
|
+
function runErrorAsserts(data, error, code, origin, displayStr) {
|
|
121
|
+
assert.equal(null, data);
|
|
122
|
+
assert.notEqual(undefined, error);
|
|
123
|
+
assert.notEqual(null, error);
|
|
124
|
+
assert.notEqual(undefined, error.IAPerror);
|
|
125
|
+
assert.notEqual(null, error.IAPerror);
|
|
126
|
+
assert.notEqual(undefined, error.IAPerror.displayString);
|
|
127
|
+
assert.notEqual(null, error.IAPerror.displayString);
|
|
128
|
+
assert.equal(code, error.icode);
|
|
129
|
+
assert.equal(origin, error.IAPerror.origin);
|
|
130
|
+
assert.equal(displayStr, error.IAPerror.displayString);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @function saveMockData
|
|
135
|
+
* Attempts to take data from responses and place them in MockDataFiles to help create Mockdata.
|
|
136
|
+
* Note, this was built based on entity file structure for Adapter-Engine 1.6.x
|
|
137
|
+
* @param {string} entityName - Name of the entity saving mock data for
|
|
138
|
+
* @param {string} actionName - Name of the action saving mock data for
|
|
139
|
+
* @param {string} descriptor - Something to describe this test (used as a type)
|
|
140
|
+
* @param {string or object} responseData - The data to put in the mock file.
|
|
141
|
+
*/
|
|
142
|
+
function saveMockData(entityName, actionName, descriptor, responseData) {
|
|
143
|
+
// do not need to save mockdata if we are running in stub mode (already has mock data) or if told not to save
|
|
144
|
+
if (stub || !isSaveMockData) {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// must have a response in order to store the response
|
|
149
|
+
if (responseData && responseData.response) {
|
|
150
|
+
let data = responseData.response;
|
|
151
|
+
|
|
152
|
+
// if there was a raw response that one is better as it is untranslated
|
|
153
|
+
if (responseData.raw) {
|
|
154
|
+
data = responseData.raw;
|
|
155
|
+
|
|
156
|
+
try {
|
|
157
|
+
const temp = JSON.parse(data);
|
|
158
|
+
data = temp;
|
|
159
|
+
} catch (pex) {
|
|
160
|
+
// do not care if it did not parse as we will just use data
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
try {
|
|
165
|
+
const base = path.join(__dirname, `../../entities/${entityName}/`);
|
|
166
|
+
const mockdatafolder = 'mockdatafiles';
|
|
167
|
+
const filename = `mockdatafiles/${actionName}-${descriptor}.json`;
|
|
168
|
+
|
|
169
|
+
if (!fs.existsSync(base + mockdatafolder)) {
|
|
170
|
+
fs.mkdirSync(base + mockdatafolder);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// write the data we retrieved
|
|
174
|
+
fs.writeFile(base + filename, JSON.stringify(data, null, 2), 'utf8', (errWritingMock) => {
|
|
175
|
+
if (errWritingMock) throw errWritingMock;
|
|
176
|
+
|
|
177
|
+
// update the action file to reflect the changes. Note: We're replacing the default object for now!
|
|
178
|
+
fs.readFile(`${base}action.json`, (errRead, content) => {
|
|
179
|
+
if (errRead) throw errRead;
|
|
180
|
+
|
|
181
|
+
// parse the action file into JSON
|
|
182
|
+
const parsedJson = JSON.parse(content);
|
|
183
|
+
|
|
184
|
+
// The object update we'll write in.
|
|
185
|
+
const responseObj = {
|
|
186
|
+
type: descriptor,
|
|
187
|
+
key: '',
|
|
188
|
+
mockFile: filename
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
// get the object for method we're trying to change.
|
|
192
|
+
const currentMethodAction = parsedJson.actions.find((obj) => obj.name === actionName);
|
|
193
|
+
|
|
194
|
+
// if the method was not found - should never happen but...
|
|
195
|
+
if (!currentMethodAction) {
|
|
196
|
+
throw Error('Can\'t find an action for this method in the provided entity.');
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// if there is a response object, we want to replace the Response object. Otherwise we'll create one.
|
|
200
|
+
const actionResponseObj = currentMethodAction.responseObjects.find((obj) => obj.type === descriptor);
|
|
201
|
+
|
|
202
|
+
// Add the action responseObj back into the array of response objects.
|
|
203
|
+
if (!actionResponseObj) {
|
|
204
|
+
// if there is a default response object, we want to get the key.
|
|
205
|
+
const defaultResponseObj = currentMethodAction.responseObjects.find((obj) => obj.type === 'default');
|
|
206
|
+
|
|
207
|
+
// save the default key into the new response object
|
|
208
|
+
if (defaultResponseObj) {
|
|
209
|
+
responseObj.key = defaultResponseObj.key;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// save the new response object
|
|
213
|
+
currentMethodAction.responseObjects = [responseObj];
|
|
214
|
+
} else {
|
|
215
|
+
// update the location of the mock data file
|
|
216
|
+
actionResponseObj.mockFile = responseObj.mockFile;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// Save results
|
|
220
|
+
fs.writeFile(`${base}action.json`, JSON.stringify(parsedJson, null, 2), (err) => {
|
|
221
|
+
if (err) throw err;
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
} catch (e) {
|
|
226
|
+
log.debug(`Failed to save mock data for ${actionName}. ${e.message}`);
|
|
227
|
+
return false;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// no response to save
|
|
232
|
+
log.debug(`No data passed to save into mockdata for ${actionName}`);
|
|
233
|
+
return false;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// require the adapter that we are going to be using
|
|
237
|
+
const ViaviXpertrak = require('../../adapter');
|
|
238
|
+
|
|
239
|
+
// begin the testing - these should be pretty well defined between the describe and the it!
|
|
240
|
+
describe('[integration] Viavi_xpertrak Adapter Test', () => {
|
|
241
|
+
describe('ViaviXpertrak Class Tests', () => {
|
|
242
|
+
const a = new ViaviXpertrak(
|
|
243
|
+
pronghornProps.adapterProps.adapters[0].id,
|
|
244
|
+
pronghornProps.adapterProps.adapters[0].properties
|
|
245
|
+
);
|
|
246
|
+
|
|
247
|
+
if (isRapidFail) {
|
|
248
|
+
const state = {};
|
|
249
|
+
state.passed = true;
|
|
250
|
+
|
|
251
|
+
mocha.afterEach(function x() {
|
|
252
|
+
state.passed = state.passed
|
|
253
|
+
&& (this.currentTest.state === 'passed');
|
|
254
|
+
});
|
|
255
|
+
mocha.beforeEach(function x() {
|
|
256
|
+
if (!state.passed) {
|
|
257
|
+
return this.currentTest.skip();
|
|
258
|
+
}
|
|
259
|
+
return true;
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
describe('#class instance created', () => {
|
|
264
|
+
it('should be a class with properties', (done) => {
|
|
265
|
+
try {
|
|
266
|
+
assert.notEqual(null, a);
|
|
267
|
+
assert.notEqual(undefined, a);
|
|
268
|
+
const checkId = global.pronghornProps.adapterProps.adapters[0].id;
|
|
269
|
+
assert.equal(checkId, a.id);
|
|
270
|
+
assert.notEqual(null, a.allProps);
|
|
271
|
+
const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
|
|
272
|
+
assert.equal(check, a.healthcheckType);
|
|
273
|
+
done();
|
|
274
|
+
} catch (error) {
|
|
275
|
+
log.error(`Test Failure: ${error}`);
|
|
276
|
+
done(error);
|
|
277
|
+
}
|
|
278
|
+
}).timeout(attemptTimeout);
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
describe('#connect', () => {
|
|
282
|
+
it('should get connected - no healthcheck', (done) => {
|
|
283
|
+
try {
|
|
284
|
+
a.healthcheckType = 'none';
|
|
285
|
+
a.connect();
|
|
286
|
+
|
|
287
|
+
try {
|
|
288
|
+
assert.equal(true, a.alive);
|
|
289
|
+
done();
|
|
290
|
+
} catch (error) {
|
|
291
|
+
log.error(`Test Failure: ${error}`);
|
|
292
|
+
done(error);
|
|
293
|
+
}
|
|
294
|
+
} catch (error) {
|
|
295
|
+
log.error(`Adapter Exception: ${error}`);
|
|
296
|
+
done(error);
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
it('should get connected - startup healthcheck', (done) => {
|
|
300
|
+
try {
|
|
301
|
+
a.healthcheckType = 'startup';
|
|
302
|
+
a.connect();
|
|
303
|
+
|
|
304
|
+
try {
|
|
305
|
+
assert.equal(true, a.alive);
|
|
306
|
+
done();
|
|
307
|
+
} catch (error) {
|
|
308
|
+
log.error(`Test Failure: ${error}`);
|
|
309
|
+
done(error);
|
|
310
|
+
}
|
|
311
|
+
} catch (error) {
|
|
312
|
+
log.error(`Adapter Exception: ${error}`);
|
|
313
|
+
done(error);
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
describe('#healthCheck', () => {
|
|
319
|
+
it('should be healthy', (done) => {
|
|
320
|
+
try {
|
|
321
|
+
a.healthCheck(null, (data) => {
|
|
322
|
+
try {
|
|
323
|
+
assert.equal(true, a.healthy);
|
|
324
|
+
saveMockData('system', 'healthcheck', 'default', data);
|
|
325
|
+
done();
|
|
326
|
+
} catch (err) {
|
|
327
|
+
log.error(`Test Failure: ${err}`);
|
|
328
|
+
done(err);
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
} catch (error) {
|
|
332
|
+
log.error(`Adapter Exception: ${error}`);
|
|
333
|
+
done(error);
|
|
334
|
+
}
|
|
335
|
+
}).timeout(attemptTimeout);
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
// broker tests
|
|
339
|
+
describe('#getDevicesFiltered - errors', () => {
|
|
340
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
341
|
+
try {
|
|
342
|
+
const opts = {
|
|
343
|
+
filter: {
|
|
344
|
+
name: 'deviceName'
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
a.getDevicesFiltered(opts, (data, error) => {
|
|
348
|
+
try {
|
|
349
|
+
if (stub) {
|
|
350
|
+
if (samProps.devicebroker.getDevicesFiltered[0].handleFailure === 'ignore') {
|
|
351
|
+
assert.equal(null, error);
|
|
352
|
+
assert.notEqual(undefined, data);
|
|
353
|
+
assert.notEqual(null, data);
|
|
354
|
+
assert.equal(0, data.total);
|
|
355
|
+
assert.equal(0, data.list.length);
|
|
356
|
+
} else {
|
|
357
|
+
const displayE = 'Error 400 received on request';
|
|
358
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
359
|
+
}
|
|
360
|
+
} else {
|
|
361
|
+
runCommonAsserts(data, error);
|
|
362
|
+
}
|
|
363
|
+
done();
|
|
364
|
+
} catch (err) {
|
|
365
|
+
log.error(`Test Failure: ${err}`);
|
|
366
|
+
done(err);
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
} catch (error) {
|
|
370
|
+
log.error(`Adapter Exception: ${error}`);
|
|
371
|
+
done(error);
|
|
372
|
+
}
|
|
373
|
+
}).timeout(attemptTimeout);
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
describe('#iapGetDeviceCount - errors', () => {
|
|
377
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
378
|
+
try {
|
|
379
|
+
const opts = {
|
|
380
|
+
filter: {
|
|
381
|
+
name: 'deviceName'
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
a.iapGetDeviceCount((data, error) => {
|
|
385
|
+
try {
|
|
386
|
+
if (stub) {
|
|
387
|
+
if (samProps.devicebroker.getDevicesFiltered[0].handleFailure === 'ignore') {
|
|
388
|
+
assert.equal(null, error);
|
|
389
|
+
assert.notEqual(undefined, data);
|
|
390
|
+
assert.notEqual(null, data);
|
|
391
|
+
assert.equal(0, data.count);
|
|
392
|
+
} else {
|
|
393
|
+
const displayE = 'Error 400 received on request';
|
|
394
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
395
|
+
}
|
|
396
|
+
} else {
|
|
397
|
+
runCommonAsserts(data, error);
|
|
398
|
+
}
|
|
399
|
+
done();
|
|
400
|
+
} catch (err) {
|
|
401
|
+
log.error(`Test Failure: ${err}`);
|
|
402
|
+
done(err);
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
} catch (error) {
|
|
406
|
+
log.error(`Adapter Exception: ${error}`);
|
|
407
|
+
done(error);
|
|
408
|
+
}
|
|
409
|
+
}).timeout(attemptTimeout);
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
// exposed cache tests
|
|
413
|
+
describe('#iapPopulateEntityCache - errors', () => {
|
|
414
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
415
|
+
try {
|
|
416
|
+
a.iapPopulateEntityCache('Device', (data, error) => {
|
|
417
|
+
try {
|
|
418
|
+
if (stub) {
|
|
419
|
+
assert.equal(null, data);
|
|
420
|
+
assert.notEqual(undefined, error);
|
|
421
|
+
assert.notEqual(null, error);
|
|
422
|
+
done();
|
|
423
|
+
} else {
|
|
424
|
+
assert.equal(undefined, error);
|
|
425
|
+
assert.equal('success', data[0]);
|
|
426
|
+
done();
|
|
427
|
+
}
|
|
428
|
+
} catch (err) {
|
|
429
|
+
log.error(`Test Failure: ${err}`);
|
|
430
|
+
done(err);
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
} catch (error) {
|
|
434
|
+
log.error(`Adapter Exception: ${error}`);
|
|
435
|
+
done(error);
|
|
436
|
+
}
|
|
437
|
+
}).timeout(attemptTimeout);
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
describe('#iapRetrieveEntitiesCache - errors', () => {
|
|
441
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
442
|
+
try {
|
|
443
|
+
a.iapRetrieveEntitiesCache('Device', {}, (data, error) => {
|
|
444
|
+
try {
|
|
445
|
+
if (stub) {
|
|
446
|
+
assert.equal(null, data);
|
|
447
|
+
assert.notEqual(null, error);
|
|
448
|
+
assert.notEqual(undefined, error);
|
|
449
|
+
} else {
|
|
450
|
+
assert.equal(undefined, error);
|
|
451
|
+
assert.notEqual(null, data);
|
|
452
|
+
assert.notEqual(undefined, data);
|
|
453
|
+
}
|
|
454
|
+
done();
|
|
455
|
+
} catch (err) {
|
|
456
|
+
log.error(`Test Failure: ${err}`);
|
|
457
|
+
done(err);
|
|
458
|
+
}
|
|
459
|
+
});
|
|
460
|
+
} catch (error) {
|
|
461
|
+
log.error(`Adapter Exception: ${error}`);
|
|
462
|
+
done(error);
|
|
463
|
+
}
|
|
464
|
+
}).timeout(attemptTimeout);
|
|
465
|
+
});
|
|
466
|
+
/*
|
|
467
|
+
-----------------------------------------------------------------------
|
|
468
|
+
-----------------------------------------------------------------------
|
|
469
|
+
*** All code above this comment will be replaced during a migration ***
|
|
470
|
+
******************* DO NOT REMOVE THIS COMMENT BLOCK ******************
|
|
471
|
+
-----------------------------------------------------------------------
|
|
472
|
+
-----------------------------------------------------------------------
|
|
473
|
+
*/
|
|
474
|
+
|
|
475
|
+
const assetManagementCMTSAddPublicCmtsUsingPOST1BodyParam = {};
|
|
476
|
+
describe('#addPublicCmtsUsingPOST1 - errors', () => {
|
|
477
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
478
|
+
try {
|
|
479
|
+
a.addPublicCmtsUsingPOST1(assetManagementCMTSAddPublicCmtsUsingPOST1BodyParam, (data, error) => {
|
|
480
|
+
try {
|
|
481
|
+
if (stub) {
|
|
482
|
+
const displayE = 'Error 400 received on request';
|
|
483
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
484
|
+
} else {
|
|
485
|
+
runCommonAsserts(data, error);
|
|
486
|
+
}
|
|
487
|
+
saveMockData('AssetManagementCMTS', 'addPublicCmtsUsingPOST1', 'default', data);
|
|
488
|
+
done();
|
|
489
|
+
} catch (err) {
|
|
490
|
+
log.error(`Test Failure: ${err}`);
|
|
491
|
+
done(err);
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
} catch (error) {
|
|
495
|
+
log.error(`Adapter Exception: ${error}`);
|
|
496
|
+
done(error);
|
|
497
|
+
}
|
|
498
|
+
}).timeout(attemptTimeout);
|
|
499
|
+
});
|
|
500
|
+
|
|
501
|
+
const assetManagementCMTSFile = 'fakedata';
|
|
502
|
+
describe('#processCmtsCsvUsingPOST1 - errors', () => {
|
|
503
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
504
|
+
try {
|
|
505
|
+
a.processCmtsCsvUsingPOST1(assetManagementCMTSFile, (data, error) => {
|
|
506
|
+
try {
|
|
507
|
+
if (stub) {
|
|
508
|
+
const displayE = 'Error 400 received on request';
|
|
509
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
510
|
+
} else {
|
|
511
|
+
runCommonAsserts(data, error);
|
|
512
|
+
}
|
|
513
|
+
saveMockData('AssetManagementCMTS', 'processCmtsCsvUsingPOST1', 'default', data);
|
|
514
|
+
done();
|
|
515
|
+
} catch (err) {
|
|
516
|
+
log.error(`Test Failure: ${err}`);
|
|
517
|
+
done(err);
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
} catch (error) {
|
|
521
|
+
log.error(`Adapter Exception: ${error}`);
|
|
522
|
+
done(error);
|
|
523
|
+
}
|
|
524
|
+
}).timeout(attemptTimeout);
|
|
525
|
+
});
|
|
526
|
+
|
|
527
|
+
const assetManagementCMTSSyncCmtsUsingPOST1BodyParam = [
|
|
528
|
+
6
|
|
529
|
+
];
|
|
530
|
+
describe('#syncCmtsUsingPOST1 - errors', () => {
|
|
531
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
532
|
+
try {
|
|
533
|
+
a.syncCmtsUsingPOST1(assetManagementCMTSSyncCmtsUsingPOST1BodyParam, (data, error) => {
|
|
534
|
+
try {
|
|
535
|
+
if (stub) {
|
|
536
|
+
const displayE = 'Error 400 received on request';
|
|
537
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
538
|
+
} else {
|
|
539
|
+
runCommonAsserts(data, error);
|
|
540
|
+
}
|
|
541
|
+
saveMockData('AssetManagementCMTS', 'syncCmtsUsingPOST1', 'default', data);
|
|
542
|
+
done();
|
|
543
|
+
} catch (err) {
|
|
544
|
+
log.error(`Test Failure: ${err}`);
|
|
545
|
+
done(err);
|
|
546
|
+
}
|
|
547
|
+
});
|
|
548
|
+
} catch (error) {
|
|
549
|
+
log.error(`Adapter Exception: ${error}`);
|
|
550
|
+
done(error);
|
|
551
|
+
}
|
|
552
|
+
}).timeout(attemptTimeout);
|
|
553
|
+
});
|
|
554
|
+
|
|
555
|
+
describe('#getAllCmtsUsingGET1 - errors', () => {
|
|
556
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
557
|
+
try {
|
|
558
|
+
a.getAllCmtsUsingGET1((data, error) => {
|
|
559
|
+
try {
|
|
560
|
+
if (stub) {
|
|
561
|
+
runCommonAsserts(data, error);
|
|
562
|
+
assert.equal('object', typeof data.response[0]);
|
|
563
|
+
} else {
|
|
564
|
+
runCommonAsserts(data, error);
|
|
565
|
+
}
|
|
566
|
+
saveMockData('AssetManagementCMTS', 'getAllCmtsUsingGET1', 'default', data);
|
|
567
|
+
done();
|
|
568
|
+
} catch (err) {
|
|
569
|
+
log.error(`Test Failure: ${err}`);
|
|
570
|
+
done(err);
|
|
571
|
+
}
|
|
572
|
+
});
|
|
573
|
+
} catch (error) {
|
|
574
|
+
log.error(`Adapter Exception: ${error}`);
|
|
575
|
+
done(error);
|
|
576
|
+
}
|
|
577
|
+
}).timeout(attemptTimeout);
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
describe('#getAllCmtsLiteUsingGET1 - errors', () => {
|
|
581
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
582
|
+
try {
|
|
583
|
+
a.getAllCmtsLiteUsingGET1((data, error) => {
|
|
584
|
+
try {
|
|
585
|
+
if (stub) {
|
|
586
|
+
runCommonAsserts(data, error);
|
|
587
|
+
assert.equal('object', typeof data.response[0]);
|
|
588
|
+
assert.equal('object', typeof data.response[1]);
|
|
589
|
+
assert.equal('object', typeof data.response[2]);
|
|
590
|
+
} else {
|
|
591
|
+
runCommonAsserts(data, error);
|
|
592
|
+
}
|
|
593
|
+
saveMockData('AssetManagementCMTS', 'getAllCmtsLiteUsingGET1', 'default', data);
|
|
594
|
+
done();
|
|
595
|
+
} catch (err) {
|
|
596
|
+
log.error(`Test Failure: ${err}`);
|
|
597
|
+
done(err);
|
|
598
|
+
}
|
|
599
|
+
});
|
|
600
|
+
} catch (error) {
|
|
601
|
+
log.error(`Adapter Exception: ${error}`);
|
|
602
|
+
done(error);
|
|
603
|
+
}
|
|
604
|
+
}).timeout(attemptTimeout);
|
|
605
|
+
});
|
|
606
|
+
|
|
607
|
+
const assetManagementCMTSIdentifier = 555;
|
|
608
|
+
describe('#getCmtsUsingGET1 - errors', () => {
|
|
609
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
610
|
+
try {
|
|
611
|
+
a.getCmtsUsingGET1(assetManagementCMTSIdentifier, (data, error) => {
|
|
612
|
+
try {
|
|
613
|
+
if (stub) {
|
|
614
|
+
const displayE = 'Error 400 received on request';
|
|
615
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
616
|
+
} else {
|
|
617
|
+
runCommonAsserts(data, error);
|
|
618
|
+
}
|
|
619
|
+
saveMockData('AssetManagementCMTS', 'getCmtsUsingGET1', 'default', data);
|
|
620
|
+
done();
|
|
621
|
+
} catch (err) {
|
|
622
|
+
log.error(`Test Failure: ${err}`);
|
|
623
|
+
done(err);
|
|
624
|
+
}
|
|
625
|
+
});
|
|
626
|
+
} catch (error) {
|
|
627
|
+
log.error(`Adapter Exception: ${error}`);
|
|
628
|
+
done(error);
|
|
629
|
+
}
|
|
630
|
+
}).timeout(attemptTimeout);
|
|
631
|
+
});
|
|
632
|
+
|
|
633
|
+
const assetManagementCMTSUSPortEditCmtsUsPortNameUsingPOST1BodyParam = {};
|
|
634
|
+
describe('#editCmtsUsPortNameUsingPOST1 - errors', () => {
|
|
635
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
636
|
+
try {
|
|
637
|
+
a.editCmtsUsPortNameUsingPOST1(assetManagementCMTSUSPortEditCmtsUsPortNameUsingPOST1BodyParam, (data, error) => {
|
|
638
|
+
try {
|
|
639
|
+
if (stub) {
|
|
640
|
+
const displayE = 'Error 400 received on request';
|
|
641
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
642
|
+
} else {
|
|
643
|
+
runCommonAsserts(data, error);
|
|
644
|
+
}
|
|
645
|
+
saveMockData('AssetManagementCMTSUSPort', 'editCmtsUsPortNameUsingPOST1', 'default', data);
|
|
646
|
+
done();
|
|
647
|
+
} catch (err) {
|
|
648
|
+
log.error(`Test Failure: ${err}`);
|
|
649
|
+
done(err);
|
|
650
|
+
}
|
|
651
|
+
});
|
|
652
|
+
} catch (error) {
|
|
653
|
+
log.error(`Adapter Exception: ${error}`);
|
|
654
|
+
done(error);
|
|
655
|
+
}
|
|
656
|
+
}).timeout(attemptTimeout);
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
const assetManagementCMTSUSPortCsvFile = 'fakedata';
|
|
660
|
+
describe('#editCmtsUsPortNameCSVUsingPOST1 - errors', () => {
|
|
661
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
662
|
+
try {
|
|
663
|
+
a.editCmtsUsPortNameCSVUsingPOST1(assetManagementCMTSUSPortCsvFile, (data, error) => {
|
|
664
|
+
try {
|
|
665
|
+
if (stub) {
|
|
666
|
+
const displayE = 'Error 400 received on request';
|
|
667
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
668
|
+
} else {
|
|
669
|
+
runCommonAsserts(data, error);
|
|
670
|
+
}
|
|
671
|
+
saveMockData('AssetManagementCMTSUSPort', 'editCmtsUsPortNameCSVUsingPOST1', 'default', data);
|
|
672
|
+
done();
|
|
673
|
+
} catch (err) {
|
|
674
|
+
log.error(`Test Failure: ${err}`);
|
|
675
|
+
done(err);
|
|
676
|
+
}
|
|
677
|
+
});
|
|
678
|
+
} catch (error) {
|
|
679
|
+
log.error(`Adapter Exception: ${error}`);
|
|
680
|
+
done(error);
|
|
681
|
+
}
|
|
682
|
+
}).timeout(attemptTimeout);
|
|
683
|
+
});
|
|
684
|
+
|
|
685
|
+
describe('#getCmtsUSPortsCSVUsingGET1 - errors', () => {
|
|
686
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
687
|
+
try {
|
|
688
|
+
a.getCmtsUSPortsCSVUsingGET1((data, error) => {
|
|
689
|
+
try {
|
|
690
|
+
if (stub) {
|
|
691
|
+
const displayE = 'Error 400 received on request';
|
|
692
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
693
|
+
} else {
|
|
694
|
+
runCommonAsserts(data, error);
|
|
695
|
+
}
|
|
696
|
+
saveMockData('AssetManagementCMTSUSPort', 'getCmtsUSPortsCSVUsingGET1', 'default', data);
|
|
697
|
+
done();
|
|
698
|
+
} catch (err) {
|
|
699
|
+
log.error(`Test Failure: ${err}`);
|
|
700
|
+
done(err);
|
|
701
|
+
}
|
|
702
|
+
});
|
|
703
|
+
} catch (error) {
|
|
704
|
+
log.error(`Adapter Exception: ${error}`);
|
|
705
|
+
done(error);
|
|
706
|
+
}
|
|
707
|
+
}).timeout(attemptTimeout);
|
|
708
|
+
});
|
|
709
|
+
|
|
710
|
+
const assetManagementHCUFile = 'fakedata';
|
|
711
|
+
describe('#processHcuCsvUsingPOST2 - errors', () => {
|
|
712
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
713
|
+
try {
|
|
714
|
+
a.processHcuCsvUsingPOST2(assetManagementHCUFile, (data, error) => {
|
|
715
|
+
try {
|
|
716
|
+
if (stub) {
|
|
717
|
+
const displayE = 'Error 400 received on request';
|
|
718
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
719
|
+
} else {
|
|
720
|
+
runCommonAsserts(data, error);
|
|
721
|
+
}
|
|
722
|
+
saveMockData('AssetManagementHCU', 'processHcuCsvUsingPOST2', 'default', data);
|
|
723
|
+
done();
|
|
724
|
+
} catch (err) {
|
|
725
|
+
log.error(`Test Failure: ${err}`);
|
|
726
|
+
done(err);
|
|
727
|
+
}
|
|
728
|
+
});
|
|
729
|
+
} catch (error) {
|
|
730
|
+
log.error(`Adapter Exception: ${error}`);
|
|
731
|
+
done(error);
|
|
732
|
+
}
|
|
733
|
+
}).timeout(attemptTimeout);
|
|
734
|
+
});
|
|
735
|
+
|
|
736
|
+
describe('#getAllHcusUsingGET1 - errors', () => {
|
|
737
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
738
|
+
try {
|
|
739
|
+
a.getAllHcusUsingGET1((data, error) => {
|
|
740
|
+
try {
|
|
741
|
+
if (stub) {
|
|
742
|
+
const displayE = 'Error 400 received on request';
|
|
743
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
744
|
+
} else {
|
|
745
|
+
runCommonAsserts(data, error);
|
|
746
|
+
}
|
|
747
|
+
saveMockData('AssetManagementHCU', 'getAllHcusUsingGET1', 'default', data);
|
|
748
|
+
done();
|
|
749
|
+
} catch (err) {
|
|
750
|
+
log.error(`Test Failure: ${err}`);
|
|
751
|
+
done(err);
|
|
752
|
+
}
|
|
753
|
+
});
|
|
754
|
+
} catch (error) {
|
|
755
|
+
log.error(`Adapter Exception: ${error}`);
|
|
756
|
+
done(error);
|
|
757
|
+
}
|
|
758
|
+
}).timeout(attemptTimeout);
|
|
759
|
+
});
|
|
760
|
+
|
|
761
|
+
const assetManagementHCUIdentifier = 555;
|
|
762
|
+
describe('#getHcuUsingGET1 - errors', () => {
|
|
763
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
764
|
+
try {
|
|
765
|
+
a.getHcuUsingGET1(assetManagementHCUIdentifier, (data, error) => {
|
|
766
|
+
try {
|
|
767
|
+
if (stub) {
|
|
768
|
+
const displayE = 'Error 400 received on request';
|
|
769
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
770
|
+
} else {
|
|
771
|
+
runCommonAsserts(data, error);
|
|
772
|
+
}
|
|
773
|
+
saveMockData('AssetManagementHCU', 'getHcuUsingGET1', 'default', data);
|
|
774
|
+
done();
|
|
775
|
+
} catch (err) {
|
|
776
|
+
log.error(`Test Failure: ${err}`);
|
|
777
|
+
done(err);
|
|
778
|
+
}
|
|
779
|
+
});
|
|
780
|
+
} catch (error) {
|
|
781
|
+
log.error(`Adapter Exception: ${error}`);
|
|
782
|
+
done(error);
|
|
783
|
+
}
|
|
784
|
+
}).timeout(attemptTimeout);
|
|
785
|
+
});
|
|
786
|
+
|
|
787
|
+
describe('#getAllHsmsUsingGET1 - errors', () => {
|
|
788
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
789
|
+
try {
|
|
790
|
+
a.getAllHsmsUsingGET1((data, error) => {
|
|
791
|
+
try {
|
|
792
|
+
if (stub) {
|
|
793
|
+
const displayE = 'Error 400 received on request';
|
|
794
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
795
|
+
} else {
|
|
796
|
+
runCommonAsserts(data, error);
|
|
797
|
+
}
|
|
798
|
+
saveMockData('AssetManagementHCUHSM', 'getAllHsmsUsingGET1', 'default', data);
|
|
799
|
+
done();
|
|
800
|
+
} catch (err) {
|
|
801
|
+
log.error(`Test Failure: ${err}`);
|
|
802
|
+
done(err);
|
|
803
|
+
}
|
|
804
|
+
});
|
|
805
|
+
} catch (error) {
|
|
806
|
+
log.error(`Adapter Exception: ${error}`);
|
|
807
|
+
done(error);
|
|
808
|
+
}
|
|
809
|
+
}).timeout(attemptTimeout);
|
|
810
|
+
});
|
|
811
|
+
|
|
812
|
+
const assetManagementHCUHSMIdentifier = 555;
|
|
813
|
+
describe('#getHsmUsingGET1 - errors', () => {
|
|
814
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
815
|
+
try {
|
|
816
|
+
a.getHsmUsingGET1(assetManagementHCUHSMIdentifier, (data, error) => {
|
|
817
|
+
try {
|
|
818
|
+
if (stub) {
|
|
819
|
+
const displayE = 'Error 400 received on request';
|
|
820
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
821
|
+
} else {
|
|
822
|
+
runCommonAsserts(data, error);
|
|
823
|
+
}
|
|
824
|
+
saveMockData('AssetManagementHCUHSM', 'getHsmUsingGET1', 'default', data);
|
|
825
|
+
done();
|
|
826
|
+
} catch (err) {
|
|
827
|
+
log.error(`Test Failure: ${err}`);
|
|
828
|
+
done(err);
|
|
829
|
+
}
|
|
830
|
+
});
|
|
831
|
+
} catch (error) {
|
|
832
|
+
log.error(`Adapter Exception: ${error}`);
|
|
833
|
+
done(error);
|
|
834
|
+
}
|
|
835
|
+
}).timeout(attemptTimeout);
|
|
836
|
+
});
|
|
837
|
+
|
|
838
|
+
describe('#getAllRpmsUsingGET1 - errors', () => {
|
|
839
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
840
|
+
try {
|
|
841
|
+
a.getAllRpmsUsingGET1(null, (data, error) => {
|
|
842
|
+
try {
|
|
843
|
+
if (stub) {
|
|
844
|
+
const displayE = 'Error 400 received on request';
|
|
845
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
846
|
+
} else {
|
|
847
|
+
runCommonAsserts(data, error);
|
|
848
|
+
}
|
|
849
|
+
saveMockData('AssetManagementHCURPM', 'getAllRpmsUsingGET1', 'default', data);
|
|
850
|
+
done();
|
|
851
|
+
} catch (err) {
|
|
852
|
+
log.error(`Test Failure: ${err}`);
|
|
853
|
+
done(err);
|
|
854
|
+
}
|
|
855
|
+
});
|
|
856
|
+
} catch (error) {
|
|
857
|
+
log.error(`Adapter Exception: ${error}`);
|
|
858
|
+
done(error);
|
|
859
|
+
}
|
|
860
|
+
}).timeout(attemptTimeout);
|
|
861
|
+
});
|
|
862
|
+
|
|
863
|
+
const assetManagementHCURPMIdentifier = 555;
|
|
864
|
+
describe('#getRpmUsingGET1 - errors', () => {
|
|
865
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
866
|
+
try {
|
|
867
|
+
a.getRpmUsingGET1(assetManagementHCURPMIdentifier, (data, error) => {
|
|
868
|
+
try {
|
|
869
|
+
if (stub) {
|
|
870
|
+
const displayE = 'Error 400 received on request';
|
|
871
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
872
|
+
} else {
|
|
873
|
+
runCommonAsserts(data, error);
|
|
874
|
+
}
|
|
875
|
+
saveMockData('AssetManagementHCURPM', 'getRpmUsingGET1', 'default', data);
|
|
876
|
+
done();
|
|
877
|
+
} catch (err) {
|
|
878
|
+
log.error(`Test Failure: ${err}`);
|
|
879
|
+
done(err);
|
|
880
|
+
}
|
|
881
|
+
});
|
|
882
|
+
} catch (error) {
|
|
883
|
+
log.error(`Adapter Exception: ${error}`);
|
|
884
|
+
done(error);
|
|
885
|
+
}
|
|
886
|
+
}).timeout(attemptTimeout);
|
|
887
|
+
});
|
|
888
|
+
|
|
889
|
+
describe('#getAllRpmPortsUsingGET1 - errors', () => {
|
|
890
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
891
|
+
try {
|
|
892
|
+
a.getAllRpmPortsUsingGET1(null, (data, error) => {
|
|
893
|
+
try {
|
|
894
|
+
if (stub) {
|
|
895
|
+
const displayE = 'Error 400 received on request';
|
|
896
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
897
|
+
} else {
|
|
898
|
+
runCommonAsserts(data, error);
|
|
899
|
+
}
|
|
900
|
+
saveMockData('AssetManagementHCURPMPort', 'getAllRpmPortsUsingGET1', 'default', data);
|
|
901
|
+
done();
|
|
902
|
+
} catch (err) {
|
|
903
|
+
log.error(`Test Failure: ${err}`);
|
|
904
|
+
done(err);
|
|
905
|
+
}
|
|
906
|
+
});
|
|
907
|
+
} catch (error) {
|
|
908
|
+
log.error(`Adapter Exception: ${error}`);
|
|
909
|
+
done(error);
|
|
910
|
+
}
|
|
911
|
+
}).timeout(attemptTimeout);
|
|
912
|
+
});
|
|
913
|
+
|
|
914
|
+
const assetManagementHCURPMPortIdentifier = 555;
|
|
915
|
+
describe('#getRpmPortUsingGET1 - errors', () => {
|
|
916
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
917
|
+
try {
|
|
918
|
+
a.getRpmPortUsingGET1(assetManagementHCURPMPortIdentifier, (data, error) => {
|
|
919
|
+
try {
|
|
920
|
+
if (stub) {
|
|
921
|
+
const displayE = 'Error 400 received on request';
|
|
922
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
923
|
+
} else {
|
|
924
|
+
runCommonAsserts(data, error);
|
|
925
|
+
}
|
|
926
|
+
saveMockData('AssetManagementHCURPMPort', 'getRpmPortUsingGET1', 'default', data);
|
|
927
|
+
done();
|
|
928
|
+
} catch (err) {
|
|
929
|
+
log.error(`Test Failure: ${err}`);
|
|
930
|
+
done(err);
|
|
931
|
+
}
|
|
932
|
+
});
|
|
933
|
+
} catch (error) {
|
|
934
|
+
log.error(`Adapter Exception: ${error}`);
|
|
935
|
+
done(error);
|
|
936
|
+
}
|
|
937
|
+
}).timeout(attemptTimeout);
|
|
938
|
+
});
|
|
939
|
+
|
|
940
|
+
const assetManagementNodeEditNodeNameUsingPOST2BodyParam = {};
|
|
941
|
+
describe('#editNodeNameUsingPOST2 - errors', () => {
|
|
942
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
943
|
+
try {
|
|
944
|
+
a.editNodeNameUsingPOST2(assetManagementNodeEditNodeNameUsingPOST2BodyParam, (data, error) => {
|
|
945
|
+
try {
|
|
946
|
+
if (stub) {
|
|
947
|
+
const displayE = 'Error 400 received on request';
|
|
948
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
949
|
+
} else {
|
|
950
|
+
runCommonAsserts(data, error);
|
|
951
|
+
}
|
|
952
|
+
saveMockData('AssetManagementNode', 'editNodeNameUsingPOST2', 'default', data);
|
|
953
|
+
done();
|
|
954
|
+
} catch (err) {
|
|
955
|
+
log.error(`Test Failure: ${err}`);
|
|
956
|
+
done(err);
|
|
957
|
+
}
|
|
958
|
+
});
|
|
959
|
+
} catch (error) {
|
|
960
|
+
log.error(`Adapter Exception: ${error}`);
|
|
961
|
+
done(error);
|
|
962
|
+
}
|
|
963
|
+
}).timeout(attemptTimeout);
|
|
964
|
+
});
|
|
965
|
+
|
|
966
|
+
describe('#getNodesUsingGET2 - errors', () => {
|
|
967
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
968
|
+
try {
|
|
969
|
+
a.getNodesUsingGET2((data, error) => {
|
|
970
|
+
try {
|
|
971
|
+
if (stub) {
|
|
972
|
+
runCommonAsserts(data, error);
|
|
973
|
+
assert.equal('object', typeof data.response[0]);
|
|
974
|
+
} else {
|
|
975
|
+
runCommonAsserts(data, error);
|
|
976
|
+
}
|
|
977
|
+
saveMockData('AssetManagementNode', 'getNodesUsingGET2', 'default', data);
|
|
978
|
+
done();
|
|
979
|
+
} catch (err) {
|
|
980
|
+
log.error(`Test Failure: ${err}`);
|
|
981
|
+
done(err);
|
|
982
|
+
}
|
|
983
|
+
});
|
|
984
|
+
} catch (error) {
|
|
985
|
+
log.error(`Adapter Exception: ${error}`);
|
|
986
|
+
done(error);
|
|
987
|
+
}
|
|
988
|
+
}).timeout(attemptTimeout);
|
|
989
|
+
});
|
|
990
|
+
|
|
991
|
+
const qoEIdentifier = 'fakedata';
|
|
992
|
+
describe('#getNodeQoeHistoryUsingGET1 - errors', () => {
|
|
993
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
994
|
+
try {
|
|
995
|
+
a.getNodeQoeHistoryUsingGET1(null, qoEIdentifier, null, null, (data, error) => {
|
|
996
|
+
try {
|
|
997
|
+
if (stub) {
|
|
998
|
+
const displayE = 'Error 400 received on request';
|
|
999
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1000
|
+
} else {
|
|
1001
|
+
runCommonAsserts(data, error);
|
|
1002
|
+
}
|
|
1003
|
+
saveMockData('QoE', 'getNodeQoeHistoryUsingGET1', 'default', data);
|
|
1004
|
+
done();
|
|
1005
|
+
} catch (err) {
|
|
1006
|
+
log.error(`Test Failure: ${err}`);
|
|
1007
|
+
done(err);
|
|
1008
|
+
}
|
|
1009
|
+
});
|
|
1010
|
+
} catch (error) {
|
|
1011
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1012
|
+
done(error);
|
|
1013
|
+
}
|
|
1014
|
+
}).timeout(attemptTimeout);
|
|
1015
|
+
});
|
|
1016
|
+
|
|
1017
|
+
describe('#getNodeSummaryMetricUsingGET1 - errors', () => {
|
|
1018
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1019
|
+
try {
|
|
1020
|
+
a.getNodeSummaryMetricUsingGET1(qoEIdentifier, null, null, (data, error) => {
|
|
1021
|
+
try {
|
|
1022
|
+
if (stub) {
|
|
1023
|
+
const displayE = 'Error 400 received on request';
|
|
1024
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1025
|
+
} else {
|
|
1026
|
+
runCommonAsserts(data, error);
|
|
1027
|
+
}
|
|
1028
|
+
saveMockData('QoE', 'getNodeSummaryMetricUsingGET1', 'default', data);
|
|
1029
|
+
done();
|
|
1030
|
+
} catch (err) {
|
|
1031
|
+
log.error(`Test Failure: ${err}`);
|
|
1032
|
+
done(err);
|
|
1033
|
+
}
|
|
1034
|
+
});
|
|
1035
|
+
} catch (error) {
|
|
1036
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1037
|
+
done(error);
|
|
1038
|
+
}
|
|
1039
|
+
}).timeout(attemptTimeout);
|
|
1040
|
+
});
|
|
1041
|
+
|
|
1042
|
+
const assetManagementNoiseTrakStatus = 'fakedata';
|
|
1043
|
+
describe('#getByStatusUsingGET1 - errors', () => {
|
|
1044
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1045
|
+
try {
|
|
1046
|
+
a.getByStatusUsingGET1(assetManagementNoiseTrakStatus, (data, error) => {
|
|
1047
|
+
try {
|
|
1048
|
+
if (stub) {
|
|
1049
|
+
const displayE = 'Error 400 received on request';
|
|
1050
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1051
|
+
} else {
|
|
1052
|
+
runCommonAsserts(data, error);
|
|
1053
|
+
}
|
|
1054
|
+
saveMockData('AssetManagementNoiseTrak', 'getByStatusUsingGET1', 'default', data);
|
|
1055
|
+
done();
|
|
1056
|
+
} catch (err) {
|
|
1057
|
+
log.error(`Test Failure: ${err}`);
|
|
1058
|
+
done(err);
|
|
1059
|
+
}
|
|
1060
|
+
});
|
|
1061
|
+
} catch (error) {
|
|
1062
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1063
|
+
done(error);
|
|
1064
|
+
}
|
|
1065
|
+
}).timeout(attemptTimeout);
|
|
1066
|
+
});
|
|
1067
|
+
|
|
1068
|
+
describe('#getAllOtusUsingGET1 - errors', () => {
|
|
1069
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
1070
|
+
try {
|
|
1071
|
+
a.getAllOtusUsingGET1((data, error) => {
|
|
1072
|
+
try {
|
|
1073
|
+
if (stub) {
|
|
1074
|
+
runCommonAsserts(data, error);
|
|
1075
|
+
assert.equal('object', typeof data.response[0]);
|
|
1076
|
+
assert.equal('object', typeof data.response[1]);
|
|
1077
|
+
assert.equal('object', typeof data.response[2]);
|
|
1078
|
+
} else {
|
|
1079
|
+
runCommonAsserts(data, error);
|
|
1080
|
+
}
|
|
1081
|
+
saveMockData('AssetManagementOTU', 'getAllOtusUsingGET1', 'default', data);
|
|
1082
|
+
done();
|
|
1083
|
+
} catch (err) {
|
|
1084
|
+
log.error(`Test Failure: ${err}`);
|
|
1085
|
+
done(err);
|
|
1086
|
+
}
|
|
1087
|
+
});
|
|
1088
|
+
} catch (error) {
|
|
1089
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1090
|
+
done(error);
|
|
1091
|
+
}
|
|
1092
|
+
}).timeout(attemptTimeout);
|
|
1093
|
+
});
|
|
1094
|
+
|
|
1095
|
+
const assetManagementOTUOtuId = 555;
|
|
1096
|
+
describe('#getOtuUsingGET1 - errors', () => {
|
|
1097
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1098
|
+
try {
|
|
1099
|
+
a.getOtuUsingGET1(assetManagementOTUOtuId, (data, error) => {
|
|
1100
|
+
try {
|
|
1101
|
+
if (stub) {
|
|
1102
|
+
const displayE = 'Error 400 received on request';
|
|
1103
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1104
|
+
} else {
|
|
1105
|
+
runCommonAsserts(data, error);
|
|
1106
|
+
}
|
|
1107
|
+
saveMockData('AssetManagementOTU', 'getOtuUsingGET1', 'default', data);
|
|
1108
|
+
done();
|
|
1109
|
+
} catch (err) {
|
|
1110
|
+
log.error(`Test Failure: ${err}`);
|
|
1111
|
+
done(err);
|
|
1112
|
+
}
|
|
1113
|
+
});
|
|
1114
|
+
} catch (error) {
|
|
1115
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1116
|
+
done(error);
|
|
1117
|
+
}
|
|
1118
|
+
}).timeout(attemptTimeout);
|
|
1119
|
+
});
|
|
1120
|
+
|
|
1121
|
+
describe('#getAllPortsUsingGET1 - errors', () => {
|
|
1122
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
1123
|
+
try {
|
|
1124
|
+
a.getAllPortsUsingGET1((data, error) => {
|
|
1125
|
+
try {
|
|
1126
|
+
if (stub) {
|
|
1127
|
+
runCommonAsserts(data, error);
|
|
1128
|
+
assert.equal('object', typeof data.response[0]);
|
|
1129
|
+
} else {
|
|
1130
|
+
runCommonAsserts(data, error);
|
|
1131
|
+
}
|
|
1132
|
+
saveMockData('AssetManagementOTUPort', 'getAllPortsUsingGET1', 'default', data);
|
|
1133
|
+
done();
|
|
1134
|
+
} catch (err) {
|
|
1135
|
+
log.error(`Test Failure: ${err}`);
|
|
1136
|
+
done(err);
|
|
1137
|
+
}
|
|
1138
|
+
});
|
|
1139
|
+
} catch (error) {
|
|
1140
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1141
|
+
done(error);
|
|
1142
|
+
}
|
|
1143
|
+
}).timeout(attemptTimeout);
|
|
1144
|
+
});
|
|
1145
|
+
|
|
1146
|
+
describe('#getAllRcisUsingGET1 - errors', () => {
|
|
1147
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
1148
|
+
try {
|
|
1149
|
+
a.getAllRcisUsingGET1((data, error) => {
|
|
1150
|
+
try {
|
|
1151
|
+
if (stub) {
|
|
1152
|
+
runCommonAsserts(data, error);
|
|
1153
|
+
assert.equal('object', typeof data.response[0]);
|
|
1154
|
+
assert.equal('object', typeof data.response[1]);
|
|
1155
|
+
assert.equal('object', typeof data.response[2]);
|
|
1156
|
+
assert.equal('object', typeof data.response[3]);
|
|
1157
|
+
} else {
|
|
1158
|
+
runCommonAsserts(data, error);
|
|
1159
|
+
}
|
|
1160
|
+
saveMockData('AssetManagementRCI', 'getAllRcisUsingGET1', 'default', data);
|
|
1161
|
+
done();
|
|
1162
|
+
} catch (err) {
|
|
1163
|
+
log.error(`Test Failure: ${err}`);
|
|
1164
|
+
done(err);
|
|
1165
|
+
}
|
|
1166
|
+
});
|
|
1167
|
+
} catch (error) {
|
|
1168
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1169
|
+
done(error);
|
|
1170
|
+
}
|
|
1171
|
+
}).timeout(attemptTimeout);
|
|
1172
|
+
});
|
|
1173
|
+
|
|
1174
|
+
const assetManagementRCIIdentifier = 555;
|
|
1175
|
+
describe('#getRciUsingGET1 - errors', () => {
|
|
1176
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1177
|
+
try {
|
|
1178
|
+
a.getRciUsingGET1(assetManagementRCIIdentifier, (data, error) => {
|
|
1179
|
+
try {
|
|
1180
|
+
if (stub) {
|
|
1181
|
+
const displayE = 'Error 400 received on request';
|
|
1182
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1183
|
+
} else {
|
|
1184
|
+
runCommonAsserts(data, error);
|
|
1185
|
+
}
|
|
1186
|
+
saveMockData('AssetManagementRCI', 'getRciUsingGET1', 'default', data);
|
|
1187
|
+
done();
|
|
1188
|
+
} catch (err) {
|
|
1189
|
+
log.error(`Test Failure: ${err}`);
|
|
1190
|
+
done(err);
|
|
1191
|
+
}
|
|
1192
|
+
});
|
|
1193
|
+
} catch (error) {
|
|
1194
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1195
|
+
done(error);
|
|
1196
|
+
}
|
|
1197
|
+
}).timeout(attemptTimeout);
|
|
1198
|
+
});
|
|
1199
|
+
|
|
1200
|
+
const authenticationLoginUsingPOST1BodyParam = {};
|
|
1201
|
+
describe('#loginUsingPOST1 - errors', () => {
|
|
1202
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1203
|
+
try {
|
|
1204
|
+
a.loginUsingPOST1(null, authenticationLoginUsingPOST1BodyParam, (data, error) => {
|
|
1205
|
+
try {
|
|
1206
|
+
if (stub) {
|
|
1207
|
+
const displayE = 'Error 400 received on request';
|
|
1208
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1209
|
+
} else {
|
|
1210
|
+
runCommonAsserts(data, error);
|
|
1211
|
+
}
|
|
1212
|
+
saveMockData('Authentication', 'loginUsingPOST1', 'default', data);
|
|
1213
|
+
done();
|
|
1214
|
+
} catch (err) {
|
|
1215
|
+
log.error(`Test Failure: ${err}`);
|
|
1216
|
+
done(err);
|
|
1217
|
+
}
|
|
1218
|
+
});
|
|
1219
|
+
} catch (error) {
|
|
1220
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1221
|
+
done(error);
|
|
1222
|
+
}
|
|
1223
|
+
}).timeout(attemptTimeout);
|
|
1224
|
+
});
|
|
1225
|
+
|
|
1226
|
+
describe('#logoutUsingGET1 - errors', () => {
|
|
1227
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1228
|
+
try {
|
|
1229
|
+
a.logoutUsingGET1((data, error) => {
|
|
1230
|
+
try {
|
|
1231
|
+
if (stub) {
|
|
1232
|
+
const displayE = 'Error 400 received on request';
|
|
1233
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1234
|
+
} else {
|
|
1235
|
+
runCommonAsserts(data, error);
|
|
1236
|
+
}
|
|
1237
|
+
saveMockData('Authentication', 'logoutUsingGET1', 'default', data);
|
|
1238
|
+
done();
|
|
1239
|
+
} catch (err) {
|
|
1240
|
+
log.error(`Test Failure: ${err}`);
|
|
1241
|
+
done(err);
|
|
1242
|
+
}
|
|
1243
|
+
});
|
|
1244
|
+
} catch (error) {
|
|
1245
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1246
|
+
done(error);
|
|
1247
|
+
}
|
|
1248
|
+
}).timeout(attemptTimeout);
|
|
1249
|
+
});
|
|
1250
|
+
|
|
1251
|
+
describe('#getModemInclusionsExclusionsUsingGET1 - errors', () => {
|
|
1252
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1253
|
+
try {
|
|
1254
|
+
a.getModemInclusionsExclusionsUsingGET1((data, error) => {
|
|
1255
|
+
try {
|
|
1256
|
+
if (stub) {
|
|
1257
|
+
const displayE = 'Error 400 received on request';
|
|
1258
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1259
|
+
} else {
|
|
1260
|
+
runCommonAsserts(data, error);
|
|
1261
|
+
}
|
|
1262
|
+
saveMockData('CableModem', 'getModemInclusionsExclusionsUsingGET1', 'default', data);
|
|
1263
|
+
done();
|
|
1264
|
+
} catch (err) {
|
|
1265
|
+
log.error(`Test Failure: ${err}`);
|
|
1266
|
+
done(err);
|
|
1267
|
+
}
|
|
1268
|
+
});
|
|
1269
|
+
} catch (error) {
|
|
1270
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1271
|
+
done(error);
|
|
1272
|
+
}
|
|
1273
|
+
}).timeout(attemptTimeout);
|
|
1274
|
+
});
|
|
1275
|
+
|
|
1276
|
+
describe('#getModemExclusionDescriptionsUsingGET1 - errors', () => {
|
|
1277
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
1278
|
+
try {
|
|
1279
|
+
a.getModemExclusionDescriptionsUsingGET1((data, error) => {
|
|
1280
|
+
try {
|
|
1281
|
+
if (stub) {
|
|
1282
|
+
runCommonAsserts(data, error);
|
|
1283
|
+
assert.equal('object', typeof data.response[0]);
|
|
1284
|
+
} else {
|
|
1285
|
+
runCommonAsserts(data, error);
|
|
1286
|
+
}
|
|
1287
|
+
saveMockData('CableModem', 'getModemExclusionDescriptionsUsingGET1', 'default', data);
|
|
1288
|
+
done();
|
|
1289
|
+
} catch (err) {
|
|
1290
|
+
log.error(`Test Failure: ${err}`);
|
|
1291
|
+
done(err);
|
|
1292
|
+
}
|
|
1293
|
+
});
|
|
1294
|
+
} catch (error) {
|
|
1295
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1296
|
+
done(error);
|
|
1297
|
+
}
|
|
1298
|
+
}).timeout(attemptTimeout);
|
|
1299
|
+
});
|
|
1300
|
+
|
|
1301
|
+
const cableModemIdentifiers = [];
|
|
1302
|
+
describe('#getModemKpiPerformanceHistoryUsingGET3 - errors', () => {
|
|
1303
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1304
|
+
try {
|
|
1305
|
+
a.getModemKpiPerformanceHistoryUsingGET3(null, null, null, null, cableModemIdentifiers, (data, error) => {
|
|
1306
|
+
try {
|
|
1307
|
+
if (stub) {
|
|
1308
|
+
const displayE = 'Error 400 received on request';
|
|
1309
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1310
|
+
} else {
|
|
1311
|
+
runCommonAsserts(data, error);
|
|
1312
|
+
}
|
|
1313
|
+
saveMockData('CableModem', 'getModemKpiPerformanceHistoryUsingGET3', 'default', data);
|
|
1314
|
+
done();
|
|
1315
|
+
} catch (err) {
|
|
1316
|
+
log.error(`Test Failure: ${err}`);
|
|
1317
|
+
done(err);
|
|
1318
|
+
}
|
|
1319
|
+
});
|
|
1320
|
+
} catch (error) {
|
|
1321
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1322
|
+
done(error);
|
|
1323
|
+
}
|
|
1324
|
+
}).timeout(attemptTimeout);
|
|
1325
|
+
});
|
|
1326
|
+
|
|
1327
|
+
describe('#getModemKpiTypesUsingGET1 - errors', () => {
|
|
1328
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1329
|
+
try {
|
|
1330
|
+
a.getModemKpiTypesUsingGET1((data, error) => {
|
|
1331
|
+
try {
|
|
1332
|
+
if (stub) {
|
|
1333
|
+
const displayE = 'Error 400 received on request';
|
|
1334
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1335
|
+
} else {
|
|
1336
|
+
runCommonAsserts(data, error);
|
|
1337
|
+
}
|
|
1338
|
+
saveMockData('CableModem', 'getModemKpiTypesUsingGET1', 'default', data);
|
|
1339
|
+
done();
|
|
1340
|
+
} catch (err) {
|
|
1341
|
+
log.error(`Test Failure: ${err}`);
|
|
1342
|
+
done(err);
|
|
1343
|
+
}
|
|
1344
|
+
});
|
|
1345
|
+
} catch (error) {
|
|
1346
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1347
|
+
done(error);
|
|
1348
|
+
}
|
|
1349
|
+
}).timeout(attemptTimeout);
|
|
1350
|
+
});
|
|
1351
|
+
|
|
1352
|
+
describe('#getModemDescriptionUsingGET1 - errors', () => {
|
|
1353
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
1354
|
+
try {
|
|
1355
|
+
a.getModemDescriptionUsingGET1((data, error) => {
|
|
1356
|
+
try {
|
|
1357
|
+
if (stub) {
|
|
1358
|
+
runCommonAsserts(data, error);
|
|
1359
|
+
assert.equal('object', typeof data.response[0]);
|
|
1360
|
+
assert.equal('object', typeof data.response[1]);
|
|
1361
|
+
assert.equal('object', typeof data.response[2]);
|
|
1362
|
+
assert.equal('object', typeof data.response[3]);
|
|
1363
|
+
} else {
|
|
1364
|
+
runCommonAsserts(data, error);
|
|
1365
|
+
}
|
|
1366
|
+
saveMockData('CableModem', 'getModemDescriptionUsingGET1', 'default', data);
|
|
1367
|
+
done();
|
|
1368
|
+
} catch (err) {
|
|
1369
|
+
log.error(`Test Failure: ${err}`);
|
|
1370
|
+
done(err);
|
|
1371
|
+
}
|
|
1372
|
+
});
|
|
1373
|
+
} catch (error) {
|
|
1374
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1375
|
+
done(error);
|
|
1376
|
+
}
|
|
1377
|
+
}).timeout(attemptTimeout);
|
|
1378
|
+
});
|
|
1379
|
+
|
|
1380
|
+
describe('#getModemWatchUsingGET1 - errors', () => {
|
|
1381
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
1382
|
+
try {
|
|
1383
|
+
a.getModemWatchUsingGET1((data, error) => {
|
|
1384
|
+
try {
|
|
1385
|
+
if (stub) {
|
|
1386
|
+
runCommonAsserts(data, error);
|
|
1387
|
+
assert.equal('object', typeof data.response[0]);
|
|
1388
|
+
assert.equal('object', typeof data.response[1]);
|
|
1389
|
+
assert.equal('object', typeof data.response[2]);
|
|
1390
|
+
assert.equal('object', typeof data.response[3]);
|
|
1391
|
+
} else {
|
|
1392
|
+
runCommonAsserts(data, error);
|
|
1393
|
+
}
|
|
1394
|
+
saveMockData('CableModem', 'getModemWatchUsingGET1', 'default', data);
|
|
1395
|
+
done();
|
|
1396
|
+
} catch (err) {
|
|
1397
|
+
log.error(`Test Failure: ${err}`);
|
|
1398
|
+
done(err);
|
|
1399
|
+
}
|
|
1400
|
+
});
|
|
1401
|
+
} catch (error) {
|
|
1402
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1403
|
+
done(error);
|
|
1404
|
+
}
|
|
1405
|
+
}).timeout(attemptTimeout);
|
|
1406
|
+
});
|
|
1407
|
+
|
|
1408
|
+
const cableModemIdentifier = 555;
|
|
1409
|
+
describe('#getModemWatchByNodeUsingGET1 - errors', () => {
|
|
1410
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
1411
|
+
try {
|
|
1412
|
+
a.getModemWatchByNodeUsingGET1(cableModemIdentifier, (data, error) => {
|
|
1413
|
+
try {
|
|
1414
|
+
if (stub) {
|
|
1415
|
+
runCommonAsserts(data, error);
|
|
1416
|
+
assert.equal('object', typeof data.response[0]);
|
|
1417
|
+
} else {
|
|
1418
|
+
runCommonAsserts(data, error);
|
|
1419
|
+
}
|
|
1420
|
+
saveMockData('CableModem', 'getModemWatchByNodeUsingGET1', 'default', data);
|
|
1421
|
+
done();
|
|
1422
|
+
} catch (err) {
|
|
1423
|
+
log.error(`Test Failure: ${err}`);
|
|
1424
|
+
done(err);
|
|
1425
|
+
}
|
|
1426
|
+
});
|
|
1427
|
+
} catch (error) {
|
|
1428
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1429
|
+
done(error);
|
|
1430
|
+
}
|
|
1431
|
+
}).timeout(attemptTimeout);
|
|
1432
|
+
});
|
|
1433
|
+
|
|
1434
|
+
describe('#getAllCollectionsUsingGET1 - errors', () => {
|
|
1435
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1436
|
+
try {
|
|
1437
|
+
a.getAllCollectionsUsingGET1((data, error) => {
|
|
1438
|
+
try {
|
|
1439
|
+
if (stub) {
|
|
1440
|
+
const displayE = 'Error 400 received on request';
|
|
1441
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1442
|
+
} else {
|
|
1443
|
+
runCommonAsserts(data, error);
|
|
1444
|
+
}
|
|
1445
|
+
saveMockData('CollectionScheduleDetails', 'getAllCollectionsUsingGET1', 'default', data);
|
|
1446
|
+
done();
|
|
1447
|
+
} catch (err) {
|
|
1448
|
+
log.error(`Test Failure: ${err}`);
|
|
1449
|
+
done(err);
|
|
1450
|
+
}
|
|
1451
|
+
});
|
|
1452
|
+
} catch (error) {
|
|
1453
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1454
|
+
done(error);
|
|
1455
|
+
}
|
|
1456
|
+
}).timeout(attemptTimeout);
|
|
1457
|
+
});
|
|
1458
|
+
|
|
1459
|
+
const collectionScheduleDetailsCollectionType = 'fakedata';
|
|
1460
|
+
describe('#getScheduleByHourForCollectionUsingGET1 - errors', () => {
|
|
1461
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1462
|
+
try {
|
|
1463
|
+
a.getScheduleByHourForCollectionUsingGET1(collectionScheduleDetailsCollectionType, (data, error) => {
|
|
1464
|
+
try {
|
|
1465
|
+
if (stub) {
|
|
1466
|
+
const displayE = 'Error 400 received on request';
|
|
1467
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1468
|
+
} else {
|
|
1469
|
+
runCommonAsserts(data, error);
|
|
1470
|
+
}
|
|
1471
|
+
saveMockData('CollectionScheduleDetails', 'getScheduleByHourForCollectionUsingGET1', 'default', data);
|
|
1472
|
+
done();
|
|
1473
|
+
} catch (err) {
|
|
1474
|
+
log.error(`Test Failure: ${err}`);
|
|
1475
|
+
done(err);
|
|
1476
|
+
}
|
|
1477
|
+
});
|
|
1478
|
+
} catch (error) {
|
|
1479
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1480
|
+
done(error);
|
|
1481
|
+
}
|
|
1482
|
+
}).timeout(attemptTimeout);
|
|
1483
|
+
});
|
|
1484
|
+
|
|
1485
|
+
describe('#getScheduleForCollectionUsingGET1 - errors', () => {
|
|
1486
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1487
|
+
try {
|
|
1488
|
+
a.getScheduleForCollectionUsingGET1(collectionScheduleDetailsCollectionType, (data, error) => {
|
|
1489
|
+
try {
|
|
1490
|
+
if (stub) {
|
|
1491
|
+
const displayE = 'Error 400 received on request';
|
|
1492
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1493
|
+
} else {
|
|
1494
|
+
runCommonAsserts(data, error);
|
|
1495
|
+
}
|
|
1496
|
+
saveMockData('CollectionScheduleDetails', 'getScheduleForCollectionUsingGET1', 'default', data);
|
|
1497
|
+
done();
|
|
1498
|
+
} catch (err) {
|
|
1499
|
+
log.error(`Test Failure: ${err}`);
|
|
1500
|
+
done(err);
|
|
1501
|
+
}
|
|
1502
|
+
});
|
|
1503
|
+
} catch (error) {
|
|
1504
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1505
|
+
done(error);
|
|
1506
|
+
}
|
|
1507
|
+
}).timeout(attemptTimeout);
|
|
1508
|
+
});
|
|
1509
|
+
|
|
1510
|
+
describe('#getNodeContainersUsingGET1 - errors', () => {
|
|
1511
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
1512
|
+
try {
|
|
1513
|
+
a.getNodeContainersUsingGET1((data, error) => {
|
|
1514
|
+
try {
|
|
1515
|
+
if (stub) {
|
|
1516
|
+
runCommonAsserts(data, error);
|
|
1517
|
+
assert.equal('object', typeof data.response[0]);
|
|
1518
|
+
assert.equal('object', typeof data.response[1]);
|
|
1519
|
+
} else {
|
|
1520
|
+
runCommonAsserts(data, error);
|
|
1521
|
+
}
|
|
1522
|
+
saveMockData('Container', 'getNodeContainersUsingGET1', 'default', data);
|
|
1523
|
+
done();
|
|
1524
|
+
} catch (err) {
|
|
1525
|
+
log.error(`Test Failure: ${err}`);
|
|
1526
|
+
done(err);
|
|
1527
|
+
}
|
|
1528
|
+
});
|
|
1529
|
+
} catch (error) {
|
|
1530
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1531
|
+
done(error);
|
|
1532
|
+
}
|
|
1533
|
+
}).timeout(attemptTimeout);
|
|
1534
|
+
});
|
|
1535
|
+
|
|
1536
|
+
const deviceSettingsBulkUpdateDeviceAttributesUsingPOST1BodyParam = {};
|
|
1537
|
+
describe('#bulkUpdateDeviceAttributesUsingPOST1 - errors', () => {
|
|
1538
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1539
|
+
try {
|
|
1540
|
+
a.bulkUpdateDeviceAttributesUsingPOST1(deviceSettingsBulkUpdateDeviceAttributesUsingPOST1BodyParam, (data, error) => {
|
|
1541
|
+
try {
|
|
1542
|
+
if (stub) {
|
|
1543
|
+
const displayE = 'Error 400 received on request';
|
|
1544
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1545
|
+
} else {
|
|
1546
|
+
runCommonAsserts(data, error);
|
|
1547
|
+
}
|
|
1548
|
+
saveMockData('DeviceSettings', 'bulkUpdateDeviceAttributesUsingPOST1', 'default', data);
|
|
1549
|
+
done();
|
|
1550
|
+
} catch (err) {
|
|
1551
|
+
log.error(`Test Failure: ${err}`);
|
|
1552
|
+
done(err);
|
|
1553
|
+
}
|
|
1554
|
+
});
|
|
1555
|
+
} catch (error) {
|
|
1556
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1557
|
+
done(error);
|
|
1558
|
+
}
|
|
1559
|
+
}).timeout(attemptTimeout);
|
|
1560
|
+
});
|
|
1561
|
+
|
|
1562
|
+
describe('#getAllAlarmsUsingGET1 - errors', () => {
|
|
1563
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1564
|
+
try {
|
|
1565
|
+
a.getAllAlarmsUsingGET1(null, null, null, null, null, (data, error) => {
|
|
1566
|
+
try {
|
|
1567
|
+
if (stub) {
|
|
1568
|
+
const displayE = 'Error 400 received on request';
|
|
1569
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1570
|
+
} else {
|
|
1571
|
+
runCommonAsserts(data, error);
|
|
1572
|
+
}
|
|
1573
|
+
saveMockData('EventsAndAlarmsAlarms', 'getAllAlarmsUsingGET1', 'default', data);
|
|
1574
|
+
done();
|
|
1575
|
+
} catch (err) {
|
|
1576
|
+
log.error(`Test Failure: ${err}`);
|
|
1577
|
+
done(err);
|
|
1578
|
+
}
|
|
1579
|
+
});
|
|
1580
|
+
} catch (error) {
|
|
1581
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1582
|
+
done(error);
|
|
1583
|
+
}
|
|
1584
|
+
}).timeout(attemptTimeout);
|
|
1585
|
+
});
|
|
1586
|
+
|
|
1587
|
+
describe('#getElementAlarmsUsingGET1 - errors', () => {
|
|
1588
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1589
|
+
try {
|
|
1590
|
+
a.getElementAlarmsUsingGET1(null, null, null, null, null, (data, error) => {
|
|
1591
|
+
try {
|
|
1592
|
+
if (stub) {
|
|
1593
|
+
const displayE = 'Error 400 received on request';
|
|
1594
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1595
|
+
} else {
|
|
1596
|
+
runCommonAsserts(data, error);
|
|
1597
|
+
}
|
|
1598
|
+
saveMockData('EventsAndAlarmsAlarms', 'getElementAlarmsUsingGET1', 'default', data);
|
|
1599
|
+
done();
|
|
1600
|
+
} catch (err) {
|
|
1601
|
+
log.error(`Test Failure: ${err}`);
|
|
1602
|
+
done(err);
|
|
1603
|
+
}
|
|
1604
|
+
});
|
|
1605
|
+
} catch (error) {
|
|
1606
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1607
|
+
done(error);
|
|
1608
|
+
}
|
|
1609
|
+
}).timeout(attemptTimeout);
|
|
1610
|
+
});
|
|
1611
|
+
|
|
1612
|
+
describe('#getNetworkAlarmsUsingGET1 - errors', () => {
|
|
1613
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1614
|
+
try {
|
|
1615
|
+
a.getNetworkAlarmsUsingGET1(null, null, null, null, null, (data, error) => {
|
|
1616
|
+
try {
|
|
1617
|
+
if (stub) {
|
|
1618
|
+
const displayE = 'Error 400 received on request';
|
|
1619
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1620
|
+
} else {
|
|
1621
|
+
runCommonAsserts(data, error);
|
|
1622
|
+
}
|
|
1623
|
+
saveMockData('EventsAndAlarmsAlarms', 'getNetworkAlarmsUsingGET1', 'default', data);
|
|
1624
|
+
done();
|
|
1625
|
+
} catch (err) {
|
|
1626
|
+
log.error(`Test Failure: ${err}`);
|
|
1627
|
+
done(err);
|
|
1628
|
+
}
|
|
1629
|
+
});
|
|
1630
|
+
} catch (error) {
|
|
1631
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1632
|
+
done(error);
|
|
1633
|
+
}
|
|
1634
|
+
}).timeout(attemptTimeout);
|
|
1635
|
+
});
|
|
1636
|
+
|
|
1637
|
+
const eventsAndAlarmsEventsId = 555;
|
|
1638
|
+
const eventsAndAlarmsEventsType = 'fakedata';
|
|
1639
|
+
describe('#getEventsUsingGET2 - errors', () => {
|
|
1640
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
1641
|
+
try {
|
|
1642
|
+
a.getEventsUsingGET2(eventsAndAlarmsEventsId, eventsAndAlarmsEventsType, (data, error) => {
|
|
1643
|
+
try {
|
|
1644
|
+
if (stub) {
|
|
1645
|
+
runCommonAsserts(data, error);
|
|
1646
|
+
assert.equal('object', typeof data.response[0]);
|
|
1647
|
+
assert.equal('object', typeof data.response[1]);
|
|
1648
|
+
assert.equal('object', typeof data.response[2]);
|
|
1649
|
+
assert.equal('object', typeof data.response[3]);
|
|
1650
|
+
} else {
|
|
1651
|
+
runCommonAsserts(data, error);
|
|
1652
|
+
}
|
|
1653
|
+
saveMockData('EventsAndAlarmsEvents', 'getEventsUsingGET2', 'default', data);
|
|
1654
|
+
done();
|
|
1655
|
+
} catch (err) {
|
|
1656
|
+
log.error(`Test Failure: ${err}`);
|
|
1657
|
+
done(err);
|
|
1658
|
+
}
|
|
1659
|
+
});
|
|
1660
|
+
} catch (error) {
|
|
1661
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1662
|
+
done(error);
|
|
1663
|
+
}
|
|
1664
|
+
}).timeout(attemptTimeout);
|
|
1665
|
+
});
|
|
1666
|
+
|
|
1667
|
+
const graphQLQueryUsingPOST1BodyParam = {};
|
|
1668
|
+
describe('#queryUsingPOST1 - errors', () => {
|
|
1669
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1670
|
+
try {
|
|
1671
|
+
a.queryUsingPOST1(graphQLQueryUsingPOST1BodyParam, (data, error) => {
|
|
1672
|
+
try {
|
|
1673
|
+
if (stub) {
|
|
1674
|
+
const displayE = 'Error 400 received on request';
|
|
1675
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1676
|
+
} else {
|
|
1677
|
+
runCommonAsserts(data, error);
|
|
1678
|
+
}
|
|
1679
|
+
saveMockData('GraphQL', 'queryUsingPOST1', 'default', data);
|
|
1680
|
+
done();
|
|
1681
|
+
} catch (err) {
|
|
1682
|
+
log.error(`Test Failure: ${err}`);
|
|
1683
|
+
done(err);
|
|
1684
|
+
}
|
|
1685
|
+
});
|
|
1686
|
+
} catch (error) {
|
|
1687
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1688
|
+
done(error);
|
|
1689
|
+
}
|
|
1690
|
+
}).timeout(attemptTimeout);
|
|
1691
|
+
});
|
|
1692
|
+
|
|
1693
|
+
describe('#getMactrakDetailsUsingGET1 - errors', () => {
|
|
1694
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
1695
|
+
try {
|
|
1696
|
+
a.getMactrakDetailsUsingGET1(null, null, null, null, null, null, (data, error) => {
|
|
1697
|
+
try {
|
|
1698
|
+
if (stub) {
|
|
1699
|
+
runCommonAsserts(data, error);
|
|
1700
|
+
assert.equal('object', typeof data.response[0]);
|
|
1701
|
+
} else {
|
|
1702
|
+
runCommonAsserts(data, error);
|
|
1703
|
+
}
|
|
1704
|
+
saveMockData('MACTrakDetail', 'getMactrakDetailsUsingGET1', 'default', data);
|
|
1705
|
+
done();
|
|
1706
|
+
} catch (err) {
|
|
1707
|
+
log.error(`Test Failure: ${err}`);
|
|
1708
|
+
done(err);
|
|
1709
|
+
}
|
|
1710
|
+
});
|
|
1711
|
+
} catch (error) {
|
|
1712
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1713
|
+
done(error);
|
|
1714
|
+
}
|
|
1715
|
+
}).timeout(attemptTimeout);
|
|
1716
|
+
});
|
|
1717
|
+
|
|
1718
|
+
const mACTrakPerformancePortId = 'fakedata';
|
|
1719
|
+
describe('#getChannelPerformanceUsingGET2 - errors', () => {
|
|
1720
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
1721
|
+
try {
|
|
1722
|
+
a.getChannelPerformanceUsingGET2(null, null, mACTrakPerformancePortId, null, (data, error) => {
|
|
1723
|
+
try {
|
|
1724
|
+
if (stub) {
|
|
1725
|
+
runCommonAsserts(data, error);
|
|
1726
|
+
assert.equal('object', typeof data.response[0]);
|
|
1727
|
+
assert.equal('object', typeof data.response[1]);
|
|
1728
|
+
} else {
|
|
1729
|
+
runCommonAsserts(data, error);
|
|
1730
|
+
}
|
|
1731
|
+
saveMockData('MACTrakPerformance', 'getChannelPerformanceUsingGET2', 'default', data);
|
|
1732
|
+
done();
|
|
1733
|
+
} catch (err) {
|
|
1734
|
+
log.error(`Test Failure: ${err}`);
|
|
1735
|
+
done(err);
|
|
1736
|
+
}
|
|
1737
|
+
});
|
|
1738
|
+
} catch (error) {
|
|
1739
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1740
|
+
done(error);
|
|
1741
|
+
}
|
|
1742
|
+
}).timeout(attemptTimeout);
|
|
1743
|
+
});
|
|
1744
|
+
|
|
1745
|
+
const mACTrakPerformancePortid = 'fakedata';
|
|
1746
|
+
describe('#getNodePerformanceUsingGET2 - errors', () => {
|
|
1747
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1748
|
+
try {
|
|
1749
|
+
a.getNodePerformanceUsingGET2(null, null, mACTrakPerformancePortid, null, (data, error) => {
|
|
1750
|
+
try {
|
|
1751
|
+
if (stub) {
|
|
1752
|
+
const displayE = 'Error 400 received on request';
|
|
1753
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1754
|
+
} else {
|
|
1755
|
+
runCommonAsserts(data, error);
|
|
1756
|
+
}
|
|
1757
|
+
saveMockData('MACTrakPerformance', 'getNodePerformanceUsingGET2', 'default', data);
|
|
1758
|
+
done();
|
|
1759
|
+
} catch (err) {
|
|
1760
|
+
log.error(`Test Failure: ${err}`);
|
|
1761
|
+
done(err);
|
|
1762
|
+
}
|
|
1763
|
+
});
|
|
1764
|
+
} catch (error) {
|
|
1765
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1766
|
+
done(error);
|
|
1767
|
+
}
|
|
1768
|
+
}).timeout(attemptTimeout);
|
|
1769
|
+
});
|
|
1770
|
+
|
|
1771
|
+
describe('#getPacketsUsingGET2 - errors', () => {
|
|
1772
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1773
|
+
try {
|
|
1774
|
+
a.getPacketsUsingGET2(null, null, mACTrakPerformancePortId, null, (data, error) => {
|
|
1775
|
+
try {
|
|
1776
|
+
if (stub) {
|
|
1777
|
+
const displayE = 'Error 400 received on request';
|
|
1778
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1779
|
+
} else {
|
|
1780
|
+
runCommonAsserts(data, error);
|
|
1781
|
+
}
|
|
1782
|
+
saveMockData('MACTrakPerformance', 'getPacketsUsingGET2', 'default', data);
|
|
1783
|
+
done();
|
|
1784
|
+
} catch (err) {
|
|
1785
|
+
log.error(`Test Failure: ${err}`);
|
|
1786
|
+
done(err);
|
|
1787
|
+
}
|
|
1788
|
+
});
|
|
1789
|
+
} catch (error) {
|
|
1790
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1791
|
+
done(error);
|
|
1792
|
+
}
|
|
1793
|
+
}).timeout(attemptTimeout);
|
|
1794
|
+
});
|
|
1795
|
+
|
|
1796
|
+
describe('#getLatestRankingsUsingGET2 - errors', () => {
|
|
1797
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
1798
|
+
try {
|
|
1799
|
+
a.getLatestRankingsUsingGET2(null, null, null, null, null, null, null, (data, error) => {
|
|
1800
|
+
try {
|
|
1801
|
+
if (stub) {
|
|
1802
|
+
runCommonAsserts(data, error);
|
|
1803
|
+
assert.equal('object', typeof data.response[0]);
|
|
1804
|
+
assert.equal('object', typeof data.response[1]);
|
|
1805
|
+
assert.equal('object', typeof data.response[2]);
|
|
1806
|
+
assert.equal('object', typeof data.response[3]);
|
|
1807
|
+
} else {
|
|
1808
|
+
runCommonAsserts(data, error);
|
|
1809
|
+
}
|
|
1810
|
+
saveMockData('MACTrakRanking', 'getLatestRankingsUsingGET2', 'default', data);
|
|
1811
|
+
done();
|
|
1812
|
+
} catch (err) {
|
|
1813
|
+
log.error(`Test Failure: ${err}`);
|
|
1814
|
+
done(err);
|
|
1815
|
+
}
|
|
1816
|
+
});
|
|
1817
|
+
} catch (error) {
|
|
1818
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1819
|
+
done(error);
|
|
1820
|
+
}
|
|
1821
|
+
}).timeout(attemptTimeout);
|
|
1822
|
+
});
|
|
1823
|
+
|
|
1824
|
+
const modemAnalysisLiveAndHistoryStartLiveViewUsingPUT1BodyParam = {};
|
|
1825
|
+
describe('#startLiveViewUsingPUT1 - errors', () => {
|
|
1826
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1827
|
+
try {
|
|
1828
|
+
a.startLiveViewUsingPUT1(null, modemAnalysisLiveAndHistoryStartLiveViewUsingPUT1BodyParam, (data, error) => {
|
|
1829
|
+
try {
|
|
1830
|
+
if (stub) {
|
|
1831
|
+
const displayE = 'Error 400 received on request';
|
|
1832
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1833
|
+
} else {
|
|
1834
|
+
runCommonAsserts(data, error);
|
|
1835
|
+
}
|
|
1836
|
+
saveMockData('ModemAnalysisLiveAndHistory', 'startLiveViewUsingPUT1', 'default', data);
|
|
1837
|
+
done();
|
|
1838
|
+
} catch (err) {
|
|
1839
|
+
log.error(`Test Failure: ${err}`);
|
|
1840
|
+
done(err);
|
|
1841
|
+
}
|
|
1842
|
+
});
|
|
1843
|
+
} catch (error) {
|
|
1844
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1845
|
+
done(error);
|
|
1846
|
+
}
|
|
1847
|
+
}).timeout(attemptTimeout);
|
|
1848
|
+
});
|
|
1849
|
+
|
|
1850
|
+
const modemAnalysisLiveAndHistorySequencenumber = 555;
|
|
1851
|
+
const modemAnalysisLiveAndHistorySessionid = 555;
|
|
1852
|
+
describe('#getTraceUsingGET5 - errors', () => {
|
|
1853
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1854
|
+
try {
|
|
1855
|
+
a.getTraceUsingGET5(modemAnalysisLiveAndHistorySequencenumber, modemAnalysisLiveAndHistorySessionid, (data, error) => {
|
|
1856
|
+
try {
|
|
1857
|
+
if (stub) {
|
|
1858
|
+
const displayE = 'Error 400 received on request';
|
|
1859
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1860
|
+
} else {
|
|
1861
|
+
runCommonAsserts(data, error);
|
|
1862
|
+
}
|
|
1863
|
+
saveMockData('ModemAnalysisLiveAndHistory', 'getTraceUsingGET5', 'default', data);
|
|
1864
|
+
done();
|
|
1865
|
+
} catch (err) {
|
|
1866
|
+
log.error(`Test Failure: ${err}`);
|
|
1867
|
+
done(err);
|
|
1868
|
+
}
|
|
1869
|
+
});
|
|
1870
|
+
} catch (error) {
|
|
1871
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1872
|
+
done(error);
|
|
1873
|
+
}
|
|
1874
|
+
}).timeout(attemptTimeout);
|
|
1875
|
+
});
|
|
1876
|
+
|
|
1877
|
+
const modemAnalysisLiveAndHistoryNodeId = 555;
|
|
1878
|
+
describe('#getModemKpiPerformanceHistoryUsingGET2 - errors', () => {
|
|
1879
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1880
|
+
try {
|
|
1881
|
+
a.getModemKpiPerformanceHistoryUsingGET2(null, null, modemAnalysisLiveAndHistoryNodeId, (data, error) => {
|
|
1882
|
+
try {
|
|
1883
|
+
if (stub) {
|
|
1884
|
+
const displayE = 'Error 400 received on request';
|
|
1885
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1886
|
+
} else {
|
|
1887
|
+
runCommonAsserts(data, error);
|
|
1888
|
+
}
|
|
1889
|
+
saveMockData('ModemAnalysisLiveAndHistory', 'getModemKpiPerformanceHistoryUsingGET2', 'default', data);
|
|
1890
|
+
done();
|
|
1891
|
+
} catch (err) {
|
|
1892
|
+
log.error(`Test Failure: ${err}`);
|
|
1893
|
+
done(err);
|
|
1894
|
+
}
|
|
1895
|
+
});
|
|
1896
|
+
} catch (error) {
|
|
1897
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1898
|
+
done(error);
|
|
1899
|
+
}
|
|
1900
|
+
}).timeout(attemptTimeout);
|
|
1901
|
+
});
|
|
1902
|
+
|
|
1903
|
+
const noiseTrakImportImportNoiseTrakJsonUsingPOST2BodyParam = {};
|
|
1904
|
+
describe('#importNoiseTrakJsonUsingPOST2 - errors', () => {
|
|
1905
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1906
|
+
try {
|
|
1907
|
+
a.importNoiseTrakJsonUsingPOST2(null, null, noiseTrakImportImportNoiseTrakJsonUsingPOST2BodyParam, (data, error) => {
|
|
1908
|
+
try {
|
|
1909
|
+
if (stub) {
|
|
1910
|
+
const displayE = 'Error 400 received on request';
|
|
1911
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1912
|
+
} else {
|
|
1913
|
+
runCommonAsserts(data, error);
|
|
1914
|
+
}
|
|
1915
|
+
saveMockData('NoiseTrakImport', 'importNoiseTrakJsonUsingPOST2', 'default', data);
|
|
1916
|
+
done();
|
|
1917
|
+
} catch (err) {
|
|
1918
|
+
log.error(`Test Failure: ${err}`);
|
|
1919
|
+
done(err);
|
|
1920
|
+
}
|
|
1921
|
+
});
|
|
1922
|
+
} catch (error) {
|
|
1923
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1924
|
+
done(error);
|
|
1925
|
+
}
|
|
1926
|
+
}).timeout(attemptTimeout);
|
|
1927
|
+
});
|
|
1928
|
+
|
|
1929
|
+
const noiseTrakImportCsvFile = 'fakedata';
|
|
1930
|
+
const noiseTrakImportImportConfig = 'fakedata';
|
|
1931
|
+
describe('#processCsvImportUsingPOST2 - errors', () => {
|
|
1932
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1933
|
+
try {
|
|
1934
|
+
a.processCsvImportUsingPOST2(noiseTrakImportCsvFile, noiseTrakImportImportConfig, null, null, (data, error) => {
|
|
1935
|
+
try {
|
|
1936
|
+
if (stub) {
|
|
1937
|
+
const displayE = 'Error 400 received on request';
|
|
1938
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1939
|
+
} else {
|
|
1940
|
+
runCommonAsserts(data, error);
|
|
1941
|
+
}
|
|
1942
|
+
saveMockData('NoiseTrakImport', 'processCsvImportUsingPOST2', 'default', data);
|
|
1943
|
+
done();
|
|
1944
|
+
} catch (err) {
|
|
1945
|
+
log.error(`Test Failure: ${err}`);
|
|
1946
|
+
done(err);
|
|
1947
|
+
}
|
|
1948
|
+
});
|
|
1949
|
+
} catch (error) {
|
|
1950
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1951
|
+
done(error);
|
|
1952
|
+
}
|
|
1953
|
+
}).timeout(attemptTimeout);
|
|
1954
|
+
});
|
|
1955
|
+
|
|
1956
|
+
describe('#csvParserConfigUsingGET2 - errors', () => {
|
|
1957
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1958
|
+
try {
|
|
1959
|
+
a.csvParserConfigUsingGET2((data, error) => {
|
|
1960
|
+
try {
|
|
1961
|
+
if (stub) {
|
|
1962
|
+
const displayE = 'Error 400 received on request';
|
|
1963
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
1964
|
+
} else {
|
|
1965
|
+
runCommonAsserts(data, error);
|
|
1966
|
+
}
|
|
1967
|
+
saveMockData('NoiseTrakImport', 'csvParserConfigUsingGET2', 'default', data);
|
|
1968
|
+
done();
|
|
1969
|
+
} catch (err) {
|
|
1970
|
+
log.error(`Test Failure: ${err}`);
|
|
1971
|
+
done(err);
|
|
1972
|
+
}
|
|
1973
|
+
});
|
|
1974
|
+
} catch (error) {
|
|
1975
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1976
|
+
done(error);
|
|
1977
|
+
}
|
|
1978
|
+
}).timeout(attemptTimeout);
|
|
1979
|
+
});
|
|
1980
|
+
|
|
1981
|
+
describe('#getSpectrumDetailsUsingGET3 - errors', () => {
|
|
1982
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
1983
|
+
try {
|
|
1984
|
+
a.getSpectrumDetailsUsingGET3(null, null, null, null, null, null, (data, error) => {
|
|
1985
|
+
try {
|
|
1986
|
+
if (stub) {
|
|
1987
|
+
runCommonAsserts(data, error);
|
|
1988
|
+
assert.equal('object', typeof data.response[0]);
|
|
1989
|
+
assert.equal('object', typeof data.response[1]);
|
|
1990
|
+
} else {
|
|
1991
|
+
runCommonAsserts(data, error);
|
|
1992
|
+
}
|
|
1993
|
+
saveMockData('QoENodeSummary', 'getSpectrumDetailsUsingGET3', 'default', data);
|
|
1994
|
+
done();
|
|
1995
|
+
} catch (err) {
|
|
1996
|
+
log.error(`Test Failure: ${err}`);
|
|
1997
|
+
done(err);
|
|
1998
|
+
}
|
|
1999
|
+
});
|
|
2000
|
+
} catch (error) {
|
|
2001
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2002
|
+
done(error);
|
|
2003
|
+
}
|
|
2004
|
+
}).timeout(attemptTimeout);
|
|
2005
|
+
});
|
|
2006
|
+
|
|
2007
|
+
describe('#getQoeNodeRankingsUsingGET1 - errors', () => {
|
|
2008
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
2009
|
+
try {
|
|
2010
|
+
a.getQoeNodeRankingsUsingGET1(null, null, null, null, null, null, null, (data, error) => {
|
|
2011
|
+
try {
|
|
2012
|
+
if (stub) {
|
|
2013
|
+
runCommonAsserts(data, error);
|
|
2014
|
+
assert.equal('object', typeof data.response[0]);
|
|
2015
|
+
assert.equal('object', typeof data.response[1]);
|
|
2016
|
+
} else {
|
|
2017
|
+
runCommonAsserts(data, error);
|
|
2018
|
+
}
|
|
2019
|
+
saveMockData('QoERanking', 'getQoeNodeRankingsUsingGET1', 'default', data);
|
|
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
|
+
const rCISweepEnableSweepUsingPOST3BodyParam = {};
|
|
2034
|
+
describe('#enableSweepUsingPOST3 - errors', () => {
|
|
2035
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2036
|
+
try {
|
|
2037
|
+
a.enableSweepUsingPOST3(rCISweepEnableSweepUsingPOST3BodyParam, (data, error) => {
|
|
2038
|
+
try {
|
|
2039
|
+
if (stub) {
|
|
2040
|
+
const displayE = 'Error 400 received on request';
|
|
2041
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2042
|
+
} else {
|
|
2043
|
+
runCommonAsserts(data, error);
|
|
2044
|
+
}
|
|
2045
|
+
saveMockData('RCISweep', 'enableSweepUsingPOST3', 'default', data);
|
|
2046
|
+
done();
|
|
2047
|
+
} catch (err) {
|
|
2048
|
+
log.error(`Test Failure: ${err}`);
|
|
2049
|
+
done(err);
|
|
2050
|
+
}
|
|
2051
|
+
});
|
|
2052
|
+
} catch (error) {
|
|
2053
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2054
|
+
done(error);
|
|
2055
|
+
}
|
|
2056
|
+
}).timeout(attemptTimeout);
|
|
2057
|
+
});
|
|
2058
|
+
|
|
2059
|
+
const rCISweepCmtsusportid = 555;
|
|
2060
|
+
describe('#disableSweepUsingPUT3 - errors', () => {
|
|
2061
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2062
|
+
try {
|
|
2063
|
+
a.disableSweepUsingPUT3(rCISweepCmtsusportid, (data, error) => {
|
|
2064
|
+
try {
|
|
2065
|
+
if (stub) {
|
|
2066
|
+
const displayE = 'Error 400 received on request';
|
|
2067
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2068
|
+
} else {
|
|
2069
|
+
runCommonAsserts(data, error);
|
|
2070
|
+
}
|
|
2071
|
+
saveMockData('RCISweep', 'disableSweepUsingPUT3', 'default', data);
|
|
2072
|
+
done();
|
|
2073
|
+
} catch (err) {
|
|
2074
|
+
log.error(`Test Failure: ${err}`);
|
|
2075
|
+
done(err);
|
|
2076
|
+
}
|
|
2077
|
+
});
|
|
2078
|
+
} catch (error) {
|
|
2079
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2080
|
+
done(error);
|
|
2081
|
+
}
|
|
2082
|
+
}).timeout(attemptTimeout);
|
|
2083
|
+
});
|
|
2084
|
+
|
|
2085
|
+
describe('#rCISweepPlanAPI1 - errors', () => {
|
|
2086
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
2087
|
+
try {
|
|
2088
|
+
a.rCISweepPlanAPI1((data, error) => {
|
|
2089
|
+
try {
|
|
2090
|
+
if (stub) {
|
|
2091
|
+
runCommonAsserts(data, error);
|
|
2092
|
+
assert.equal('object', typeof data.response[0]);
|
|
2093
|
+
assert.equal('object', typeof data.response[1]);
|
|
2094
|
+
} else {
|
|
2095
|
+
runCommonAsserts(data, error);
|
|
2096
|
+
}
|
|
2097
|
+
saveMockData('RCISweep', 'rCISweepPlanAPI1', 'default', data);
|
|
2098
|
+
done();
|
|
2099
|
+
} catch (err) {
|
|
2100
|
+
log.error(`Test Failure: ${err}`);
|
|
2101
|
+
done(err);
|
|
2102
|
+
}
|
|
2103
|
+
});
|
|
2104
|
+
} catch (error) {
|
|
2105
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2106
|
+
done(error);
|
|
2107
|
+
}
|
|
2108
|
+
}).timeout(attemptTimeout);
|
|
2109
|
+
});
|
|
2110
|
+
|
|
2111
|
+
describe('#getElementBroadcastStatusResponsesUsingGET1 - errors', () => {
|
|
2112
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2113
|
+
try {
|
|
2114
|
+
a.getElementBroadcastStatusResponsesUsingGET1(null, null, null, (data, error) => {
|
|
2115
|
+
try {
|
|
2116
|
+
if (stub) {
|
|
2117
|
+
const displayE = 'Error 400 received on request';
|
|
2118
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2119
|
+
} else {
|
|
2120
|
+
runCommonAsserts(data, error);
|
|
2121
|
+
}
|
|
2122
|
+
saveMockData('RPMPortBroadcast', 'getElementBroadcastStatusResponsesUsingGET1', 'default', data);
|
|
2123
|
+
done();
|
|
2124
|
+
} catch (err) {
|
|
2125
|
+
log.error(`Test Failure: ${err}`);
|
|
2126
|
+
done(err);
|
|
2127
|
+
}
|
|
2128
|
+
});
|
|
2129
|
+
} catch (error) {
|
|
2130
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2131
|
+
done(error);
|
|
2132
|
+
}
|
|
2133
|
+
}).timeout(attemptTimeout);
|
|
2134
|
+
});
|
|
2135
|
+
|
|
2136
|
+
const rPMPortBroadcastIdentifier = 'fakedata';
|
|
2137
|
+
const rPMPortBroadcastPutRpmPortBroadcastUsingPUT2BodyParam = {};
|
|
2138
|
+
describe('#putRpmPortBroadcastUsingPUT2 - errors', () => {
|
|
2139
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2140
|
+
try {
|
|
2141
|
+
a.putRpmPortBroadcastUsingPUT2(rPMPortBroadcastIdentifier, null, rPMPortBroadcastPutRpmPortBroadcastUsingPUT2BodyParam, (data, error) => {
|
|
2142
|
+
try {
|
|
2143
|
+
if (stub) {
|
|
2144
|
+
const displayE = 'Error 400 received on request';
|
|
2145
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2146
|
+
} else {
|
|
2147
|
+
runCommonAsserts(data, error);
|
|
2148
|
+
}
|
|
2149
|
+
saveMockData('RPMPortBroadcast', 'putRpmPortBroadcastUsingPUT2', 'default', data);
|
|
2150
|
+
done();
|
|
2151
|
+
} catch (err) {
|
|
2152
|
+
log.error(`Test Failure: ${err}`);
|
|
2153
|
+
done(err);
|
|
2154
|
+
}
|
|
2155
|
+
});
|
|
2156
|
+
} catch (error) {
|
|
2157
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2158
|
+
done(error);
|
|
2159
|
+
}
|
|
2160
|
+
}).timeout(attemptTimeout);
|
|
2161
|
+
});
|
|
2162
|
+
|
|
2163
|
+
describe('#getRankingDetailsUsingGET2 - errors', () => {
|
|
2164
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2165
|
+
try {
|
|
2166
|
+
a.getRankingDetailsUsingGET2(null, null, null, null, (data, error) => {
|
|
2167
|
+
try {
|
|
2168
|
+
if (stub) {
|
|
2169
|
+
const displayE = 'Error 400 received on request';
|
|
2170
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2171
|
+
} else {
|
|
2172
|
+
runCommonAsserts(data, error);
|
|
2173
|
+
}
|
|
2174
|
+
saveMockData('Ranking', 'getRankingDetailsUsingGET2', 'default', data);
|
|
2175
|
+
done();
|
|
2176
|
+
} catch (err) {
|
|
2177
|
+
log.error(`Test Failure: ${err}`);
|
|
2178
|
+
done(err);
|
|
2179
|
+
}
|
|
2180
|
+
});
|
|
2181
|
+
} catch (error) {
|
|
2182
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2183
|
+
done(error);
|
|
2184
|
+
}
|
|
2185
|
+
}).timeout(attemptTimeout);
|
|
2186
|
+
});
|
|
2187
|
+
|
|
2188
|
+
describe('#getRankingSummaryUsingGET1 - errors', () => {
|
|
2189
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2190
|
+
try {
|
|
2191
|
+
a.getRankingSummaryUsingGET1(null, null, (data, error) => {
|
|
2192
|
+
try {
|
|
2193
|
+
if (stub) {
|
|
2194
|
+
const displayE = 'Error 400 received on request';
|
|
2195
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2196
|
+
} else {
|
|
2197
|
+
runCommonAsserts(data, error);
|
|
2198
|
+
}
|
|
2199
|
+
saveMockData('RankingSummary', 'getRankingSummaryUsingGET1', 'default', data);
|
|
2200
|
+
done();
|
|
2201
|
+
} catch (err) {
|
|
2202
|
+
log.error(`Test Failure: ${err}`);
|
|
2203
|
+
done(err);
|
|
2204
|
+
}
|
|
2205
|
+
});
|
|
2206
|
+
} catch (error) {
|
|
2207
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2208
|
+
done(error);
|
|
2209
|
+
}
|
|
2210
|
+
}).timeout(attemptTimeout);
|
|
2211
|
+
});
|
|
2212
|
+
|
|
2213
|
+
describe('#searchAlarmableModemsUsingGET1 - errors', () => {
|
|
2214
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
2215
|
+
try {
|
|
2216
|
+
a.searchAlarmableModemsUsingGET1((data, error) => {
|
|
2217
|
+
try {
|
|
2218
|
+
if (stub) {
|
|
2219
|
+
runCommonAsserts(data, error);
|
|
2220
|
+
assert.equal('object', typeof data.response[0]);
|
|
2221
|
+
assert.equal('object', typeof data.response[1]);
|
|
2222
|
+
assert.equal('object', typeof data.response[2]);
|
|
2223
|
+
assert.equal('object', typeof data.response[3]);
|
|
2224
|
+
} else {
|
|
2225
|
+
runCommonAsserts(data, error);
|
|
2226
|
+
}
|
|
2227
|
+
saveMockData('SearchNetworkElementsAndProperties', 'searchAlarmableModemsUsingGET1', 'default', data);
|
|
2228
|
+
done();
|
|
2229
|
+
} catch (err) {
|
|
2230
|
+
log.error(`Test Failure: ${err}`);
|
|
2231
|
+
done(err);
|
|
2232
|
+
}
|
|
2233
|
+
});
|
|
2234
|
+
} catch (error) {
|
|
2235
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2236
|
+
done(error);
|
|
2237
|
+
}
|
|
2238
|
+
}).timeout(attemptTimeout);
|
|
2239
|
+
});
|
|
2240
|
+
|
|
2241
|
+
describe('#searchModemWatchModemsUsingGET1 - errors', () => {
|
|
2242
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
2243
|
+
try {
|
|
2244
|
+
a.searchModemWatchModemsUsingGET1((data, error) => {
|
|
2245
|
+
try {
|
|
2246
|
+
if (stub) {
|
|
2247
|
+
runCommonAsserts(data, error);
|
|
2248
|
+
assert.equal('object', typeof data.response[0]);
|
|
2249
|
+
assert.equal('object', typeof data.response[1]);
|
|
2250
|
+
assert.equal('object', typeof data.response[2]);
|
|
2251
|
+
} else {
|
|
2252
|
+
runCommonAsserts(data, error);
|
|
2253
|
+
}
|
|
2254
|
+
saveMockData('SearchNetworkElementsAndProperties', 'searchModemWatchModemsUsingGET1', 'default', data);
|
|
2255
|
+
done();
|
|
2256
|
+
} catch (err) {
|
|
2257
|
+
log.error(`Test Failure: ${err}`);
|
|
2258
|
+
done(err);
|
|
2259
|
+
}
|
|
2260
|
+
});
|
|
2261
|
+
} catch (error) {
|
|
2262
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2263
|
+
done(error);
|
|
2264
|
+
}
|
|
2265
|
+
}).timeout(attemptTimeout);
|
|
2266
|
+
});
|
|
2267
|
+
|
|
2268
|
+
const searchNetworkElementsAndPropertiesType = 'fakedata';
|
|
2269
|
+
describe('#searchElementsUsingGET1 - errors', () => {
|
|
2270
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
2271
|
+
try {
|
|
2272
|
+
a.searchElementsUsingGET1(searchNetworkElementsAndPropertiesType, (data, error) => {
|
|
2273
|
+
try {
|
|
2274
|
+
if (stub) {
|
|
2275
|
+
runCommonAsserts(data, error);
|
|
2276
|
+
assert.equal('object', typeof data.response[0]);
|
|
2277
|
+
} else {
|
|
2278
|
+
runCommonAsserts(data, error);
|
|
2279
|
+
}
|
|
2280
|
+
saveMockData('SearchNetworkElementsAndProperties', 'searchElementsUsingGET1', 'default', data);
|
|
2281
|
+
done();
|
|
2282
|
+
} catch (err) {
|
|
2283
|
+
log.error(`Test Failure: ${err}`);
|
|
2284
|
+
done(err);
|
|
2285
|
+
}
|
|
2286
|
+
});
|
|
2287
|
+
} catch (error) {
|
|
2288
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2289
|
+
done(error);
|
|
2290
|
+
}
|
|
2291
|
+
}).timeout(attemptTimeout);
|
|
2292
|
+
});
|
|
2293
|
+
|
|
2294
|
+
const searchNetworkElementsAndPropertiesId = 'fakedata';
|
|
2295
|
+
describe('#getElementDetailUsingGET1 - errors', () => {
|
|
2296
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2297
|
+
try {
|
|
2298
|
+
a.getElementDetailUsingGET1(null, searchNetworkElementsAndPropertiesId, searchNetworkElementsAndPropertiesType, (data, error) => {
|
|
2299
|
+
try {
|
|
2300
|
+
if (stub) {
|
|
2301
|
+
const displayE = 'Error 400 received on request';
|
|
2302
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2303
|
+
} else {
|
|
2304
|
+
runCommonAsserts(data, error);
|
|
2305
|
+
}
|
|
2306
|
+
saveMockData('SearchNetworkElementsAndProperties', 'getElementDetailUsingGET1', 'default', data);
|
|
2307
|
+
done();
|
|
2308
|
+
} catch (err) {
|
|
2309
|
+
log.error(`Test Failure: ${err}`);
|
|
2310
|
+
done(err);
|
|
2311
|
+
}
|
|
2312
|
+
});
|
|
2313
|
+
} catch (error) {
|
|
2314
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2315
|
+
done(error);
|
|
2316
|
+
}
|
|
2317
|
+
}).timeout(attemptTimeout);
|
|
2318
|
+
});
|
|
2319
|
+
|
|
2320
|
+
describe('#getAllUsingGET6 - errors', () => {
|
|
2321
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
2322
|
+
try {
|
|
2323
|
+
a.getAllUsingGET6((data, error) => {
|
|
2324
|
+
try {
|
|
2325
|
+
if (stub) {
|
|
2326
|
+
runCommonAsserts(data, error);
|
|
2327
|
+
assert.equal('object', typeof data.response[0]);
|
|
2328
|
+
} else {
|
|
2329
|
+
runCommonAsserts(data, error);
|
|
2330
|
+
}
|
|
2331
|
+
saveMockData('Site', 'getAllUsingGET6', 'default', data);
|
|
2332
|
+
done();
|
|
2333
|
+
} catch (err) {
|
|
2334
|
+
log.error(`Test Failure: ${err}`);
|
|
2335
|
+
done(err);
|
|
2336
|
+
}
|
|
2337
|
+
});
|
|
2338
|
+
} catch (error) {
|
|
2339
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2340
|
+
done(error);
|
|
2341
|
+
}
|
|
2342
|
+
}).timeout(attemptTimeout);
|
|
2343
|
+
});
|
|
2344
|
+
|
|
2345
|
+
describe('#getSpectrumDetailsUsingGET4 - errors', () => {
|
|
2346
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2347
|
+
try {
|
|
2348
|
+
a.getSpectrumDetailsUsingGET4(null, null, null, null, null, null, null, (data, error) => {
|
|
2349
|
+
try {
|
|
2350
|
+
if (stub) {
|
|
2351
|
+
const displayE = 'Error 400 received on request';
|
|
2352
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2353
|
+
} else {
|
|
2354
|
+
runCommonAsserts(data, error);
|
|
2355
|
+
}
|
|
2356
|
+
saveMockData('SpectrumAll', 'getSpectrumDetailsUsingGET4', 'default', data);
|
|
2357
|
+
done();
|
|
2358
|
+
} catch (err) {
|
|
2359
|
+
log.error(`Test Failure: ${err}`);
|
|
2360
|
+
done(err);
|
|
2361
|
+
}
|
|
2362
|
+
});
|
|
2363
|
+
} catch (error) {
|
|
2364
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2365
|
+
done(error);
|
|
2366
|
+
}
|
|
2367
|
+
}).timeout(attemptTimeout);
|
|
2368
|
+
});
|
|
2369
|
+
|
|
2370
|
+
describe('#getSpectrumDetailsUsingGET5 - errors', () => {
|
|
2371
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
2372
|
+
try {
|
|
2373
|
+
a.getSpectrumDetailsUsingGET5(null, null, null, null, null, null, null, (data, error) => {
|
|
2374
|
+
try {
|
|
2375
|
+
if (stub) {
|
|
2376
|
+
runCommonAsserts(data, error);
|
|
2377
|
+
assert.equal('object', typeof data.response[0]);
|
|
2378
|
+
} else {
|
|
2379
|
+
runCommonAsserts(data, error);
|
|
2380
|
+
}
|
|
2381
|
+
saveMockData('SpectrumDetail', 'getSpectrumDetailsUsingGET5', 'default', data);
|
|
2382
|
+
done();
|
|
2383
|
+
} catch (err) {
|
|
2384
|
+
log.error(`Test Failure: ${err}`);
|
|
2385
|
+
done(err);
|
|
2386
|
+
}
|
|
2387
|
+
});
|
|
2388
|
+
} catch (error) {
|
|
2389
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2390
|
+
done(error);
|
|
2391
|
+
}
|
|
2392
|
+
}).timeout(attemptTimeout);
|
|
2393
|
+
});
|
|
2394
|
+
|
|
2395
|
+
describe('#getLatestRankingsUsingGET3 - errors', () => {
|
|
2396
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
2397
|
+
try {
|
|
2398
|
+
a.getLatestRankingsUsingGET3(null, null, null, null, null, null, null, null, (data, error) => {
|
|
2399
|
+
try {
|
|
2400
|
+
if (stub) {
|
|
2401
|
+
runCommonAsserts(data, error);
|
|
2402
|
+
assert.equal('object', typeof data.response[0]);
|
|
2403
|
+
assert.equal('object', typeof data.response[1]);
|
|
2404
|
+
assert.equal('object', typeof data.response[2]);
|
|
2405
|
+
assert.equal('object', typeof data.response[3]);
|
|
2406
|
+
} else {
|
|
2407
|
+
runCommonAsserts(data, error);
|
|
2408
|
+
}
|
|
2409
|
+
saveMockData('SpectrumRanking', 'getLatestRankingsUsingGET3', 'default', data);
|
|
2410
|
+
done();
|
|
2411
|
+
} catch (err) {
|
|
2412
|
+
log.error(`Test Failure: ${err}`);
|
|
2413
|
+
done(err);
|
|
2414
|
+
}
|
|
2415
|
+
});
|
|
2416
|
+
} catch (error) {
|
|
2417
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2418
|
+
done(error);
|
|
2419
|
+
}
|
|
2420
|
+
}).timeout(attemptTimeout);
|
|
2421
|
+
});
|
|
2422
|
+
|
|
2423
|
+
const topologyImportImportTopologyJsonUsingPOST1BodyParam = {};
|
|
2424
|
+
describe('#importTopologyJsonUsingPOST1 - errors', () => {
|
|
2425
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2426
|
+
try {
|
|
2427
|
+
a.importTopologyJsonUsingPOST1(topologyImportImportTopologyJsonUsingPOST1BodyParam, (data, error) => {
|
|
2428
|
+
try {
|
|
2429
|
+
if (stub) {
|
|
2430
|
+
const displayE = 'Error 400 received on request';
|
|
2431
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2432
|
+
} else {
|
|
2433
|
+
runCommonAsserts(data, error);
|
|
2434
|
+
}
|
|
2435
|
+
saveMockData('TopologyImport', 'importTopologyJsonUsingPOST1', 'default', data);
|
|
2436
|
+
done();
|
|
2437
|
+
} catch (err) {
|
|
2438
|
+
log.error(`Test Failure: ${err}`);
|
|
2439
|
+
done(err);
|
|
2440
|
+
}
|
|
2441
|
+
});
|
|
2442
|
+
} catch (error) {
|
|
2443
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2444
|
+
done(error);
|
|
2445
|
+
}
|
|
2446
|
+
}).timeout(attemptTimeout);
|
|
2447
|
+
});
|
|
2448
|
+
|
|
2449
|
+
const topologyImportFile = 'fakedata';
|
|
2450
|
+
describe('#processCsvUsingPOST3 - errors', () => {
|
|
2451
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2452
|
+
try {
|
|
2453
|
+
a.processCsvUsingPOST3(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, topologyImportFile, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
|
|
2454
|
+
try {
|
|
2455
|
+
if (stub) {
|
|
2456
|
+
const displayE = 'Error 400 received on request';
|
|
2457
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2458
|
+
} else {
|
|
2459
|
+
runCommonAsserts(data, error);
|
|
2460
|
+
}
|
|
2461
|
+
saveMockData('TopologyImport', 'processCsvUsingPOST3', 'default', data);
|
|
2462
|
+
done();
|
|
2463
|
+
} catch (err) {
|
|
2464
|
+
log.error(`Test Failure: ${err}`);
|
|
2465
|
+
done(err);
|
|
2466
|
+
}
|
|
2467
|
+
});
|
|
2468
|
+
} catch (error) {
|
|
2469
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2470
|
+
done(error);
|
|
2471
|
+
}
|
|
2472
|
+
}).timeout(attemptTimeout);
|
|
2473
|
+
});
|
|
2474
|
+
|
|
2475
|
+
const topologyImportCsvFile = 'fakedata';
|
|
2476
|
+
const topologyImportImportConfig = 'fakedata';
|
|
2477
|
+
describe('#processCsvUsingPOST2 - errors', () => {
|
|
2478
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2479
|
+
try {
|
|
2480
|
+
a.processCsvUsingPOST2(topologyImportCsvFile, topologyImportImportConfig, null, (data, error) => {
|
|
2481
|
+
try {
|
|
2482
|
+
if (stub) {
|
|
2483
|
+
const displayE = 'Error 400 received on request';
|
|
2484
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2485
|
+
} else {
|
|
2486
|
+
runCommonAsserts(data, error);
|
|
2487
|
+
}
|
|
2488
|
+
saveMockData('TopologyImport', 'processCsvUsingPOST2', 'default', data);
|
|
2489
|
+
done();
|
|
2490
|
+
} catch (err) {
|
|
2491
|
+
log.error(`Test Failure: ${err}`);
|
|
2492
|
+
done(err);
|
|
2493
|
+
}
|
|
2494
|
+
});
|
|
2495
|
+
} catch (error) {
|
|
2496
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2497
|
+
done(error);
|
|
2498
|
+
}
|
|
2499
|
+
}).timeout(attemptTimeout);
|
|
2500
|
+
});
|
|
2501
|
+
|
|
2502
|
+
describe('#csvParserConfigUsingGET3 - errors', () => {
|
|
2503
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2504
|
+
try {
|
|
2505
|
+
a.csvParserConfigUsingGET3((data, error) => {
|
|
2506
|
+
try {
|
|
2507
|
+
if (stub) {
|
|
2508
|
+
const displayE = 'Error 400 received on request';
|
|
2509
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2510
|
+
} else {
|
|
2511
|
+
runCommonAsserts(data, error);
|
|
2512
|
+
}
|
|
2513
|
+
saveMockData('TopologyImport', 'csvParserConfigUsingGET3', 'default', data);
|
|
2514
|
+
done();
|
|
2515
|
+
} catch (err) {
|
|
2516
|
+
log.error(`Test Failure: ${err}`);
|
|
2517
|
+
done(err);
|
|
2518
|
+
}
|
|
2519
|
+
});
|
|
2520
|
+
} catch (error) {
|
|
2521
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2522
|
+
done(error);
|
|
2523
|
+
}
|
|
2524
|
+
}).timeout(attemptTimeout);
|
|
2525
|
+
});
|
|
2526
|
+
|
|
2527
|
+
describe('#getAllFeatureNamesUsingGET1 - errors', () => {
|
|
2528
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2529
|
+
try {
|
|
2530
|
+
a.getAllFeatureNamesUsingGET1((data, error) => {
|
|
2531
|
+
try {
|
|
2532
|
+
if (stub) {
|
|
2533
|
+
const displayE = 'Error 400 received on request';
|
|
2534
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2535
|
+
} else {
|
|
2536
|
+
runCommonAsserts(data, error);
|
|
2537
|
+
}
|
|
2538
|
+
saveMockData('UserActionLogging', 'getAllFeatureNamesUsingGET1', 'default', data);
|
|
2539
|
+
done();
|
|
2540
|
+
} catch (err) {
|
|
2541
|
+
log.error(`Test Failure: ${err}`);
|
|
2542
|
+
done(err);
|
|
2543
|
+
}
|
|
2544
|
+
});
|
|
2545
|
+
} catch (error) {
|
|
2546
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2547
|
+
done(error);
|
|
2548
|
+
}
|
|
2549
|
+
}).timeout(attemptTimeout);
|
|
2550
|
+
});
|
|
2551
|
+
|
|
2552
|
+
describe('#getUsingGET2 - errors', () => {
|
|
2553
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2554
|
+
try {
|
|
2555
|
+
a.getUsingGET2(null, null, null, null, null, null, (data, error) => {
|
|
2556
|
+
try {
|
|
2557
|
+
if (stub) {
|
|
2558
|
+
const displayE = 'Error 400 received on request';
|
|
2559
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2560
|
+
} else {
|
|
2561
|
+
runCommonAsserts(data, error);
|
|
2562
|
+
}
|
|
2563
|
+
saveMockData('UserActionLogging', 'getUsingGET2', 'default', data);
|
|
2564
|
+
done();
|
|
2565
|
+
} catch (err) {
|
|
2566
|
+
log.error(`Test Failure: ${err}`);
|
|
2567
|
+
done(err);
|
|
2568
|
+
}
|
|
2569
|
+
});
|
|
2570
|
+
} catch (error) {
|
|
2571
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2572
|
+
done(error);
|
|
2573
|
+
}
|
|
2574
|
+
}).timeout(attemptTimeout);
|
|
2575
|
+
});
|
|
2576
|
+
|
|
2577
|
+
describe('#getUsingGET3 - errors', () => {
|
|
2578
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2579
|
+
try {
|
|
2580
|
+
a.getUsingGET3(null, null, null, (data, error) => {
|
|
2581
|
+
try {
|
|
2582
|
+
if (stub) {
|
|
2583
|
+
const displayE = 'Error 400 received on request';
|
|
2584
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2585
|
+
} else {
|
|
2586
|
+
runCommonAsserts(data, error);
|
|
2587
|
+
}
|
|
2588
|
+
saveMockData('UserActionSummary', 'getUsingGET3', 'default', data);
|
|
2589
|
+
done();
|
|
2590
|
+
} catch (err) {
|
|
2591
|
+
log.error(`Test Failure: ${err}`);
|
|
2592
|
+
done(err);
|
|
2593
|
+
}
|
|
2594
|
+
});
|
|
2595
|
+
} catch (error) {
|
|
2596
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2597
|
+
done(error);
|
|
2598
|
+
}
|
|
2599
|
+
}).timeout(attemptTimeout);
|
|
2600
|
+
});
|
|
2601
|
+
|
|
2602
|
+
describe('#getRankingUsingGET1 - errors', () => {
|
|
2603
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2604
|
+
try {
|
|
2605
|
+
a.getRankingUsingGET1(null, (data, error) => {
|
|
2606
|
+
try {
|
|
2607
|
+
if (stub) {
|
|
2608
|
+
const displayE = 'Error 400 received on request';
|
|
2609
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2610
|
+
} else {
|
|
2611
|
+
runCommonAsserts(data, error);
|
|
2612
|
+
}
|
|
2613
|
+
saveMockData('PreeqApiService', 'getRankingUsingGET1', 'default', data);
|
|
2614
|
+
done();
|
|
2615
|
+
} catch (err) {
|
|
2616
|
+
log.error(`Test Failure: ${err}`);
|
|
2617
|
+
done(err);
|
|
2618
|
+
}
|
|
2619
|
+
});
|
|
2620
|
+
} catch (error) {
|
|
2621
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2622
|
+
done(error);
|
|
2623
|
+
}
|
|
2624
|
+
}).timeout(attemptTimeout);
|
|
2625
|
+
});
|
|
2626
|
+
|
|
2627
|
+
describe('#deleteModemWatchByNodeUsingDELETE1 - errors', () => {
|
|
2628
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2629
|
+
try {
|
|
2630
|
+
a.deleteModemWatchByNodeUsingDELETE1(cableModemIdentifier, (data, error) => {
|
|
2631
|
+
try {
|
|
2632
|
+
if (stub) {
|
|
2633
|
+
const displayE = 'Error 400 received on request';
|
|
2634
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2635
|
+
} else {
|
|
2636
|
+
runCommonAsserts(data, error);
|
|
2637
|
+
}
|
|
2638
|
+
saveMockData('CableModem', 'deleteModemWatchByNodeUsingDELETE1', 'default', data);
|
|
2639
|
+
done();
|
|
2640
|
+
} catch (err) {
|
|
2641
|
+
log.error(`Test Failure: ${err}`);
|
|
2642
|
+
done(err);
|
|
2643
|
+
}
|
|
2644
|
+
});
|
|
2645
|
+
} catch (error) {
|
|
2646
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2647
|
+
done(error);
|
|
2648
|
+
}
|
|
2649
|
+
}).timeout(attemptTimeout);
|
|
2650
|
+
});
|
|
2651
|
+
|
|
2652
|
+
describe('#bulkDeleteDeviceAttributesUsingDELETE1 - errors', () => {
|
|
2653
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2654
|
+
try {
|
|
2655
|
+
a.bulkDeleteDeviceAttributesUsingDELETE1((data, error) => {
|
|
2656
|
+
try {
|
|
2657
|
+
if (stub) {
|
|
2658
|
+
const displayE = 'Error 400 received on request';
|
|
2659
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2660
|
+
} else {
|
|
2661
|
+
runCommonAsserts(data, error);
|
|
2662
|
+
}
|
|
2663
|
+
saveMockData('DeviceSettings', 'bulkDeleteDeviceAttributesUsingDELETE1', 'default', data);
|
|
2664
|
+
done();
|
|
2665
|
+
} catch (err) {
|
|
2666
|
+
log.error(`Test Failure: ${err}`);
|
|
2667
|
+
done(err);
|
|
2668
|
+
}
|
|
2669
|
+
});
|
|
2670
|
+
} catch (error) {
|
|
2671
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2672
|
+
done(error);
|
|
2673
|
+
}
|
|
2674
|
+
}).timeout(attemptTimeout);
|
|
2675
|
+
});
|
|
2676
|
+
|
|
2677
|
+
describe('#clearAlarmsUsingDELETE1 - errors', () => {
|
|
2678
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2679
|
+
try {
|
|
2680
|
+
a.clearAlarmsUsingDELETE1((data, error) => {
|
|
2681
|
+
try {
|
|
2682
|
+
if (stub) {
|
|
2683
|
+
const displayE = 'Error 400 received on request';
|
|
2684
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2685
|
+
} else {
|
|
2686
|
+
runCommonAsserts(data, error);
|
|
2687
|
+
}
|
|
2688
|
+
saveMockData('EventsAndAlarmsAlarms', 'clearAlarmsUsingDELETE1', 'default', data);
|
|
2689
|
+
done();
|
|
2690
|
+
} catch (err) {
|
|
2691
|
+
log.error(`Test Failure: ${err}`);
|
|
2692
|
+
done(err);
|
|
2693
|
+
}
|
|
2694
|
+
});
|
|
2695
|
+
} catch (error) {
|
|
2696
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2697
|
+
done(error);
|
|
2698
|
+
}
|
|
2699
|
+
}).timeout(attemptTimeout);
|
|
2700
|
+
});
|
|
2701
|
+
|
|
2702
|
+
describe('#clearAllElementAlarmsUsingDELETE1 - errors', () => {
|
|
2703
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2704
|
+
try {
|
|
2705
|
+
a.clearAllElementAlarmsUsingDELETE1(null, null, (data, error) => {
|
|
2706
|
+
try {
|
|
2707
|
+
if (stub) {
|
|
2708
|
+
const displayE = 'Error 400 received on request';
|
|
2709
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2710
|
+
} else {
|
|
2711
|
+
runCommonAsserts(data, error);
|
|
2712
|
+
}
|
|
2713
|
+
saveMockData('EventsAndAlarmsAlarms', 'clearAllElementAlarmsUsingDELETE1', 'default', data);
|
|
2714
|
+
done();
|
|
2715
|
+
} catch (err) {
|
|
2716
|
+
log.error(`Test Failure: ${err}`);
|
|
2717
|
+
done(err);
|
|
2718
|
+
}
|
|
2719
|
+
});
|
|
2720
|
+
} catch (error) {
|
|
2721
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2722
|
+
done(error);
|
|
2723
|
+
}
|
|
2724
|
+
}).timeout(attemptTimeout);
|
|
2725
|
+
});
|
|
2726
|
+
|
|
2727
|
+
describe('#clearAllNetworkAlarmsUsingDELETE1 - errors', () => {
|
|
2728
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2729
|
+
try {
|
|
2730
|
+
a.clearAllNetworkAlarmsUsingDELETE1(null, null, (data, error) => {
|
|
2731
|
+
try {
|
|
2732
|
+
if (stub) {
|
|
2733
|
+
const displayE = 'Error 400 received on request';
|
|
2734
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2735
|
+
} else {
|
|
2736
|
+
runCommonAsserts(data, error);
|
|
2737
|
+
}
|
|
2738
|
+
saveMockData('EventsAndAlarmsAlarms', 'clearAllNetworkAlarmsUsingDELETE1', 'default', data);
|
|
2739
|
+
done();
|
|
2740
|
+
} catch (err) {
|
|
2741
|
+
log.error(`Test Failure: ${err}`);
|
|
2742
|
+
done(err);
|
|
2743
|
+
}
|
|
2744
|
+
});
|
|
2745
|
+
} catch (error) {
|
|
2746
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2747
|
+
done(error);
|
|
2748
|
+
}
|
|
2749
|
+
}).timeout(attemptTimeout);
|
|
2750
|
+
});
|
|
2751
|
+
|
|
2752
|
+
describe('#deleteRpmPortBroadcastUsingDELETE1 - errors', () => {
|
|
2753
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2754
|
+
try {
|
|
2755
|
+
a.deleteRpmPortBroadcastUsingDELETE1(rPMPortBroadcastIdentifier, (data, error) => {
|
|
2756
|
+
try {
|
|
2757
|
+
if (stub) {
|
|
2758
|
+
const displayE = 'Error 400 received on request';
|
|
2759
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-viavi_xpertrak-connectorRest-handleEndResponse', displayE);
|
|
2760
|
+
} else {
|
|
2761
|
+
runCommonAsserts(data, error);
|
|
2762
|
+
}
|
|
2763
|
+
saveMockData('RPMPortBroadcast', 'deleteRpmPortBroadcastUsingDELETE1', 'default', data);
|
|
2764
|
+
done();
|
|
2765
|
+
} catch (err) {
|
|
2766
|
+
log.error(`Test Failure: ${err}`);
|
|
2767
|
+
done(err);
|
|
2768
|
+
}
|
|
2769
|
+
});
|
|
2770
|
+
} catch (error) {
|
|
2771
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2772
|
+
done(error);
|
|
2773
|
+
}
|
|
2774
|
+
}).timeout(attemptTimeout);
|
|
2775
|
+
});
|
|
2776
|
+
});
|
|
2777
|
+
});
|