@itentialopensource/adapter-qualys 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/.jshintrc +0 -0
- package/AUTH.md +39 -0
- package/BROKER.md +199 -0
- package/CALLS.md +170 -0
- package/CHANGELOG.md +9 -0
- package/CODE_OF_CONDUCT.md +43 -0
- package/CONTRIBUTING.md +172 -0
- package/ENHANCE.md +69 -0
- package/LICENSE +201 -0
- package/PROPERTIES.md +641 -0
- package/README.md +337 -0
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +11 -0
- package/TROUBLESHOOT.md +47 -0
- package/adapter.js +9870 -0
- package/adapterBase.js +1787 -0
- package/entities/.generic/action.json +214 -0
- package/entities/.generic/schema.json +28 -0
- package/entities/.system/action.json +50 -0
- package/entities/.system/mockdatafiles/getToken-default.json +3 -0
- package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
- package/entities/.system/schema.json +19 -0
- package/entities/.system/schemaTokenReq.json +53 -0
- package/entities/.system/schemaTokenResp.json +53 -0
- package/entities/AssetTagging/action.json +64 -0
- package/entities/AssetTagging/schema.json +21 -0
- package/entities/BulkCloudAgentActivation/action.json +24 -0
- package/entities/BulkCloudAgentActivation/schema.json +19 -0
- package/entities/CertViewAPIV1/action.json +44 -0
- package/entities/CertViewAPIV1/schema.json +20 -0
- package/entities/ContinuousMonitoringCMAPIV1/action.json +168 -0
- package/entities/ContinuousMonitoringCMAPIV1/schema.json +26 -0
- package/entities/DownloadAllAlertsFromTheContinuousMonitoringModule/action.json +24 -0
- package/entities/DownloadAllAlertsFromTheContinuousMonitoringModule/schema.json +19 -0
- package/entities/DownloadAllCloudAgentActivationKeys/action.json +24 -0
- package/entities/DownloadAllCloudAgentActivationKeys/schema.json +19 -0
- package/entities/DownloadQualysUserActivityLog/action.json +24 -0
- package/entities/DownloadQualysUserActivityLog/schema.json +19 -0
- package/entities/Events/action.json +210 -0
- package/entities/Events/schema.json +28 -0
- package/entities/FindPlatformVersions/action.json +25 -0
- package/entities/FindPlatformVersions/schema.json +19 -0
- package/entities/GettingStartedWithTheQualysAPI/action.json +44 -0
- package/entities/GettingStartedWithTheQualysAPI/schema.json +31 -0
- package/entities/GlobalITAssetInventoryITAMAIAPIV1/action.json +64 -0
- package/entities/GlobalITAssetInventoryITAMAIAPIV1/schema.json +21 -0
- package/entities/HLDNewActiveReOpenVulnerabilities/action.json +24 -0
- package/entities/HLDNewActiveReOpenVulnerabilities/schema.json +52 -0
- package/entities/Ignore/action.json +128 -0
- package/entities/Ignore/schema.json +35 -0
- package/entities/Incidents/action.json +86 -0
- package/entities/Incidents/schema.json +22 -0
- package/entities/IndicationOfCompromiseIOCUseCases/action.json +46 -0
- package/entities/IndicationOfCompromiseIOCUseCases/schema.json +20 -0
- package/entities/MalwareDetectionMDAPIV1/action.json +65 -0
- package/entities/MalwareDetectionMDAPIV1/schema.json +21 -0
- package/entities/PurgeAssetsIMPORTANTPurgingCannotBeReversed/action.json +24 -0
- package/entities/PurgeAssetsIMPORTANTPurgingCannotBeReversed/schema.json +41 -0
- package/entities/SendReportResultsToSupport/action.json +24 -0
- package/entities/SendReportResultsToSupport/schema.json +52 -0
- package/entities/Step1GenerateAPIGatewayTokenForAuth/action.json +24 -0
- package/entities/Step1GenerateAPIGatewayTokenForAuth/schema.json +19 -0
- package/entities/Step3AddIPToAssetGroup/action.json +24 -0
- package/entities/Step3AddIPToAssetGroup/schema.json +41 -0
- package/entities/Step3EnableVulnerabilityManagementAndOrPolicyComplianceForTheHostAsset/action.json +24 -0
- package/entities/Step3EnableVulnerabilityManagementAndOrPolicyComplianceForTheHostAsset/schema.json +41 -0
- package/entities/Step4AddSiteToScheduledScan/action.json +24 -0
- package/entities/Step4AddSiteToScheduledScan/schema.json +96 -0
- package/entities/Step4AuthenticationRecords/action.json +44 -0
- package/entities/Step4AuthenticationRecords/schema.json +31 -0
- package/entities/Step5GetCertificateScanResults/action.json +24 -0
- package/entities/Step5GetCertificateScanResults/schema.json +19 -0
- package/entities/Step5LaunchScans/action.json +44 -0
- package/entities/Step5LaunchScans/schema.json +53 -0
- package/entities/UserAccountManagement/action.json +24 -0
- package/entities/UserAccountManagement/schema.json +63 -0
- package/entities/V1Old/action.json +167 -0
- package/entities/V1Old/schema.json +26 -0
- package/entities/V2NewWIP/action.json +44 -0
- package/entities/V2NewWIP/schema.json +20 -0
- package/entities/VMReporting/action.json +25 -0
- package/entities/VMReporting/schema.json +19 -0
- package/entities/VulnerabilityManagementVMPolicyCompliancePCAPIV2/action.json +84 -0
- package/entities/VulnerabilityManagementVMPolicyCompliancePCAPIV2/schema.json +33 -0
- package/entities/WebApplicationScanningWASAPIV3/action.json +167 -0
- package/entities/WebApplicationScanningWASAPIV3/schema.json +26 -0
- package/error.json +190 -0
- package/package.json +84 -0
- package/pronghorn.json +5074 -0
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +1248 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/Qualys API Collection v 4.0.postman_collection.json-OpenApi3Json.json +11562 -0
- package/report/creationReport.json +1082 -0
- package/sampleProperties.json +195 -0
- package/test/integration/adapterTestBasicGet.js +85 -0
- package/test/integration/adapterTestConnectivity.js +93 -0
- package/test/integration/adapterTestIntegration.js +2578 -0
- package/test/unit/adapterBaseTestUnit.js +949 -0
- package/test/unit/adapterTestUnit.js +5702 -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/modify.js +154 -0
- package/utils/packModificationScript.js +35 -0
- package/utils/patches2bundledDeps.js +90 -0
- package/utils/pre-commit.sh +30 -0
- package/utils/removeHooks.js +20 -0
- package/utils/setup.js +33 -0
- package/utils/tbScript.js +184 -0
- package/utils/tbUtils.js +469 -0
- package/utils/testRunner.js +298 -0
- package/utils/troubleshootingAdapter.js +190 -0
- package/workflows/README.md +3 -0
|
@@ -0,0 +1,2578 @@
|
|
|
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 mocha = require('mocha');
|
|
13
|
+
const path = require('path');
|
|
14
|
+
const winston = require('winston');
|
|
15
|
+
const { expect } = require('chai');
|
|
16
|
+
const { use } = require('chai');
|
|
17
|
+
const td = require('testdouble');
|
|
18
|
+
const util = require('util');
|
|
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-qualys',
|
|
61
|
+
type: 'Qualys',
|
|
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 Qualys = require('../../adapter');
|
|
238
|
+
|
|
239
|
+
// begin the testing - these should be pretty well defined between the describe and the it!
|
|
240
|
+
describe('[integration] Qualys Adapter Test', () => {
|
|
241
|
+
describe('Qualys Class Tests', () => {
|
|
242
|
+
const a = new Qualys(
|
|
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
|
+
/*
|
|
339
|
+
-----------------------------------------------------------------------
|
|
340
|
+
-----------------------------------------------------------------------
|
|
341
|
+
*** All code above this comment will be replaced during a migration ***
|
|
342
|
+
******************* DO NOT REMOVE THIS COMMENT BLOCK ******************
|
|
343
|
+
-----------------------------------------------------------------------
|
|
344
|
+
-----------------------------------------------------------------------
|
|
345
|
+
*/
|
|
346
|
+
|
|
347
|
+
const gettingStartedWithTheQualysAPIAction = 'fakedata';
|
|
348
|
+
const gettingStartedWithTheQualysAPIDetails = 'fakedata';
|
|
349
|
+
const gettingStartedWithTheQualysAPIIds = 'fakedata';
|
|
350
|
+
const gettingStartedWithTheQualysAPIEchoRequest = 555;
|
|
351
|
+
describe('#testKnowledgeBaseAccess - errors', () => {
|
|
352
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
353
|
+
try {
|
|
354
|
+
a.testKnowledgeBaseAccess(gettingStartedWithTheQualysAPIAction, gettingStartedWithTheQualysAPIDetails, gettingStartedWithTheQualysAPIIds, gettingStartedWithTheQualysAPIEchoRequest, (data, error) => {
|
|
355
|
+
try {
|
|
356
|
+
if (stub) {
|
|
357
|
+
const displayE = 'Error 400 received on request';
|
|
358
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
359
|
+
} else {
|
|
360
|
+
runCommonAsserts(data, error);
|
|
361
|
+
}
|
|
362
|
+
saveMockData('GettingStartedWithTheQualysAPI', 'testKnowledgeBaseAccess', 'default', data);
|
|
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('#testVMAPIAccess - errors', () => {
|
|
377
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
378
|
+
try {
|
|
379
|
+
a.testVMAPIAccess((data, error) => {
|
|
380
|
+
try {
|
|
381
|
+
if (stub) {
|
|
382
|
+
const displayE = 'Error 400 received on request';
|
|
383
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
384
|
+
} else {
|
|
385
|
+
runCommonAsserts(data, error);
|
|
386
|
+
}
|
|
387
|
+
saveMockData('GettingStartedWithTheQualysAPI', 'testVMAPIAccess', 'default', data);
|
|
388
|
+
done();
|
|
389
|
+
} catch (err) {
|
|
390
|
+
log.error(`Test Failure: ${err}`);
|
|
391
|
+
done(err);
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
} catch (error) {
|
|
395
|
+
log.error(`Adapter Exception: ${error}`);
|
|
396
|
+
done(error);
|
|
397
|
+
}
|
|
398
|
+
}).timeout(attemptTimeout);
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
describe('#getyourportalversion - errors', () => {
|
|
402
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
403
|
+
try {
|
|
404
|
+
a.getyourportalversion((data, error) => {
|
|
405
|
+
try {
|
|
406
|
+
if (stub) {
|
|
407
|
+
const displayE = 'Error 400 received on request';
|
|
408
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
409
|
+
} else {
|
|
410
|
+
runCommonAsserts(data, error);
|
|
411
|
+
}
|
|
412
|
+
saveMockData('FindPlatformVersions', 'getyourportalversion', 'default', data);
|
|
413
|
+
done();
|
|
414
|
+
} catch (err) {
|
|
415
|
+
log.error(`Test Failure: ${err}`);
|
|
416
|
+
done(err);
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
} catch (error) {
|
|
420
|
+
log.error(`Adapter Exception: ${error}`);
|
|
421
|
+
done(error);
|
|
422
|
+
}
|
|
423
|
+
}).timeout(attemptTimeout);
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
const purgeAssetsIMPORTANTPurgingCannotBeReversedAction = 'fakedata';
|
|
427
|
+
const purgeAssetsIMPORTANTPurgingCannotBeReversedEchoRequest = 555;
|
|
428
|
+
const purgeAssetsIMPORTANTPurgingCannotBeReversedNoVmScanSince = 'fakedata';
|
|
429
|
+
describe('#step1DownloadaListofallHoststobePurgedForyourrecords - errors', () => {
|
|
430
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
431
|
+
try {
|
|
432
|
+
a.step1DownloadaListofallHoststobePurgedForyourrecords(purgeAssetsIMPORTANTPurgingCannotBeReversedAction, purgeAssetsIMPORTANTPurgingCannotBeReversedEchoRequest, purgeAssetsIMPORTANTPurgingCannotBeReversedNoVmScanSince, (data, error) => {
|
|
433
|
+
try {
|
|
434
|
+
if (stub) {
|
|
435
|
+
const displayE = 'Error 400 received on request';
|
|
436
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
437
|
+
} else {
|
|
438
|
+
runCommonAsserts(data, error);
|
|
439
|
+
}
|
|
440
|
+
saveMockData('PurgeAssetsIMPORTANTPurgingCannotBeReversed', 'step1DownloadaListofallHoststobePurgedForyourrecords', 'default', data);
|
|
441
|
+
done();
|
|
442
|
+
} catch (err) {
|
|
443
|
+
log.error(`Test Failure: ${err}`);
|
|
444
|
+
done(err);
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
} catch (error) {
|
|
448
|
+
log.error(`Adapter Exception: ${error}`);
|
|
449
|
+
done(error);
|
|
450
|
+
}
|
|
451
|
+
}).timeout(attemptTimeout);
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
const sendReportResultsToSupportAction = 'fakedata';
|
|
455
|
+
const sendReportResultsToSupportTemplateId = 555;
|
|
456
|
+
const sendReportResultsToSupportReportTitle = 'fakedata';
|
|
457
|
+
const sendReportResultsToSupportOutputFormat = 'fakedata';
|
|
458
|
+
describe('#step1LaunchReportthatSupportRequested - errors', () => {
|
|
459
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
460
|
+
try {
|
|
461
|
+
a.step1LaunchReportthatSupportRequested(sendReportResultsToSupportAction, sendReportResultsToSupportTemplateId, sendReportResultsToSupportReportTitle, sendReportResultsToSupportOutputFormat, (data, error) => {
|
|
462
|
+
try {
|
|
463
|
+
if (stub) {
|
|
464
|
+
const displayE = 'Error 400 received on request';
|
|
465
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
466
|
+
} else {
|
|
467
|
+
runCommonAsserts(data, error);
|
|
468
|
+
}
|
|
469
|
+
saveMockData('SendReportResultsToSupport', 'step1LaunchReportthatSupportRequested', 'default', data);
|
|
470
|
+
done();
|
|
471
|
+
} catch (err) {
|
|
472
|
+
log.error(`Test Failure: ${err}`);
|
|
473
|
+
done(err);
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
} catch (error) {
|
|
477
|
+
log.error(`Adapter Exception: ${error}`);
|
|
478
|
+
done(error);
|
|
479
|
+
}
|
|
480
|
+
}).timeout(attemptTimeout);
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
const userAccountManagementAction = 'fakedata';
|
|
484
|
+
const userAccountManagementSendEmail = 555;
|
|
485
|
+
const userAccountManagementUserRole = 'fakedata';
|
|
486
|
+
const userAccountManagementFirstName = 'fakedata';
|
|
487
|
+
const userAccountManagementLastName = 'fakedata';
|
|
488
|
+
const userAccountManagementTitle = 'fakedata';
|
|
489
|
+
const userAccountManagementPhone = 'fakedata';
|
|
490
|
+
const userAccountManagementEmail = 'fakedata';
|
|
491
|
+
const userAccountManagementAddress1 = 'fakedata';
|
|
492
|
+
const userAccountManagementCity = 'fakedata';
|
|
493
|
+
const userAccountManagementCountry = 'fakedata';
|
|
494
|
+
const userAccountManagementState = 'fakedata';
|
|
495
|
+
describe('#addUsersNotbulk - errors', () => {
|
|
496
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
497
|
+
try {
|
|
498
|
+
a.addUsersNotbulk(userAccountManagementAction, userAccountManagementSendEmail, userAccountManagementUserRole, userAccountManagementFirstName, userAccountManagementLastName, userAccountManagementTitle, userAccountManagementPhone, userAccountManagementEmail, userAccountManagementAddress1, userAccountManagementCity, userAccountManagementCountry, userAccountManagementState, (data, error) => {
|
|
499
|
+
try {
|
|
500
|
+
if (stub) {
|
|
501
|
+
const displayE = 'Error 400 received on request';
|
|
502
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
503
|
+
} else {
|
|
504
|
+
runCommonAsserts(data, error);
|
|
505
|
+
}
|
|
506
|
+
saveMockData('UserAccountManagement', 'addUsersNotbulk', 'default', data);
|
|
507
|
+
done();
|
|
508
|
+
} catch (err) {
|
|
509
|
+
log.error(`Test Failure: ${err}`);
|
|
510
|
+
done(err);
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
} catch (error) {
|
|
514
|
+
log.error(`Adapter Exception: ${error}`);
|
|
515
|
+
done(error);
|
|
516
|
+
}
|
|
517
|
+
}).timeout(attemptTimeout);
|
|
518
|
+
});
|
|
519
|
+
|
|
520
|
+
const bulkCloudAgentActivationModule = 'fakedata';
|
|
521
|
+
describe('#bulkActivateAgentsforVMModule - errors', () => {
|
|
522
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
523
|
+
try {
|
|
524
|
+
a.bulkActivateAgentsforVMModule(bulkCloudAgentActivationModule, (data, error) => {
|
|
525
|
+
try {
|
|
526
|
+
if (stub) {
|
|
527
|
+
const displayE = 'Error 400 received on request';
|
|
528
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
529
|
+
} else {
|
|
530
|
+
runCommonAsserts(data, error);
|
|
531
|
+
}
|
|
532
|
+
saveMockData('BulkCloudAgentActivation', 'bulkActivateAgentsforVMModule', 'default', data);
|
|
533
|
+
done();
|
|
534
|
+
} catch (err) {
|
|
535
|
+
log.error(`Test Failure: ${err}`);
|
|
536
|
+
done(err);
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
} catch (error) {
|
|
540
|
+
log.error(`Adapter Exception: ${error}`);
|
|
541
|
+
done(error);
|
|
542
|
+
}
|
|
543
|
+
}).timeout(attemptTimeout);
|
|
544
|
+
});
|
|
545
|
+
|
|
546
|
+
const hLDNewActiveReOpenVulnerabilitiesAction = 'fakedata';
|
|
547
|
+
const hLDNewActiveReOpenVulnerabilitiesIds = 'fakedata';
|
|
548
|
+
const hLDNewActiveReOpenVulnerabilitiesStatus = 'fakedata';
|
|
549
|
+
const hLDNewActiveReOpenVulnerabilitiesDetectionUpdatedSince = 'fakedata';
|
|
550
|
+
const hLDNewActiveReOpenVulnerabilitiesTruncationLimit = 555;
|
|
551
|
+
const hLDNewActiveReOpenVulnerabilitiesOutputFormat = 'fakedata';
|
|
552
|
+
describe('#exportNewActiveReOpenVulnerabilityDatausingHLD - errors', () => {
|
|
553
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
554
|
+
try {
|
|
555
|
+
a.exportNewActiveReOpenVulnerabilityDatausingHLD(hLDNewActiveReOpenVulnerabilitiesAction, hLDNewActiveReOpenVulnerabilitiesIds, hLDNewActiveReOpenVulnerabilitiesStatus, hLDNewActiveReOpenVulnerabilitiesDetectionUpdatedSince, hLDNewActiveReOpenVulnerabilitiesTruncationLimit, hLDNewActiveReOpenVulnerabilitiesOutputFormat, (data, error) => {
|
|
556
|
+
try {
|
|
557
|
+
if (stub) {
|
|
558
|
+
const displayE = 'Error 400 received on request';
|
|
559
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
560
|
+
} else {
|
|
561
|
+
runCommonAsserts(data, error);
|
|
562
|
+
}
|
|
563
|
+
saveMockData('HLDNewActiveReOpenVulnerabilities', 'exportNewActiveReOpenVulnerabilityDatausingHLD', 'default', data);
|
|
564
|
+
done();
|
|
565
|
+
} catch (err) {
|
|
566
|
+
log.error(`Test Failure: ${err}`);
|
|
567
|
+
done(err);
|
|
568
|
+
}
|
|
569
|
+
});
|
|
570
|
+
} catch (error) {
|
|
571
|
+
log.error(`Adapter Exception: ${error}`);
|
|
572
|
+
done(error);
|
|
573
|
+
}
|
|
574
|
+
}).timeout(attemptTimeout);
|
|
575
|
+
});
|
|
576
|
+
|
|
577
|
+
describe('#downloadallcloudagentactivationkeys - errors', () => {
|
|
578
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
579
|
+
try {
|
|
580
|
+
a.downloadallcloudagentactivationkeys((data, error) => {
|
|
581
|
+
try {
|
|
582
|
+
if (stub) {
|
|
583
|
+
const displayE = 'Error 400 received on request';
|
|
584
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
585
|
+
} else {
|
|
586
|
+
runCommonAsserts(data, error);
|
|
587
|
+
}
|
|
588
|
+
saveMockData('DownloadAllCloudAgentActivationKeys', 'downloadallcloudagentactivationkeys', 'default', data);
|
|
589
|
+
done();
|
|
590
|
+
} catch (err) {
|
|
591
|
+
log.error(`Test Failure: ${err}`);
|
|
592
|
+
done(err);
|
|
593
|
+
}
|
|
594
|
+
});
|
|
595
|
+
} catch (error) {
|
|
596
|
+
log.error(`Adapter Exception: ${error}`);
|
|
597
|
+
done(error);
|
|
598
|
+
}
|
|
599
|
+
}).timeout(attemptTimeout);
|
|
600
|
+
});
|
|
601
|
+
|
|
602
|
+
const downloadQualysUserActivityLogAction = 'fakedata';
|
|
603
|
+
describe('#downloadtheQualysuseractivitylog - errors', () => {
|
|
604
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
605
|
+
try {
|
|
606
|
+
a.downloadtheQualysuseractivitylog(downloadQualysUserActivityLogAction, (data, error) => {
|
|
607
|
+
try {
|
|
608
|
+
if (stub) {
|
|
609
|
+
const displayE = 'Error 400 received on request';
|
|
610
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
611
|
+
} else {
|
|
612
|
+
runCommonAsserts(data, error);
|
|
613
|
+
}
|
|
614
|
+
saveMockData('DownloadQualysUserActivityLog', 'downloadtheQualysuseractivitylog', 'default', data);
|
|
615
|
+
done();
|
|
616
|
+
} catch (err) {
|
|
617
|
+
log.error(`Test Failure: ${err}`);
|
|
618
|
+
done(err);
|
|
619
|
+
}
|
|
620
|
+
});
|
|
621
|
+
} catch (error) {
|
|
622
|
+
log.error(`Adapter Exception: ${error}`);
|
|
623
|
+
done(error);
|
|
624
|
+
}
|
|
625
|
+
}).timeout(attemptTimeout);
|
|
626
|
+
});
|
|
627
|
+
|
|
628
|
+
describe('#listAlertsbycriteriaFirstbatchexample - errors', () => {
|
|
629
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
630
|
+
try {
|
|
631
|
+
a.listAlertsbycriteriaFirstbatchexample((data, error) => {
|
|
632
|
+
try {
|
|
633
|
+
if (stub) {
|
|
634
|
+
const displayE = 'Error 400 received on request';
|
|
635
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
636
|
+
} else {
|
|
637
|
+
runCommonAsserts(data, error);
|
|
638
|
+
}
|
|
639
|
+
saveMockData('DownloadAllAlertsFromTheContinuousMonitoringModule', 'listAlertsbycriteriaFirstbatchexample', 'default', data);
|
|
640
|
+
done();
|
|
641
|
+
} catch (err) {
|
|
642
|
+
log.error(`Test Failure: ${err}`);
|
|
643
|
+
done(err);
|
|
644
|
+
}
|
|
645
|
+
});
|
|
646
|
+
} catch (error) {
|
|
647
|
+
log.error(`Adapter Exception: ${error}`);
|
|
648
|
+
done(error);
|
|
649
|
+
}
|
|
650
|
+
}).timeout(attemptTimeout);
|
|
651
|
+
});
|
|
652
|
+
|
|
653
|
+
const step3EnableVulnerabilityManagementAndOrPolicyComplianceForTheHostAssetAction = 'fakedata';
|
|
654
|
+
const step3EnableVulnerabilityManagementAndOrPolicyComplianceForTheHostAssetEnableVm = 555;
|
|
655
|
+
const step3EnableVulnerabilityManagementAndOrPolicyComplianceForTheHostAssetEnablePc = 555;
|
|
656
|
+
const step3EnableVulnerabilityManagementAndOrPolicyComplianceForTheHostAssetIps = 'fakedata';
|
|
657
|
+
describe('#enableVulnerabilityManagementandPolicyComplianceHostAssets - errors', () => {
|
|
658
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
659
|
+
try {
|
|
660
|
+
a.enableVulnerabilityManagementandPolicyComplianceHostAssets(step3EnableVulnerabilityManagementAndOrPolicyComplianceForTheHostAssetAction, step3EnableVulnerabilityManagementAndOrPolicyComplianceForTheHostAssetEnableVm, step3EnableVulnerabilityManagementAndOrPolicyComplianceForTheHostAssetEnablePc, step3EnableVulnerabilityManagementAndOrPolicyComplianceForTheHostAssetIps, (data, error) => {
|
|
661
|
+
try {
|
|
662
|
+
if (stub) {
|
|
663
|
+
const displayE = 'Error 400 received on request';
|
|
664
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
665
|
+
} else {
|
|
666
|
+
runCommonAsserts(data, error);
|
|
667
|
+
}
|
|
668
|
+
saveMockData('Step3EnableVulnerabilityManagementAndOrPolicyComplianceForTheHostAsset', 'enableVulnerabilityManagementandPolicyComplianceHostAssets', 'default', data);
|
|
669
|
+
done();
|
|
670
|
+
} catch (err) {
|
|
671
|
+
log.error(`Test Failure: ${err}`);
|
|
672
|
+
done(err);
|
|
673
|
+
}
|
|
674
|
+
});
|
|
675
|
+
} catch (error) {
|
|
676
|
+
log.error(`Adapter Exception: ${error}`);
|
|
677
|
+
done(error);
|
|
678
|
+
}
|
|
679
|
+
}).timeout(attemptTimeout);
|
|
680
|
+
});
|
|
681
|
+
|
|
682
|
+
const step4AuthenticationRecordsAction = 'fakedata';
|
|
683
|
+
const step4AuthenticationRecordsIds = 555;
|
|
684
|
+
const step4AuthenticationRecordsAddIps = 'fakedata';
|
|
685
|
+
describe('#aPICommandstoaddIPaddressEsUnixLinux - errors', () => {
|
|
686
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
687
|
+
try {
|
|
688
|
+
a.aPICommandstoaddIPaddressEsUnixLinux(step4AuthenticationRecordsAction, step4AuthenticationRecordsIds, step4AuthenticationRecordsAddIps, (data, error) => {
|
|
689
|
+
try {
|
|
690
|
+
if (stub) {
|
|
691
|
+
const displayE = 'Error 400 received on request';
|
|
692
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
693
|
+
} else {
|
|
694
|
+
runCommonAsserts(data, error);
|
|
695
|
+
}
|
|
696
|
+
saveMockData('Step4AuthenticationRecords', 'aPICommandstoaddIPaddressEsUnixLinux', '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
|
+
describe('#aPICommandstoaddIPaddressEsWindows - errors', () => {
|
|
711
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
712
|
+
try {
|
|
713
|
+
a.aPICommandstoaddIPaddressEsWindows(step4AuthenticationRecordsAction, step4AuthenticationRecordsIds, step4AuthenticationRecordsAddIps, (data, error) => {
|
|
714
|
+
try {
|
|
715
|
+
if (stub) {
|
|
716
|
+
const displayE = 'Error 400 received on request';
|
|
717
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
718
|
+
} else {
|
|
719
|
+
runCommonAsserts(data, error);
|
|
720
|
+
}
|
|
721
|
+
saveMockData('Step4AuthenticationRecords', 'aPICommandstoaddIPaddressEsWindows', 'default', data);
|
|
722
|
+
done();
|
|
723
|
+
} catch (err) {
|
|
724
|
+
log.error(`Test Failure: ${err}`);
|
|
725
|
+
done(err);
|
|
726
|
+
}
|
|
727
|
+
});
|
|
728
|
+
} catch (error) {
|
|
729
|
+
log.error(`Adapter Exception: ${error}`);
|
|
730
|
+
done(error);
|
|
731
|
+
}
|
|
732
|
+
}).timeout(attemptTimeout);
|
|
733
|
+
});
|
|
734
|
+
|
|
735
|
+
const step5LaunchScansAction = 'fakedata';
|
|
736
|
+
const step5LaunchScansIscannerId = 555;
|
|
737
|
+
const step5LaunchScansScanTitle = 'fakedata';
|
|
738
|
+
const step5LaunchScansOptionId = 555;
|
|
739
|
+
const step5LaunchScansIp = 'fakedata';
|
|
740
|
+
const step5LaunchScansPriority = 'fakedata';
|
|
741
|
+
describe('#launchVulnerabilityScan - errors', () => {
|
|
742
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
743
|
+
try {
|
|
744
|
+
a.launchVulnerabilityScan(step5LaunchScansAction, step5LaunchScansIscannerId, step5LaunchScansScanTitle, step5LaunchScansOptionId, step5LaunchScansIp, step5LaunchScansPriority, (data, error) => {
|
|
745
|
+
try {
|
|
746
|
+
if (stub) {
|
|
747
|
+
const displayE = 'Error 400 received on request';
|
|
748
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
749
|
+
} else {
|
|
750
|
+
runCommonAsserts(data, error);
|
|
751
|
+
}
|
|
752
|
+
saveMockData('Step5LaunchScans', 'launchVulnerabilityScan', 'default', data);
|
|
753
|
+
done();
|
|
754
|
+
} catch (err) {
|
|
755
|
+
log.error(`Test Failure: ${err}`);
|
|
756
|
+
done(err);
|
|
757
|
+
}
|
|
758
|
+
});
|
|
759
|
+
} catch (error) {
|
|
760
|
+
log.error(`Adapter Exception: ${error}`);
|
|
761
|
+
done(error);
|
|
762
|
+
}
|
|
763
|
+
}).timeout(attemptTimeout);
|
|
764
|
+
});
|
|
765
|
+
|
|
766
|
+
describe('#launchPolicyComplianceScan - errors', () => {
|
|
767
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
768
|
+
try {
|
|
769
|
+
a.launchPolicyComplianceScan(step5LaunchScansAction, step5LaunchScansIscannerId, step5LaunchScansScanTitle, step5LaunchScansOptionId, step5LaunchScansIp, step5LaunchScansPriority, (data, error) => {
|
|
770
|
+
try {
|
|
771
|
+
if (stub) {
|
|
772
|
+
const displayE = 'Error 400 received on request';
|
|
773
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
774
|
+
} else {
|
|
775
|
+
runCommonAsserts(data, error);
|
|
776
|
+
}
|
|
777
|
+
saveMockData('Step5LaunchScans', 'launchPolicyComplianceScan', 'default', data);
|
|
778
|
+
done();
|
|
779
|
+
} catch (err) {
|
|
780
|
+
log.error(`Test Failure: ${err}`);
|
|
781
|
+
done(err);
|
|
782
|
+
}
|
|
783
|
+
});
|
|
784
|
+
} catch (error) {
|
|
785
|
+
log.error(`Adapter Exception: ${error}`);
|
|
786
|
+
done(error);
|
|
787
|
+
}
|
|
788
|
+
}).timeout(attemptTimeout);
|
|
789
|
+
});
|
|
790
|
+
|
|
791
|
+
const step3AddIPToAssetGroupAction = 'fakedata';
|
|
792
|
+
const step3AddIPToAssetGroupOutputFormat = 'fakedata';
|
|
793
|
+
const step3AddIPToAssetGroupTruncationLimit = 555;
|
|
794
|
+
describe('#optionalListallExistingAssetGroups - errors', () => {
|
|
795
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
796
|
+
try {
|
|
797
|
+
a.optionalListallExistingAssetGroups(step3AddIPToAssetGroupAction, step3AddIPToAssetGroupOutputFormat, step3AddIPToAssetGroupTruncationLimit, (data, error) => {
|
|
798
|
+
try {
|
|
799
|
+
if (stub) {
|
|
800
|
+
const displayE = 'Error 400 received on request';
|
|
801
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
802
|
+
} else {
|
|
803
|
+
runCommonAsserts(data, error);
|
|
804
|
+
}
|
|
805
|
+
saveMockData('Step3AddIPToAssetGroup', 'optionalListallExistingAssetGroups', 'default', data);
|
|
806
|
+
done();
|
|
807
|
+
} catch (err) {
|
|
808
|
+
log.error(`Test Failure: ${err}`);
|
|
809
|
+
done(err);
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
} catch (error) {
|
|
813
|
+
log.error(`Adapter Exception: ${error}`);
|
|
814
|
+
done(error);
|
|
815
|
+
}
|
|
816
|
+
}).timeout(attemptTimeout);
|
|
817
|
+
});
|
|
818
|
+
|
|
819
|
+
const assetTaggingCreateanewDynamicTagBodyParam = {
|
|
820
|
+
data: {}
|
|
821
|
+
};
|
|
822
|
+
describe('#createanewDynamicTag - errors', () => {
|
|
823
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
824
|
+
try {
|
|
825
|
+
a.createanewDynamicTag(assetTaggingCreateanewDynamicTagBodyParam, (data, error) => {
|
|
826
|
+
try {
|
|
827
|
+
if (stub) {
|
|
828
|
+
const displayE = 'Error 400 received on request';
|
|
829
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
830
|
+
} else {
|
|
831
|
+
runCommonAsserts(data, error);
|
|
832
|
+
}
|
|
833
|
+
saveMockData('AssetTagging', 'createanewDynamicTag', 'default', data);
|
|
834
|
+
done();
|
|
835
|
+
} catch (err) {
|
|
836
|
+
log.error(`Test Failure: ${err}`);
|
|
837
|
+
done(err);
|
|
838
|
+
}
|
|
839
|
+
});
|
|
840
|
+
} catch (error) {
|
|
841
|
+
log.error(`Adapter Exception: ${error}`);
|
|
842
|
+
done(error);
|
|
843
|
+
}
|
|
844
|
+
}).timeout(attemptTimeout);
|
|
845
|
+
});
|
|
846
|
+
|
|
847
|
+
const assetTaggingSearchHostsbyTagNameBodyParam = {
|
|
848
|
+
preferences: {},
|
|
849
|
+
filters: {}
|
|
850
|
+
};
|
|
851
|
+
describe('#searchHostsbyTagName - errors', () => {
|
|
852
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
853
|
+
try {
|
|
854
|
+
a.searchHostsbyTagName(assetTaggingSearchHostsbyTagNameBodyParam, (data, error) => {
|
|
855
|
+
try {
|
|
856
|
+
if (stub) {
|
|
857
|
+
const displayE = 'Error 400 received on request';
|
|
858
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
859
|
+
} else {
|
|
860
|
+
runCommonAsserts(data, error);
|
|
861
|
+
}
|
|
862
|
+
saveMockData('AssetTagging', 'searchHostsbyTagName', 'default', data);
|
|
863
|
+
done();
|
|
864
|
+
} catch (err) {
|
|
865
|
+
log.error(`Test Failure: ${err}`);
|
|
866
|
+
done(err);
|
|
867
|
+
}
|
|
868
|
+
});
|
|
869
|
+
} catch (error) {
|
|
870
|
+
log.error(`Adapter Exception: ${error}`);
|
|
871
|
+
done(error);
|
|
872
|
+
}
|
|
873
|
+
}).timeout(attemptTimeout);
|
|
874
|
+
});
|
|
875
|
+
|
|
876
|
+
const assetTaggingApplyingatagortagstomultiplehostassetsHostIDBodyParam = {
|
|
877
|
+
filters: {},
|
|
878
|
+
data: {}
|
|
879
|
+
};
|
|
880
|
+
describe('#applyingatagortagstomultiplehostassetsHostID - errors', () => {
|
|
881
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
882
|
+
try {
|
|
883
|
+
a.applyingatagortagstomultiplehostassetsHostID(assetTaggingApplyingatagortagstomultiplehostassetsHostIDBodyParam, (data, error) => {
|
|
884
|
+
try {
|
|
885
|
+
if (stub) {
|
|
886
|
+
const displayE = 'Error 400 received on request';
|
|
887
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
888
|
+
} else {
|
|
889
|
+
runCommonAsserts(data, error);
|
|
890
|
+
}
|
|
891
|
+
saveMockData('AssetTagging', 'applyingatagortagstomultiplehostassetsHostID', 'default', data);
|
|
892
|
+
done();
|
|
893
|
+
} catch (err) {
|
|
894
|
+
log.error(`Test Failure: ${err}`);
|
|
895
|
+
done(err);
|
|
896
|
+
}
|
|
897
|
+
});
|
|
898
|
+
} catch (error) {
|
|
899
|
+
log.error(`Adapter Exception: ${error}`);
|
|
900
|
+
done(error);
|
|
901
|
+
}
|
|
902
|
+
}).timeout(attemptTimeout);
|
|
903
|
+
});
|
|
904
|
+
|
|
905
|
+
const step1GenerateAPIGatewayTokenForAuthUsername = 'fakedata';
|
|
906
|
+
const step1GenerateAPIGatewayTokenForAuthPassword = 'fakedata';
|
|
907
|
+
const step1GenerateAPIGatewayTokenForAuthToken = true;
|
|
908
|
+
describe('#generateAuthenticateGenerateToken - errors', () => {
|
|
909
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
910
|
+
try {
|
|
911
|
+
a.generateAuthenticateGenerateToken(step1GenerateAPIGatewayTokenForAuthUsername, step1GenerateAPIGatewayTokenForAuthPassword, step1GenerateAPIGatewayTokenForAuthToken, (data, error) => {
|
|
912
|
+
try {
|
|
913
|
+
if (stub) {
|
|
914
|
+
const displayE = 'Error 400 received on request';
|
|
915
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
916
|
+
} else {
|
|
917
|
+
runCommonAsserts(data, error);
|
|
918
|
+
}
|
|
919
|
+
saveMockData('Step1GenerateAPIGatewayTokenForAuth', 'generateAuthenticateGenerateToken', 'default', data);
|
|
920
|
+
done();
|
|
921
|
+
} catch (err) {
|
|
922
|
+
log.error(`Test Failure: ${err}`);
|
|
923
|
+
done(err);
|
|
924
|
+
}
|
|
925
|
+
});
|
|
926
|
+
} catch (error) {
|
|
927
|
+
log.error(`Adapter Exception: ${error}`);
|
|
928
|
+
done(error);
|
|
929
|
+
}
|
|
930
|
+
}).timeout(attemptTimeout);
|
|
931
|
+
});
|
|
932
|
+
|
|
933
|
+
const step4AddSiteToScheduledScanAction = 'fakedata';
|
|
934
|
+
const step4AddSiteToScheduledScanScanTitle = 'fakedata';
|
|
935
|
+
const step4AddSiteToScheduledScanActive = 555;
|
|
936
|
+
const step4AddSiteToScheduledScanOptionId = 'fakedata';
|
|
937
|
+
const step4AddSiteToScheduledScanScanType = 'fakedata';
|
|
938
|
+
const step4AddSiteToScheduledScanFqdn = 'fakedata';
|
|
939
|
+
const step4AddSiteToScheduledScanOccurrence = 'fakedata';
|
|
940
|
+
const step4AddSiteToScheduledScanFrequencyWeeks = 555;
|
|
941
|
+
const step4AddSiteToScheduledScanWeekdays = 'fakedata';
|
|
942
|
+
const step4AddSiteToScheduledScanStartHour = 555;
|
|
943
|
+
const step4AddSiteToScheduledScanStartMinute = 555;
|
|
944
|
+
const step4AddSiteToScheduledScanObserveDst = 'fakedata';
|
|
945
|
+
describe('#scheduleCertViewScanbyFQDNs - errors', () => {
|
|
946
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
947
|
+
try {
|
|
948
|
+
a.scheduleCertViewScanbyFQDNs(step4AddSiteToScheduledScanAction, step4AddSiteToScheduledScanScanTitle, step4AddSiteToScheduledScanActive, step4AddSiteToScheduledScanOptionId, step4AddSiteToScheduledScanScanType, step4AddSiteToScheduledScanFqdn, step4AddSiteToScheduledScanOccurrence, step4AddSiteToScheduledScanFrequencyWeeks, step4AddSiteToScheduledScanWeekdays, step4AddSiteToScheduledScanStartHour, step4AddSiteToScheduledScanStartMinute, step4AddSiteToScheduledScanObserveDst, (data, error) => {
|
|
949
|
+
try {
|
|
950
|
+
if (stub) {
|
|
951
|
+
const displayE = 'Error 400 received on request';
|
|
952
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
953
|
+
} else {
|
|
954
|
+
runCommonAsserts(data, error);
|
|
955
|
+
}
|
|
956
|
+
saveMockData('Step4AddSiteToScheduledScan', 'scheduleCertViewScanbyFQDNs', 'default', data);
|
|
957
|
+
done();
|
|
958
|
+
} catch (err) {
|
|
959
|
+
log.error(`Test Failure: ${err}`);
|
|
960
|
+
done(err);
|
|
961
|
+
}
|
|
962
|
+
});
|
|
963
|
+
} catch (error) {
|
|
964
|
+
log.error(`Adapter Exception: ${error}`);
|
|
965
|
+
done(error);
|
|
966
|
+
}
|
|
967
|
+
}).timeout(attemptTimeout);
|
|
968
|
+
});
|
|
969
|
+
|
|
970
|
+
const vMReportingAction = 'fakedata';
|
|
971
|
+
describe('#downloadallScheduledReportInfo - errors', () => {
|
|
972
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
973
|
+
try {
|
|
974
|
+
a.downloadallScheduledReportInfo(vMReportingAction, (data, error) => {
|
|
975
|
+
try {
|
|
976
|
+
if (stub) {
|
|
977
|
+
const displayE = 'Error 400 received on request';
|
|
978
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
979
|
+
} else {
|
|
980
|
+
runCommonAsserts(data, error);
|
|
981
|
+
}
|
|
982
|
+
saveMockData('VMReporting', 'downloadallScheduledReportInfo', 'default', data);
|
|
983
|
+
done();
|
|
984
|
+
} catch (err) {
|
|
985
|
+
log.error(`Test Failure: ${err}`);
|
|
986
|
+
done(err);
|
|
987
|
+
}
|
|
988
|
+
});
|
|
989
|
+
} catch (error) {
|
|
990
|
+
log.error(`Adapter Exception: ${error}`);
|
|
991
|
+
done(error);
|
|
992
|
+
}
|
|
993
|
+
}).timeout(attemptTimeout);
|
|
994
|
+
});
|
|
995
|
+
|
|
996
|
+
const step5GetCertificateScanResultsFqdn = 'fakedata';
|
|
997
|
+
const step5GetCertificateScanResultsIp = 'fakedata';
|
|
998
|
+
const step5GetCertificateScanResultsPort = 'fakedata';
|
|
999
|
+
const step5GetCertificateScanResultsService = 'fakedata';
|
|
1000
|
+
describe('#retrievedetailedhostinstanceinformation - errors', () => {
|
|
1001
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1002
|
+
try {
|
|
1003
|
+
a.retrievedetailedhostinstanceinformation(step5GetCertificateScanResultsFqdn, step5GetCertificateScanResultsIp, step5GetCertificateScanResultsPort, step5GetCertificateScanResultsService, (data, error) => {
|
|
1004
|
+
try {
|
|
1005
|
+
if (stub) {
|
|
1006
|
+
const displayE = 'Error 400 received on request';
|
|
1007
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1008
|
+
} else {
|
|
1009
|
+
runCommonAsserts(data, error);
|
|
1010
|
+
}
|
|
1011
|
+
saveMockData('Step5GetCertificateScanResults', 'retrievedetailedhostinstanceinformation', 'default', data);
|
|
1012
|
+
done();
|
|
1013
|
+
} catch (err) {
|
|
1014
|
+
log.error(`Test Failure: ${err}`);
|
|
1015
|
+
done(err);
|
|
1016
|
+
}
|
|
1017
|
+
});
|
|
1018
|
+
} catch (error) {
|
|
1019
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1020
|
+
done(error);
|
|
1021
|
+
}
|
|
1022
|
+
}).timeout(attemptTimeout);
|
|
1023
|
+
});
|
|
1024
|
+
|
|
1025
|
+
const indicationOfCompromiseIOCUseCasesState = true;
|
|
1026
|
+
const indicationOfCompromiseIOCUseCasesFilter = 'fakedata';
|
|
1027
|
+
describe('#getCurrentIOCEventswhereIndicatorScoreisGreaterthan7 - errors', () => {
|
|
1028
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1029
|
+
try {
|
|
1030
|
+
a.getCurrentIOCEventswhereIndicatorScoreisGreaterthan7(indicationOfCompromiseIOCUseCasesState, indicationOfCompromiseIOCUseCasesFilter, (data, error) => {
|
|
1031
|
+
try {
|
|
1032
|
+
if (stub) {
|
|
1033
|
+
const displayE = 'Error 400 received on request';
|
|
1034
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1035
|
+
} else {
|
|
1036
|
+
runCommonAsserts(data, error);
|
|
1037
|
+
}
|
|
1038
|
+
saveMockData('IndicationOfCompromiseIOCUseCases', 'getCurrentIOCEventswhereIndicatorScoreisGreaterthan7', 'default', data);
|
|
1039
|
+
done();
|
|
1040
|
+
} catch (err) {
|
|
1041
|
+
log.error(`Test Failure: ${err}`);
|
|
1042
|
+
done(err);
|
|
1043
|
+
}
|
|
1044
|
+
});
|
|
1045
|
+
} catch (error) {
|
|
1046
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1047
|
+
done(error);
|
|
1048
|
+
}
|
|
1049
|
+
}).timeout(attemptTimeout);
|
|
1050
|
+
});
|
|
1051
|
+
|
|
1052
|
+
describe('#getCurrentIOCEventsCountwhereIndicatorScoreisGreaterthan7 - errors', () => {
|
|
1053
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1054
|
+
try {
|
|
1055
|
+
a.getCurrentIOCEventsCountwhereIndicatorScoreisGreaterthan7(indicationOfCompromiseIOCUseCasesState, indicationOfCompromiseIOCUseCasesFilter, (data, error) => {
|
|
1056
|
+
try {
|
|
1057
|
+
if (stub) {
|
|
1058
|
+
const displayE = 'Error 400 received on request';
|
|
1059
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1060
|
+
} else {
|
|
1061
|
+
runCommonAsserts(data, error);
|
|
1062
|
+
}
|
|
1063
|
+
saveMockData('IndicationOfCompromiseIOCUseCases', 'getCurrentIOCEventsCountwhereIndicatorScoreisGreaterthan7', 'default', data);
|
|
1064
|
+
done();
|
|
1065
|
+
} catch (err) {
|
|
1066
|
+
log.error(`Test Failure: ${err}`);
|
|
1067
|
+
done(err);
|
|
1068
|
+
}
|
|
1069
|
+
});
|
|
1070
|
+
} catch (error) {
|
|
1071
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1072
|
+
done(error);
|
|
1073
|
+
}
|
|
1074
|
+
}).timeout(attemptTimeout);
|
|
1075
|
+
});
|
|
1076
|
+
|
|
1077
|
+
const vulnerabilityManagementVMPolicyCompliancePCAPIV2Action = 'fakedata';
|
|
1078
|
+
describe('#vMScannerappliances - errors', () => {
|
|
1079
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1080
|
+
try {
|
|
1081
|
+
a.vMScannerappliances(vulnerabilityManagementVMPolicyCompliancePCAPIV2Action, (data, error) => {
|
|
1082
|
+
try {
|
|
1083
|
+
if (stub) {
|
|
1084
|
+
const displayE = 'Error 400 received on request';
|
|
1085
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1086
|
+
} else {
|
|
1087
|
+
runCommonAsserts(data, error);
|
|
1088
|
+
}
|
|
1089
|
+
saveMockData('VulnerabilityManagementVMPolicyCompliancePCAPIV2', 'vMScannerappliances', 'default', data);
|
|
1090
|
+
done();
|
|
1091
|
+
} catch (err) {
|
|
1092
|
+
log.error(`Test Failure: ${err}`);
|
|
1093
|
+
done(err);
|
|
1094
|
+
}
|
|
1095
|
+
});
|
|
1096
|
+
} catch (error) {
|
|
1097
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1098
|
+
done(error);
|
|
1099
|
+
}
|
|
1100
|
+
}).timeout(attemptTimeout);
|
|
1101
|
+
});
|
|
1102
|
+
|
|
1103
|
+
describe('#excludedhostslist - errors', () => {
|
|
1104
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1105
|
+
try {
|
|
1106
|
+
a.excludedhostslist(vulnerabilityManagementVMPolicyCompliancePCAPIV2Action, (data, error) => {
|
|
1107
|
+
try {
|
|
1108
|
+
if (stub) {
|
|
1109
|
+
const displayE = 'Error 400 received on request';
|
|
1110
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1111
|
+
} else {
|
|
1112
|
+
runCommonAsserts(data, error);
|
|
1113
|
+
}
|
|
1114
|
+
saveMockData('VulnerabilityManagementVMPolicyCompliancePCAPIV2', 'excludedhostslist', 'default', data);
|
|
1115
|
+
done();
|
|
1116
|
+
} catch (err) {
|
|
1117
|
+
log.error(`Test Failure: ${err}`);
|
|
1118
|
+
done(err);
|
|
1119
|
+
}
|
|
1120
|
+
});
|
|
1121
|
+
} catch (error) {
|
|
1122
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1123
|
+
done(error);
|
|
1124
|
+
}
|
|
1125
|
+
}).timeout(attemptTimeout);
|
|
1126
|
+
});
|
|
1127
|
+
|
|
1128
|
+
describe('#excludedvirtualhostslist - errors', () => {
|
|
1129
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1130
|
+
try {
|
|
1131
|
+
a.excludedvirtualhostslist(vulnerabilityManagementVMPolicyCompliancePCAPIV2Action, (data, error) => {
|
|
1132
|
+
try {
|
|
1133
|
+
if (stub) {
|
|
1134
|
+
const displayE = 'Error 400 received on request';
|
|
1135
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1136
|
+
} else {
|
|
1137
|
+
runCommonAsserts(data, error);
|
|
1138
|
+
}
|
|
1139
|
+
saveMockData('VulnerabilityManagementVMPolicyCompliancePCAPIV2', 'excludedvirtualhostslist', 'default', data);
|
|
1140
|
+
done();
|
|
1141
|
+
} catch (err) {
|
|
1142
|
+
log.error(`Test Failure: ${err}`);
|
|
1143
|
+
done(err);
|
|
1144
|
+
}
|
|
1145
|
+
});
|
|
1146
|
+
} catch (error) {
|
|
1147
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1148
|
+
done(error);
|
|
1149
|
+
}
|
|
1150
|
+
}).timeout(attemptTimeout);
|
|
1151
|
+
});
|
|
1152
|
+
|
|
1153
|
+
const vulnerabilityManagementVMPolicyCompliancePCAPIV2Details = 'fakedata';
|
|
1154
|
+
const vulnerabilityManagementVMPolicyCompliancePCAPIV2PolicyIds = 555;
|
|
1155
|
+
const vulnerabilityManagementVMPolicyCompliancePCAPIV2Ips = 'fakedata';
|
|
1156
|
+
describe('#pCComplianceposture - errors', () => {
|
|
1157
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1158
|
+
try {
|
|
1159
|
+
a.pCComplianceposture(vulnerabilityManagementVMPolicyCompliancePCAPIV2Action, vulnerabilityManagementVMPolicyCompliancePCAPIV2Details, vulnerabilityManagementVMPolicyCompliancePCAPIV2PolicyIds, vulnerabilityManagementVMPolicyCompliancePCAPIV2Ips, (data, error) => {
|
|
1160
|
+
try {
|
|
1161
|
+
if (stub) {
|
|
1162
|
+
const displayE = 'Error 400 received on request';
|
|
1163
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1164
|
+
} else {
|
|
1165
|
+
runCommonAsserts(data, error);
|
|
1166
|
+
}
|
|
1167
|
+
saveMockData('VulnerabilityManagementVMPolicyCompliancePCAPIV2', 'pCComplianceposture', 'default', data);
|
|
1168
|
+
done();
|
|
1169
|
+
} catch (err) {
|
|
1170
|
+
log.error(`Test Failure: ${err}`);
|
|
1171
|
+
done(err);
|
|
1172
|
+
}
|
|
1173
|
+
});
|
|
1174
|
+
} catch (error) {
|
|
1175
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1176
|
+
done(error);
|
|
1177
|
+
}
|
|
1178
|
+
}).timeout(attemptTimeout);
|
|
1179
|
+
});
|
|
1180
|
+
|
|
1181
|
+
describe('#assetSearchbycriteria - errors', () => {
|
|
1182
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1183
|
+
try {
|
|
1184
|
+
a.assetSearchbycriteria((data, error) => {
|
|
1185
|
+
try {
|
|
1186
|
+
if (stub) {
|
|
1187
|
+
const displayE = 'Error 400 received on request';
|
|
1188
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1189
|
+
} else {
|
|
1190
|
+
runCommonAsserts(data, error);
|
|
1191
|
+
}
|
|
1192
|
+
saveMockData('V1Old', 'assetSearchbycriteria', 'default', data);
|
|
1193
|
+
done();
|
|
1194
|
+
} catch (err) {
|
|
1195
|
+
log.error(`Test Failure: ${err}`);
|
|
1196
|
+
done(err);
|
|
1197
|
+
}
|
|
1198
|
+
});
|
|
1199
|
+
} catch (error) {
|
|
1200
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1201
|
+
done(error);
|
|
1202
|
+
}
|
|
1203
|
+
}).timeout(attemptTimeout);
|
|
1204
|
+
});
|
|
1205
|
+
|
|
1206
|
+
describe('#hostassetSearchbycriteria - errors', () => {
|
|
1207
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1208
|
+
try {
|
|
1209
|
+
a.hostassetSearchbycriteria((data, error) => {
|
|
1210
|
+
try {
|
|
1211
|
+
if (stub) {
|
|
1212
|
+
const displayE = 'Error 400 received on request';
|
|
1213
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1214
|
+
} else {
|
|
1215
|
+
runCommonAsserts(data, error);
|
|
1216
|
+
}
|
|
1217
|
+
saveMockData('V1Old', 'hostassetSearchbycriteria', 'default', data);
|
|
1218
|
+
done();
|
|
1219
|
+
} catch (err) {
|
|
1220
|
+
log.error(`Test Failure: ${err}`);
|
|
1221
|
+
done(err);
|
|
1222
|
+
}
|
|
1223
|
+
});
|
|
1224
|
+
} catch (error) {
|
|
1225
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1226
|
+
done(error);
|
|
1227
|
+
}
|
|
1228
|
+
}).timeout(attemptTimeout);
|
|
1229
|
+
});
|
|
1230
|
+
|
|
1231
|
+
describe('#tagList - errors', () => {
|
|
1232
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1233
|
+
try {
|
|
1234
|
+
a.tagList((data, error) => {
|
|
1235
|
+
try {
|
|
1236
|
+
if (stub) {
|
|
1237
|
+
const displayE = 'Error 400 received on request';
|
|
1238
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1239
|
+
} else {
|
|
1240
|
+
runCommonAsserts(data, error);
|
|
1241
|
+
}
|
|
1242
|
+
saveMockData('V1Old', 'tagList', 'default', data);
|
|
1243
|
+
done();
|
|
1244
|
+
} catch (err) {
|
|
1245
|
+
log.error(`Test Failure: ${err}`);
|
|
1246
|
+
done(err);
|
|
1247
|
+
}
|
|
1248
|
+
});
|
|
1249
|
+
} catch (error) {
|
|
1250
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1251
|
+
done(error);
|
|
1252
|
+
}
|
|
1253
|
+
}).timeout(attemptTimeout);
|
|
1254
|
+
});
|
|
1255
|
+
|
|
1256
|
+
describe('#assetUpdate - errors', () => {
|
|
1257
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1258
|
+
try {
|
|
1259
|
+
a.assetUpdate((data, error) => {
|
|
1260
|
+
try {
|
|
1261
|
+
if (stub) {
|
|
1262
|
+
const displayE = 'Error 400 received on request';
|
|
1263
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1264
|
+
} else {
|
|
1265
|
+
runCommonAsserts(data, error);
|
|
1266
|
+
}
|
|
1267
|
+
saveMockData('V1Old', 'assetUpdate', 'default', data);
|
|
1268
|
+
done();
|
|
1269
|
+
} catch (err) {
|
|
1270
|
+
log.error(`Test Failure: ${err}`);
|
|
1271
|
+
done(err);
|
|
1272
|
+
}
|
|
1273
|
+
});
|
|
1274
|
+
} catch (error) {
|
|
1275
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1276
|
+
done(error);
|
|
1277
|
+
}
|
|
1278
|
+
}).timeout(attemptTimeout);
|
|
1279
|
+
});
|
|
1280
|
+
|
|
1281
|
+
describe('#tagUpdate - errors', () => {
|
|
1282
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1283
|
+
try {
|
|
1284
|
+
a.tagUpdate((data, error) => {
|
|
1285
|
+
try {
|
|
1286
|
+
if (stub) {
|
|
1287
|
+
const displayE = 'Error 400 received on request';
|
|
1288
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1289
|
+
} else {
|
|
1290
|
+
runCommonAsserts(data, error);
|
|
1291
|
+
}
|
|
1292
|
+
saveMockData('V1Old', 'tagUpdate', 'default', data);
|
|
1293
|
+
done();
|
|
1294
|
+
} catch (err) {
|
|
1295
|
+
log.error(`Test Failure: ${err}`);
|
|
1296
|
+
done(err);
|
|
1297
|
+
}
|
|
1298
|
+
});
|
|
1299
|
+
} catch (error) {
|
|
1300
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1301
|
+
done(error);
|
|
1302
|
+
}
|
|
1303
|
+
}).timeout(attemptTimeout);
|
|
1304
|
+
});
|
|
1305
|
+
|
|
1306
|
+
describe('#assetGet - errors', () => {
|
|
1307
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1308
|
+
try {
|
|
1309
|
+
a.assetGet((data, error) => {
|
|
1310
|
+
try {
|
|
1311
|
+
if (stub) {
|
|
1312
|
+
const displayE = 'Error 400 received on request';
|
|
1313
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1314
|
+
} else {
|
|
1315
|
+
runCommonAsserts(data, error);
|
|
1316
|
+
}
|
|
1317
|
+
saveMockData('V1Old', 'assetGet', 'default', data);
|
|
1318
|
+
done();
|
|
1319
|
+
} catch (err) {
|
|
1320
|
+
log.error(`Test Failure: ${err}`);
|
|
1321
|
+
done(err);
|
|
1322
|
+
}
|
|
1323
|
+
});
|
|
1324
|
+
} catch (error) {
|
|
1325
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1326
|
+
done(error);
|
|
1327
|
+
}
|
|
1328
|
+
}).timeout(attemptTimeout);
|
|
1329
|
+
});
|
|
1330
|
+
|
|
1331
|
+
describe('#hostassetsGet - errors', () => {
|
|
1332
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1333
|
+
try {
|
|
1334
|
+
a.hostassetsGet((data, error) => {
|
|
1335
|
+
try {
|
|
1336
|
+
if (stub) {
|
|
1337
|
+
const displayE = 'Error 400 received on request';
|
|
1338
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1339
|
+
} else {
|
|
1340
|
+
runCommonAsserts(data, error);
|
|
1341
|
+
}
|
|
1342
|
+
saveMockData('V1Old', 'hostassetsGet', 'default', data);
|
|
1343
|
+
done();
|
|
1344
|
+
} catch (err) {
|
|
1345
|
+
log.error(`Test Failure: ${err}`);
|
|
1346
|
+
done(err);
|
|
1347
|
+
}
|
|
1348
|
+
});
|
|
1349
|
+
} catch (error) {
|
|
1350
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1351
|
+
done(error);
|
|
1352
|
+
}
|
|
1353
|
+
}).timeout(attemptTimeout);
|
|
1354
|
+
});
|
|
1355
|
+
|
|
1356
|
+
describe('#tagGet - errors', () => {
|
|
1357
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1358
|
+
try {
|
|
1359
|
+
a.tagGet((data, error) => {
|
|
1360
|
+
try {
|
|
1361
|
+
if (stub) {
|
|
1362
|
+
const displayE = 'Error 400 received on request';
|
|
1363
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1364
|
+
} else {
|
|
1365
|
+
runCommonAsserts(data, error);
|
|
1366
|
+
}
|
|
1367
|
+
saveMockData('V1Old', 'tagGet', 'default', data);
|
|
1368
|
+
done();
|
|
1369
|
+
} catch (err) {
|
|
1370
|
+
log.error(`Test Failure: ${err}`);
|
|
1371
|
+
done(err);
|
|
1372
|
+
}
|
|
1373
|
+
});
|
|
1374
|
+
} catch (error) {
|
|
1375
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1376
|
+
done(error);
|
|
1377
|
+
}
|
|
1378
|
+
}).timeout(attemptTimeout);
|
|
1379
|
+
});
|
|
1380
|
+
|
|
1381
|
+
const v2NewWIPPostAssetSearchbycriteriaBodyParam = {
|
|
1382
|
+
filters: {}
|
|
1383
|
+
};
|
|
1384
|
+
describe('#postAssetSearchbycriteria - errors', () => {
|
|
1385
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1386
|
+
try {
|
|
1387
|
+
a.postAssetSearchbycriteria(v2NewWIPPostAssetSearchbycriteriaBodyParam, (data, error) => {
|
|
1388
|
+
try {
|
|
1389
|
+
if (stub) {
|
|
1390
|
+
const displayE = 'Error 400 received on request';
|
|
1391
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1392
|
+
} else {
|
|
1393
|
+
runCommonAsserts(data, error);
|
|
1394
|
+
}
|
|
1395
|
+
saveMockData('V2NewWIP', 'postAssetSearchbycriteria', 'default', data);
|
|
1396
|
+
done();
|
|
1397
|
+
} catch (err) {
|
|
1398
|
+
log.error(`Test Failure: ${err}`);
|
|
1399
|
+
done(err);
|
|
1400
|
+
}
|
|
1401
|
+
});
|
|
1402
|
+
} catch (error) {
|
|
1403
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1404
|
+
done(error);
|
|
1405
|
+
}
|
|
1406
|
+
}).timeout(attemptTimeout);
|
|
1407
|
+
});
|
|
1408
|
+
|
|
1409
|
+
const v2NewWIPFields = 'fakedata';
|
|
1410
|
+
const v2NewWIPSearchtofindtagBodyParam = {
|
|
1411
|
+
filters: {}
|
|
1412
|
+
};
|
|
1413
|
+
describe('#searchtofindtag - errors', () => {
|
|
1414
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1415
|
+
try {
|
|
1416
|
+
a.searchtofindtag(v2NewWIPFields, v2NewWIPSearchtofindtagBodyParam, (data, error) => {
|
|
1417
|
+
try {
|
|
1418
|
+
if (stub) {
|
|
1419
|
+
const displayE = 'Error 400 received on request';
|
|
1420
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1421
|
+
} else {
|
|
1422
|
+
runCommonAsserts(data, error);
|
|
1423
|
+
}
|
|
1424
|
+
saveMockData('V2NewWIP', 'searchtofindtag', 'default', data);
|
|
1425
|
+
done();
|
|
1426
|
+
} catch (err) {
|
|
1427
|
+
log.error(`Test Failure: ${err}`);
|
|
1428
|
+
done(err);
|
|
1429
|
+
}
|
|
1430
|
+
});
|
|
1431
|
+
} catch (error) {
|
|
1432
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1433
|
+
done(error);
|
|
1434
|
+
}
|
|
1435
|
+
}).timeout(attemptTimeout);
|
|
1436
|
+
});
|
|
1437
|
+
|
|
1438
|
+
describe('#reportCreatewebapp - errors', () => {
|
|
1439
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1440
|
+
try {
|
|
1441
|
+
a.reportCreatewebapp((data, error) => {
|
|
1442
|
+
try {
|
|
1443
|
+
if (stub) {
|
|
1444
|
+
const displayE = 'Error 400 received on request';
|
|
1445
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1446
|
+
} else {
|
|
1447
|
+
runCommonAsserts(data, error);
|
|
1448
|
+
}
|
|
1449
|
+
saveMockData('WebApplicationScanningWASAPIV3', 'reportCreatewebapp', 'default', data);
|
|
1450
|
+
done();
|
|
1451
|
+
} catch (err) {
|
|
1452
|
+
log.error(`Test Failure: ${err}`);
|
|
1453
|
+
done(err);
|
|
1454
|
+
}
|
|
1455
|
+
});
|
|
1456
|
+
} catch (error) {
|
|
1457
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1458
|
+
done(error);
|
|
1459
|
+
}
|
|
1460
|
+
}).timeout(attemptTimeout);
|
|
1461
|
+
});
|
|
1462
|
+
|
|
1463
|
+
describe('#appScan - errors', () => {
|
|
1464
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1465
|
+
try {
|
|
1466
|
+
a.appScan((data, error) => {
|
|
1467
|
+
try {
|
|
1468
|
+
if (stub) {
|
|
1469
|
+
const displayE = 'Error 400 received on request';
|
|
1470
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1471
|
+
} else {
|
|
1472
|
+
runCommonAsserts(data, error);
|
|
1473
|
+
}
|
|
1474
|
+
saveMockData('WebApplicationScanningWASAPIV3', 'appScan', 'default', data);
|
|
1475
|
+
done();
|
|
1476
|
+
} catch (err) {
|
|
1477
|
+
log.error(`Test Failure: ${err}`);
|
|
1478
|
+
done(err);
|
|
1479
|
+
}
|
|
1480
|
+
});
|
|
1481
|
+
} catch (error) {
|
|
1482
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1483
|
+
done(error);
|
|
1484
|
+
}
|
|
1485
|
+
}).timeout(attemptTimeout);
|
|
1486
|
+
});
|
|
1487
|
+
|
|
1488
|
+
describe('#scanListrunning - errors', () => {
|
|
1489
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1490
|
+
try {
|
|
1491
|
+
a.scanListrunning((data, error) => {
|
|
1492
|
+
try {
|
|
1493
|
+
if (stub) {
|
|
1494
|
+
const displayE = 'Error 400 received on request';
|
|
1495
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1496
|
+
} else {
|
|
1497
|
+
runCommonAsserts(data, error);
|
|
1498
|
+
}
|
|
1499
|
+
saveMockData('WebApplicationScanningWASAPIV3', 'scanListrunning', 'default', data);
|
|
1500
|
+
done();
|
|
1501
|
+
} catch (err) {
|
|
1502
|
+
log.error(`Test Failure: ${err}`);
|
|
1503
|
+
done(err);
|
|
1504
|
+
}
|
|
1505
|
+
});
|
|
1506
|
+
} catch (error) {
|
|
1507
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1508
|
+
done(error);
|
|
1509
|
+
}
|
|
1510
|
+
}).timeout(attemptTimeout);
|
|
1511
|
+
});
|
|
1512
|
+
|
|
1513
|
+
describe('#appList - errors', () => {
|
|
1514
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1515
|
+
try {
|
|
1516
|
+
a.appList((data, error) => {
|
|
1517
|
+
try {
|
|
1518
|
+
if (stub) {
|
|
1519
|
+
const displayE = 'Error 400 received on request';
|
|
1520
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1521
|
+
} else {
|
|
1522
|
+
runCommonAsserts(data, error);
|
|
1523
|
+
}
|
|
1524
|
+
saveMockData('WebApplicationScanningWASAPIV3', 'appList', 'default', data);
|
|
1525
|
+
done();
|
|
1526
|
+
} catch (err) {
|
|
1527
|
+
log.error(`Test Failure: ${err}`);
|
|
1528
|
+
done(err);
|
|
1529
|
+
}
|
|
1530
|
+
});
|
|
1531
|
+
} catch (error) {
|
|
1532
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1533
|
+
done(error);
|
|
1534
|
+
}
|
|
1535
|
+
}).timeout(attemptTimeout);
|
|
1536
|
+
});
|
|
1537
|
+
|
|
1538
|
+
describe('#appUpdate - errors', () => {
|
|
1539
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1540
|
+
try {
|
|
1541
|
+
a.appUpdate((data, error) => {
|
|
1542
|
+
try {
|
|
1543
|
+
if (stub) {
|
|
1544
|
+
const displayE = 'Error 400 received on request';
|
|
1545
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1546
|
+
} else {
|
|
1547
|
+
runCommonAsserts(data, error);
|
|
1548
|
+
}
|
|
1549
|
+
saveMockData('WebApplicationScanningWASAPIV3', 'appUpdate', 'default', data);
|
|
1550
|
+
done();
|
|
1551
|
+
} catch (err) {
|
|
1552
|
+
log.error(`Test Failure: ${err}`);
|
|
1553
|
+
done(err);
|
|
1554
|
+
}
|
|
1555
|
+
});
|
|
1556
|
+
} catch (error) {
|
|
1557
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1558
|
+
done(error);
|
|
1559
|
+
}
|
|
1560
|
+
}).timeout(attemptTimeout);
|
|
1561
|
+
});
|
|
1562
|
+
|
|
1563
|
+
describe('#reportDownload - errors', () => {
|
|
1564
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1565
|
+
try {
|
|
1566
|
+
a.reportDownload((data, error) => {
|
|
1567
|
+
try {
|
|
1568
|
+
if (stub) {
|
|
1569
|
+
const displayE = 'Error 400 received on request';
|
|
1570
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1571
|
+
} else {
|
|
1572
|
+
runCommonAsserts(data, error);
|
|
1573
|
+
}
|
|
1574
|
+
saveMockData('WebApplicationScanningWASAPIV3', 'reportDownload', 'default', data);
|
|
1575
|
+
done();
|
|
1576
|
+
} catch (err) {
|
|
1577
|
+
log.error(`Test Failure: ${err}`);
|
|
1578
|
+
done(err);
|
|
1579
|
+
}
|
|
1580
|
+
});
|
|
1581
|
+
} catch (error) {
|
|
1582
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1583
|
+
done(error);
|
|
1584
|
+
}
|
|
1585
|
+
}).timeout(attemptTimeout);
|
|
1586
|
+
});
|
|
1587
|
+
|
|
1588
|
+
describe('#scanDownload - errors', () => {
|
|
1589
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1590
|
+
try {
|
|
1591
|
+
a.scanDownload((data, error) => {
|
|
1592
|
+
try {
|
|
1593
|
+
if (stub) {
|
|
1594
|
+
const displayE = 'Error 400 received on request';
|
|
1595
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1596
|
+
} else {
|
|
1597
|
+
runCommonAsserts(data, error);
|
|
1598
|
+
}
|
|
1599
|
+
saveMockData('WebApplicationScanningWASAPIV3', 'scanDownload', 'default', data);
|
|
1600
|
+
done();
|
|
1601
|
+
} catch (err) {
|
|
1602
|
+
log.error(`Test Failure: ${err}`);
|
|
1603
|
+
done(err);
|
|
1604
|
+
}
|
|
1605
|
+
});
|
|
1606
|
+
} catch (error) {
|
|
1607
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1608
|
+
done(error);
|
|
1609
|
+
}
|
|
1610
|
+
}).timeout(attemptTimeout);
|
|
1611
|
+
});
|
|
1612
|
+
|
|
1613
|
+
describe('#appCount - errors', () => {
|
|
1614
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1615
|
+
try {
|
|
1616
|
+
a.appCount((data, error) => {
|
|
1617
|
+
try {
|
|
1618
|
+
if (stub) {
|
|
1619
|
+
const displayE = 'Error 400 received on request';
|
|
1620
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1621
|
+
} else {
|
|
1622
|
+
runCommonAsserts(data, error);
|
|
1623
|
+
}
|
|
1624
|
+
saveMockData('WebApplicationScanningWASAPIV3', 'appCount', 'default', data);
|
|
1625
|
+
done();
|
|
1626
|
+
} catch (err) {
|
|
1627
|
+
log.error(`Test Failure: ${err}`);
|
|
1628
|
+
done(err);
|
|
1629
|
+
}
|
|
1630
|
+
});
|
|
1631
|
+
} catch (error) {
|
|
1632
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1633
|
+
done(error);
|
|
1634
|
+
}
|
|
1635
|
+
}).timeout(attemptTimeout);
|
|
1636
|
+
});
|
|
1637
|
+
|
|
1638
|
+
const ignoreFilter = 'fakedata';
|
|
1639
|
+
const ignoreSort = 'fakedata';
|
|
1640
|
+
const ignoreGroupBy = [];
|
|
1641
|
+
const ignoreLimit = 'fakedata';
|
|
1642
|
+
const ignoreInterval = 'fakedata';
|
|
1643
|
+
describe('#postGetignoredeventscount - errors', () => {
|
|
1644
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1645
|
+
try {
|
|
1646
|
+
a.postGetignoredeventscount(ignoreFilter, ignoreGroupBy, ignoreLimit, ignoreInterval, ignoreSort, (data, error) => {
|
|
1647
|
+
try {
|
|
1648
|
+
if (stub) {
|
|
1649
|
+
const displayE = 'Error 400 received on request';
|
|
1650
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1651
|
+
} else {
|
|
1652
|
+
runCommonAsserts(data, error);
|
|
1653
|
+
}
|
|
1654
|
+
saveMockData('Ignore', 'postGetignoredeventscount', 'default', data);
|
|
1655
|
+
done();
|
|
1656
|
+
} catch (err) {
|
|
1657
|
+
log.error(`Test Failure: ${err}`);
|
|
1658
|
+
done(err);
|
|
1659
|
+
}
|
|
1660
|
+
});
|
|
1661
|
+
} catch (error) {
|
|
1662
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1663
|
+
done(error);
|
|
1664
|
+
}
|
|
1665
|
+
}).timeout(attemptTimeout);
|
|
1666
|
+
});
|
|
1667
|
+
|
|
1668
|
+
const ignorePageNumber = 'fakedata';
|
|
1669
|
+
const ignorePageSize = 'fakedata';
|
|
1670
|
+
const ignoreSearchAfter = [];
|
|
1671
|
+
describe('#postAPIstofetchFIMeventdataforignoredevents - errors', () => {
|
|
1672
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1673
|
+
try {
|
|
1674
|
+
a.postAPIstofetchFIMeventdataforignoredevents(ignoreFilter, ignoreGroupBy, ignorePageNumber, ignorePageSize, ignoreSort, ignoreSearchAfter, (data, error) => {
|
|
1675
|
+
try {
|
|
1676
|
+
if (stub) {
|
|
1677
|
+
const displayE = 'Error 400 received on request';
|
|
1678
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1679
|
+
} else {
|
|
1680
|
+
runCommonAsserts(data, error);
|
|
1681
|
+
}
|
|
1682
|
+
saveMockData('Ignore', 'postAPIstofetchFIMeventdataforignoredevents', 'default', data);
|
|
1683
|
+
done();
|
|
1684
|
+
} catch (err) {
|
|
1685
|
+
log.error(`Test Failure: ${err}`);
|
|
1686
|
+
done(err);
|
|
1687
|
+
}
|
|
1688
|
+
});
|
|
1689
|
+
} catch (error) {
|
|
1690
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1691
|
+
done(error);
|
|
1692
|
+
}
|
|
1693
|
+
}).timeout(attemptTimeout);
|
|
1694
|
+
});
|
|
1695
|
+
|
|
1696
|
+
describe('#aPIstofetchFIMeventdataforignoredevents - errors', () => {
|
|
1697
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1698
|
+
try {
|
|
1699
|
+
a.aPIstofetchFIMeventdataforignoredevents(ignoreFilter, ignorePageNumber, ignorePageSize, ignoreSort, (data, error) => {
|
|
1700
|
+
try {
|
|
1701
|
+
if (stub) {
|
|
1702
|
+
const displayE = 'Error 400 received on request';
|
|
1703
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1704
|
+
} else {
|
|
1705
|
+
runCommonAsserts(data, error);
|
|
1706
|
+
}
|
|
1707
|
+
saveMockData('Ignore', 'aPIstofetchFIMeventdataforignoredevents', 'default', data);
|
|
1708
|
+
done();
|
|
1709
|
+
} catch (err) {
|
|
1710
|
+
log.error(`Test Failure: ${err}`);
|
|
1711
|
+
done(err);
|
|
1712
|
+
}
|
|
1713
|
+
});
|
|
1714
|
+
} catch (error) {
|
|
1715
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1716
|
+
done(error);
|
|
1717
|
+
}
|
|
1718
|
+
}).timeout(attemptTimeout);
|
|
1719
|
+
});
|
|
1720
|
+
|
|
1721
|
+
describe('#getignoredeventscount - errors', () => {
|
|
1722
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1723
|
+
try {
|
|
1724
|
+
a.getignoredeventscount(ignoreFilter, ignoreGroupBy, ignoreLimit, ignoreSort, ignoreInterval, (data, error) => {
|
|
1725
|
+
try {
|
|
1726
|
+
if (stub) {
|
|
1727
|
+
const displayE = 'Error 400 received on request';
|
|
1728
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1729
|
+
} else {
|
|
1730
|
+
runCommonAsserts(data, error);
|
|
1731
|
+
}
|
|
1732
|
+
saveMockData('Ignore', 'getignoredeventscount', 'default', data);
|
|
1733
|
+
done();
|
|
1734
|
+
} catch (err) {
|
|
1735
|
+
log.error(`Test Failure: ${err}`);
|
|
1736
|
+
done(err);
|
|
1737
|
+
}
|
|
1738
|
+
});
|
|
1739
|
+
} catch (error) {
|
|
1740
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1741
|
+
done(error);
|
|
1742
|
+
}
|
|
1743
|
+
}).timeout(attemptTimeout);
|
|
1744
|
+
});
|
|
1745
|
+
|
|
1746
|
+
const ignoreIgnoredEventId = 'fakedata';
|
|
1747
|
+
describe('#fetchignoredeventdetails - errors', () => {
|
|
1748
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1749
|
+
try {
|
|
1750
|
+
a.fetchignoredeventdetails(ignoreIgnoredEventId, (data, error) => {
|
|
1751
|
+
try {
|
|
1752
|
+
if (stub) {
|
|
1753
|
+
const displayE = 'Error 400 received on request';
|
|
1754
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1755
|
+
} else {
|
|
1756
|
+
runCommonAsserts(data, error);
|
|
1757
|
+
}
|
|
1758
|
+
saveMockData('Ignore', 'fetchignoredeventdetails', 'default', data);
|
|
1759
|
+
done();
|
|
1760
|
+
} catch (err) {
|
|
1761
|
+
log.error(`Test Failure: ${err}`);
|
|
1762
|
+
done(err);
|
|
1763
|
+
}
|
|
1764
|
+
});
|
|
1765
|
+
} catch (error) {
|
|
1766
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1767
|
+
done(error);
|
|
1768
|
+
}
|
|
1769
|
+
}).timeout(attemptTimeout);
|
|
1770
|
+
});
|
|
1771
|
+
|
|
1772
|
+
describe('#fetchignoredeventdetails1 - errors', () => {
|
|
1773
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1774
|
+
try {
|
|
1775
|
+
a.fetchignoredeventdetails1(ignoreIgnoredEventId, (data, error) => {
|
|
1776
|
+
try {
|
|
1777
|
+
if (stub) {
|
|
1778
|
+
const displayE = 'Error 400 received on request';
|
|
1779
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1780
|
+
} else {
|
|
1781
|
+
runCommonAsserts(data, error);
|
|
1782
|
+
}
|
|
1783
|
+
saveMockData('Ignore', 'fetchignoredeventdetails1', 'default', data);
|
|
1784
|
+
done();
|
|
1785
|
+
} catch (err) {
|
|
1786
|
+
log.error(`Test Failure: ${err}`);
|
|
1787
|
+
done(err);
|
|
1788
|
+
}
|
|
1789
|
+
});
|
|
1790
|
+
} catch (error) {
|
|
1791
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1792
|
+
done(error);
|
|
1793
|
+
}
|
|
1794
|
+
}).timeout(attemptTimeout);
|
|
1795
|
+
});
|
|
1796
|
+
|
|
1797
|
+
const eventsFilter = 'fakedata';
|
|
1798
|
+
const eventsSort = 'fakedata';
|
|
1799
|
+
const eventsIncidentContext = 'fakedata';
|
|
1800
|
+
const eventsIncidentIds = 'fakedata';
|
|
1801
|
+
const eventsGroupBy = [];
|
|
1802
|
+
const eventsInterval = 'fakedata';
|
|
1803
|
+
describe('#postGeteventcountwithinadaterange - errors', () => {
|
|
1804
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1805
|
+
try {
|
|
1806
|
+
a.postGeteventcountwithinadaterange(eventsFilter, eventsGroupBy, eventsInterval, eventsSort, eventsIncidentContext, eventsIncidentIds, (data, error) => {
|
|
1807
|
+
try {
|
|
1808
|
+
if (stub) {
|
|
1809
|
+
const displayE = 'Error 400 received on request';
|
|
1810
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1811
|
+
} else {
|
|
1812
|
+
runCommonAsserts(data, error);
|
|
1813
|
+
}
|
|
1814
|
+
saveMockData('Events', 'postGeteventcountwithinadaterange', 'default', data);
|
|
1815
|
+
done();
|
|
1816
|
+
} catch (err) {
|
|
1817
|
+
log.error(`Test Failure: ${err}`);
|
|
1818
|
+
done(err);
|
|
1819
|
+
}
|
|
1820
|
+
});
|
|
1821
|
+
} catch (error) {
|
|
1822
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1823
|
+
done(error);
|
|
1824
|
+
}
|
|
1825
|
+
}).timeout(attemptTimeout);
|
|
1826
|
+
});
|
|
1827
|
+
|
|
1828
|
+
const eventsPageNumber = 'fakedata';
|
|
1829
|
+
const eventsPageSize = 'fakedata';
|
|
1830
|
+
const eventsSearchAfter = [];
|
|
1831
|
+
describe('#postAPIstofetchFIMeventdata - errors', () => {
|
|
1832
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1833
|
+
try {
|
|
1834
|
+
a.postAPIstofetchFIMeventdata(eventsFilter, eventsGroupBy, eventsPageNumber, eventsPageSize, eventsSort, eventsIncidentContext, eventsIncidentIds, eventsSearchAfter, (data, error) => {
|
|
1835
|
+
try {
|
|
1836
|
+
if (stub) {
|
|
1837
|
+
const displayE = 'Error 400 received on request';
|
|
1838
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1839
|
+
} else {
|
|
1840
|
+
runCommonAsserts(data, error);
|
|
1841
|
+
}
|
|
1842
|
+
saveMockData('Events', 'postAPIstofetchFIMeventdata', 'default', data);
|
|
1843
|
+
done();
|
|
1844
|
+
} catch (err) {
|
|
1845
|
+
log.error(`Test Failure: ${err}`);
|
|
1846
|
+
done(err);
|
|
1847
|
+
}
|
|
1848
|
+
});
|
|
1849
|
+
} catch (error) {
|
|
1850
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1851
|
+
done(error);
|
|
1852
|
+
}
|
|
1853
|
+
}).timeout(attemptTimeout);
|
|
1854
|
+
});
|
|
1855
|
+
|
|
1856
|
+
const eventsLimit = 'fakedata';
|
|
1857
|
+
const eventsIncidentId = 'fakedata';
|
|
1858
|
+
describe('#postGeteventcountforanincident - errors', () => {
|
|
1859
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1860
|
+
try {
|
|
1861
|
+
a.postGeteventcountforanincident(eventsIncidentId, eventsFilter, eventsGroupBy, eventsLimit, eventsInterval, eventsSort, (data, error) => {
|
|
1862
|
+
try {
|
|
1863
|
+
if (stub) {
|
|
1864
|
+
const displayE = 'Error 400 received on request';
|
|
1865
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1866
|
+
} else {
|
|
1867
|
+
runCommonAsserts(data, error);
|
|
1868
|
+
}
|
|
1869
|
+
saveMockData('Events', 'postGeteventcountforanincident', 'default', data);
|
|
1870
|
+
done();
|
|
1871
|
+
} catch (err) {
|
|
1872
|
+
log.error(`Test Failure: ${err}`);
|
|
1873
|
+
done(err);
|
|
1874
|
+
}
|
|
1875
|
+
});
|
|
1876
|
+
} catch (error) {
|
|
1877
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1878
|
+
done(error);
|
|
1879
|
+
}
|
|
1880
|
+
}).timeout(attemptTimeout);
|
|
1881
|
+
});
|
|
1882
|
+
|
|
1883
|
+
const eventsAttributes = 'fakedata';
|
|
1884
|
+
describe('#postFetcheventsforanincident - errors', () => {
|
|
1885
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1886
|
+
try {
|
|
1887
|
+
a.postFetcheventsforanincident(eventsIncidentId, eventsFilter, eventsPageNumber, eventsPageSize, eventsAttributes, eventsSort, (data, error) => {
|
|
1888
|
+
try {
|
|
1889
|
+
if (stub) {
|
|
1890
|
+
const displayE = 'Error 400 received on request';
|
|
1891
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1892
|
+
} else {
|
|
1893
|
+
runCommonAsserts(data, error);
|
|
1894
|
+
}
|
|
1895
|
+
saveMockData('Events', 'postFetcheventsforanincident', 'default', data);
|
|
1896
|
+
done();
|
|
1897
|
+
} catch (err) {
|
|
1898
|
+
log.error(`Test Failure: ${err}`);
|
|
1899
|
+
done(err);
|
|
1900
|
+
}
|
|
1901
|
+
});
|
|
1902
|
+
} catch (error) {
|
|
1903
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1904
|
+
done(error);
|
|
1905
|
+
}
|
|
1906
|
+
}).timeout(attemptTimeout);
|
|
1907
|
+
});
|
|
1908
|
+
|
|
1909
|
+
describe('#aPIstofetchFIMeventdata - errors', () => {
|
|
1910
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1911
|
+
try {
|
|
1912
|
+
a.aPIstofetchFIMeventdata(eventsFilter, eventsPageNumber, eventsPageSize, eventsSort, eventsIncidentContext, eventsIncidentIds, (data, error) => {
|
|
1913
|
+
try {
|
|
1914
|
+
if (stub) {
|
|
1915
|
+
const displayE = 'Error 400 received on request';
|
|
1916
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1917
|
+
} else {
|
|
1918
|
+
runCommonAsserts(data, error);
|
|
1919
|
+
}
|
|
1920
|
+
saveMockData('Events', 'aPIstofetchFIMeventdata', 'default', data);
|
|
1921
|
+
done();
|
|
1922
|
+
} catch (err) {
|
|
1923
|
+
log.error(`Test Failure: ${err}`);
|
|
1924
|
+
done(err);
|
|
1925
|
+
}
|
|
1926
|
+
});
|
|
1927
|
+
} catch (error) {
|
|
1928
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1929
|
+
done(error);
|
|
1930
|
+
}
|
|
1931
|
+
}).timeout(attemptTimeout);
|
|
1932
|
+
});
|
|
1933
|
+
|
|
1934
|
+
describe('#geteventcountwithinadaterange - errors', () => {
|
|
1935
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1936
|
+
try {
|
|
1937
|
+
a.geteventcountwithinadaterange(eventsFilter, eventsGroupBy, eventsLimit, eventsSort, eventsInterval, eventsIncidentContext, eventsIncidentIds, (data, error) => {
|
|
1938
|
+
try {
|
|
1939
|
+
if (stub) {
|
|
1940
|
+
const displayE = 'Error 400 received on request';
|
|
1941
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1942
|
+
} else {
|
|
1943
|
+
runCommonAsserts(data, error);
|
|
1944
|
+
}
|
|
1945
|
+
saveMockData('Events', 'geteventcountwithinadaterange', 'default', data);
|
|
1946
|
+
done();
|
|
1947
|
+
} catch (err) {
|
|
1948
|
+
log.error(`Test Failure: ${err}`);
|
|
1949
|
+
done(err);
|
|
1950
|
+
}
|
|
1951
|
+
});
|
|
1952
|
+
} catch (error) {
|
|
1953
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1954
|
+
done(error);
|
|
1955
|
+
}
|
|
1956
|
+
}).timeout(attemptTimeout);
|
|
1957
|
+
});
|
|
1958
|
+
|
|
1959
|
+
const eventsEventId = 'fakedata';
|
|
1960
|
+
describe('#fetcheventdetails - errors', () => {
|
|
1961
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1962
|
+
try {
|
|
1963
|
+
a.fetcheventdetails(eventsEventId, (data, error) => {
|
|
1964
|
+
try {
|
|
1965
|
+
if (stub) {
|
|
1966
|
+
const displayE = 'Error 400 received on request';
|
|
1967
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1968
|
+
} else {
|
|
1969
|
+
runCommonAsserts(data, error);
|
|
1970
|
+
}
|
|
1971
|
+
saveMockData('Events', 'fetcheventdetails', 'default', data);
|
|
1972
|
+
done();
|
|
1973
|
+
} catch (err) {
|
|
1974
|
+
log.error(`Test Failure: ${err}`);
|
|
1975
|
+
done(err);
|
|
1976
|
+
}
|
|
1977
|
+
});
|
|
1978
|
+
} catch (error) {
|
|
1979
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1980
|
+
done(error);
|
|
1981
|
+
}
|
|
1982
|
+
}).timeout(attemptTimeout);
|
|
1983
|
+
});
|
|
1984
|
+
|
|
1985
|
+
describe('#fetcheventsforanincident - errors', () => {
|
|
1986
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1987
|
+
try {
|
|
1988
|
+
a.fetcheventsforanincident(eventsFilter, eventsPageNumber, eventsPageSize, eventsSort, eventsAttributes, eventsIncidentId, (data, error) => {
|
|
1989
|
+
try {
|
|
1990
|
+
if (stub) {
|
|
1991
|
+
const displayE = 'Error 400 received on request';
|
|
1992
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
1993
|
+
} else {
|
|
1994
|
+
runCommonAsserts(data, error);
|
|
1995
|
+
}
|
|
1996
|
+
saveMockData('Events', 'fetcheventsforanincident', 'default', data);
|
|
1997
|
+
done();
|
|
1998
|
+
} catch (err) {
|
|
1999
|
+
log.error(`Test Failure: ${err}`);
|
|
2000
|
+
done(err);
|
|
2001
|
+
}
|
|
2002
|
+
});
|
|
2003
|
+
} catch (error) {
|
|
2004
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2005
|
+
done(error);
|
|
2006
|
+
}
|
|
2007
|
+
}).timeout(attemptTimeout);
|
|
2008
|
+
});
|
|
2009
|
+
|
|
2010
|
+
describe('#geteventcountforanincident - errors', () => {
|
|
2011
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2012
|
+
try {
|
|
2013
|
+
a.geteventcountforanincident(eventsFilter, eventsGroupBy, eventsLimit, eventsSort, eventsInterval, eventsIncidentId, (data, error) => {
|
|
2014
|
+
try {
|
|
2015
|
+
if (stub) {
|
|
2016
|
+
const displayE = 'Error 400 received on request';
|
|
2017
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2018
|
+
} else {
|
|
2019
|
+
runCommonAsserts(data, error);
|
|
2020
|
+
}
|
|
2021
|
+
saveMockData('Events', 'geteventcountforanincident', 'default', data);
|
|
2022
|
+
done();
|
|
2023
|
+
} catch (err) {
|
|
2024
|
+
log.error(`Test Failure: ${err}`);
|
|
2025
|
+
done(err);
|
|
2026
|
+
}
|
|
2027
|
+
});
|
|
2028
|
+
} catch (error) {
|
|
2029
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2030
|
+
done(error);
|
|
2031
|
+
}
|
|
2032
|
+
}).timeout(attemptTimeout);
|
|
2033
|
+
});
|
|
2034
|
+
|
|
2035
|
+
describe('#fetcheventdetails1 - errors', () => {
|
|
2036
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2037
|
+
try {
|
|
2038
|
+
a.fetcheventdetails1(eventsEventId, (data, error) => {
|
|
2039
|
+
try {
|
|
2040
|
+
if (stub) {
|
|
2041
|
+
const displayE = 'Error 400 received on request';
|
|
2042
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2043
|
+
} else {
|
|
2044
|
+
runCommonAsserts(data, error);
|
|
2045
|
+
}
|
|
2046
|
+
saveMockData('Events', 'fetcheventdetails1', 'default', data);
|
|
2047
|
+
done();
|
|
2048
|
+
} catch (err) {
|
|
2049
|
+
log.error(`Test Failure: ${err}`);
|
|
2050
|
+
done(err);
|
|
2051
|
+
}
|
|
2052
|
+
});
|
|
2053
|
+
} catch (error) {
|
|
2054
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2055
|
+
done(error);
|
|
2056
|
+
}
|
|
2057
|
+
}).timeout(attemptTimeout);
|
|
2058
|
+
});
|
|
2059
|
+
|
|
2060
|
+
const incidentsFilter = 'fakedata';
|
|
2061
|
+
const incidentsSort = 'fakedata';
|
|
2062
|
+
const incidentsGroupBy = [];
|
|
2063
|
+
const incidentsLimit = 'fakedata';
|
|
2064
|
+
const incidentsInterval = 'fakedata';
|
|
2065
|
+
describe('#postGetincidentcount - errors', () => {
|
|
2066
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2067
|
+
try {
|
|
2068
|
+
a.postGetincidentcount(incidentsFilter, incidentsGroupBy, incidentsLimit, incidentsInterval, incidentsSort, (data, error) => {
|
|
2069
|
+
try {
|
|
2070
|
+
if (stub) {
|
|
2071
|
+
const displayE = 'Error 400 received on request';
|
|
2072
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2073
|
+
} else {
|
|
2074
|
+
runCommonAsserts(data, error);
|
|
2075
|
+
}
|
|
2076
|
+
saveMockData('Incidents', 'postGetincidentcount', 'default', data);
|
|
2077
|
+
done();
|
|
2078
|
+
} catch (err) {
|
|
2079
|
+
log.error(`Test Failure: ${err}`);
|
|
2080
|
+
done(err);
|
|
2081
|
+
}
|
|
2082
|
+
});
|
|
2083
|
+
} catch (error) {
|
|
2084
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2085
|
+
done(error);
|
|
2086
|
+
}
|
|
2087
|
+
}).timeout(attemptTimeout);
|
|
2088
|
+
});
|
|
2089
|
+
|
|
2090
|
+
const incidentsPageNumber = 'fakedata';
|
|
2091
|
+
const incidentsPageSize = 'fakedata';
|
|
2092
|
+
const incidentsAttributes = 'fakedata';
|
|
2093
|
+
describe('#postAPIstofetchFIMincidentdata - errors', () => {
|
|
2094
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2095
|
+
try {
|
|
2096
|
+
a.postAPIstofetchFIMincidentdata(incidentsFilter, incidentsPageNumber, incidentsPageSize, incidentsAttributes, incidentsSort, (data, error) => {
|
|
2097
|
+
try {
|
|
2098
|
+
if (stub) {
|
|
2099
|
+
const displayE = 'Error 400 received on request';
|
|
2100
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2101
|
+
} else {
|
|
2102
|
+
runCommonAsserts(data, error);
|
|
2103
|
+
}
|
|
2104
|
+
saveMockData('Incidents', 'postAPIstofetchFIMincidentdata', 'default', data);
|
|
2105
|
+
done();
|
|
2106
|
+
} catch (err) {
|
|
2107
|
+
log.error(`Test Failure: ${err}`);
|
|
2108
|
+
done(err);
|
|
2109
|
+
}
|
|
2110
|
+
});
|
|
2111
|
+
} catch (error) {
|
|
2112
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2113
|
+
done(error);
|
|
2114
|
+
}
|
|
2115
|
+
}).timeout(attemptTimeout);
|
|
2116
|
+
});
|
|
2117
|
+
|
|
2118
|
+
describe('#aPIstofetchFIMincidentdata - errors', () => {
|
|
2119
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2120
|
+
try {
|
|
2121
|
+
a.aPIstofetchFIMincidentdata(incidentsFilter, incidentsPageNumber, incidentsPageSize, incidentsSort, incidentsAttributes, (data, error) => {
|
|
2122
|
+
try {
|
|
2123
|
+
if (stub) {
|
|
2124
|
+
const displayE = 'Error 400 received on request';
|
|
2125
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2126
|
+
} else {
|
|
2127
|
+
runCommonAsserts(data, error);
|
|
2128
|
+
}
|
|
2129
|
+
saveMockData('Incidents', 'aPIstofetchFIMincidentdata', 'default', data);
|
|
2130
|
+
done();
|
|
2131
|
+
} catch (err) {
|
|
2132
|
+
log.error(`Test Failure: ${err}`);
|
|
2133
|
+
done(err);
|
|
2134
|
+
}
|
|
2135
|
+
});
|
|
2136
|
+
} catch (error) {
|
|
2137
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2138
|
+
done(error);
|
|
2139
|
+
}
|
|
2140
|
+
}).timeout(attemptTimeout);
|
|
2141
|
+
});
|
|
2142
|
+
|
|
2143
|
+
describe('#getincidentcount - errors', () => {
|
|
2144
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2145
|
+
try {
|
|
2146
|
+
a.getincidentcount(incidentsFilter, incidentsGroupBy, incidentsLimit, incidentsSort, incidentsInterval, (data, error) => {
|
|
2147
|
+
try {
|
|
2148
|
+
if (stub) {
|
|
2149
|
+
const displayE = 'Error 400 received on request';
|
|
2150
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2151
|
+
} else {
|
|
2152
|
+
runCommonAsserts(data, error);
|
|
2153
|
+
}
|
|
2154
|
+
saveMockData('Incidents', 'getincidentcount', 'default', data);
|
|
2155
|
+
done();
|
|
2156
|
+
} catch (err) {
|
|
2157
|
+
log.error(`Test Failure: ${err}`);
|
|
2158
|
+
done(err);
|
|
2159
|
+
}
|
|
2160
|
+
});
|
|
2161
|
+
} catch (error) {
|
|
2162
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2163
|
+
done(error);
|
|
2164
|
+
}
|
|
2165
|
+
}).timeout(attemptTimeout);
|
|
2166
|
+
});
|
|
2167
|
+
|
|
2168
|
+
describe('#detectionsCount - errors', () => {
|
|
2169
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2170
|
+
try {
|
|
2171
|
+
a.detectionsCount((data, error) => {
|
|
2172
|
+
try {
|
|
2173
|
+
if (stub) {
|
|
2174
|
+
const displayE = 'Error 400 received on request';
|
|
2175
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2176
|
+
} else {
|
|
2177
|
+
runCommonAsserts(data, error);
|
|
2178
|
+
}
|
|
2179
|
+
saveMockData('MalwareDetectionMDAPIV1', 'detectionsCount', 'default', data);
|
|
2180
|
+
done();
|
|
2181
|
+
} catch (err) {
|
|
2182
|
+
log.error(`Test Failure: ${err}`);
|
|
2183
|
+
done(err);
|
|
2184
|
+
}
|
|
2185
|
+
});
|
|
2186
|
+
} catch (error) {
|
|
2187
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2188
|
+
done(error);
|
|
2189
|
+
}
|
|
2190
|
+
}).timeout(attemptTimeout);
|
|
2191
|
+
});
|
|
2192
|
+
|
|
2193
|
+
describe('#alertsSearchbycriteria - errors', () => {
|
|
2194
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2195
|
+
try {
|
|
2196
|
+
a.alertsSearchbycriteria((data, error) => {
|
|
2197
|
+
try {
|
|
2198
|
+
if (stub) {
|
|
2199
|
+
const displayE = 'Error 400 received on request';
|
|
2200
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2201
|
+
} else {
|
|
2202
|
+
runCommonAsserts(data, error);
|
|
2203
|
+
}
|
|
2204
|
+
saveMockData('MalwareDetectionMDAPIV1', 'alertsSearchbycriteria', 'default', data);
|
|
2205
|
+
done();
|
|
2206
|
+
} catch (err) {
|
|
2207
|
+
log.error(`Test Failure: ${err}`);
|
|
2208
|
+
done(err);
|
|
2209
|
+
}
|
|
2210
|
+
});
|
|
2211
|
+
} catch (error) {
|
|
2212
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2213
|
+
done(error);
|
|
2214
|
+
}
|
|
2215
|
+
}).timeout(attemptTimeout);
|
|
2216
|
+
});
|
|
2217
|
+
|
|
2218
|
+
describe('#alertsViewdetailsbyid - errors', () => {
|
|
2219
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2220
|
+
try {
|
|
2221
|
+
a.alertsViewdetailsbyid((data, error) => {
|
|
2222
|
+
try {
|
|
2223
|
+
if (stub) {
|
|
2224
|
+
const displayE = 'Error 400 received on request';
|
|
2225
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2226
|
+
} else {
|
|
2227
|
+
runCommonAsserts(data, error);
|
|
2228
|
+
}
|
|
2229
|
+
saveMockData('MalwareDetectionMDAPIV1', 'alertsViewdetailsbyid', 'default', data);
|
|
2230
|
+
done();
|
|
2231
|
+
} catch (err) {
|
|
2232
|
+
log.error(`Test Failure: ${err}`);
|
|
2233
|
+
done(err);
|
|
2234
|
+
}
|
|
2235
|
+
});
|
|
2236
|
+
} catch (error) {
|
|
2237
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2238
|
+
done(error);
|
|
2239
|
+
}
|
|
2240
|
+
}).timeout(attemptTimeout);
|
|
2241
|
+
});
|
|
2242
|
+
|
|
2243
|
+
const continuousMonitoringCMAPIV1Format = 'fakedata';
|
|
2244
|
+
describe('#alertsDownloadbycriteria - errors', () => {
|
|
2245
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2246
|
+
try {
|
|
2247
|
+
a.alertsDownloadbycriteria(continuousMonitoringCMAPIV1Format, (data, error) => {
|
|
2248
|
+
try {
|
|
2249
|
+
if (stub) {
|
|
2250
|
+
const displayE = 'Error 400 received on request';
|
|
2251
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2252
|
+
} else {
|
|
2253
|
+
runCommonAsserts(data, error);
|
|
2254
|
+
}
|
|
2255
|
+
saveMockData('ContinuousMonitoringCMAPIV1', 'alertsDownloadbycriteria', 'default', data);
|
|
2256
|
+
done();
|
|
2257
|
+
} catch (err) {
|
|
2258
|
+
log.error(`Test Failure: ${err}`);
|
|
2259
|
+
done(err);
|
|
2260
|
+
}
|
|
2261
|
+
});
|
|
2262
|
+
} catch (error) {
|
|
2263
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2264
|
+
done(error);
|
|
2265
|
+
}
|
|
2266
|
+
}).timeout(attemptTimeout);
|
|
2267
|
+
});
|
|
2268
|
+
|
|
2269
|
+
describe('#profilesSearchbycriteria - errors', () => {
|
|
2270
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2271
|
+
try {
|
|
2272
|
+
a.profilesSearchbycriteria((data, error) => {
|
|
2273
|
+
try {
|
|
2274
|
+
if (stub) {
|
|
2275
|
+
const displayE = 'Error 400 received on request';
|
|
2276
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2277
|
+
} else {
|
|
2278
|
+
runCommonAsserts(data, error);
|
|
2279
|
+
}
|
|
2280
|
+
saveMockData('ContinuousMonitoringCMAPIV1', 'profilesSearchbycriteria', '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
|
+
describe('#rulesSearchbycriteria - errors', () => {
|
|
2295
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2296
|
+
try {
|
|
2297
|
+
a.rulesSearchbycriteria((data, error) => {
|
|
2298
|
+
try {
|
|
2299
|
+
if (stub) {
|
|
2300
|
+
const displayE = 'Error 400 received on request';
|
|
2301
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2302
|
+
} else {
|
|
2303
|
+
runCommonAsserts(data, error);
|
|
2304
|
+
}
|
|
2305
|
+
saveMockData('ContinuousMonitoringCMAPIV1', 'rulesSearchbycriteria', 'default', data);
|
|
2306
|
+
done();
|
|
2307
|
+
} catch (err) {
|
|
2308
|
+
log.error(`Test Failure: ${err}`);
|
|
2309
|
+
done(err);
|
|
2310
|
+
}
|
|
2311
|
+
});
|
|
2312
|
+
} catch (error) {
|
|
2313
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2314
|
+
done(error);
|
|
2315
|
+
}
|
|
2316
|
+
}).timeout(attemptTimeout);
|
|
2317
|
+
});
|
|
2318
|
+
|
|
2319
|
+
describe('#rulesetsSearchbycriteria - errors', () => {
|
|
2320
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2321
|
+
try {
|
|
2322
|
+
a.rulesetsSearchbycriteria((data, error) => {
|
|
2323
|
+
try {
|
|
2324
|
+
if (stub) {
|
|
2325
|
+
const displayE = 'Error 400 received on request';
|
|
2326
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2327
|
+
} else {
|
|
2328
|
+
runCommonAsserts(data, error);
|
|
2329
|
+
}
|
|
2330
|
+
saveMockData('ContinuousMonitoringCMAPIV1', 'rulesetsSearchbycriteria', 'default', data);
|
|
2331
|
+
done();
|
|
2332
|
+
} catch (err) {
|
|
2333
|
+
log.error(`Test Failure: ${err}`);
|
|
2334
|
+
done(err);
|
|
2335
|
+
}
|
|
2336
|
+
});
|
|
2337
|
+
} catch (error) {
|
|
2338
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2339
|
+
done(error);
|
|
2340
|
+
}
|
|
2341
|
+
}).timeout(attemptTimeout);
|
|
2342
|
+
});
|
|
2343
|
+
|
|
2344
|
+
describe('#getAlertsViewdetailsbyid - errors', () => {
|
|
2345
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2346
|
+
try {
|
|
2347
|
+
a.getAlertsViewdetailsbyid((data, error) => {
|
|
2348
|
+
try {
|
|
2349
|
+
if (stub) {
|
|
2350
|
+
const displayE = 'Error 400 received on request';
|
|
2351
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2352
|
+
} else {
|
|
2353
|
+
runCommonAsserts(data, error);
|
|
2354
|
+
}
|
|
2355
|
+
saveMockData('ContinuousMonitoringCMAPIV1', 'getAlertsViewdetailsbyid', 'default', data);
|
|
2356
|
+
done();
|
|
2357
|
+
} catch (err) {
|
|
2358
|
+
log.error(`Test Failure: ${err}`);
|
|
2359
|
+
done(err);
|
|
2360
|
+
}
|
|
2361
|
+
});
|
|
2362
|
+
} catch (error) {
|
|
2363
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2364
|
+
done(error);
|
|
2365
|
+
}
|
|
2366
|
+
}).timeout(attemptTimeout);
|
|
2367
|
+
});
|
|
2368
|
+
|
|
2369
|
+
describe('#profilesViewdetailsbyid - errors', () => {
|
|
2370
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2371
|
+
try {
|
|
2372
|
+
a.profilesViewdetailsbyid((data, error) => {
|
|
2373
|
+
try {
|
|
2374
|
+
if (stub) {
|
|
2375
|
+
const displayE = 'Error 400 received on request';
|
|
2376
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2377
|
+
} else {
|
|
2378
|
+
runCommonAsserts(data, error);
|
|
2379
|
+
}
|
|
2380
|
+
saveMockData('ContinuousMonitoringCMAPIV1', 'profilesViewdetailsbyid', 'default', data);
|
|
2381
|
+
done();
|
|
2382
|
+
} catch (err) {
|
|
2383
|
+
log.error(`Test Failure: ${err}`);
|
|
2384
|
+
done(err);
|
|
2385
|
+
}
|
|
2386
|
+
});
|
|
2387
|
+
} catch (error) {
|
|
2388
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2389
|
+
done(error);
|
|
2390
|
+
}
|
|
2391
|
+
}).timeout(attemptTimeout);
|
|
2392
|
+
});
|
|
2393
|
+
|
|
2394
|
+
describe('#rulesViewdetailsbyid - errors', () => {
|
|
2395
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2396
|
+
try {
|
|
2397
|
+
a.rulesViewdetailsbyid((data, error) => {
|
|
2398
|
+
try {
|
|
2399
|
+
if (stub) {
|
|
2400
|
+
const displayE = 'Error 400 received on request';
|
|
2401
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2402
|
+
} else {
|
|
2403
|
+
runCommonAsserts(data, error);
|
|
2404
|
+
}
|
|
2405
|
+
saveMockData('ContinuousMonitoringCMAPIV1', 'rulesViewdetailsbyid', 'default', data);
|
|
2406
|
+
done();
|
|
2407
|
+
} catch (err) {
|
|
2408
|
+
log.error(`Test Failure: ${err}`);
|
|
2409
|
+
done(err);
|
|
2410
|
+
}
|
|
2411
|
+
});
|
|
2412
|
+
} catch (error) {
|
|
2413
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2414
|
+
done(error);
|
|
2415
|
+
}
|
|
2416
|
+
}).timeout(attemptTimeout);
|
|
2417
|
+
});
|
|
2418
|
+
|
|
2419
|
+
describe('#rulesetsViewdetailsbyid - errors', () => {
|
|
2420
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2421
|
+
try {
|
|
2422
|
+
a.rulesetsViewdetailsbyid((data, error) => {
|
|
2423
|
+
try {
|
|
2424
|
+
if (stub) {
|
|
2425
|
+
const displayE = 'Error 400 received on request';
|
|
2426
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2427
|
+
} else {
|
|
2428
|
+
runCommonAsserts(data, error);
|
|
2429
|
+
}
|
|
2430
|
+
saveMockData('ContinuousMonitoringCMAPIV1', 'rulesetsViewdetailsbyid', 'default', data);
|
|
2431
|
+
done();
|
|
2432
|
+
} catch (err) {
|
|
2433
|
+
log.error(`Test Failure: ${err}`);
|
|
2434
|
+
done(err);
|
|
2435
|
+
}
|
|
2436
|
+
});
|
|
2437
|
+
} catch (error) {
|
|
2438
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2439
|
+
done(error);
|
|
2440
|
+
}
|
|
2441
|
+
}).timeout(attemptTimeout);
|
|
2442
|
+
});
|
|
2443
|
+
|
|
2444
|
+
const certViewAPIV1Host = 'fakedata';
|
|
2445
|
+
describe('#retrievehostassessmentsummary - errors', () => {
|
|
2446
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2447
|
+
try {
|
|
2448
|
+
a.retrievehostassessmentsummary(certViewAPIV1Host, (data, error) => {
|
|
2449
|
+
try {
|
|
2450
|
+
if (stub) {
|
|
2451
|
+
const displayE = 'Error 400 received on request';
|
|
2452
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2453
|
+
} else {
|
|
2454
|
+
runCommonAsserts(data, error);
|
|
2455
|
+
}
|
|
2456
|
+
saveMockData('CertViewAPIV1', 'retrievehostassessmentsummary', 'default', data);
|
|
2457
|
+
done();
|
|
2458
|
+
} catch (err) {
|
|
2459
|
+
log.error(`Test Failure: ${err}`);
|
|
2460
|
+
done(err);
|
|
2461
|
+
}
|
|
2462
|
+
});
|
|
2463
|
+
} catch (error) {
|
|
2464
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2465
|
+
done(error);
|
|
2466
|
+
}
|
|
2467
|
+
}).timeout(attemptTimeout);
|
|
2468
|
+
});
|
|
2469
|
+
|
|
2470
|
+
const certViewAPIV1Filter = 'fakedata';
|
|
2471
|
+
const certViewAPIV1PageNumber = 'fakedata';
|
|
2472
|
+
const certViewAPIV1PageSize = 555;
|
|
2473
|
+
const certViewAPIV1Sort = 'fakedata';
|
|
2474
|
+
describe('#getCertviewCertificatesforagivencustomer - errors', () => {
|
|
2475
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2476
|
+
try {
|
|
2477
|
+
a.getCertviewCertificatesforagivencustomer(certViewAPIV1Filter, certViewAPIV1PageNumber, certViewAPIV1PageSize, certViewAPIV1Sort, (data, error) => {
|
|
2478
|
+
try {
|
|
2479
|
+
if (stub) {
|
|
2480
|
+
const displayE = 'Error 400 received on request';
|
|
2481
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2482
|
+
} else {
|
|
2483
|
+
runCommonAsserts(data, error);
|
|
2484
|
+
}
|
|
2485
|
+
saveMockData('CertViewAPIV1', 'getCertviewCertificatesforagivencustomer', 'default', data);
|
|
2486
|
+
done();
|
|
2487
|
+
} catch (err) {
|
|
2488
|
+
log.error(`Test Failure: ${err}`);
|
|
2489
|
+
done(err);
|
|
2490
|
+
}
|
|
2491
|
+
});
|
|
2492
|
+
} catch (error) {
|
|
2493
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2494
|
+
done(error);
|
|
2495
|
+
}
|
|
2496
|
+
}).timeout(attemptTimeout);
|
|
2497
|
+
});
|
|
2498
|
+
|
|
2499
|
+
const globalITAssetInventoryITAMAIAPIV1AssetId = 555;
|
|
2500
|
+
describe('#fetchassetsdetailsforagivenassetid - errors', () => {
|
|
2501
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2502
|
+
try {
|
|
2503
|
+
a.fetchassetsdetailsforagivenassetid(globalITAssetInventoryITAMAIAPIV1AssetId, (data, error) => {
|
|
2504
|
+
try {
|
|
2505
|
+
if (stub) {
|
|
2506
|
+
const displayE = 'Error 400 received on request';
|
|
2507
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2508
|
+
} else {
|
|
2509
|
+
runCommonAsserts(data, error);
|
|
2510
|
+
}
|
|
2511
|
+
saveMockData('GlobalITAssetInventoryITAMAIAPIV1', 'fetchassetsdetailsforagivenassetid', 'default', data);
|
|
2512
|
+
done();
|
|
2513
|
+
} catch (err) {
|
|
2514
|
+
log.error(`Test Failure: ${err}`);
|
|
2515
|
+
done(err);
|
|
2516
|
+
}
|
|
2517
|
+
});
|
|
2518
|
+
} catch (error) {
|
|
2519
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2520
|
+
done(error);
|
|
2521
|
+
}
|
|
2522
|
+
}).timeout(attemptTimeout);
|
|
2523
|
+
});
|
|
2524
|
+
|
|
2525
|
+
const globalITAssetInventoryITAMAIAPIV1Filter = 'fakedata';
|
|
2526
|
+
const globalITAssetInventoryITAMAIAPIV1LastModifiedDate = 'fakedata';
|
|
2527
|
+
describe('#getcountofassetssatisfyingthefiltercriteria - errors', () => {
|
|
2528
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2529
|
+
try {
|
|
2530
|
+
a.getcountofassetssatisfyingthefiltercriteria(globalITAssetInventoryITAMAIAPIV1Filter, globalITAssetInventoryITAMAIAPIV1LastModifiedDate, (data, error) => {
|
|
2531
|
+
try {
|
|
2532
|
+
if (stub) {
|
|
2533
|
+
const displayE = 'Error 400 received on request';
|
|
2534
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2535
|
+
} else {
|
|
2536
|
+
runCommonAsserts(data, error);
|
|
2537
|
+
}
|
|
2538
|
+
saveMockData('GlobalITAssetInventoryITAMAIAPIV1', 'getcountofassetssatisfyingthefiltercriteria', '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
|
+
const globalITAssetInventoryITAMAIAPIV1PageSize = 555;
|
|
2553
|
+
describe('#fetchdetailsofallassetsforagivencustomer - errors', () => {
|
|
2554
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2555
|
+
try {
|
|
2556
|
+
a.fetchdetailsofallassetsforagivencustomer(globalITAssetInventoryITAMAIAPIV1LastModifiedDate, globalITAssetInventoryITAMAIAPIV1PageSize, (data, error) => {
|
|
2557
|
+
try {
|
|
2558
|
+
if (stub) {
|
|
2559
|
+
const displayE = 'Error 400 received on request';
|
|
2560
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-qualys-connectorRest-handleEndResponse', displayE);
|
|
2561
|
+
} else {
|
|
2562
|
+
runCommonAsserts(data, error);
|
|
2563
|
+
}
|
|
2564
|
+
saveMockData('GlobalITAssetInventoryITAMAIAPIV1', 'fetchdetailsofallassetsforagivencustomer', 'default', data);
|
|
2565
|
+
done();
|
|
2566
|
+
} catch (err) {
|
|
2567
|
+
log.error(`Test Failure: ${err}`);
|
|
2568
|
+
done(err);
|
|
2569
|
+
}
|
|
2570
|
+
});
|
|
2571
|
+
} catch (error) {
|
|
2572
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2573
|
+
done(error);
|
|
2574
|
+
}
|
|
2575
|
+
}).timeout(attemptTimeout);
|
|
2576
|
+
});
|
|
2577
|
+
});
|
|
2578
|
+
});
|