@itentialopensource/adapter-zscaler 0.8.2 → 0.9.0
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/CALLS.md +1116 -0
- package/CHANGELOG.md +16 -0
- package/TAB1.md +5 -0
- package/TAB2.md +1732 -0
- package/adapter.js +17190 -0
- package/entities/AdminRoleManagement/action.json +126 -0
- package/entities/AdminRoleManagement/schema.json +24 -0
- package/entities/AppViews/action.json +46 -0
- package/entities/AppViews/mockdatafiles/getViewApps-default.json +40 -0
- package/entities/AppViews/mockdatafiles/getViews-default.json +16 -0
- package/entities/AppViews/schema.json +20 -0
- package/entities/Applications/action.json +66 -0
- package/entities/Applications/mockdatafiles/appsSearchGET-default.json +186 -0
- package/entities/Applications/schema.json +21 -0
- package/entities/BrowserIsolation/action.json +25 -0
- package/entities/BrowserIsolation/mockdatafiles/getCloudBrowserIsolationProfiles-default.json +20 -0
- package/entities/BrowserIsolation/schema.json +19 -0
- package/entities/DataLossPrevention/action.json +767 -0
- package/entities/DataLossPrevention/mockdatafiles/getDLPDictionarySummary-default.json +808 -0
- package/entities/DataLossPrevention/mockdatafiles/getDLPEngines-default.json +26 -0
- package/entities/DataLossPrevention/mockdatafiles/getDLPEnginesSummary-default.json +18 -0
- package/entities/DataLossPrevention/mockdatafiles/getDlpDictionaries-default.json +402 -0
- package/entities/DataLossPrevention/mockdatafiles/getICAPServerSummary-default.json +14 -0
- package/entities/DataLossPrevention/mockdatafiles/getICAPServers-default.json +20 -0
- package/entities/DataLossPrevention/mockdatafiles/getIncidentReceiverServerSummary-default.json +30 -0
- package/entities/DataLossPrevention/mockdatafiles/getIncidentReceiverServers-default.json +30 -0
- package/entities/DataLossPrevention/mockdatafiles/getPredefinedHierarchicalIdentifiersByDictionaryId-default.json +4 -0
- package/entities/DataLossPrevention/mockdatafiles/getProfiles-default.json +94 -0
- package/entities/DataLossPrevention/mockdatafiles/getRules-default.json +5556 -0
- package/entities/DataLossPrevention/mockdatafiles/getSchemaLite-default.json +52 -0
- package/entities/DataLossPrevention/mockdatafiles/getSchemas-default.json +379 -0
- package/entities/DataLossPrevention/mockdatafiles/getSummary-default.json +56 -0
- package/entities/DataLossPrevention/mockdatafiles/getWebDlpRulesLite-default.json +5758 -0
- package/entities/DataLossPrevention/mockdatafiles/gettemplates-default.json +34 -0
- package/entities/DataLossPrevention/schema.json +55 -0
- package/entities/DeviceGroups/action.json +67 -0
- package/entities/DeviceGroups/mockdatafiles/getDeviceGroups-default.json +20 -0
- package/entities/DeviceGroups/mockdatafiles/getDevices-default.json +26 -0
- package/entities/DeviceGroups/mockdatafiles/getDevicesLite-default.json +38 -0
- package/entities/DeviceGroups/schema.json +21 -0
- package/entities/EventLogs/action.json +86 -0
- package/entities/EventLogs/schema.json +22 -0
- package/entities/FirewallPolicies/action.json +889 -0
- package/entities/FirewallPolicies/mockdatafiles/getDestinationIpGroups-default.json +130 -0
- package/entities/FirewallPolicies/mockdatafiles/getDestinationIpGroupsLite-default.json +94 -0
- package/entities/FirewallPolicies/mockdatafiles/getDestinationIpv6Groups-default.json +111 -0
- package/entities/FirewallPolicies/mockdatafiles/getDestinationIpv6GroupsLite-default.json +20 -0
- package/entities/FirewallPolicies/mockdatafiles/getFirewallFilteringRules-default.json +3884 -0
- package/entities/FirewallPolicies/mockdatafiles/getNetowrkApplicationGroups-default.json +21 -0
- package/entities/FirewallPolicies/mockdatafiles/getNetowrkApplicationGroupsLite-default.json +49 -0
- package/entities/FirewallPolicies/mockdatafiles/getNetworkApplications-default.json +20 -0
- package/entities/FirewallPolicies/mockdatafiles/getNetworkServiceGroups-default.json +657 -0
- package/entities/FirewallPolicies/mockdatafiles/getNetworkServiceGroupsLite-default.json +361 -0
- package/entities/FirewallPolicies/mockdatafiles/getNetworkServices-default.json +206 -0
- package/entities/FirewallPolicies/mockdatafiles/getNetworkServicesLite-default.json +322 -0
- package/entities/FirewallPolicies/mockdatafiles/getSourceIpGroups-default.json +57 -0
- package/entities/FirewallPolicies/mockdatafiles/getSourceIpGroupsLite-default.json +17 -0
- package/entities/FirewallPolicies/mockdatafiles/getSourceIpv6Groups-default.json +54 -0
- package/entities/FirewallPolicies/mockdatafiles/getSourceIpv6GroupsLite-default.json +15 -0
- package/entities/FirewallPolicies/mockdatafiles/getTimeWindowSummary-default.json +42 -0
- package/entities/FirewallPolicies/mockdatafiles/getTimeWindows-default.json +32 -0
- package/entities/FirewallPolicies/schema.json +61 -0
- package/entities/ForwardingControlPolicy/action.json +208 -0
- package/entities/ForwardingControlPolicy/mockdatafiles/getForwardingRules-default.json +2183 -0
- package/entities/ForwardingControlPolicy/mockdatafiles/getZpaGateways-default.json +60 -0
- package/entities/ForwardingControlPolicy/schema.json +28 -0
- package/entities/IntermediateCACertificates/action.json +455 -0
- package/entities/IntermediateCACertificates/mockdatafiles/getCertificatesInReadyToUseState-default.json +70 -0
- package/entities/IntermediateCACertificates/mockdatafiles/getIntermediateCaCertificates-default.json +19 -0
- package/entities/IntermediateCACertificates/mockdatafiles/getIntermediateCaCertificatesLite-default.json +53 -0
- package/entities/IntermediateCACertificates/schema.json +40 -0
- package/entities/IoTReport/action.json +88 -0
- package/entities/IoTReport/mockdatafiles/getCategories-default.json +22 -0
- package/entities/IoTReport/mockdatafiles/getClassifications-default.json +12 -0
- package/entities/IoTReport/mockdatafiles/getDeviceTypes-default.json +7 -0
- package/entities/IoTReport/schema.json +22 -0
- package/entities/LocationManagement/action.json +130 -0
- package/entities/LocationManagement/mockdatafiles/getGroups-default.json +372 -0
- package/entities/LocationManagement/mockdatafiles/getGroups__v1-default.json +372 -0
- package/entities/LocationManagement/mockdatafiles/getGroups__v2-default.json +372 -0
- package/entities/LocationManagement/mockdatafiles/getSubLocations-default.json +465 -0
- package/entities/LocationManagement/mockdatafiles/getTopLocations-default.json +191 -0
- package/entities/LocationManagement/schema.json +24 -0
- package/entities/RuleLabels/action.json +106 -0
- package/entities/RuleLabels/mockdatafiles/getRuleLabels-default.json +59 -0
- package/entities/RuleLabels/schema.json +23 -0
- package/entities/SandboxSettings/action.json +66 -0
- package/entities/SandboxSettings/schema.json +21 -0
- package/entities/SandboxSubmissionAPI/action.json +44 -0
- package/entities/SandboxSubmissionAPI/schema.json +20 -0
- package/entities/ShadowITReport/action.json +106 -0
- package/entities/ShadowITReport/mockdatafiles/getAllCustomTags-default.json +10 -0
- package/entities/ShadowITReport/mockdatafiles/getCloudApplicationsLite-default.json +10 -0
- package/entities/ShadowITReport/schema.json +23 -0
- package/entities/TrafficForwarding/action.json +459 -0
- package/entities/TrafficForwarding/mockdatafiles/getAllGreTunnels-default.json +70 -0
- package/entities/TrafficForwarding/mockdatafiles/getAllStaticIPs-default.json +90 -0
- package/entities/TrafficForwarding/mockdatafiles/getDns64Prefixes-default.json +34 -0
- package/entities/TrafficForwarding/mockdatafiles/getIPGWDetails-default.json +32 -0
- package/entities/TrafficForwarding/mockdatafiles/getNat64Prefixes-default.json +18 -0
- package/entities/TrafficForwarding/mockdatafiles/getRecommendedGreVips-default.json +20 -0
- package/entities/TrafficForwarding/mockdatafiles/getRecommendedVipsGroupedByDC-default.json +82 -0
- package/entities/TrafficForwarding/mockdatafiles/getRegionsByPrefix-default.json +26 -0
- package/entities/TrafficForwarding/mockdatafiles/getVpnCredentials-default.json +82 -0
- package/entities/TrafficForwarding/mockdatafiles/getVpnCredentials__v1-default.json +82 -0
- package/entities/TrafficForwarding/mockdatafiles/getVpnCredentials__v2-default.json +82 -0
- package/entities/TrafficForwarding/mockdatafiles/getZscalerNodesDetails-default.json +170 -0
- package/entities/TrafficForwarding/mockdatafiles/validateAndGetAvailableInternalIpRanges-default.json +18 -0
- package/entities/TrafficForwarding/schema.json +40 -0
- package/entities/URLFilteringPolicies/action.json +106 -0
- package/entities/URLFilteringPolicies/mockdatafiles/getUrlFilteringRules-default.json +2918 -0
- package/entities/URLFilteringPolicies/schema.json +23 -0
- package/entities/UserAuthenticationSettings/action.json +45 -0
- package/entities/UserAuthenticationSettings/schema.json +20 -0
- package/entities/WorkloadGroups/action.json +25 -0
- package/entities/WorkloadGroups/mockdatafiles/getWorkloadGroups-default.json +396 -0
- package/entities/WorkloadGroups/schema.json +19 -0
- package/package.json +3 -3
- package/pronghorn.json +17256 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/adapter-openapi.json +17120 -2
- package/report/adapter-openapi.yaml +13753 -815
- package/report/adapterInfo.json +7 -7
- package/test/integration/adapterTestIntegration.js +4882 -0
- package/test/unit/adapterTestUnit.js +3848 -1
|
@@ -2174,5 +2174,4887 @@ describe('[integration] Zscaler Adapter Test', () => {
|
|
|
2174
2174
|
}
|
|
2175
2175
|
}).timeout(attemptTimeout);
|
|
2176
2176
|
});
|
|
2177
|
+
|
|
2178
|
+
describe('#submitFile - errors', () => {
|
|
2179
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2180
|
+
try {
|
|
2181
|
+
a.submitFile('fakedata', null, (data, error) => {
|
|
2182
|
+
try {
|
|
2183
|
+
if (stub) {
|
|
2184
|
+
const displayE = 'Error 400 received on request';
|
|
2185
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
2186
|
+
} else {
|
|
2187
|
+
runCommonAsserts(data, error);
|
|
2188
|
+
}
|
|
2189
|
+
saveMockData('SandboxSubmissionAPI', 'submitFile', 'default', data);
|
|
2190
|
+
done();
|
|
2191
|
+
} catch (err) {
|
|
2192
|
+
log.error(`Test Failure: ${err}`);
|
|
2193
|
+
done(err);
|
|
2194
|
+
}
|
|
2195
|
+
});
|
|
2196
|
+
} catch (error) {
|
|
2197
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2198
|
+
done(error);
|
|
2199
|
+
}
|
|
2200
|
+
}).timeout(attemptTimeout);
|
|
2201
|
+
});
|
|
2202
|
+
|
|
2203
|
+
describe('#submitFileForScan - errors', () => {
|
|
2204
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2205
|
+
try {
|
|
2206
|
+
a.submitFileForScan('fakedata', (data, error) => {
|
|
2207
|
+
try {
|
|
2208
|
+
if (stub) {
|
|
2209
|
+
const displayE = 'Error 400 received on request';
|
|
2210
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
2211
|
+
} else {
|
|
2212
|
+
runCommonAsserts(data, error);
|
|
2213
|
+
}
|
|
2214
|
+
saveMockData('SandboxSubmissionAPI', 'submitFileForScan', 'default', data);
|
|
2215
|
+
done();
|
|
2216
|
+
} catch (err) {
|
|
2217
|
+
log.error(`Test Failure: ${err}`);
|
|
2218
|
+
done(err);
|
|
2219
|
+
}
|
|
2220
|
+
});
|
|
2221
|
+
} catch (error) {
|
|
2222
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2223
|
+
done(error);
|
|
2224
|
+
}
|
|
2225
|
+
}).timeout(attemptTimeout);
|
|
2226
|
+
});
|
|
2227
|
+
|
|
2228
|
+
describe('#getApp - errors', () => {
|
|
2229
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2230
|
+
try {
|
|
2231
|
+
a.getApp(null, null, null, (data, error) => {
|
|
2232
|
+
try {
|
|
2233
|
+
if (stub) {
|
|
2234
|
+
const displayE = 'Error 400 received on request';
|
|
2235
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
2236
|
+
} else {
|
|
2237
|
+
runCommonAsserts(data, error);
|
|
2238
|
+
}
|
|
2239
|
+
saveMockData('Applications', 'getApp', 'default', data);
|
|
2240
|
+
done();
|
|
2241
|
+
} catch (err) {
|
|
2242
|
+
log.error(`Test Failure: ${err}`);
|
|
2243
|
+
done(err);
|
|
2244
|
+
}
|
|
2245
|
+
});
|
|
2246
|
+
} catch (error) {
|
|
2247
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2248
|
+
done(error);
|
|
2249
|
+
}
|
|
2250
|
+
}).timeout(attemptTimeout);
|
|
2251
|
+
});
|
|
2252
|
+
|
|
2253
|
+
const applicationsPostAppBodyParam = {};
|
|
2254
|
+
describe('#postApp - errors', () => {
|
|
2255
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2256
|
+
try {
|
|
2257
|
+
a.postApp(applicationsPostAppBodyParam, (data, error) => {
|
|
2258
|
+
try {
|
|
2259
|
+
if (stub) {
|
|
2260
|
+
const displayE = 'Error 400 received on request';
|
|
2261
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
2262
|
+
} else {
|
|
2263
|
+
runCommonAsserts(data, error);
|
|
2264
|
+
}
|
|
2265
|
+
saveMockData('Applications', 'postApp', 'default', data);
|
|
2266
|
+
done();
|
|
2267
|
+
} catch (err) {
|
|
2268
|
+
log.error(`Test Failure: ${err}`);
|
|
2269
|
+
done(err);
|
|
2270
|
+
}
|
|
2271
|
+
});
|
|
2272
|
+
} catch (error) {
|
|
2273
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2274
|
+
done(error);
|
|
2275
|
+
}
|
|
2276
|
+
}).timeout(attemptTimeout);
|
|
2277
|
+
});
|
|
2278
|
+
|
|
2279
|
+
describe('#appsSearchGET - errors', () => {
|
|
2280
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
2281
|
+
try {
|
|
2282
|
+
a.appsSearchGET('fakedata', null, null, (data, error) => {
|
|
2283
|
+
try {
|
|
2284
|
+
if (stub) {
|
|
2285
|
+
runCommonAsserts(data, error);
|
|
2286
|
+
assert.equal('object', typeof data.response[0]);
|
|
2287
|
+
assert.equal('object', typeof data.response[1]);
|
|
2288
|
+
assert.equal('object', typeof data.response[2]);
|
|
2289
|
+
assert.equal('object', typeof data.response[3]);
|
|
2290
|
+
} else {
|
|
2291
|
+
runCommonAsserts(data, error);
|
|
2292
|
+
}
|
|
2293
|
+
saveMockData('Applications', 'appsSearchGET', 'default', data);
|
|
2294
|
+
done();
|
|
2295
|
+
} catch (err) {
|
|
2296
|
+
log.error(`Test Failure: ${err}`);
|
|
2297
|
+
done(err);
|
|
2298
|
+
}
|
|
2299
|
+
});
|
|
2300
|
+
} catch (error) {
|
|
2301
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2302
|
+
done(error);
|
|
2303
|
+
}
|
|
2304
|
+
}).timeout(attemptTimeout);
|
|
2305
|
+
});
|
|
2306
|
+
|
|
2307
|
+
describe('#getViews - errors', () => {
|
|
2308
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
2309
|
+
try {
|
|
2310
|
+
a.getViews((data, error) => {
|
|
2311
|
+
try {
|
|
2312
|
+
if (stub) {
|
|
2313
|
+
runCommonAsserts(data, error);
|
|
2314
|
+
assert.equal('object', typeof data.response[0]);
|
|
2315
|
+
} else {
|
|
2316
|
+
runCommonAsserts(data, error);
|
|
2317
|
+
}
|
|
2318
|
+
saveMockData('AppViews', 'getViews', 'default', data);
|
|
2319
|
+
done();
|
|
2320
|
+
} catch (err) {
|
|
2321
|
+
log.error(`Test Failure: ${err}`);
|
|
2322
|
+
done(err);
|
|
2323
|
+
}
|
|
2324
|
+
});
|
|
2325
|
+
} catch (error) {
|
|
2326
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2327
|
+
done(error);
|
|
2328
|
+
}
|
|
2329
|
+
}).timeout(attemptTimeout);
|
|
2330
|
+
});
|
|
2331
|
+
|
|
2332
|
+
describe('#getViewApps - errors', () => {
|
|
2333
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
2334
|
+
try {
|
|
2335
|
+
a.getViewApps('fakedata', (data, error) => {
|
|
2336
|
+
try {
|
|
2337
|
+
if (stub) {
|
|
2338
|
+
runCommonAsserts(data, error);
|
|
2339
|
+
assert.equal('object', typeof data.response[0]);
|
|
2340
|
+
assert.equal('object', typeof data.response[1]);
|
|
2341
|
+
} else {
|
|
2342
|
+
runCommonAsserts(data, error);
|
|
2343
|
+
}
|
|
2344
|
+
saveMockData('AppViews', 'getViewApps', 'default', data);
|
|
2345
|
+
done();
|
|
2346
|
+
} catch (err) {
|
|
2347
|
+
log.error(`Test Failure: ${err}`);
|
|
2348
|
+
done(err);
|
|
2349
|
+
}
|
|
2350
|
+
});
|
|
2351
|
+
} catch (error) {
|
|
2352
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2353
|
+
done(error);
|
|
2354
|
+
}
|
|
2355
|
+
}).timeout(attemptTimeout);
|
|
2356
|
+
});
|
|
2357
|
+
|
|
2358
|
+
describe('#getRoleSummary - errors', () => {
|
|
2359
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2360
|
+
try {
|
|
2361
|
+
a.getRoleSummary(null, null, null, (data, error) => {
|
|
2362
|
+
try {
|
|
2363
|
+
if (stub) {
|
|
2364
|
+
const displayE = 'Error 400 received on request';
|
|
2365
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
2366
|
+
} else {
|
|
2367
|
+
runCommonAsserts(data, error);
|
|
2368
|
+
}
|
|
2369
|
+
saveMockData('AdminRoleManagement', 'getRoleSummary', 'default', data);
|
|
2370
|
+
done();
|
|
2371
|
+
} catch (err) {
|
|
2372
|
+
log.error(`Test Failure: ${err}`);
|
|
2373
|
+
done(err);
|
|
2374
|
+
}
|
|
2375
|
+
});
|
|
2376
|
+
} catch (error) {
|
|
2377
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2378
|
+
done(error);
|
|
2379
|
+
}
|
|
2380
|
+
}).timeout(attemptTimeout);
|
|
2381
|
+
});
|
|
2382
|
+
|
|
2383
|
+
describe('#getAdminUsers - errors', () => {
|
|
2384
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2385
|
+
try {
|
|
2386
|
+
a.getAdminUsers(null, null, null, null, null, (data, error) => {
|
|
2387
|
+
try {
|
|
2388
|
+
if (stub) {
|
|
2389
|
+
const displayE = 'Error 400 received on request';
|
|
2390
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
2391
|
+
} else {
|
|
2392
|
+
runCommonAsserts(data, error);
|
|
2393
|
+
}
|
|
2394
|
+
saveMockData('AdminRoleManagement', 'getAdminUsers', 'default', data);
|
|
2395
|
+
done();
|
|
2396
|
+
} catch (err) {
|
|
2397
|
+
log.error(`Test Failure: ${err}`);
|
|
2398
|
+
done(err);
|
|
2399
|
+
}
|
|
2400
|
+
});
|
|
2401
|
+
} catch (error) {
|
|
2402
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2403
|
+
done(error);
|
|
2404
|
+
}
|
|
2405
|
+
}).timeout(attemptTimeout);
|
|
2406
|
+
});
|
|
2407
|
+
|
|
2408
|
+
const adminRoleManagementAddAdminUserBodyParam = {
|
|
2409
|
+
loginName: 'string',
|
|
2410
|
+
userName: 'string',
|
|
2411
|
+
email: 'string'
|
|
2412
|
+
};
|
|
2413
|
+
describe('#addAdminUser - errors', () => {
|
|
2414
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2415
|
+
try {
|
|
2416
|
+
a.addAdminUser(null, adminRoleManagementAddAdminUserBodyParam, (data, error) => {
|
|
2417
|
+
try {
|
|
2418
|
+
if (stub) {
|
|
2419
|
+
const displayE = 'Error 400 received on request';
|
|
2420
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
2421
|
+
} else {
|
|
2422
|
+
runCommonAsserts(data, error);
|
|
2423
|
+
}
|
|
2424
|
+
saveMockData('AdminRoleManagement', 'addAdminUser', 'default', data);
|
|
2425
|
+
done();
|
|
2426
|
+
} catch (err) {
|
|
2427
|
+
log.error(`Test Failure: ${err}`);
|
|
2428
|
+
done(err);
|
|
2429
|
+
}
|
|
2430
|
+
});
|
|
2431
|
+
} catch (error) {
|
|
2432
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2433
|
+
done(error);
|
|
2434
|
+
}
|
|
2435
|
+
}).timeout(attemptTimeout);
|
|
2436
|
+
});
|
|
2437
|
+
|
|
2438
|
+
describe('#updateAdminUser - errors', () => {
|
|
2439
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2440
|
+
try {
|
|
2441
|
+
a.updateAdminUser(555, (data, error) => {
|
|
2442
|
+
try {
|
|
2443
|
+
if (stub) {
|
|
2444
|
+
const displayE = 'Error 400 received on request';
|
|
2445
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
2446
|
+
} else {
|
|
2447
|
+
runCommonAsserts(data, error);
|
|
2448
|
+
}
|
|
2449
|
+
saveMockData('AdminRoleManagement', 'updateAdminUser', 'default', data);
|
|
2450
|
+
done();
|
|
2451
|
+
} catch (err) {
|
|
2452
|
+
log.error(`Test Failure: ${err}`);
|
|
2453
|
+
done(err);
|
|
2454
|
+
}
|
|
2455
|
+
});
|
|
2456
|
+
} catch (error) {
|
|
2457
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2458
|
+
done(error);
|
|
2459
|
+
}
|
|
2460
|
+
}).timeout(attemptTimeout);
|
|
2461
|
+
});
|
|
2462
|
+
|
|
2463
|
+
describe('#deleteAdminUser - errors', () => {
|
|
2464
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2465
|
+
try {
|
|
2466
|
+
a.deleteAdminUser(555, (data, error) => {
|
|
2467
|
+
try {
|
|
2468
|
+
if (stub) {
|
|
2469
|
+
const displayE = 'Error 400 received on request';
|
|
2470
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
2471
|
+
} else {
|
|
2472
|
+
runCommonAsserts(data, error);
|
|
2473
|
+
}
|
|
2474
|
+
saveMockData('AdminRoleManagement', 'deleteAdminUser', 'default', data);
|
|
2475
|
+
done();
|
|
2476
|
+
} catch (err) {
|
|
2477
|
+
log.error(`Test Failure: ${err}`);
|
|
2478
|
+
done(err);
|
|
2479
|
+
}
|
|
2480
|
+
});
|
|
2481
|
+
} catch (error) {
|
|
2482
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2483
|
+
done(error);
|
|
2484
|
+
}
|
|
2485
|
+
}).timeout(attemptTimeout);
|
|
2486
|
+
});
|
|
2487
|
+
|
|
2488
|
+
const adminRoleManagementConvertAdminToEndUserBodyParam = {};
|
|
2489
|
+
describe('#convertAdminToEndUser - errors', () => {
|
|
2490
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2491
|
+
try {
|
|
2492
|
+
a.convertAdminToEndUser(555, adminRoleManagementConvertAdminToEndUserBodyParam, (data, error) => {
|
|
2493
|
+
try {
|
|
2494
|
+
if (stub) {
|
|
2495
|
+
const displayE = 'Error 400 received on request';
|
|
2496
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
2497
|
+
} else {
|
|
2498
|
+
runCommonAsserts(data, error);
|
|
2499
|
+
}
|
|
2500
|
+
saveMockData('AdminRoleManagement', 'convertAdminToEndUser', 'default', data);
|
|
2501
|
+
done();
|
|
2502
|
+
} catch (err) {
|
|
2503
|
+
log.error(`Test Failure: ${err}`);
|
|
2504
|
+
done(err);
|
|
2505
|
+
}
|
|
2506
|
+
});
|
|
2507
|
+
} catch (error) {
|
|
2508
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2509
|
+
done(error);
|
|
2510
|
+
}
|
|
2511
|
+
}).timeout(attemptTimeout);
|
|
2512
|
+
});
|
|
2513
|
+
|
|
2514
|
+
describe('#getCloudBrowserIsolationProfiles - errors', () => {
|
|
2515
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
2516
|
+
try {
|
|
2517
|
+
a.getCloudBrowserIsolationProfiles((data, error) => {
|
|
2518
|
+
try {
|
|
2519
|
+
if (stub) {
|
|
2520
|
+
runCommonAsserts(data, error);
|
|
2521
|
+
assert.equal('object', typeof data.response[0]);
|
|
2522
|
+
assert.equal('object', typeof data.response[1]);
|
|
2523
|
+
assert.equal('object', typeof data.response[2]);
|
|
2524
|
+
} else {
|
|
2525
|
+
runCommonAsserts(data, error);
|
|
2526
|
+
}
|
|
2527
|
+
saveMockData('BrowserIsolation', 'getCloudBrowserIsolationProfiles', 'default', data);
|
|
2528
|
+
done();
|
|
2529
|
+
} catch (err) {
|
|
2530
|
+
log.error(`Test Failure: ${err}`);
|
|
2531
|
+
done(err);
|
|
2532
|
+
}
|
|
2533
|
+
});
|
|
2534
|
+
} catch (error) {
|
|
2535
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2536
|
+
done(error);
|
|
2537
|
+
}
|
|
2538
|
+
}).timeout(attemptTimeout);
|
|
2539
|
+
});
|
|
2540
|
+
|
|
2541
|
+
describe('#getDlpDictionaries - errors', () => {
|
|
2542
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
2543
|
+
try {
|
|
2544
|
+
a.getDlpDictionaries(null, (data, error) => {
|
|
2545
|
+
try {
|
|
2546
|
+
if (stub) {
|
|
2547
|
+
runCommonAsserts(data, error);
|
|
2548
|
+
assert.equal('object', typeof data.response[0]);
|
|
2549
|
+
assert.equal('object', typeof data.response[1]);
|
|
2550
|
+
} else {
|
|
2551
|
+
runCommonAsserts(data, error);
|
|
2552
|
+
}
|
|
2553
|
+
saveMockData('DataLossPrevention', 'getDlpDictionaries', 'default', data);
|
|
2554
|
+
done();
|
|
2555
|
+
} catch (err) {
|
|
2556
|
+
log.error(`Test Failure: ${err}`);
|
|
2557
|
+
done(err);
|
|
2558
|
+
}
|
|
2559
|
+
});
|
|
2560
|
+
} catch (error) {
|
|
2561
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2562
|
+
done(error);
|
|
2563
|
+
}
|
|
2564
|
+
}).timeout(attemptTimeout);
|
|
2565
|
+
});
|
|
2566
|
+
|
|
2567
|
+
const dataLossPreventionAddCustomDLPDictionaryBodyParam = {};
|
|
2568
|
+
describe('#addCustomDLPDictionary - errors', () => {
|
|
2569
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2570
|
+
try {
|
|
2571
|
+
a.addCustomDLPDictionary(dataLossPreventionAddCustomDLPDictionaryBodyParam, (data, error) => {
|
|
2572
|
+
try {
|
|
2573
|
+
if (stub) {
|
|
2574
|
+
const displayE = 'Error 400 received on request';
|
|
2575
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
2576
|
+
} else {
|
|
2577
|
+
runCommonAsserts(data, error);
|
|
2578
|
+
}
|
|
2579
|
+
saveMockData('DataLossPrevention', 'addCustomDLPDictionary', 'default', data);
|
|
2580
|
+
done();
|
|
2581
|
+
} catch (err) {
|
|
2582
|
+
log.error(`Test Failure: ${err}`);
|
|
2583
|
+
done(err);
|
|
2584
|
+
}
|
|
2585
|
+
});
|
|
2586
|
+
} catch (error) {
|
|
2587
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2588
|
+
done(error);
|
|
2589
|
+
}
|
|
2590
|
+
}).timeout(attemptTimeout);
|
|
2591
|
+
});
|
|
2592
|
+
|
|
2593
|
+
describe('#getDLPDictionarySummary - errors', () => {
|
|
2594
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
2595
|
+
try {
|
|
2596
|
+
a.getDLPDictionarySummary((data, error) => {
|
|
2597
|
+
try {
|
|
2598
|
+
if (stub) {
|
|
2599
|
+
runCommonAsserts(data, error);
|
|
2600
|
+
assert.equal('object', typeof data.response[0]);
|
|
2601
|
+
assert.equal('object', typeof data.response[1]);
|
|
2602
|
+
assert.equal('object', typeof data.response[2]);
|
|
2603
|
+
assert.equal('object', typeof data.response[3]);
|
|
2604
|
+
} else {
|
|
2605
|
+
runCommonAsserts(data, error);
|
|
2606
|
+
}
|
|
2607
|
+
saveMockData('DataLossPrevention', 'getDLPDictionarySummary', 'default', data);
|
|
2608
|
+
done();
|
|
2609
|
+
} catch (err) {
|
|
2610
|
+
log.error(`Test Failure: ${err}`);
|
|
2611
|
+
done(err);
|
|
2612
|
+
}
|
|
2613
|
+
});
|
|
2614
|
+
} catch (error) {
|
|
2615
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2616
|
+
done(error);
|
|
2617
|
+
}
|
|
2618
|
+
}).timeout(attemptTimeout);
|
|
2619
|
+
});
|
|
2620
|
+
|
|
2621
|
+
describe('#getDlpDictionaryById - errors', () => {
|
|
2622
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2623
|
+
try {
|
|
2624
|
+
a.getDlpDictionaryById(555, (data, error) => {
|
|
2625
|
+
try {
|
|
2626
|
+
if (stub) {
|
|
2627
|
+
const displayE = 'Error 400 received on request';
|
|
2628
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
2629
|
+
} else {
|
|
2630
|
+
runCommonAsserts(data, error);
|
|
2631
|
+
}
|
|
2632
|
+
saveMockData('DataLossPrevention', 'getDlpDictionaryById', 'default', data);
|
|
2633
|
+
done();
|
|
2634
|
+
} catch (err) {
|
|
2635
|
+
log.error(`Test Failure: ${err}`);
|
|
2636
|
+
done(err);
|
|
2637
|
+
}
|
|
2638
|
+
});
|
|
2639
|
+
} catch (error) {
|
|
2640
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2641
|
+
done(error);
|
|
2642
|
+
}
|
|
2643
|
+
}).timeout(attemptTimeout);
|
|
2644
|
+
});
|
|
2645
|
+
|
|
2646
|
+
const dataLossPreventionUpdateDlpDictionaryBodyParam = {};
|
|
2647
|
+
describe('#updateDlpDictionary - errors', () => {
|
|
2648
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2649
|
+
try {
|
|
2650
|
+
a.updateDlpDictionary(555, dataLossPreventionUpdateDlpDictionaryBodyParam, (data, error) => {
|
|
2651
|
+
try {
|
|
2652
|
+
if (stub) {
|
|
2653
|
+
const displayE = 'Error 400 received on request';
|
|
2654
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
2655
|
+
} else {
|
|
2656
|
+
runCommonAsserts(data, error);
|
|
2657
|
+
}
|
|
2658
|
+
saveMockData('DataLossPrevention', 'updateDlpDictionary', 'default', data);
|
|
2659
|
+
done();
|
|
2660
|
+
} catch (err) {
|
|
2661
|
+
log.error(`Test Failure: ${err}`);
|
|
2662
|
+
done(err);
|
|
2663
|
+
}
|
|
2664
|
+
});
|
|
2665
|
+
} catch (error) {
|
|
2666
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2667
|
+
done(error);
|
|
2668
|
+
}
|
|
2669
|
+
}).timeout(attemptTimeout);
|
|
2670
|
+
});
|
|
2671
|
+
|
|
2672
|
+
describe('#deleteCustomDlpDictionary - errors', () => {
|
|
2673
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2674
|
+
try {
|
|
2675
|
+
a.deleteCustomDlpDictionary(555, (data, error) => {
|
|
2676
|
+
try {
|
|
2677
|
+
if (stub) {
|
|
2678
|
+
const displayE = 'Error 400 received on request';
|
|
2679
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
2680
|
+
} else {
|
|
2681
|
+
runCommonAsserts(data, error);
|
|
2682
|
+
}
|
|
2683
|
+
saveMockData('DataLossPrevention', 'deleteCustomDlpDictionary', 'default', data);
|
|
2684
|
+
done();
|
|
2685
|
+
} catch (err) {
|
|
2686
|
+
log.error(`Test Failure: ${err}`);
|
|
2687
|
+
done(err);
|
|
2688
|
+
}
|
|
2689
|
+
});
|
|
2690
|
+
} catch (error) {
|
|
2691
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2692
|
+
done(error);
|
|
2693
|
+
}
|
|
2694
|
+
}).timeout(attemptTimeout);
|
|
2695
|
+
});
|
|
2696
|
+
|
|
2697
|
+
describe('#getPredefinedHierarchicalIdentifiersByDictionaryId - errors', () => {
|
|
2698
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
2699
|
+
try {
|
|
2700
|
+
a.getPredefinedHierarchicalIdentifiersByDictionaryId(555, (data, error) => {
|
|
2701
|
+
try {
|
|
2702
|
+
if (stub) {
|
|
2703
|
+
runCommonAsserts(data, error);
|
|
2704
|
+
assert.equal('string', data.response[0]);
|
|
2705
|
+
assert.equal('string', data.response[1]);
|
|
2706
|
+
} else {
|
|
2707
|
+
runCommonAsserts(data, error);
|
|
2708
|
+
}
|
|
2709
|
+
saveMockData('DataLossPrevention', 'getPredefinedHierarchicalIdentifiersByDictionaryId', 'default', data);
|
|
2710
|
+
done();
|
|
2711
|
+
} catch (err) {
|
|
2712
|
+
log.error(`Test Failure: ${err}`);
|
|
2713
|
+
done(err);
|
|
2714
|
+
}
|
|
2715
|
+
});
|
|
2716
|
+
} catch (error) {
|
|
2717
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2718
|
+
done(error);
|
|
2719
|
+
}
|
|
2720
|
+
}).timeout(attemptTimeout);
|
|
2721
|
+
});
|
|
2722
|
+
|
|
2723
|
+
describe('#validateDlpPattern - errors', () => {
|
|
2724
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2725
|
+
try {
|
|
2726
|
+
a.validateDlpPattern((data, error) => {
|
|
2727
|
+
try {
|
|
2728
|
+
if (stub) {
|
|
2729
|
+
const displayE = 'Error 400 received on request';
|
|
2730
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
2731
|
+
} else {
|
|
2732
|
+
runCommonAsserts(data, error);
|
|
2733
|
+
}
|
|
2734
|
+
saveMockData('DataLossPrevention', 'validateDlpPattern', 'default', data);
|
|
2735
|
+
done();
|
|
2736
|
+
} catch (err) {
|
|
2737
|
+
log.error(`Test Failure: ${err}`);
|
|
2738
|
+
done(err);
|
|
2739
|
+
}
|
|
2740
|
+
});
|
|
2741
|
+
} catch (error) {
|
|
2742
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2743
|
+
done(error);
|
|
2744
|
+
}
|
|
2745
|
+
}).timeout(attemptTimeout);
|
|
2746
|
+
});
|
|
2747
|
+
|
|
2748
|
+
describe('#getDLPEngines - errors', () => {
|
|
2749
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
2750
|
+
try {
|
|
2751
|
+
a.getDLPEngines((data, error) => {
|
|
2752
|
+
try {
|
|
2753
|
+
if (stub) {
|
|
2754
|
+
runCommonAsserts(data, error);
|
|
2755
|
+
assert.equal('object', typeof data.response[0]);
|
|
2756
|
+
assert.equal('object', typeof data.response[1]);
|
|
2757
|
+
assert.equal('object', typeof data.response[2]);
|
|
2758
|
+
} else {
|
|
2759
|
+
runCommonAsserts(data, error);
|
|
2760
|
+
}
|
|
2761
|
+
saveMockData('DataLossPrevention', 'getDLPEngines', 'default', data);
|
|
2762
|
+
done();
|
|
2763
|
+
} catch (err) {
|
|
2764
|
+
log.error(`Test Failure: ${err}`);
|
|
2765
|
+
done(err);
|
|
2766
|
+
}
|
|
2767
|
+
});
|
|
2768
|
+
} catch (error) {
|
|
2769
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2770
|
+
done(error);
|
|
2771
|
+
}
|
|
2772
|
+
}).timeout(attemptTimeout);
|
|
2773
|
+
});
|
|
2774
|
+
|
|
2775
|
+
const dataLossPreventionAddCustomDLPEngineBodyParam = {};
|
|
2776
|
+
describe('#addCustomDLPEngine - errors', () => {
|
|
2777
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2778
|
+
try {
|
|
2779
|
+
a.addCustomDLPEngine(dataLossPreventionAddCustomDLPEngineBodyParam, (data, error) => {
|
|
2780
|
+
try {
|
|
2781
|
+
if (stub) {
|
|
2782
|
+
const displayE = 'Error 400 received on request';
|
|
2783
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
2784
|
+
} else {
|
|
2785
|
+
runCommonAsserts(data, error);
|
|
2786
|
+
}
|
|
2787
|
+
saveMockData('DataLossPrevention', 'addCustomDLPEngine', 'default', data);
|
|
2788
|
+
done();
|
|
2789
|
+
} catch (err) {
|
|
2790
|
+
log.error(`Test Failure: ${err}`);
|
|
2791
|
+
done(err);
|
|
2792
|
+
}
|
|
2793
|
+
});
|
|
2794
|
+
} catch (error) {
|
|
2795
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2796
|
+
done(error);
|
|
2797
|
+
}
|
|
2798
|
+
}).timeout(attemptTimeout);
|
|
2799
|
+
});
|
|
2800
|
+
|
|
2801
|
+
describe('#getDLPEnginesSummary - errors', () => {
|
|
2802
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
2803
|
+
try {
|
|
2804
|
+
a.getDLPEnginesSummary((data, error) => {
|
|
2805
|
+
try {
|
|
2806
|
+
if (stub) {
|
|
2807
|
+
runCommonAsserts(data, error);
|
|
2808
|
+
assert.equal('object', typeof data.response[0]);
|
|
2809
|
+
assert.equal('object', typeof data.response[1]);
|
|
2810
|
+
} else {
|
|
2811
|
+
runCommonAsserts(data, error);
|
|
2812
|
+
}
|
|
2813
|
+
saveMockData('DataLossPrevention', 'getDLPEnginesSummary', 'default', data);
|
|
2814
|
+
done();
|
|
2815
|
+
} catch (err) {
|
|
2816
|
+
log.error(`Test Failure: ${err}`);
|
|
2817
|
+
done(err);
|
|
2818
|
+
}
|
|
2819
|
+
});
|
|
2820
|
+
} catch (error) {
|
|
2821
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2822
|
+
done(error);
|
|
2823
|
+
}
|
|
2824
|
+
}).timeout(attemptTimeout);
|
|
2825
|
+
});
|
|
2826
|
+
|
|
2827
|
+
const dataLossPreventionPostDlpEnginesValidateDlpExprBodyParam = {};
|
|
2828
|
+
describe('#postDlpEnginesValidateDlpExpr - errors', () => {
|
|
2829
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2830
|
+
try {
|
|
2831
|
+
a.postDlpEnginesValidateDlpExpr(dataLossPreventionPostDlpEnginesValidateDlpExprBodyParam, (data, error) => {
|
|
2832
|
+
try {
|
|
2833
|
+
if (stub) {
|
|
2834
|
+
const displayE = 'Error 400 received on request';
|
|
2835
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
2836
|
+
} else {
|
|
2837
|
+
runCommonAsserts(data, error);
|
|
2838
|
+
}
|
|
2839
|
+
saveMockData('DataLossPrevention', 'postDlpEnginesValidateDlpExpr', 'default', data);
|
|
2840
|
+
done();
|
|
2841
|
+
} catch (err) {
|
|
2842
|
+
log.error(`Test Failure: ${err}`);
|
|
2843
|
+
done(err);
|
|
2844
|
+
}
|
|
2845
|
+
});
|
|
2846
|
+
} catch (error) {
|
|
2847
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2848
|
+
done(error);
|
|
2849
|
+
}
|
|
2850
|
+
}).timeout(attemptTimeout);
|
|
2851
|
+
});
|
|
2852
|
+
|
|
2853
|
+
describe('#getDLPEngineById - errors', () => {
|
|
2854
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2855
|
+
try {
|
|
2856
|
+
a.getDLPEngineById(555, (data, error) => {
|
|
2857
|
+
try {
|
|
2858
|
+
if (stub) {
|
|
2859
|
+
const displayE = 'Error 400 received on request';
|
|
2860
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
2861
|
+
} else {
|
|
2862
|
+
runCommonAsserts(data, error);
|
|
2863
|
+
}
|
|
2864
|
+
saveMockData('DataLossPrevention', 'getDLPEngineById', 'default', data);
|
|
2865
|
+
done();
|
|
2866
|
+
} catch (err) {
|
|
2867
|
+
log.error(`Test Failure: ${err}`);
|
|
2868
|
+
done(err);
|
|
2869
|
+
}
|
|
2870
|
+
});
|
|
2871
|
+
} catch (error) {
|
|
2872
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2873
|
+
done(error);
|
|
2874
|
+
}
|
|
2875
|
+
}).timeout(attemptTimeout);
|
|
2876
|
+
});
|
|
2877
|
+
|
|
2878
|
+
const dataLossPreventionUpdateDlpEngineBodyParam = {
|
|
2879
|
+
id: 10,
|
|
2880
|
+
name: 'string',
|
|
2881
|
+
predefinedEngineName: 'string',
|
|
2882
|
+
engineExpression: 'string',
|
|
2883
|
+
customDlpEngine: false,
|
|
2884
|
+
description: 'string'
|
|
2885
|
+
};
|
|
2886
|
+
describe('#updateDlpEngine - errors', () => {
|
|
2887
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2888
|
+
try {
|
|
2889
|
+
a.updateDlpEngine(555, dataLossPreventionUpdateDlpEngineBodyParam, (data, error) => {
|
|
2890
|
+
try {
|
|
2891
|
+
if (stub) {
|
|
2892
|
+
const displayE = 'Error 400 received on request';
|
|
2893
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
2894
|
+
} else {
|
|
2895
|
+
runCommonAsserts(data, error);
|
|
2896
|
+
}
|
|
2897
|
+
saveMockData('DataLossPrevention', 'updateDlpEngine', 'default', data);
|
|
2898
|
+
done();
|
|
2899
|
+
} catch (err) {
|
|
2900
|
+
log.error(`Test Failure: ${err}`);
|
|
2901
|
+
done(err);
|
|
2902
|
+
}
|
|
2903
|
+
});
|
|
2904
|
+
} catch (error) {
|
|
2905
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2906
|
+
done(error);
|
|
2907
|
+
}
|
|
2908
|
+
}).timeout(attemptTimeout);
|
|
2909
|
+
});
|
|
2910
|
+
|
|
2911
|
+
describe('#deleteCustomDlpEngine - errors', () => {
|
|
2912
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
2913
|
+
try {
|
|
2914
|
+
a.deleteCustomDlpEngine(555, (data, error) => {
|
|
2915
|
+
try {
|
|
2916
|
+
if (stub) {
|
|
2917
|
+
const displayE = 'Error 400 received on request';
|
|
2918
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
2919
|
+
} else {
|
|
2920
|
+
runCommonAsserts(data, error);
|
|
2921
|
+
}
|
|
2922
|
+
saveMockData('DataLossPrevention', 'deleteCustomDlpEngine', 'default', data);
|
|
2923
|
+
done();
|
|
2924
|
+
} catch (err) {
|
|
2925
|
+
log.error(`Test Failure: ${err}`);
|
|
2926
|
+
done(err);
|
|
2927
|
+
}
|
|
2928
|
+
});
|
|
2929
|
+
} catch (error) {
|
|
2930
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2931
|
+
done(error);
|
|
2932
|
+
}
|
|
2933
|
+
}).timeout(attemptTimeout);
|
|
2934
|
+
});
|
|
2935
|
+
|
|
2936
|
+
describe('#getSchemas - errors', () => {
|
|
2937
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
2938
|
+
try {
|
|
2939
|
+
a.getSchemas((data, error) => {
|
|
2940
|
+
try {
|
|
2941
|
+
if (stub) {
|
|
2942
|
+
runCommonAsserts(data, error);
|
|
2943
|
+
assert.equal('object', typeof data.response[0]);
|
|
2944
|
+
assert.equal('object', typeof data.response[1]);
|
|
2945
|
+
assert.equal('object', typeof data.response[2]);
|
|
2946
|
+
assert.equal('object', typeof data.response[3]);
|
|
2947
|
+
} else {
|
|
2948
|
+
runCommonAsserts(data, error);
|
|
2949
|
+
}
|
|
2950
|
+
saveMockData('DataLossPrevention', 'getSchemas', 'default', data);
|
|
2951
|
+
done();
|
|
2952
|
+
} catch (err) {
|
|
2953
|
+
log.error(`Test Failure: ${err}`);
|
|
2954
|
+
done(err);
|
|
2955
|
+
}
|
|
2956
|
+
});
|
|
2957
|
+
} catch (error) {
|
|
2958
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2959
|
+
done(error);
|
|
2960
|
+
}
|
|
2961
|
+
}).timeout(attemptTimeout);
|
|
2962
|
+
});
|
|
2963
|
+
|
|
2964
|
+
describe('#getSchemaLite - errors', () => {
|
|
2965
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
2966
|
+
try {
|
|
2967
|
+
a.getSchemaLite(null, null, null, (data, error) => {
|
|
2968
|
+
try {
|
|
2969
|
+
if (stub) {
|
|
2970
|
+
runCommonAsserts(data, error);
|
|
2971
|
+
assert.equal('object', typeof data.response[0]);
|
|
2972
|
+
} else {
|
|
2973
|
+
runCommonAsserts(data, error);
|
|
2974
|
+
}
|
|
2975
|
+
saveMockData('DataLossPrevention', 'getSchemaLite', 'default', data);
|
|
2976
|
+
done();
|
|
2977
|
+
} catch (err) {
|
|
2978
|
+
log.error(`Test Failure: ${err}`);
|
|
2979
|
+
done(err);
|
|
2980
|
+
}
|
|
2981
|
+
});
|
|
2982
|
+
} catch (error) {
|
|
2983
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2984
|
+
done(error);
|
|
2985
|
+
}
|
|
2986
|
+
}).timeout(attemptTimeout);
|
|
2987
|
+
});
|
|
2988
|
+
|
|
2989
|
+
describe('#gettemplates - errors', () => {
|
|
2990
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
2991
|
+
try {
|
|
2992
|
+
a.gettemplates((data, error) => {
|
|
2993
|
+
try {
|
|
2994
|
+
if (stub) {
|
|
2995
|
+
runCommonAsserts(data, error);
|
|
2996
|
+
assert.equal('object', typeof data.response[0]);
|
|
2997
|
+
assert.equal('object', typeof data.response[1]);
|
|
2998
|
+
assert.equal('object', typeof data.response[2]);
|
|
2999
|
+
assert.equal('object', typeof data.response[3]);
|
|
3000
|
+
} else {
|
|
3001
|
+
runCommonAsserts(data, error);
|
|
3002
|
+
}
|
|
3003
|
+
saveMockData('DataLossPrevention', 'gettemplates', 'default', data);
|
|
3004
|
+
done();
|
|
3005
|
+
} catch (err) {
|
|
3006
|
+
log.error(`Test Failure: ${err}`);
|
|
3007
|
+
done(err);
|
|
3008
|
+
}
|
|
3009
|
+
});
|
|
3010
|
+
} catch (error) {
|
|
3011
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3012
|
+
done(error);
|
|
3013
|
+
}
|
|
3014
|
+
}).timeout(attemptTimeout);
|
|
3015
|
+
});
|
|
3016
|
+
|
|
3017
|
+
describe('#addtemplate - errors', () => {
|
|
3018
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3019
|
+
try {
|
|
3020
|
+
a.addtemplate((data, error) => {
|
|
3021
|
+
try {
|
|
3022
|
+
if (stub) {
|
|
3023
|
+
const displayE = 'Error 400 received on request';
|
|
3024
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3025
|
+
} else {
|
|
3026
|
+
runCommonAsserts(data, error);
|
|
3027
|
+
}
|
|
3028
|
+
saveMockData('DataLossPrevention', 'addtemplate', 'default', data);
|
|
3029
|
+
done();
|
|
3030
|
+
} catch (err) {
|
|
3031
|
+
log.error(`Test Failure: ${err}`);
|
|
3032
|
+
done(err);
|
|
3033
|
+
}
|
|
3034
|
+
});
|
|
3035
|
+
} catch (error) {
|
|
3036
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3037
|
+
done(error);
|
|
3038
|
+
}
|
|
3039
|
+
}).timeout(attemptTimeout);
|
|
3040
|
+
});
|
|
3041
|
+
|
|
3042
|
+
describe('#getTemplateById - errors', () => {
|
|
3043
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3044
|
+
try {
|
|
3045
|
+
a.getTemplateById(555, (data, error) => {
|
|
3046
|
+
try {
|
|
3047
|
+
if (stub) {
|
|
3048
|
+
const displayE = 'Error 400 received on request';
|
|
3049
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3050
|
+
} else {
|
|
3051
|
+
runCommonAsserts(data, error);
|
|
3052
|
+
}
|
|
3053
|
+
saveMockData('DataLossPrevention', 'getTemplateById', 'default', data);
|
|
3054
|
+
done();
|
|
3055
|
+
} catch (err) {
|
|
3056
|
+
log.error(`Test Failure: ${err}`);
|
|
3057
|
+
done(err);
|
|
3058
|
+
}
|
|
3059
|
+
});
|
|
3060
|
+
} catch (error) {
|
|
3061
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3062
|
+
done(error);
|
|
3063
|
+
}
|
|
3064
|
+
}).timeout(attemptTimeout);
|
|
3065
|
+
});
|
|
3066
|
+
|
|
3067
|
+
describe('#updatetemplate - errors', () => {
|
|
3068
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3069
|
+
try {
|
|
3070
|
+
a.updatetemplate(555, (data, error) => {
|
|
3071
|
+
try {
|
|
3072
|
+
if (stub) {
|
|
3073
|
+
const displayE = 'Error 400 received on request';
|
|
3074
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3075
|
+
} else {
|
|
3076
|
+
runCommonAsserts(data, error);
|
|
3077
|
+
}
|
|
3078
|
+
saveMockData('DataLossPrevention', 'updatetemplate', 'default', data);
|
|
3079
|
+
done();
|
|
3080
|
+
} catch (err) {
|
|
3081
|
+
log.error(`Test Failure: ${err}`);
|
|
3082
|
+
done(err);
|
|
3083
|
+
}
|
|
3084
|
+
});
|
|
3085
|
+
} catch (error) {
|
|
3086
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3087
|
+
done(error);
|
|
3088
|
+
}
|
|
3089
|
+
}).timeout(attemptTimeout);
|
|
3090
|
+
});
|
|
3091
|
+
|
|
3092
|
+
describe('#deletetemplate - errors', () => {
|
|
3093
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3094
|
+
try {
|
|
3095
|
+
a.deletetemplate(555, (data, error) => {
|
|
3096
|
+
try {
|
|
3097
|
+
if (stub) {
|
|
3098
|
+
const displayE = 'Error 400 received on request';
|
|
3099
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3100
|
+
} else {
|
|
3101
|
+
runCommonAsserts(data, error);
|
|
3102
|
+
}
|
|
3103
|
+
saveMockData('DataLossPrevention', 'deletetemplate', 'default', data);
|
|
3104
|
+
done();
|
|
3105
|
+
} catch (err) {
|
|
3106
|
+
log.error(`Test Failure: ${err}`);
|
|
3107
|
+
done(err);
|
|
3108
|
+
}
|
|
3109
|
+
});
|
|
3110
|
+
} catch (error) {
|
|
3111
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3112
|
+
done(error);
|
|
3113
|
+
}
|
|
3114
|
+
}).timeout(attemptTimeout);
|
|
3115
|
+
});
|
|
3116
|
+
|
|
3117
|
+
describe('#getICAPServers - errors', () => {
|
|
3118
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
3119
|
+
try {
|
|
3120
|
+
a.getICAPServers((data, error) => {
|
|
3121
|
+
try {
|
|
3122
|
+
if (stub) {
|
|
3123
|
+
runCommonAsserts(data, error);
|
|
3124
|
+
assert.equal('object', typeof data.response[0]);
|
|
3125
|
+
assert.equal('object', typeof data.response[1]);
|
|
3126
|
+
assert.equal('object', typeof data.response[2]);
|
|
3127
|
+
} else {
|
|
3128
|
+
runCommonAsserts(data, error);
|
|
3129
|
+
}
|
|
3130
|
+
saveMockData('DataLossPrevention', 'getICAPServers', 'default', data);
|
|
3131
|
+
done();
|
|
3132
|
+
} catch (err) {
|
|
3133
|
+
log.error(`Test Failure: ${err}`);
|
|
3134
|
+
done(err);
|
|
3135
|
+
}
|
|
3136
|
+
});
|
|
3137
|
+
} catch (error) {
|
|
3138
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3139
|
+
done(error);
|
|
3140
|
+
}
|
|
3141
|
+
}).timeout(attemptTimeout);
|
|
3142
|
+
});
|
|
3143
|
+
|
|
3144
|
+
describe('#getICAPServerSummary - errors', () => {
|
|
3145
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
3146
|
+
try {
|
|
3147
|
+
a.getICAPServerSummary((data, error) => {
|
|
3148
|
+
try {
|
|
3149
|
+
if (stub) {
|
|
3150
|
+
runCommonAsserts(data, error);
|
|
3151
|
+
assert.equal('object', typeof data.response[0]);
|
|
3152
|
+
assert.equal('object', typeof data.response[1]);
|
|
3153
|
+
} else {
|
|
3154
|
+
runCommonAsserts(data, error);
|
|
3155
|
+
}
|
|
3156
|
+
saveMockData('DataLossPrevention', 'getICAPServerSummary', 'default', data);
|
|
3157
|
+
done();
|
|
3158
|
+
} catch (err) {
|
|
3159
|
+
log.error(`Test Failure: ${err}`);
|
|
3160
|
+
done(err);
|
|
3161
|
+
}
|
|
3162
|
+
});
|
|
3163
|
+
} catch (error) {
|
|
3164
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3165
|
+
done(error);
|
|
3166
|
+
}
|
|
3167
|
+
}).timeout(attemptTimeout);
|
|
3168
|
+
});
|
|
3169
|
+
|
|
3170
|
+
describe('#getICAPServer - errors', () => {
|
|
3171
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3172
|
+
try {
|
|
3173
|
+
a.getICAPServer(555, (data, error) => {
|
|
3174
|
+
try {
|
|
3175
|
+
if (stub) {
|
|
3176
|
+
const displayE = 'Error 400 received on request';
|
|
3177
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3178
|
+
} else {
|
|
3179
|
+
runCommonAsserts(data, error);
|
|
3180
|
+
}
|
|
3181
|
+
saveMockData('DataLossPrevention', 'getICAPServer', 'default', data);
|
|
3182
|
+
done();
|
|
3183
|
+
} catch (err) {
|
|
3184
|
+
log.error(`Test Failure: ${err}`);
|
|
3185
|
+
done(err);
|
|
3186
|
+
}
|
|
3187
|
+
});
|
|
3188
|
+
} catch (error) {
|
|
3189
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3190
|
+
done(error);
|
|
3191
|
+
}
|
|
3192
|
+
}).timeout(attemptTimeout);
|
|
3193
|
+
});
|
|
3194
|
+
|
|
3195
|
+
describe('#getProfiles - errors', () => {
|
|
3196
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
3197
|
+
try {
|
|
3198
|
+
a.getProfiles((data, error) => {
|
|
3199
|
+
try {
|
|
3200
|
+
if (stub) {
|
|
3201
|
+
runCommonAsserts(data, error);
|
|
3202
|
+
assert.equal('object', typeof data.response[0]);
|
|
3203
|
+
assert.equal('object', typeof data.response[1]);
|
|
3204
|
+
} else {
|
|
3205
|
+
runCommonAsserts(data, error);
|
|
3206
|
+
}
|
|
3207
|
+
saveMockData('DataLossPrevention', 'getProfiles', 'default', data);
|
|
3208
|
+
done();
|
|
3209
|
+
} catch (err) {
|
|
3210
|
+
log.error(`Test Failure: ${err}`);
|
|
3211
|
+
done(err);
|
|
3212
|
+
}
|
|
3213
|
+
});
|
|
3214
|
+
} catch (error) {
|
|
3215
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3216
|
+
done(error);
|
|
3217
|
+
}
|
|
3218
|
+
}).timeout(attemptTimeout);
|
|
3219
|
+
});
|
|
3220
|
+
|
|
3221
|
+
describe('#getSummary - errors', () => {
|
|
3222
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
3223
|
+
try {
|
|
3224
|
+
a.getSummary(null, (data, error) => {
|
|
3225
|
+
try {
|
|
3226
|
+
if (stub) {
|
|
3227
|
+
runCommonAsserts(data, error);
|
|
3228
|
+
assert.equal('object', typeof data.response[0]);
|
|
3229
|
+
assert.equal('object', typeof data.response[1]);
|
|
3230
|
+
assert.equal('object', typeof data.response[2]);
|
|
3231
|
+
} else {
|
|
3232
|
+
runCommonAsserts(data, error);
|
|
3233
|
+
}
|
|
3234
|
+
saveMockData('DataLossPrevention', 'getSummary', 'default', data);
|
|
3235
|
+
done();
|
|
3236
|
+
} catch (err) {
|
|
3237
|
+
log.error(`Test Failure: ${err}`);
|
|
3238
|
+
done(err);
|
|
3239
|
+
}
|
|
3240
|
+
});
|
|
3241
|
+
} catch (error) {
|
|
3242
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3243
|
+
done(error);
|
|
3244
|
+
}
|
|
3245
|
+
}).timeout(attemptTimeout);
|
|
3246
|
+
});
|
|
3247
|
+
|
|
3248
|
+
describe('#getProfileById - errors', () => {
|
|
3249
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3250
|
+
try {
|
|
3251
|
+
a.getProfileById(555, (data, error) => {
|
|
3252
|
+
try {
|
|
3253
|
+
if (stub) {
|
|
3254
|
+
const displayE = 'Error 400 received on request';
|
|
3255
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3256
|
+
} else {
|
|
3257
|
+
runCommonAsserts(data, error);
|
|
3258
|
+
}
|
|
3259
|
+
saveMockData('DataLossPrevention', 'getProfileById', 'default', data);
|
|
3260
|
+
done();
|
|
3261
|
+
} catch (err) {
|
|
3262
|
+
log.error(`Test Failure: ${err}`);
|
|
3263
|
+
done(err);
|
|
3264
|
+
}
|
|
3265
|
+
});
|
|
3266
|
+
} catch (error) {
|
|
3267
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3268
|
+
done(error);
|
|
3269
|
+
}
|
|
3270
|
+
}).timeout(attemptTimeout);
|
|
3271
|
+
});
|
|
3272
|
+
|
|
3273
|
+
describe('#getIncidentReceiverServers - errors', () => {
|
|
3274
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
3275
|
+
try {
|
|
3276
|
+
a.getIncidentReceiverServers((data, error) => {
|
|
3277
|
+
try {
|
|
3278
|
+
if (stub) {
|
|
3279
|
+
runCommonAsserts(data, error);
|
|
3280
|
+
assert.equal('object', typeof data.response[0]);
|
|
3281
|
+
assert.equal('object', typeof data.response[1]);
|
|
3282
|
+
assert.equal('object', typeof data.response[2]);
|
|
3283
|
+
assert.equal('object', typeof data.response[3]);
|
|
3284
|
+
} else {
|
|
3285
|
+
runCommonAsserts(data, error);
|
|
3286
|
+
}
|
|
3287
|
+
saveMockData('DataLossPrevention', 'getIncidentReceiverServers', 'default', data);
|
|
3288
|
+
done();
|
|
3289
|
+
} catch (err) {
|
|
3290
|
+
log.error(`Test Failure: ${err}`);
|
|
3291
|
+
done(err);
|
|
3292
|
+
}
|
|
3293
|
+
});
|
|
3294
|
+
} catch (error) {
|
|
3295
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3296
|
+
done(error);
|
|
3297
|
+
}
|
|
3298
|
+
}).timeout(attemptTimeout);
|
|
3299
|
+
});
|
|
3300
|
+
|
|
3301
|
+
describe('#getIncidentReceiverServerSummary - errors', () => {
|
|
3302
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
3303
|
+
try {
|
|
3304
|
+
a.getIncidentReceiverServerSummary((data, error) => {
|
|
3305
|
+
try {
|
|
3306
|
+
if (stub) {
|
|
3307
|
+
runCommonAsserts(data, error);
|
|
3308
|
+
assert.equal('object', typeof data.response[0]);
|
|
3309
|
+
assert.equal('object', typeof data.response[1]);
|
|
3310
|
+
assert.equal('object', typeof data.response[2]);
|
|
3311
|
+
assert.equal('object', typeof data.response[3]);
|
|
3312
|
+
} else {
|
|
3313
|
+
runCommonAsserts(data, error);
|
|
3314
|
+
}
|
|
3315
|
+
saveMockData('DataLossPrevention', 'getIncidentReceiverServerSummary', 'default', data);
|
|
3316
|
+
done();
|
|
3317
|
+
} catch (err) {
|
|
3318
|
+
log.error(`Test Failure: ${err}`);
|
|
3319
|
+
done(err);
|
|
3320
|
+
}
|
|
3321
|
+
});
|
|
3322
|
+
} catch (error) {
|
|
3323
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3324
|
+
done(error);
|
|
3325
|
+
}
|
|
3326
|
+
}).timeout(attemptTimeout);
|
|
3327
|
+
});
|
|
3328
|
+
|
|
3329
|
+
describe('#getIncidentReceiverServer - errors', () => {
|
|
3330
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3331
|
+
try {
|
|
3332
|
+
a.getIncidentReceiverServer(555, (data, error) => {
|
|
3333
|
+
try {
|
|
3334
|
+
if (stub) {
|
|
3335
|
+
const displayE = 'Error 400 received on request';
|
|
3336
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3337
|
+
} else {
|
|
3338
|
+
runCommonAsserts(data, error);
|
|
3339
|
+
}
|
|
3340
|
+
saveMockData('DataLossPrevention', 'getIncidentReceiverServer', 'default', data);
|
|
3341
|
+
done();
|
|
3342
|
+
} catch (err) {
|
|
3343
|
+
log.error(`Test Failure: ${err}`);
|
|
3344
|
+
done(err);
|
|
3345
|
+
}
|
|
3346
|
+
});
|
|
3347
|
+
} catch (error) {
|
|
3348
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3349
|
+
done(error);
|
|
3350
|
+
}
|
|
3351
|
+
}).timeout(attemptTimeout);
|
|
3352
|
+
});
|
|
3353
|
+
|
|
3354
|
+
describe('#getRules - errors', () => {
|
|
3355
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
3356
|
+
try {
|
|
3357
|
+
a.getRules((data, error) => {
|
|
3358
|
+
try {
|
|
3359
|
+
if (stub) {
|
|
3360
|
+
runCommonAsserts(data, error);
|
|
3361
|
+
assert.equal('object', typeof data.response[0]);
|
|
3362
|
+
assert.equal('object', typeof data.response[1]);
|
|
3363
|
+
assert.equal('object', typeof data.response[2]);
|
|
3364
|
+
assert.equal('object', typeof data.response[3]);
|
|
3365
|
+
} else {
|
|
3366
|
+
runCommonAsserts(data, error);
|
|
3367
|
+
}
|
|
3368
|
+
saveMockData('DataLossPrevention', 'getRules', 'default', data);
|
|
3369
|
+
done();
|
|
3370
|
+
} catch (err) {
|
|
3371
|
+
log.error(`Test Failure: ${err}`);
|
|
3372
|
+
done(err);
|
|
3373
|
+
}
|
|
3374
|
+
});
|
|
3375
|
+
} catch (error) {
|
|
3376
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3377
|
+
done(error);
|
|
3378
|
+
}
|
|
3379
|
+
}).timeout(attemptTimeout);
|
|
3380
|
+
});
|
|
3381
|
+
|
|
3382
|
+
const dataLossPreventionAddRuleBodyParam = {};
|
|
3383
|
+
describe('#addRule - errors', () => {
|
|
3384
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3385
|
+
try {
|
|
3386
|
+
a.addRule(dataLossPreventionAddRuleBodyParam, (data, error) => {
|
|
3387
|
+
try {
|
|
3388
|
+
if (stub) {
|
|
3389
|
+
const displayE = 'Error 400 received on request';
|
|
3390
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3391
|
+
} else {
|
|
3392
|
+
runCommonAsserts(data, error);
|
|
3393
|
+
}
|
|
3394
|
+
saveMockData('DataLossPrevention', 'addRule', 'default', data);
|
|
3395
|
+
done();
|
|
3396
|
+
} catch (err) {
|
|
3397
|
+
log.error(`Test Failure: ${err}`);
|
|
3398
|
+
done(err);
|
|
3399
|
+
}
|
|
3400
|
+
});
|
|
3401
|
+
} catch (error) {
|
|
3402
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3403
|
+
done(error);
|
|
3404
|
+
}
|
|
3405
|
+
}).timeout(attemptTimeout);
|
|
3406
|
+
});
|
|
3407
|
+
|
|
3408
|
+
describe('#getWebDlpRulesLite - errors', () => {
|
|
3409
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
3410
|
+
try {
|
|
3411
|
+
a.getWebDlpRulesLite((data, error) => {
|
|
3412
|
+
try {
|
|
3413
|
+
if (stub) {
|
|
3414
|
+
runCommonAsserts(data, error);
|
|
3415
|
+
assert.equal('object', typeof data.response[0]);
|
|
3416
|
+
assert.equal('object', typeof data.response[1]);
|
|
3417
|
+
assert.equal('object', typeof data.response[2]);
|
|
3418
|
+
} else {
|
|
3419
|
+
runCommonAsserts(data, error);
|
|
3420
|
+
}
|
|
3421
|
+
saveMockData('DataLossPrevention', 'getWebDlpRulesLite', 'default', data);
|
|
3422
|
+
done();
|
|
3423
|
+
} catch (err) {
|
|
3424
|
+
log.error(`Test Failure: ${err}`);
|
|
3425
|
+
done(err);
|
|
3426
|
+
}
|
|
3427
|
+
});
|
|
3428
|
+
} catch (error) {
|
|
3429
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3430
|
+
done(error);
|
|
3431
|
+
}
|
|
3432
|
+
}).timeout(attemptTimeout);
|
|
3433
|
+
});
|
|
3434
|
+
|
|
3435
|
+
describe('#getRuleById - errors', () => {
|
|
3436
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3437
|
+
try {
|
|
3438
|
+
a.getRuleById(555, (data, error) => {
|
|
3439
|
+
try {
|
|
3440
|
+
if (stub) {
|
|
3441
|
+
const displayE = 'Error 400 received on request';
|
|
3442
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3443
|
+
} else {
|
|
3444
|
+
runCommonAsserts(data, error);
|
|
3445
|
+
}
|
|
3446
|
+
saveMockData('DataLossPrevention', 'getRuleById', 'default', data);
|
|
3447
|
+
done();
|
|
3448
|
+
} catch (err) {
|
|
3449
|
+
log.error(`Test Failure: ${err}`);
|
|
3450
|
+
done(err);
|
|
3451
|
+
}
|
|
3452
|
+
});
|
|
3453
|
+
} catch (error) {
|
|
3454
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3455
|
+
done(error);
|
|
3456
|
+
}
|
|
3457
|
+
}).timeout(attemptTimeout);
|
|
3458
|
+
});
|
|
3459
|
+
|
|
3460
|
+
const dataLossPreventionUpdateRuleBodyParam = {};
|
|
3461
|
+
describe('#updateRule - errors', () => {
|
|
3462
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3463
|
+
try {
|
|
3464
|
+
a.updateRule(555, dataLossPreventionUpdateRuleBodyParam, (data, error) => {
|
|
3465
|
+
try {
|
|
3466
|
+
if (stub) {
|
|
3467
|
+
const displayE = 'Error 400 received on request';
|
|
3468
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3469
|
+
} else {
|
|
3470
|
+
runCommonAsserts(data, error);
|
|
3471
|
+
}
|
|
3472
|
+
saveMockData('DataLossPrevention', 'updateRule', 'default', data);
|
|
3473
|
+
done();
|
|
3474
|
+
} catch (err) {
|
|
3475
|
+
log.error(`Test Failure: ${err}`);
|
|
3476
|
+
done(err);
|
|
3477
|
+
}
|
|
3478
|
+
});
|
|
3479
|
+
} catch (error) {
|
|
3480
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3481
|
+
done(error);
|
|
3482
|
+
}
|
|
3483
|
+
}).timeout(attemptTimeout);
|
|
3484
|
+
});
|
|
3485
|
+
|
|
3486
|
+
describe('#deleteRule - errors', () => {
|
|
3487
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3488
|
+
try {
|
|
3489
|
+
a.deleteRule(555, (data, error) => {
|
|
3490
|
+
try {
|
|
3491
|
+
if (stub) {
|
|
3492
|
+
const displayE = 'Error 400 received on request';
|
|
3493
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3494
|
+
} else {
|
|
3495
|
+
runCommonAsserts(data, error);
|
|
3496
|
+
}
|
|
3497
|
+
saveMockData('DataLossPrevention', 'deleteRule', 'default', data);
|
|
3498
|
+
done();
|
|
3499
|
+
} catch (err) {
|
|
3500
|
+
log.error(`Test Failure: ${err}`);
|
|
3501
|
+
done(err);
|
|
3502
|
+
}
|
|
3503
|
+
});
|
|
3504
|
+
} catch (error) {
|
|
3505
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3506
|
+
done(error);
|
|
3507
|
+
}
|
|
3508
|
+
}).timeout(attemptTimeout);
|
|
3509
|
+
});
|
|
3510
|
+
|
|
3511
|
+
describe('#getDeviceGroups - errors', () => {
|
|
3512
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
3513
|
+
try {
|
|
3514
|
+
a.getDeviceGroups(null, null, (data, error) => {
|
|
3515
|
+
try {
|
|
3516
|
+
if (stub) {
|
|
3517
|
+
runCommonAsserts(data, error);
|
|
3518
|
+
assert.equal('object', typeof data.response[0]);
|
|
3519
|
+
assert.equal('object', typeof data.response[1]);
|
|
3520
|
+
} else {
|
|
3521
|
+
runCommonAsserts(data, error);
|
|
3522
|
+
}
|
|
3523
|
+
saveMockData('DeviceGroups', 'getDeviceGroups', 'default', data);
|
|
3524
|
+
done();
|
|
3525
|
+
} catch (err) {
|
|
3526
|
+
log.error(`Test Failure: ${err}`);
|
|
3527
|
+
done(err);
|
|
3528
|
+
}
|
|
3529
|
+
});
|
|
3530
|
+
} catch (error) {
|
|
3531
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3532
|
+
done(error);
|
|
3533
|
+
}
|
|
3534
|
+
}).timeout(attemptTimeout);
|
|
3535
|
+
});
|
|
3536
|
+
|
|
3537
|
+
describe('#getDevices - errors', () => {
|
|
3538
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
3539
|
+
try {
|
|
3540
|
+
a.getDevices(null, null, null, null, null, null, null, null, null, null, null, (data, error) => {
|
|
3541
|
+
try {
|
|
3542
|
+
if (stub) {
|
|
3543
|
+
runCommonAsserts(data, error);
|
|
3544
|
+
assert.equal('object', typeof data.response[0]);
|
|
3545
|
+
assert.equal('object', typeof data.response[1]);
|
|
3546
|
+
} else {
|
|
3547
|
+
runCommonAsserts(data, error);
|
|
3548
|
+
}
|
|
3549
|
+
saveMockData('DeviceGroups', 'getDevices', 'default', data);
|
|
3550
|
+
done();
|
|
3551
|
+
} catch (err) {
|
|
3552
|
+
log.error(`Test Failure: ${err}`);
|
|
3553
|
+
done(err);
|
|
3554
|
+
}
|
|
3555
|
+
});
|
|
3556
|
+
} catch (error) {
|
|
3557
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3558
|
+
done(error);
|
|
3559
|
+
}
|
|
3560
|
+
}).timeout(attemptTimeout);
|
|
3561
|
+
});
|
|
3562
|
+
|
|
3563
|
+
describe('#getDevicesLite - errors', () => {
|
|
3564
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
3565
|
+
try {
|
|
3566
|
+
a.getDevicesLite(null, null, null, null, null, (data, error) => {
|
|
3567
|
+
try {
|
|
3568
|
+
if (stub) {
|
|
3569
|
+
runCommonAsserts(data, error);
|
|
3570
|
+
assert.equal('object', typeof data.response[0]);
|
|
3571
|
+
assert.equal('object', typeof data.response[1]);
|
|
3572
|
+
assert.equal('object', typeof data.response[2]);
|
|
3573
|
+
} else {
|
|
3574
|
+
runCommonAsserts(data, error);
|
|
3575
|
+
}
|
|
3576
|
+
saveMockData('DeviceGroups', 'getDevicesLite', 'default', data);
|
|
3577
|
+
done();
|
|
3578
|
+
} catch (err) {
|
|
3579
|
+
log.error(`Test Failure: ${err}`);
|
|
3580
|
+
done(err);
|
|
3581
|
+
}
|
|
3582
|
+
});
|
|
3583
|
+
} catch (error) {
|
|
3584
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3585
|
+
done(error);
|
|
3586
|
+
}
|
|
3587
|
+
}).timeout(attemptTimeout);
|
|
3588
|
+
});
|
|
3589
|
+
|
|
3590
|
+
describe('#getEventReportEntryCsvExportStatus - errors', () => {
|
|
3591
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3592
|
+
try {
|
|
3593
|
+
a.getEventReportEntryCsvExportStatus((data, error) => {
|
|
3594
|
+
try {
|
|
3595
|
+
if (stub) {
|
|
3596
|
+
const displayE = 'Error 400 received on request';
|
|
3597
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3598
|
+
} else {
|
|
3599
|
+
runCommonAsserts(data, error);
|
|
3600
|
+
}
|
|
3601
|
+
saveMockData('EventLogs', 'getEventReportEntryCsvExportStatus', 'default', data);
|
|
3602
|
+
done();
|
|
3603
|
+
} catch (err) {
|
|
3604
|
+
log.error(`Test Failure: ${err}`);
|
|
3605
|
+
done(err);
|
|
3606
|
+
}
|
|
3607
|
+
});
|
|
3608
|
+
} catch (error) {
|
|
3609
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3610
|
+
done(error);
|
|
3611
|
+
}
|
|
3612
|
+
}).timeout(attemptTimeout);
|
|
3613
|
+
});
|
|
3614
|
+
|
|
3615
|
+
const eventLogsStartEventReportEntryCsvExportBodyParam = {};
|
|
3616
|
+
describe('#startEventReportEntryCsvExport - errors', () => {
|
|
3617
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3618
|
+
try {
|
|
3619
|
+
a.startEventReportEntryCsvExport(eventLogsStartEventReportEntryCsvExportBodyParam, (data, error) => {
|
|
3620
|
+
try {
|
|
3621
|
+
if (stub) {
|
|
3622
|
+
const displayE = 'Error 400 received on request';
|
|
3623
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3624
|
+
} else {
|
|
3625
|
+
runCommonAsserts(data, error);
|
|
3626
|
+
}
|
|
3627
|
+
saveMockData('EventLogs', 'startEventReportEntryCsvExport', 'default', data);
|
|
3628
|
+
done();
|
|
3629
|
+
} catch (err) {
|
|
3630
|
+
log.error(`Test Failure: ${err}`);
|
|
3631
|
+
done(err);
|
|
3632
|
+
}
|
|
3633
|
+
});
|
|
3634
|
+
} catch (error) {
|
|
3635
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3636
|
+
done(error);
|
|
3637
|
+
}
|
|
3638
|
+
}).timeout(attemptTimeout);
|
|
3639
|
+
});
|
|
3640
|
+
|
|
3641
|
+
describe('#cancelEventReportEntryCsvExport - errors', () => {
|
|
3642
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3643
|
+
try {
|
|
3644
|
+
a.cancelEventReportEntryCsvExport((data, error) => {
|
|
3645
|
+
try {
|
|
3646
|
+
if (stub) {
|
|
3647
|
+
const displayE = 'Error 400 received on request';
|
|
3648
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3649
|
+
} else {
|
|
3650
|
+
runCommonAsserts(data, error);
|
|
3651
|
+
}
|
|
3652
|
+
saveMockData('EventLogs', 'cancelEventReportEntryCsvExport', 'default', data);
|
|
3653
|
+
done();
|
|
3654
|
+
} catch (err) {
|
|
3655
|
+
log.error(`Test Failure: ${err}`);
|
|
3656
|
+
done(err);
|
|
3657
|
+
}
|
|
3658
|
+
});
|
|
3659
|
+
} catch (error) {
|
|
3660
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3661
|
+
done(error);
|
|
3662
|
+
}
|
|
3663
|
+
}).timeout(attemptTimeout);
|
|
3664
|
+
});
|
|
3665
|
+
|
|
3666
|
+
describe('#getEventReportEntryCsvData - errors', () => {
|
|
3667
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3668
|
+
try {
|
|
3669
|
+
a.getEventReportEntryCsvData((data, error) => {
|
|
3670
|
+
try {
|
|
3671
|
+
if (stub) {
|
|
3672
|
+
const displayE = 'Error 400 received on request';
|
|
3673
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3674
|
+
} else {
|
|
3675
|
+
runCommonAsserts(data, error);
|
|
3676
|
+
}
|
|
3677
|
+
saveMockData('EventLogs', 'getEventReportEntryCsvData', 'default', data);
|
|
3678
|
+
done();
|
|
3679
|
+
} catch (err) {
|
|
3680
|
+
log.error(`Test Failure: ${err}`);
|
|
3681
|
+
done(err);
|
|
3682
|
+
}
|
|
3683
|
+
});
|
|
3684
|
+
} catch (error) {
|
|
3685
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3686
|
+
done(error);
|
|
3687
|
+
}
|
|
3688
|
+
}).timeout(attemptTimeout);
|
|
3689
|
+
});
|
|
3690
|
+
|
|
3691
|
+
describe('#getFirewallFilteringRules - errors', () => {
|
|
3692
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
3693
|
+
try {
|
|
3694
|
+
a.getFirewallFilteringRules((data, error) => {
|
|
3695
|
+
try {
|
|
3696
|
+
if (stub) {
|
|
3697
|
+
runCommonAsserts(data, error);
|
|
3698
|
+
assert.equal('object', typeof data.response[0]);
|
|
3699
|
+
assert.equal('object', typeof data.response[1]);
|
|
3700
|
+
} else {
|
|
3701
|
+
runCommonAsserts(data, error);
|
|
3702
|
+
}
|
|
3703
|
+
saveMockData('FirewallPolicies', 'getFirewallFilteringRules', 'default', data);
|
|
3704
|
+
done();
|
|
3705
|
+
} catch (err) {
|
|
3706
|
+
log.error(`Test Failure: ${err}`);
|
|
3707
|
+
done(err);
|
|
3708
|
+
}
|
|
3709
|
+
});
|
|
3710
|
+
} catch (error) {
|
|
3711
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3712
|
+
done(error);
|
|
3713
|
+
}
|
|
3714
|
+
}).timeout(attemptTimeout);
|
|
3715
|
+
});
|
|
3716
|
+
|
|
3717
|
+
const firewallPoliciesCreateFirewallFilteringRuleBodyParam = {};
|
|
3718
|
+
describe('#createFirewallFilteringRule - errors', () => {
|
|
3719
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3720
|
+
try {
|
|
3721
|
+
a.createFirewallFilteringRule(firewallPoliciesCreateFirewallFilteringRuleBodyParam, (data, error) => {
|
|
3722
|
+
try {
|
|
3723
|
+
if (stub) {
|
|
3724
|
+
const displayE = 'Error 400 received on request';
|
|
3725
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3726
|
+
} else {
|
|
3727
|
+
runCommonAsserts(data, error);
|
|
3728
|
+
}
|
|
3729
|
+
saveMockData('FirewallPolicies', 'createFirewallFilteringRule', 'default', data);
|
|
3730
|
+
done();
|
|
3731
|
+
} catch (err) {
|
|
3732
|
+
log.error(`Test Failure: ${err}`);
|
|
3733
|
+
done(err);
|
|
3734
|
+
}
|
|
3735
|
+
});
|
|
3736
|
+
} catch (error) {
|
|
3737
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3738
|
+
done(error);
|
|
3739
|
+
}
|
|
3740
|
+
}).timeout(attemptTimeout);
|
|
3741
|
+
});
|
|
3742
|
+
|
|
3743
|
+
describe('#getFirewallFilteringRule - errors', () => {
|
|
3744
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3745
|
+
try {
|
|
3746
|
+
a.getFirewallFilteringRule(555, (data, error) => {
|
|
3747
|
+
try {
|
|
3748
|
+
if (stub) {
|
|
3749
|
+
const displayE = 'Error 400 received on request';
|
|
3750
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3751
|
+
} else {
|
|
3752
|
+
runCommonAsserts(data, error);
|
|
3753
|
+
}
|
|
3754
|
+
saveMockData('FirewallPolicies', 'getFirewallFilteringRule', 'default', data);
|
|
3755
|
+
done();
|
|
3756
|
+
} catch (err) {
|
|
3757
|
+
log.error(`Test Failure: ${err}`);
|
|
3758
|
+
done(err);
|
|
3759
|
+
}
|
|
3760
|
+
});
|
|
3761
|
+
} catch (error) {
|
|
3762
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3763
|
+
done(error);
|
|
3764
|
+
}
|
|
3765
|
+
}).timeout(attemptTimeout);
|
|
3766
|
+
});
|
|
3767
|
+
|
|
3768
|
+
const firewallPoliciesUpdateFirewallFilteringRuleBodyParam = {};
|
|
3769
|
+
describe('#updateFirewallFilteringRule - errors', () => {
|
|
3770
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3771
|
+
try {
|
|
3772
|
+
a.updateFirewallFilteringRule(555, firewallPoliciesUpdateFirewallFilteringRuleBodyParam, (data, error) => {
|
|
3773
|
+
try {
|
|
3774
|
+
if (stub) {
|
|
3775
|
+
const displayE = 'Error 400 received on request';
|
|
3776
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3777
|
+
} else {
|
|
3778
|
+
runCommonAsserts(data, error);
|
|
3779
|
+
}
|
|
3780
|
+
saveMockData('FirewallPolicies', 'updateFirewallFilteringRule', 'default', data);
|
|
3781
|
+
done();
|
|
3782
|
+
} catch (err) {
|
|
3783
|
+
log.error(`Test Failure: ${err}`);
|
|
3784
|
+
done(err);
|
|
3785
|
+
}
|
|
3786
|
+
});
|
|
3787
|
+
} catch (error) {
|
|
3788
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3789
|
+
done(error);
|
|
3790
|
+
}
|
|
3791
|
+
}).timeout(attemptTimeout);
|
|
3792
|
+
});
|
|
3793
|
+
|
|
3794
|
+
describe('#deleteFirewallFilteringRule - errors', () => {
|
|
3795
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3796
|
+
try {
|
|
3797
|
+
a.deleteFirewallFilteringRule(555, (data, error) => {
|
|
3798
|
+
try {
|
|
3799
|
+
if (stub) {
|
|
3800
|
+
const displayE = 'Error 400 received on request';
|
|
3801
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3802
|
+
} else {
|
|
3803
|
+
runCommonAsserts(data, error);
|
|
3804
|
+
}
|
|
3805
|
+
saveMockData('FirewallPolicies', 'deleteFirewallFilteringRule', 'default', data);
|
|
3806
|
+
done();
|
|
3807
|
+
} catch (err) {
|
|
3808
|
+
log.error(`Test Failure: ${err}`);
|
|
3809
|
+
done(err);
|
|
3810
|
+
}
|
|
3811
|
+
});
|
|
3812
|
+
} catch (error) {
|
|
3813
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3814
|
+
done(error);
|
|
3815
|
+
}
|
|
3816
|
+
}).timeout(attemptTimeout);
|
|
3817
|
+
});
|
|
3818
|
+
|
|
3819
|
+
describe('#getDestinationIpGroups - errors', () => {
|
|
3820
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
3821
|
+
try {
|
|
3822
|
+
a.getDestinationIpGroups(null, (data, error) => {
|
|
3823
|
+
try {
|
|
3824
|
+
if (stub) {
|
|
3825
|
+
runCommonAsserts(data, error);
|
|
3826
|
+
assert.equal('object', typeof data.response[0]);
|
|
3827
|
+
assert.equal('object', typeof data.response[1]);
|
|
3828
|
+
assert.equal('object', typeof data.response[2]);
|
|
3829
|
+
assert.equal('object', typeof data.response[3]);
|
|
3830
|
+
} else {
|
|
3831
|
+
runCommonAsserts(data, error);
|
|
3832
|
+
}
|
|
3833
|
+
saveMockData('FirewallPolicies', 'getDestinationIpGroups', 'default', data);
|
|
3834
|
+
done();
|
|
3835
|
+
} catch (err) {
|
|
3836
|
+
log.error(`Test Failure: ${err}`);
|
|
3837
|
+
done(err);
|
|
3838
|
+
}
|
|
3839
|
+
});
|
|
3840
|
+
} catch (error) {
|
|
3841
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3842
|
+
done(error);
|
|
3843
|
+
}
|
|
3844
|
+
}).timeout(attemptTimeout);
|
|
3845
|
+
});
|
|
3846
|
+
|
|
3847
|
+
describe('#addDestinationIpGroup - errors', () => {
|
|
3848
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3849
|
+
try {
|
|
3850
|
+
a.addDestinationIpGroup((data, error) => {
|
|
3851
|
+
try {
|
|
3852
|
+
if (stub) {
|
|
3853
|
+
const displayE = 'Error 400 received on request';
|
|
3854
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3855
|
+
} else {
|
|
3856
|
+
runCommonAsserts(data, error);
|
|
3857
|
+
}
|
|
3858
|
+
saveMockData('FirewallPolicies', 'addDestinationIpGroup', 'default', data);
|
|
3859
|
+
done();
|
|
3860
|
+
} catch (err) {
|
|
3861
|
+
log.error(`Test Failure: ${err}`);
|
|
3862
|
+
done(err);
|
|
3863
|
+
}
|
|
3864
|
+
});
|
|
3865
|
+
} catch (error) {
|
|
3866
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3867
|
+
done(error);
|
|
3868
|
+
}
|
|
3869
|
+
}).timeout(attemptTimeout);
|
|
3870
|
+
});
|
|
3871
|
+
|
|
3872
|
+
describe('#getDestinationIpv6Groups - errors', () => {
|
|
3873
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
3874
|
+
try {
|
|
3875
|
+
a.getDestinationIpv6Groups(null, (data, error) => {
|
|
3876
|
+
try {
|
|
3877
|
+
if (stub) {
|
|
3878
|
+
runCommonAsserts(data, error);
|
|
3879
|
+
assert.equal('object', typeof data.response[0]);
|
|
3880
|
+
assert.equal('object', typeof data.response[1]);
|
|
3881
|
+
assert.equal('object', typeof data.response[2]);
|
|
3882
|
+
assert.equal('object', typeof data.response[3]);
|
|
3883
|
+
} else {
|
|
3884
|
+
runCommonAsserts(data, error);
|
|
3885
|
+
}
|
|
3886
|
+
saveMockData('FirewallPolicies', 'getDestinationIpv6Groups', 'default', data);
|
|
3887
|
+
done();
|
|
3888
|
+
} catch (err) {
|
|
3889
|
+
log.error(`Test Failure: ${err}`);
|
|
3890
|
+
done(err);
|
|
3891
|
+
}
|
|
3892
|
+
});
|
|
3893
|
+
} catch (error) {
|
|
3894
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3895
|
+
done(error);
|
|
3896
|
+
}
|
|
3897
|
+
}).timeout(attemptTimeout);
|
|
3898
|
+
});
|
|
3899
|
+
|
|
3900
|
+
describe('#getDestinationIpv6GroupsLite - errors', () => {
|
|
3901
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
3902
|
+
try {
|
|
3903
|
+
a.getDestinationIpv6GroupsLite(null, null, (data, error) => {
|
|
3904
|
+
try {
|
|
3905
|
+
if (stub) {
|
|
3906
|
+
runCommonAsserts(data, error);
|
|
3907
|
+
assert.equal('object', typeof data.response[0]);
|
|
3908
|
+
assert.equal('object', typeof data.response[1]);
|
|
3909
|
+
assert.equal('object', typeof data.response[2]);
|
|
3910
|
+
} else {
|
|
3911
|
+
runCommonAsserts(data, error);
|
|
3912
|
+
}
|
|
3913
|
+
saveMockData('FirewallPolicies', 'getDestinationIpv6GroupsLite', 'default', data);
|
|
3914
|
+
done();
|
|
3915
|
+
} catch (err) {
|
|
3916
|
+
log.error(`Test Failure: ${err}`);
|
|
3917
|
+
done(err);
|
|
3918
|
+
}
|
|
3919
|
+
});
|
|
3920
|
+
} catch (error) {
|
|
3921
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3922
|
+
done(error);
|
|
3923
|
+
}
|
|
3924
|
+
}).timeout(attemptTimeout);
|
|
3925
|
+
});
|
|
3926
|
+
|
|
3927
|
+
describe('#getDestinationIpGroupsLite - errors', () => {
|
|
3928
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
3929
|
+
try {
|
|
3930
|
+
a.getDestinationIpGroupsLite(null, null, (data, error) => {
|
|
3931
|
+
try {
|
|
3932
|
+
if (stub) {
|
|
3933
|
+
runCommonAsserts(data, error);
|
|
3934
|
+
assert.equal('object', typeof data.response[0]);
|
|
3935
|
+
assert.equal('object', typeof data.response[1]);
|
|
3936
|
+
assert.equal('object', typeof data.response[2]);
|
|
3937
|
+
} else {
|
|
3938
|
+
runCommonAsserts(data, error);
|
|
3939
|
+
}
|
|
3940
|
+
saveMockData('FirewallPolicies', 'getDestinationIpGroupsLite', 'default', data);
|
|
3941
|
+
done();
|
|
3942
|
+
} catch (err) {
|
|
3943
|
+
log.error(`Test Failure: ${err}`);
|
|
3944
|
+
done(err);
|
|
3945
|
+
}
|
|
3946
|
+
});
|
|
3947
|
+
} catch (error) {
|
|
3948
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3949
|
+
done(error);
|
|
3950
|
+
}
|
|
3951
|
+
}).timeout(attemptTimeout);
|
|
3952
|
+
});
|
|
3953
|
+
|
|
3954
|
+
describe('#getDestinationIpGroupById - errors', () => {
|
|
3955
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3956
|
+
try {
|
|
3957
|
+
a.getDestinationIpGroupById(555, (data, error) => {
|
|
3958
|
+
try {
|
|
3959
|
+
if (stub) {
|
|
3960
|
+
const displayE = 'Error 400 received on request';
|
|
3961
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3962
|
+
} else {
|
|
3963
|
+
runCommonAsserts(data, error);
|
|
3964
|
+
}
|
|
3965
|
+
saveMockData('FirewallPolicies', 'getDestinationIpGroupById', 'default', data);
|
|
3966
|
+
done();
|
|
3967
|
+
} catch (err) {
|
|
3968
|
+
log.error(`Test Failure: ${err}`);
|
|
3969
|
+
done(err);
|
|
3970
|
+
}
|
|
3971
|
+
});
|
|
3972
|
+
} catch (error) {
|
|
3973
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3974
|
+
done(error);
|
|
3975
|
+
}
|
|
3976
|
+
}).timeout(attemptTimeout);
|
|
3977
|
+
});
|
|
3978
|
+
|
|
3979
|
+
describe('#editDestinationIpGroup - errors', () => {
|
|
3980
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
3981
|
+
try {
|
|
3982
|
+
a.editDestinationIpGroup(555, (data, error) => {
|
|
3983
|
+
try {
|
|
3984
|
+
if (stub) {
|
|
3985
|
+
const displayE = 'Error 400 received on request';
|
|
3986
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
3987
|
+
} else {
|
|
3988
|
+
runCommonAsserts(data, error);
|
|
3989
|
+
}
|
|
3990
|
+
saveMockData('FirewallPolicies', 'editDestinationIpGroup', 'default', data);
|
|
3991
|
+
done();
|
|
3992
|
+
} catch (err) {
|
|
3993
|
+
log.error(`Test Failure: ${err}`);
|
|
3994
|
+
done(err);
|
|
3995
|
+
}
|
|
3996
|
+
});
|
|
3997
|
+
} catch (error) {
|
|
3998
|
+
log.error(`Adapter Exception: ${error}`);
|
|
3999
|
+
done(error);
|
|
4000
|
+
}
|
|
4001
|
+
}).timeout(attemptTimeout);
|
|
4002
|
+
});
|
|
4003
|
+
|
|
4004
|
+
describe('#deleteDestinationIpGroup - errors', () => {
|
|
4005
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4006
|
+
try {
|
|
4007
|
+
a.deleteDestinationIpGroup(555, (data, error) => {
|
|
4008
|
+
try {
|
|
4009
|
+
if (stub) {
|
|
4010
|
+
const displayE = 'Error 400 received on request';
|
|
4011
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4012
|
+
} else {
|
|
4013
|
+
runCommonAsserts(data, error);
|
|
4014
|
+
}
|
|
4015
|
+
saveMockData('FirewallPolicies', 'deleteDestinationIpGroup', 'default', data);
|
|
4016
|
+
done();
|
|
4017
|
+
} catch (err) {
|
|
4018
|
+
log.error(`Test Failure: ${err}`);
|
|
4019
|
+
done(err);
|
|
4020
|
+
}
|
|
4021
|
+
});
|
|
4022
|
+
} catch (error) {
|
|
4023
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4024
|
+
done(error);
|
|
4025
|
+
}
|
|
4026
|
+
}).timeout(attemptTimeout);
|
|
4027
|
+
});
|
|
4028
|
+
|
|
4029
|
+
describe('#getSourceIpGroups - errors', () => {
|
|
4030
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
4031
|
+
try {
|
|
4032
|
+
a.getSourceIpGroups(null, (data, error) => {
|
|
4033
|
+
try {
|
|
4034
|
+
if (stub) {
|
|
4035
|
+
runCommonAsserts(data, error);
|
|
4036
|
+
assert.equal('object', typeof data.response[0]);
|
|
4037
|
+
assert.equal('object', typeof data.response[1]);
|
|
4038
|
+
assert.equal('object', typeof data.response[2]);
|
|
4039
|
+
assert.equal('object', typeof data.response[3]);
|
|
4040
|
+
} else {
|
|
4041
|
+
runCommonAsserts(data, error);
|
|
4042
|
+
}
|
|
4043
|
+
saveMockData('FirewallPolicies', 'getSourceIpGroups', 'default', data);
|
|
4044
|
+
done();
|
|
4045
|
+
} catch (err) {
|
|
4046
|
+
log.error(`Test Failure: ${err}`);
|
|
4047
|
+
done(err);
|
|
4048
|
+
}
|
|
4049
|
+
});
|
|
4050
|
+
} catch (error) {
|
|
4051
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4052
|
+
done(error);
|
|
4053
|
+
}
|
|
4054
|
+
}).timeout(attemptTimeout);
|
|
4055
|
+
});
|
|
4056
|
+
|
|
4057
|
+
describe('#addSourceIpGroup - errors', () => {
|
|
4058
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4059
|
+
try {
|
|
4060
|
+
a.addSourceIpGroup((data, error) => {
|
|
4061
|
+
try {
|
|
4062
|
+
if (stub) {
|
|
4063
|
+
const displayE = 'Error 400 received on request';
|
|
4064
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4065
|
+
} else {
|
|
4066
|
+
runCommonAsserts(data, error);
|
|
4067
|
+
}
|
|
4068
|
+
saveMockData('FirewallPolicies', 'addSourceIpGroup', 'default', data);
|
|
4069
|
+
done();
|
|
4070
|
+
} catch (err) {
|
|
4071
|
+
log.error(`Test Failure: ${err}`);
|
|
4072
|
+
done(err);
|
|
4073
|
+
}
|
|
4074
|
+
});
|
|
4075
|
+
} catch (error) {
|
|
4076
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4077
|
+
done(error);
|
|
4078
|
+
}
|
|
4079
|
+
}).timeout(attemptTimeout);
|
|
4080
|
+
});
|
|
4081
|
+
|
|
4082
|
+
describe('#getSourceIpv6Groups - errors', () => {
|
|
4083
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
4084
|
+
try {
|
|
4085
|
+
a.getSourceIpv6Groups((data, error) => {
|
|
4086
|
+
try {
|
|
4087
|
+
if (stub) {
|
|
4088
|
+
runCommonAsserts(data, error);
|
|
4089
|
+
assert.equal('object', typeof data.response[0]);
|
|
4090
|
+
assert.equal('object', typeof data.response[1]);
|
|
4091
|
+
assert.equal('object', typeof data.response[2]);
|
|
4092
|
+
assert.equal('object', typeof data.response[3]);
|
|
4093
|
+
} else {
|
|
4094
|
+
runCommonAsserts(data, error);
|
|
4095
|
+
}
|
|
4096
|
+
saveMockData('FirewallPolicies', 'getSourceIpv6Groups', 'default', data);
|
|
4097
|
+
done();
|
|
4098
|
+
} catch (err) {
|
|
4099
|
+
log.error(`Test Failure: ${err}`);
|
|
4100
|
+
done(err);
|
|
4101
|
+
}
|
|
4102
|
+
});
|
|
4103
|
+
} catch (error) {
|
|
4104
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4105
|
+
done(error);
|
|
4106
|
+
}
|
|
4107
|
+
}).timeout(attemptTimeout);
|
|
4108
|
+
});
|
|
4109
|
+
|
|
4110
|
+
describe('#getSourceIpv6GroupsLite - errors', () => {
|
|
4111
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
4112
|
+
try {
|
|
4113
|
+
a.getSourceIpv6GroupsLite((data, error) => {
|
|
4114
|
+
try {
|
|
4115
|
+
if (stub) {
|
|
4116
|
+
runCommonAsserts(data, error);
|
|
4117
|
+
assert.equal('object', typeof data.response[0]);
|
|
4118
|
+
} else {
|
|
4119
|
+
runCommonAsserts(data, error);
|
|
4120
|
+
}
|
|
4121
|
+
saveMockData('FirewallPolicies', 'getSourceIpv6GroupsLite', 'default', data);
|
|
4122
|
+
done();
|
|
4123
|
+
} catch (err) {
|
|
4124
|
+
log.error(`Test Failure: ${err}`);
|
|
4125
|
+
done(err);
|
|
4126
|
+
}
|
|
4127
|
+
});
|
|
4128
|
+
} catch (error) {
|
|
4129
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4130
|
+
done(error);
|
|
4131
|
+
}
|
|
4132
|
+
}).timeout(attemptTimeout);
|
|
4133
|
+
});
|
|
4134
|
+
|
|
4135
|
+
describe('#getSourceIpGroupsLite - errors', () => {
|
|
4136
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
4137
|
+
try {
|
|
4138
|
+
a.getSourceIpGroupsLite((data, error) => {
|
|
4139
|
+
try {
|
|
4140
|
+
if (stub) {
|
|
4141
|
+
runCommonAsserts(data, error);
|
|
4142
|
+
assert.equal('object', typeof data.response[0]);
|
|
4143
|
+
} else {
|
|
4144
|
+
runCommonAsserts(data, error);
|
|
4145
|
+
}
|
|
4146
|
+
saveMockData('FirewallPolicies', 'getSourceIpGroupsLite', 'default', data);
|
|
4147
|
+
done();
|
|
4148
|
+
} catch (err) {
|
|
4149
|
+
log.error(`Test Failure: ${err}`);
|
|
4150
|
+
done(err);
|
|
4151
|
+
}
|
|
4152
|
+
});
|
|
4153
|
+
} catch (error) {
|
|
4154
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4155
|
+
done(error);
|
|
4156
|
+
}
|
|
4157
|
+
}).timeout(attemptTimeout);
|
|
4158
|
+
});
|
|
4159
|
+
|
|
4160
|
+
describe('#getSourceIpGroupById - errors', () => {
|
|
4161
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4162
|
+
try {
|
|
4163
|
+
a.getSourceIpGroupById(555, (data, error) => {
|
|
4164
|
+
try {
|
|
4165
|
+
if (stub) {
|
|
4166
|
+
const displayE = 'Error 400 received on request';
|
|
4167
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4168
|
+
} else {
|
|
4169
|
+
runCommonAsserts(data, error);
|
|
4170
|
+
}
|
|
4171
|
+
saveMockData('FirewallPolicies', 'getSourceIpGroupById', 'default', data);
|
|
4172
|
+
done();
|
|
4173
|
+
} catch (err) {
|
|
4174
|
+
log.error(`Test Failure: ${err}`);
|
|
4175
|
+
done(err);
|
|
4176
|
+
}
|
|
4177
|
+
});
|
|
4178
|
+
} catch (error) {
|
|
4179
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4180
|
+
done(error);
|
|
4181
|
+
}
|
|
4182
|
+
}).timeout(attemptTimeout);
|
|
4183
|
+
});
|
|
4184
|
+
|
|
4185
|
+
describe('#editSourceIpGroup - errors', () => {
|
|
4186
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4187
|
+
try {
|
|
4188
|
+
a.editSourceIpGroup(555, (data, error) => {
|
|
4189
|
+
try {
|
|
4190
|
+
if (stub) {
|
|
4191
|
+
const displayE = 'Error 400 received on request';
|
|
4192
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4193
|
+
} else {
|
|
4194
|
+
runCommonAsserts(data, error);
|
|
4195
|
+
}
|
|
4196
|
+
saveMockData('FirewallPolicies', 'editSourceIpGroup', 'default', data);
|
|
4197
|
+
done();
|
|
4198
|
+
} catch (err) {
|
|
4199
|
+
log.error(`Test Failure: ${err}`);
|
|
4200
|
+
done(err);
|
|
4201
|
+
}
|
|
4202
|
+
});
|
|
4203
|
+
} catch (error) {
|
|
4204
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4205
|
+
done(error);
|
|
4206
|
+
}
|
|
4207
|
+
}).timeout(attemptTimeout);
|
|
4208
|
+
});
|
|
4209
|
+
|
|
4210
|
+
describe('#deleteSourceIpGroup - errors', () => {
|
|
4211
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4212
|
+
try {
|
|
4213
|
+
a.deleteSourceIpGroup(555, (data, error) => {
|
|
4214
|
+
try {
|
|
4215
|
+
if (stub) {
|
|
4216
|
+
const displayE = 'Error 400 received on request';
|
|
4217
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4218
|
+
} else {
|
|
4219
|
+
runCommonAsserts(data, error);
|
|
4220
|
+
}
|
|
4221
|
+
saveMockData('FirewallPolicies', 'deleteSourceIpGroup', 'default', data);
|
|
4222
|
+
done();
|
|
4223
|
+
} catch (err) {
|
|
4224
|
+
log.error(`Test Failure: ${err}`);
|
|
4225
|
+
done(err);
|
|
4226
|
+
}
|
|
4227
|
+
});
|
|
4228
|
+
} catch (error) {
|
|
4229
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4230
|
+
done(error);
|
|
4231
|
+
}
|
|
4232
|
+
}).timeout(attemptTimeout);
|
|
4233
|
+
});
|
|
4234
|
+
|
|
4235
|
+
describe('#getNetowrkApplicationGroups - errors', () => {
|
|
4236
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
4237
|
+
try {
|
|
4238
|
+
a.getNetowrkApplicationGroups(null, (data, error) => {
|
|
4239
|
+
try {
|
|
4240
|
+
if (stub) {
|
|
4241
|
+
runCommonAsserts(data, error);
|
|
4242
|
+
assert.equal('object', typeof data.response[0]);
|
|
4243
|
+
assert.equal('object', typeof data.response[1]);
|
|
4244
|
+
} else {
|
|
4245
|
+
runCommonAsserts(data, error);
|
|
4246
|
+
}
|
|
4247
|
+
saveMockData('FirewallPolicies', 'getNetowrkApplicationGroups', 'default', data);
|
|
4248
|
+
done();
|
|
4249
|
+
} catch (err) {
|
|
4250
|
+
log.error(`Test Failure: ${err}`);
|
|
4251
|
+
done(err);
|
|
4252
|
+
}
|
|
4253
|
+
});
|
|
4254
|
+
} catch (error) {
|
|
4255
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4256
|
+
done(error);
|
|
4257
|
+
}
|
|
4258
|
+
}).timeout(attemptTimeout);
|
|
4259
|
+
});
|
|
4260
|
+
|
|
4261
|
+
describe('#createNetworkApplicationGroup - errors', () => {
|
|
4262
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4263
|
+
try {
|
|
4264
|
+
a.createNetworkApplicationGroup((data, error) => {
|
|
4265
|
+
try {
|
|
4266
|
+
if (stub) {
|
|
4267
|
+
const displayE = 'Error 400 received on request';
|
|
4268
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4269
|
+
} else {
|
|
4270
|
+
runCommonAsserts(data, error);
|
|
4271
|
+
}
|
|
4272
|
+
saveMockData('FirewallPolicies', 'createNetworkApplicationGroup', 'default', data);
|
|
4273
|
+
done();
|
|
4274
|
+
} catch (err) {
|
|
4275
|
+
log.error(`Test Failure: ${err}`);
|
|
4276
|
+
done(err);
|
|
4277
|
+
}
|
|
4278
|
+
});
|
|
4279
|
+
} catch (error) {
|
|
4280
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4281
|
+
done(error);
|
|
4282
|
+
}
|
|
4283
|
+
}).timeout(attemptTimeout);
|
|
4284
|
+
});
|
|
4285
|
+
|
|
4286
|
+
describe('#getNetowrkApplicationGroupsLite - errors', () => {
|
|
4287
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
4288
|
+
try {
|
|
4289
|
+
a.getNetowrkApplicationGroupsLite((data, error) => {
|
|
4290
|
+
try {
|
|
4291
|
+
if (stub) {
|
|
4292
|
+
runCommonAsserts(data, error);
|
|
4293
|
+
assert.equal('object', typeof data.response[0]);
|
|
4294
|
+
assert.equal('object', typeof data.response[1]);
|
|
4295
|
+
assert.equal('object', typeof data.response[2]);
|
|
4296
|
+
assert.equal('object', typeof data.response[3]);
|
|
4297
|
+
} else {
|
|
4298
|
+
runCommonAsserts(data, error);
|
|
4299
|
+
}
|
|
4300
|
+
saveMockData('FirewallPolicies', 'getNetowrkApplicationGroupsLite', 'default', data);
|
|
4301
|
+
done();
|
|
4302
|
+
} catch (err) {
|
|
4303
|
+
log.error(`Test Failure: ${err}`);
|
|
4304
|
+
done(err);
|
|
4305
|
+
}
|
|
4306
|
+
});
|
|
4307
|
+
} catch (error) {
|
|
4308
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4309
|
+
done(error);
|
|
4310
|
+
}
|
|
4311
|
+
}).timeout(attemptTimeout);
|
|
4312
|
+
});
|
|
4313
|
+
|
|
4314
|
+
describe('#getNetworkApplicationGroupById - errors', () => {
|
|
4315
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4316
|
+
try {
|
|
4317
|
+
a.getNetworkApplicationGroupById(555, (data, error) => {
|
|
4318
|
+
try {
|
|
4319
|
+
if (stub) {
|
|
4320
|
+
const displayE = 'Error 400 received on request';
|
|
4321
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4322
|
+
} else {
|
|
4323
|
+
runCommonAsserts(data, error);
|
|
4324
|
+
}
|
|
4325
|
+
saveMockData('FirewallPolicies', 'getNetworkApplicationGroupById', 'default', data);
|
|
4326
|
+
done();
|
|
4327
|
+
} catch (err) {
|
|
4328
|
+
log.error(`Test Failure: ${err}`);
|
|
4329
|
+
done(err);
|
|
4330
|
+
}
|
|
4331
|
+
});
|
|
4332
|
+
} catch (error) {
|
|
4333
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4334
|
+
done(error);
|
|
4335
|
+
}
|
|
4336
|
+
}).timeout(attemptTimeout);
|
|
4337
|
+
});
|
|
4338
|
+
|
|
4339
|
+
describe('#updateNetworkApplicationGroup - errors', () => {
|
|
4340
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4341
|
+
try {
|
|
4342
|
+
a.updateNetworkApplicationGroup(555, (data, error) => {
|
|
4343
|
+
try {
|
|
4344
|
+
if (stub) {
|
|
4345
|
+
const displayE = 'Error 400 received on request';
|
|
4346
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4347
|
+
} else {
|
|
4348
|
+
runCommonAsserts(data, error);
|
|
4349
|
+
}
|
|
4350
|
+
saveMockData('FirewallPolicies', 'updateNetworkApplicationGroup', 'default', data);
|
|
4351
|
+
done();
|
|
4352
|
+
} catch (err) {
|
|
4353
|
+
log.error(`Test Failure: ${err}`);
|
|
4354
|
+
done(err);
|
|
4355
|
+
}
|
|
4356
|
+
});
|
|
4357
|
+
} catch (error) {
|
|
4358
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4359
|
+
done(error);
|
|
4360
|
+
}
|
|
4361
|
+
}).timeout(attemptTimeout);
|
|
4362
|
+
});
|
|
4363
|
+
|
|
4364
|
+
describe('#deleteNetworkApplicationGroup - errors', () => {
|
|
4365
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4366
|
+
try {
|
|
4367
|
+
a.deleteNetworkApplicationGroup(555, (data, error) => {
|
|
4368
|
+
try {
|
|
4369
|
+
if (stub) {
|
|
4370
|
+
const displayE = 'Error 400 received on request';
|
|
4371
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4372
|
+
} else {
|
|
4373
|
+
runCommonAsserts(data, error);
|
|
4374
|
+
}
|
|
4375
|
+
saveMockData('FirewallPolicies', 'deleteNetworkApplicationGroup', 'default', data);
|
|
4376
|
+
done();
|
|
4377
|
+
} catch (err) {
|
|
4378
|
+
log.error(`Test Failure: ${err}`);
|
|
4379
|
+
done(err);
|
|
4380
|
+
}
|
|
4381
|
+
});
|
|
4382
|
+
} catch (error) {
|
|
4383
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4384
|
+
done(error);
|
|
4385
|
+
}
|
|
4386
|
+
}).timeout(attemptTimeout);
|
|
4387
|
+
});
|
|
4388
|
+
|
|
4389
|
+
describe('#getNetworkApplications - errors', () => {
|
|
4390
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
4391
|
+
try {
|
|
4392
|
+
a.getNetworkApplications(null, null, (data, error) => {
|
|
4393
|
+
try {
|
|
4394
|
+
if (stub) {
|
|
4395
|
+
runCommonAsserts(data, error);
|
|
4396
|
+
assert.equal('object', typeof data.response[0]);
|
|
4397
|
+
assert.equal('object', typeof data.response[1]);
|
|
4398
|
+
assert.equal('object', typeof data.response[2]);
|
|
4399
|
+
} else {
|
|
4400
|
+
runCommonAsserts(data, error);
|
|
4401
|
+
}
|
|
4402
|
+
saveMockData('FirewallPolicies', 'getNetworkApplications', 'default', data);
|
|
4403
|
+
done();
|
|
4404
|
+
} catch (err) {
|
|
4405
|
+
log.error(`Test Failure: ${err}`);
|
|
4406
|
+
done(err);
|
|
4407
|
+
}
|
|
4408
|
+
});
|
|
4409
|
+
} catch (error) {
|
|
4410
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4411
|
+
done(error);
|
|
4412
|
+
}
|
|
4413
|
+
}).timeout(attemptTimeout);
|
|
4414
|
+
});
|
|
4415
|
+
|
|
4416
|
+
describe('#getNetworkApplicationById - errors', () => {
|
|
4417
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4418
|
+
try {
|
|
4419
|
+
a.getNetworkApplicationById('fakedata', null, (data, error) => {
|
|
4420
|
+
try {
|
|
4421
|
+
if (stub) {
|
|
4422
|
+
const displayE = 'Error 400 received on request';
|
|
4423
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4424
|
+
} else {
|
|
4425
|
+
runCommonAsserts(data, error);
|
|
4426
|
+
}
|
|
4427
|
+
saveMockData('FirewallPolicies', 'getNetworkApplicationById', 'default', data);
|
|
4428
|
+
done();
|
|
4429
|
+
} catch (err) {
|
|
4430
|
+
log.error(`Test Failure: ${err}`);
|
|
4431
|
+
done(err);
|
|
4432
|
+
}
|
|
4433
|
+
});
|
|
4434
|
+
} catch (error) {
|
|
4435
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4436
|
+
done(error);
|
|
4437
|
+
}
|
|
4438
|
+
}).timeout(attemptTimeout);
|
|
4439
|
+
});
|
|
4440
|
+
|
|
4441
|
+
describe('#getNetworkServiceGroups - errors', () => {
|
|
4442
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
4443
|
+
try {
|
|
4444
|
+
a.getNetworkServiceGroups(null, (data, error) => {
|
|
4445
|
+
try {
|
|
4446
|
+
if (stub) {
|
|
4447
|
+
runCommonAsserts(data, error);
|
|
4448
|
+
assert.equal('object', typeof data.response[0]);
|
|
4449
|
+
} else {
|
|
4450
|
+
runCommonAsserts(data, error);
|
|
4451
|
+
}
|
|
4452
|
+
saveMockData('FirewallPolicies', 'getNetworkServiceGroups', 'default', data);
|
|
4453
|
+
done();
|
|
4454
|
+
} catch (err) {
|
|
4455
|
+
log.error(`Test Failure: ${err}`);
|
|
4456
|
+
done(err);
|
|
4457
|
+
}
|
|
4458
|
+
});
|
|
4459
|
+
} catch (error) {
|
|
4460
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4461
|
+
done(error);
|
|
4462
|
+
}
|
|
4463
|
+
}).timeout(attemptTimeout);
|
|
4464
|
+
});
|
|
4465
|
+
|
|
4466
|
+
describe('#addCustomNetworkServiceGroup - errors', () => {
|
|
4467
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4468
|
+
try {
|
|
4469
|
+
a.addCustomNetworkServiceGroup((data, error) => {
|
|
4470
|
+
try {
|
|
4471
|
+
if (stub) {
|
|
4472
|
+
const displayE = 'Error 400 received on request';
|
|
4473
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4474
|
+
} else {
|
|
4475
|
+
runCommonAsserts(data, error);
|
|
4476
|
+
}
|
|
4477
|
+
saveMockData('FirewallPolicies', 'addCustomNetworkServiceGroup', 'default', data);
|
|
4478
|
+
done();
|
|
4479
|
+
} catch (err) {
|
|
4480
|
+
log.error(`Test Failure: ${err}`);
|
|
4481
|
+
done(err);
|
|
4482
|
+
}
|
|
4483
|
+
});
|
|
4484
|
+
} catch (error) {
|
|
4485
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4486
|
+
done(error);
|
|
4487
|
+
}
|
|
4488
|
+
}).timeout(attemptTimeout);
|
|
4489
|
+
});
|
|
4490
|
+
|
|
4491
|
+
describe('#getNetworkServiceGroupsLite - errors', () => {
|
|
4492
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
4493
|
+
try {
|
|
4494
|
+
a.getNetworkServiceGroupsLite((data, error) => {
|
|
4495
|
+
try {
|
|
4496
|
+
if (stub) {
|
|
4497
|
+
runCommonAsserts(data, error);
|
|
4498
|
+
assert.equal('object', typeof data.response[0]);
|
|
4499
|
+
} else {
|
|
4500
|
+
runCommonAsserts(data, error);
|
|
4501
|
+
}
|
|
4502
|
+
saveMockData('FirewallPolicies', 'getNetworkServiceGroupsLite', 'default', data);
|
|
4503
|
+
done();
|
|
4504
|
+
} catch (err) {
|
|
4505
|
+
log.error(`Test Failure: ${err}`);
|
|
4506
|
+
done(err);
|
|
4507
|
+
}
|
|
4508
|
+
});
|
|
4509
|
+
} catch (error) {
|
|
4510
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4511
|
+
done(error);
|
|
4512
|
+
}
|
|
4513
|
+
}).timeout(attemptTimeout);
|
|
4514
|
+
});
|
|
4515
|
+
|
|
4516
|
+
describe('#getNetworkServiceGroupById - errors', () => {
|
|
4517
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4518
|
+
try {
|
|
4519
|
+
a.getNetworkServiceGroupById(555, (data, error) => {
|
|
4520
|
+
try {
|
|
4521
|
+
if (stub) {
|
|
4522
|
+
const displayE = 'Error 400 received on request';
|
|
4523
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4524
|
+
} else {
|
|
4525
|
+
runCommonAsserts(data, error);
|
|
4526
|
+
}
|
|
4527
|
+
saveMockData('FirewallPolicies', 'getNetworkServiceGroupById', 'default', data);
|
|
4528
|
+
done();
|
|
4529
|
+
} catch (err) {
|
|
4530
|
+
log.error(`Test Failure: ${err}`);
|
|
4531
|
+
done(err);
|
|
4532
|
+
}
|
|
4533
|
+
});
|
|
4534
|
+
} catch (error) {
|
|
4535
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4536
|
+
done(error);
|
|
4537
|
+
}
|
|
4538
|
+
}).timeout(attemptTimeout);
|
|
4539
|
+
});
|
|
4540
|
+
|
|
4541
|
+
describe('#editNetworkServiceGroup - errors', () => {
|
|
4542
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4543
|
+
try {
|
|
4544
|
+
a.editNetworkServiceGroup(555, (data, error) => {
|
|
4545
|
+
try {
|
|
4546
|
+
if (stub) {
|
|
4547
|
+
const displayE = 'Error 400 received on request';
|
|
4548
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4549
|
+
} else {
|
|
4550
|
+
runCommonAsserts(data, error);
|
|
4551
|
+
}
|
|
4552
|
+
saveMockData('FirewallPolicies', 'editNetworkServiceGroup', 'default', data);
|
|
4553
|
+
done();
|
|
4554
|
+
} catch (err) {
|
|
4555
|
+
log.error(`Test Failure: ${err}`);
|
|
4556
|
+
done(err);
|
|
4557
|
+
}
|
|
4558
|
+
});
|
|
4559
|
+
} catch (error) {
|
|
4560
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4561
|
+
done(error);
|
|
4562
|
+
}
|
|
4563
|
+
}).timeout(attemptTimeout);
|
|
4564
|
+
});
|
|
4565
|
+
|
|
4566
|
+
describe('#deleteCustomNetowrkServiceGroup - errors', () => {
|
|
4567
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4568
|
+
try {
|
|
4569
|
+
a.deleteCustomNetowrkServiceGroup(555, (data, error) => {
|
|
4570
|
+
try {
|
|
4571
|
+
if (stub) {
|
|
4572
|
+
const displayE = 'Error 400 received on request';
|
|
4573
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4574
|
+
} else {
|
|
4575
|
+
runCommonAsserts(data, error);
|
|
4576
|
+
}
|
|
4577
|
+
saveMockData('FirewallPolicies', 'deleteCustomNetowrkServiceGroup', 'default', data);
|
|
4578
|
+
done();
|
|
4579
|
+
} catch (err) {
|
|
4580
|
+
log.error(`Test Failure: ${err}`);
|
|
4581
|
+
done(err);
|
|
4582
|
+
}
|
|
4583
|
+
});
|
|
4584
|
+
} catch (error) {
|
|
4585
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4586
|
+
done(error);
|
|
4587
|
+
}
|
|
4588
|
+
}).timeout(attemptTimeout);
|
|
4589
|
+
});
|
|
4590
|
+
|
|
4591
|
+
describe('#getNetworkServices - errors', () => {
|
|
4592
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
4593
|
+
try {
|
|
4594
|
+
a.getNetworkServices(null, null, null, (data, error) => {
|
|
4595
|
+
try {
|
|
4596
|
+
if (stub) {
|
|
4597
|
+
runCommonAsserts(data, error);
|
|
4598
|
+
assert.equal('object', typeof data.response[0]);
|
|
4599
|
+
assert.equal('object', typeof data.response[1]);
|
|
4600
|
+
} else {
|
|
4601
|
+
runCommonAsserts(data, error);
|
|
4602
|
+
}
|
|
4603
|
+
saveMockData('FirewallPolicies', 'getNetworkServices', 'default', data);
|
|
4604
|
+
done();
|
|
4605
|
+
} catch (err) {
|
|
4606
|
+
log.error(`Test Failure: ${err}`);
|
|
4607
|
+
done(err);
|
|
4608
|
+
}
|
|
4609
|
+
});
|
|
4610
|
+
} catch (error) {
|
|
4611
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4612
|
+
done(error);
|
|
4613
|
+
}
|
|
4614
|
+
}).timeout(attemptTimeout);
|
|
4615
|
+
});
|
|
4616
|
+
|
|
4617
|
+
const firewallPoliciesAddCustomNetworkServiceBodyParam = {};
|
|
4618
|
+
describe('#addCustomNetworkService - errors', () => {
|
|
4619
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4620
|
+
try {
|
|
4621
|
+
a.addCustomNetworkService(firewallPoliciesAddCustomNetworkServiceBodyParam, (data, error) => {
|
|
4622
|
+
try {
|
|
4623
|
+
if (stub) {
|
|
4624
|
+
const displayE = 'Error 400 received on request';
|
|
4625
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4626
|
+
} else {
|
|
4627
|
+
runCommonAsserts(data, error);
|
|
4628
|
+
}
|
|
4629
|
+
saveMockData('FirewallPolicies', 'addCustomNetworkService', 'default', data);
|
|
4630
|
+
done();
|
|
4631
|
+
} catch (err) {
|
|
4632
|
+
log.error(`Test Failure: ${err}`);
|
|
4633
|
+
done(err);
|
|
4634
|
+
}
|
|
4635
|
+
});
|
|
4636
|
+
} catch (error) {
|
|
4637
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4638
|
+
done(error);
|
|
4639
|
+
}
|
|
4640
|
+
}).timeout(attemptTimeout);
|
|
4641
|
+
});
|
|
4642
|
+
|
|
4643
|
+
describe('#getNetworkServicesLite - errors', () => {
|
|
4644
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
4645
|
+
try {
|
|
4646
|
+
a.getNetworkServicesLite(null, (data, error) => {
|
|
4647
|
+
try {
|
|
4648
|
+
if (stub) {
|
|
4649
|
+
runCommonAsserts(data, error);
|
|
4650
|
+
assert.equal('object', typeof data.response[0]);
|
|
4651
|
+
assert.equal('object', typeof data.response[1]);
|
|
4652
|
+
assert.equal('object', typeof data.response[2]);
|
|
4653
|
+
} else {
|
|
4654
|
+
runCommonAsserts(data, error);
|
|
4655
|
+
}
|
|
4656
|
+
saveMockData('FirewallPolicies', 'getNetworkServicesLite', 'default', data);
|
|
4657
|
+
done();
|
|
4658
|
+
} catch (err) {
|
|
4659
|
+
log.error(`Test Failure: ${err}`);
|
|
4660
|
+
done(err);
|
|
4661
|
+
}
|
|
4662
|
+
});
|
|
4663
|
+
} catch (error) {
|
|
4664
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4665
|
+
done(error);
|
|
4666
|
+
}
|
|
4667
|
+
}).timeout(attemptTimeout);
|
|
4668
|
+
});
|
|
4669
|
+
|
|
4670
|
+
describe('#getNetworkServiceById - errors', () => {
|
|
4671
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4672
|
+
try {
|
|
4673
|
+
a.getNetworkServiceById(555, null, (data, error) => {
|
|
4674
|
+
try {
|
|
4675
|
+
if (stub) {
|
|
4676
|
+
const displayE = 'Error 400 received on request';
|
|
4677
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4678
|
+
} else {
|
|
4679
|
+
runCommonAsserts(data, error);
|
|
4680
|
+
}
|
|
4681
|
+
saveMockData('FirewallPolicies', 'getNetworkServiceById', 'default', data);
|
|
4682
|
+
done();
|
|
4683
|
+
} catch (err) {
|
|
4684
|
+
log.error(`Test Failure: ${err}`);
|
|
4685
|
+
done(err);
|
|
4686
|
+
}
|
|
4687
|
+
});
|
|
4688
|
+
} catch (error) {
|
|
4689
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4690
|
+
done(error);
|
|
4691
|
+
}
|
|
4692
|
+
}).timeout(attemptTimeout);
|
|
4693
|
+
});
|
|
4694
|
+
|
|
4695
|
+
describe('#editNetworkService - errors', () => {
|
|
4696
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4697
|
+
try {
|
|
4698
|
+
a.editNetworkService(555, (data, error) => {
|
|
4699
|
+
try {
|
|
4700
|
+
if (stub) {
|
|
4701
|
+
const displayE = 'Error 400 received on request';
|
|
4702
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4703
|
+
} else {
|
|
4704
|
+
runCommonAsserts(data, error);
|
|
4705
|
+
}
|
|
4706
|
+
saveMockData('FirewallPolicies', 'editNetworkService', 'default', data);
|
|
4707
|
+
done();
|
|
4708
|
+
} catch (err) {
|
|
4709
|
+
log.error(`Test Failure: ${err}`);
|
|
4710
|
+
done(err);
|
|
4711
|
+
}
|
|
4712
|
+
});
|
|
4713
|
+
} catch (error) {
|
|
4714
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4715
|
+
done(error);
|
|
4716
|
+
}
|
|
4717
|
+
}).timeout(attemptTimeout);
|
|
4718
|
+
});
|
|
4719
|
+
|
|
4720
|
+
describe('#deleteCustomNetworkService - errors', () => {
|
|
4721
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4722
|
+
try {
|
|
4723
|
+
a.deleteCustomNetworkService(555, (data, error) => {
|
|
4724
|
+
try {
|
|
4725
|
+
if (stub) {
|
|
4726
|
+
const displayE = 'Error 400 received on request';
|
|
4727
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4728
|
+
} else {
|
|
4729
|
+
runCommonAsserts(data, error);
|
|
4730
|
+
}
|
|
4731
|
+
saveMockData('FirewallPolicies', 'deleteCustomNetworkService', 'default', data);
|
|
4732
|
+
done();
|
|
4733
|
+
} catch (err) {
|
|
4734
|
+
log.error(`Test Failure: ${err}`);
|
|
4735
|
+
done(err);
|
|
4736
|
+
}
|
|
4737
|
+
});
|
|
4738
|
+
} catch (error) {
|
|
4739
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4740
|
+
done(error);
|
|
4741
|
+
}
|
|
4742
|
+
}).timeout(attemptTimeout);
|
|
4743
|
+
});
|
|
4744
|
+
|
|
4745
|
+
describe('#getTimeWindows - errors', () => {
|
|
4746
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
4747
|
+
try {
|
|
4748
|
+
a.getTimeWindows((data, error) => {
|
|
4749
|
+
try {
|
|
4750
|
+
if (stub) {
|
|
4751
|
+
runCommonAsserts(data, error);
|
|
4752
|
+
assert.equal('object', typeof data.response[0]);
|
|
4753
|
+
assert.equal('object', typeof data.response[1]);
|
|
4754
|
+
assert.equal('object', typeof data.response[2]);
|
|
4755
|
+
} else {
|
|
4756
|
+
runCommonAsserts(data, error);
|
|
4757
|
+
}
|
|
4758
|
+
saveMockData('FirewallPolicies', 'getTimeWindows', 'default', data);
|
|
4759
|
+
done();
|
|
4760
|
+
} catch (err) {
|
|
4761
|
+
log.error(`Test Failure: ${err}`);
|
|
4762
|
+
done(err);
|
|
4763
|
+
}
|
|
4764
|
+
});
|
|
4765
|
+
} catch (error) {
|
|
4766
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4767
|
+
done(error);
|
|
4768
|
+
}
|
|
4769
|
+
}).timeout(attemptTimeout);
|
|
4770
|
+
});
|
|
4771
|
+
|
|
4772
|
+
describe('#getTimeWindowSummary - errors', () => {
|
|
4773
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
4774
|
+
try {
|
|
4775
|
+
a.getTimeWindowSummary((data, error) => {
|
|
4776
|
+
try {
|
|
4777
|
+
if (stub) {
|
|
4778
|
+
runCommonAsserts(data, error);
|
|
4779
|
+
assert.equal('object', typeof data.response[0]);
|
|
4780
|
+
assert.equal('object', typeof data.response[1]);
|
|
4781
|
+
assert.equal('object', typeof data.response[2]);
|
|
4782
|
+
} else {
|
|
4783
|
+
runCommonAsserts(data, error);
|
|
4784
|
+
}
|
|
4785
|
+
saveMockData('FirewallPolicies', 'getTimeWindowSummary', 'default', data);
|
|
4786
|
+
done();
|
|
4787
|
+
} catch (err) {
|
|
4788
|
+
log.error(`Test Failure: ${err}`);
|
|
4789
|
+
done(err);
|
|
4790
|
+
}
|
|
4791
|
+
});
|
|
4792
|
+
} catch (error) {
|
|
4793
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4794
|
+
done(error);
|
|
4795
|
+
}
|
|
4796
|
+
}).timeout(attemptTimeout);
|
|
4797
|
+
});
|
|
4798
|
+
|
|
4799
|
+
describe('#getUrlFilteringRules - errors', () => {
|
|
4800
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
4801
|
+
try {
|
|
4802
|
+
a.getUrlFilteringRules((data, error) => {
|
|
4803
|
+
try {
|
|
4804
|
+
if (stub) {
|
|
4805
|
+
runCommonAsserts(data, error);
|
|
4806
|
+
assert.equal('object', typeof data.response[0]);
|
|
4807
|
+
assert.equal('object', typeof data.response[1]);
|
|
4808
|
+
} else {
|
|
4809
|
+
runCommonAsserts(data, error);
|
|
4810
|
+
}
|
|
4811
|
+
saveMockData('URLFilteringPolicies', 'getUrlFilteringRules', 'default', data);
|
|
4812
|
+
done();
|
|
4813
|
+
} catch (err) {
|
|
4814
|
+
log.error(`Test Failure: ${err}`);
|
|
4815
|
+
done(err);
|
|
4816
|
+
}
|
|
4817
|
+
});
|
|
4818
|
+
} catch (error) {
|
|
4819
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4820
|
+
done(error);
|
|
4821
|
+
}
|
|
4822
|
+
}).timeout(attemptTimeout);
|
|
4823
|
+
});
|
|
4824
|
+
|
|
4825
|
+
const uRLFilteringPoliciesPostUrlFilteringRulesBodyParam = {};
|
|
4826
|
+
describe('#postUrlFilteringRules - errors', () => {
|
|
4827
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4828
|
+
try {
|
|
4829
|
+
a.postUrlFilteringRules(uRLFilteringPoliciesPostUrlFilteringRulesBodyParam, (data, error) => {
|
|
4830
|
+
try {
|
|
4831
|
+
if (stub) {
|
|
4832
|
+
const displayE = 'Error 400 received on request';
|
|
4833
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4834
|
+
} else {
|
|
4835
|
+
runCommonAsserts(data, error);
|
|
4836
|
+
}
|
|
4837
|
+
saveMockData('URLFilteringPolicies', 'postUrlFilteringRules', 'default', data);
|
|
4838
|
+
done();
|
|
4839
|
+
} catch (err) {
|
|
4840
|
+
log.error(`Test Failure: ${err}`);
|
|
4841
|
+
done(err);
|
|
4842
|
+
}
|
|
4843
|
+
});
|
|
4844
|
+
} catch (error) {
|
|
4845
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4846
|
+
done(error);
|
|
4847
|
+
}
|
|
4848
|
+
}).timeout(attemptTimeout);
|
|
4849
|
+
});
|
|
4850
|
+
|
|
4851
|
+
describe('#getUrlFilteringRulesRuleId - errors', () => {
|
|
4852
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4853
|
+
try {
|
|
4854
|
+
a.getUrlFilteringRulesRuleId(555, (data, error) => {
|
|
4855
|
+
try {
|
|
4856
|
+
if (stub) {
|
|
4857
|
+
const displayE = 'Error 400 received on request';
|
|
4858
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4859
|
+
} else {
|
|
4860
|
+
runCommonAsserts(data, error);
|
|
4861
|
+
}
|
|
4862
|
+
saveMockData('URLFilteringPolicies', 'getUrlFilteringRulesRuleId', 'default', data);
|
|
4863
|
+
done();
|
|
4864
|
+
} catch (err) {
|
|
4865
|
+
log.error(`Test Failure: ${err}`);
|
|
4866
|
+
done(err);
|
|
4867
|
+
}
|
|
4868
|
+
});
|
|
4869
|
+
} catch (error) {
|
|
4870
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4871
|
+
done(error);
|
|
4872
|
+
}
|
|
4873
|
+
}).timeout(attemptTimeout);
|
|
4874
|
+
});
|
|
4875
|
+
|
|
4876
|
+
const uRLFilteringPoliciesPutUrlFilteringRulesRuleIdBodyParam = {};
|
|
4877
|
+
describe('#putUrlFilteringRulesRuleId - errors', () => {
|
|
4878
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4879
|
+
try {
|
|
4880
|
+
a.putUrlFilteringRulesRuleId(555, uRLFilteringPoliciesPutUrlFilteringRulesRuleIdBodyParam, (data, error) => {
|
|
4881
|
+
try {
|
|
4882
|
+
if (stub) {
|
|
4883
|
+
const displayE = 'Error 400 received on request';
|
|
4884
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4885
|
+
} else {
|
|
4886
|
+
runCommonAsserts(data, error);
|
|
4887
|
+
}
|
|
4888
|
+
saveMockData('URLFilteringPolicies', 'putUrlFilteringRulesRuleId', 'default', data);
|
|
4889
|
+
done();
|
|
4890
|
+
} catch (err) {
|
|
4891
|
+
log.error(`Test Failure: ${err}`);
|
|
4892
|
+
done(err);
|
|
4893
|
+
}
|
|
4894
|
+
});
|
|
4895
|
+
} catch (error) {
|
|
4896
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4897
|
+
done(error);
|
|
4898
|
+
}
|
|
4899
|
+
}).timeout(attemptTimeout);
|
|
4900
|
+
});
|
|
4901
|
+
|
|
4902
|
+
describe('#deleteUrlFilteringRulesRuleId - errors', () => {
|
|
4903
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4904
|
+
try {
|
|
4905
|
+
a.deleteUrlFilteringRulesRuleId(555, (data, error) => {
|
|
4906
|
+
try {
|
|
4907
|
+
if (stub) {
|
|
4908
|
+
const displayE = 'Error 400 received on request';
|
|
4909
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4910
|
+
} else {
|
|
4911
|
+
runCommonAsserts(data, error);
|
|
4912
|
+
}
|
|
4913
|
+
saveMockData('URLFilteringPolicies', 'deleteUrlFilteringRulesRuleId', 'default', data);
|
|
4914
|
+
done();
|
|
4915
|
+
} catch (err) {
|
|
4916
|
+
log.error(`Test Failure: ${err}`);
|
|
4917
|
+
done(err);
|
|
4918
|
+
}
|
|
4919
|
+
});
|
|
4920
|
+
} catch (error) {
|
|
4921
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4922
|
+
done(error);
|
|
4923
|
+
}
|
|
4924
|
+
}).timeout(attemptTimeout);
|
|
4925
|
+
});
|
|
4926
|
+
|
|
4927
|
+
describe('#getForwardingRules - errors', () => {
|
|
4928
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
4929
|
+
try {
|
|
4930
|
+
a.getForwardingRules((data, error) => {
|
|
4931
|
+
try {
|
|
4932
|
+
if (stub) {
|
|
4933
|
+
runCommonAsserts(data, error);
|
|
4934
|
+
assert.equal('object', typeof data.response[0]);
|
|
4935
|
+
assert.equal('object', typeof data.response[1]);
|
|
4936
|
+
assert.equal('object', typeof data.response[2]);
|
|
4937
|
+
} else {
|
|
4938
|
+
runCommonAsserts(data, error);
|
|
4939
|
+
}
|
|
4940
|
+
saveMockData('ForwardingControlPolicy', 'getForwardingRules', 'default', data);
|
|
4941
|
+
done();
|
|
4942
|
+
} catch (err) {
|
|
4943
|
+
log.error(`Test Failure: ${err}`);
|
|
4944
|
+
done(err);
|
|
4945
|
+
}
|
|
4946
|
+
});
|
|
4947
|
+
} catch (error) {
|
|
4948
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4949
|
+
done(error);
|
|
4950
|
+
}
|
|
4951
|
+
}).timeout(attemptTimeout);
|
|
4952
|
+
});
|
|
4953
|
+
|
|
4954
|
+
const forwardingControlPolicyCreateForwardingRuleBodyParam = {};
|
|
4955
|
+
describe('#createForwardingRule - errors', () => {
|
|
4956
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4957
|
+
try {
|
|
4958
|
+
a.createForwardingRule(forwardingControlPolicyCreateForwardingRuleBodyParam, (data, error) => {
|
|
4959
|
+
try {
|
|
4960
|
+
if (stub) {
|
|
4961
|
+
const displayE = 'Error 400 received on request';
|
|
4962
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4963
|
+
} else {
|
|
4964
|
+
runCommonAsserts(data, error);
|
|
4965
|
+
}
|
|
4966
|
+
saveMockData('ForwardingControlPolicy', 'createForwardingRule', 'default', data);
|
|
4967
|
+
done();
|
|
4968
|
+
} catch (err) {
|
|
4969
|
+
log.error(`Test Failure: ${err}`);
|
|
4970
|
+
done(err);
|
|
4971
|
+
}
|
|
4972
|
+
});
|
|
4973
|
+
} catch (error) {
|
|
4974
|
+
log.error(`Adapter Exception: ${error}`);
|
|
4975
|
+
done(error);
|
|
4976
|
+
}
|
|
4977
|
+
}).timeout(attemptTimeout);
|
|
4978
|
+
});
|
|
4979
|
+
|
|
4980
|
+
describe('#getForwardingRule - errors', () => {
|
|
4981
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
4982
|
+
try {
|
|
4983
|
+
a.getForwardingRule(555, (data, error) => {
|
|
4984
|
+
try {
|
|
4985
|
+
if (stub) {
|
|
4986
|
+
const displayE = 'Error 400 received on request';
|
|
4987
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
4988
|
+
} else {
|
|
4989
|
+
runCommonAsserts(data, error);
|
|
4990
|
+
}
|
|
4991
|
+
saveMockData('ForwardingControlPolicy', 'getForwardingRule', 'default', data);
|
|
4992
|
+
done();
|
|
4993
|
+
} catch (err) {
|
|
4994
|
+
log.error(`Test Failure: ${err}`);
|
|
4995
|
+
done(err);
|
|
4996
|
+
}
|
|
4997
|
+
});
|
|
4998
|
+
} catch (error) {
|
|
4999
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5000
|
+
done(error);
|
|
5001
|
+
}
|
|
5002
|
+
}).timeout(attemptTimeout);
|
|
5003
|
+
});
|
|
5004
|
+
|
|
5005
|
+
const forwardingControlPolicyUpdateForwardingRuleBodyParam = {};
|
|
5006
|
+
describe('#updateForwardingRule - errors', () => {
|
|
5007
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5008
|
+
try {
|
|
5009
|
+
a.updateForwardingRule(555, forwardingControlPolicyUpdateForwardingRuleBodyParam, (data, error) => {
|
|
5010
|
+
try {
|
|
5011
|
+
if (stub) {
|
|
5012
|
+
const displayE = 'Error 400 received on request';
|
|
5013
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5014
|
+
} else {
|
|
5015
|
+
runCommonAsserts(data, error);
|
|
5016
|
+
}
|
|
5017
|
+
saveMockData('ForwardingControlPolicy', 'updateForwardingRule', 'default', data);
|
|
5018
|
+
done();
|
|
5019
|
+
} catch (err) {
|
|
5020
|
+
log.error(`Test Failure: ${err}`);
|
|
5021
|
+
done(err);
|
|
5022
|
+
}
|
|
5023
|
+
});
|
|
5024
|
+
} catch (error) {
|
|
5025
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5026
|
+
done(error);
|
|
5027
|
+
}
|
|
5028
|
+
}).timeout(attemptTimeout);
|
|
5029
|
+
});
|
|
5030
|
+
|
|
5031
|
+
describe('#deleteForwardingRule - errors', () => {
|
|
5032
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5033
|
+
try {
|
|
5034
|
+
a.deleteForwardingRule(555, (data, error) => {
|
|
5035
|
+
try {
|
|
5036
|
+
if (stub) {
|
|
5037
|
+
const displayE = 'Error 400 received on request';
|
|
5038
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5039
|
+
} else {
|
|
5040
|
+
runCommonAsserts(data, error);
|
|
5041
|
+
}
|
|
5042
|
+
saveMockData('ForwardingControlPolicy', 'deleteForwardingRule', 'default', data);
|
|
5043
|
+
done();
|
|
5044
|
+
} catch (err) {
|
|
5045
|
+
log.error(`Test Failure: ${err}`);
|
|
5046
|
+
done(err);
|
|
5047
|
+
}
|
|
5048
|
+
});
|
|
5049
|
+
} catch (error) {
|
|
5050
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5051
|
+
done(error);
|
|
5052
|
+
}
|
|
5053
|
+
}).timeout(attemptTimeout);
|
|
5054
|
+
});
|
|
5055
|
+
|
|
5056
|
+
describe('#getZpaGateways - errors', () => {
|
|
5057
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
5058
|
+
try {
|
|
5059
|
+
a.getZpaGateways(null, null, (data, error) => {
|
|
5060
|
+
try {
|
|
5061
|
+
if (stub) {
|
|
5062
|
+
runCommonAsserts(data, error);
|
|
5063
|
+
assert.equal('object', typeof data.response[0]);
|
|
5064
|
+
} else {
|
|
5065
|
+
runCommonAsserts(data, error);
|
|
5066
|
+
}
|
|
5067
|
+
saveMockData('ForwardingControlPolicy', 'getZpaGateways', 'default', data);
|
|
5068
|
+
done();
|
|
5069
|
+
} catch (err) {
|
|
5070
|
+
log.error(`Test Failure: ${err}`);
|
|
5071
|
+
done(err);
|
|
5072
|
+
}
|
|
5073
|
+
});
|
|
5074
|
+
} catch (error) {
|
|
5075
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5076
|
+
done(error);
|
|
5077
|
+
}
|
|
5078
|
+
}).timeout(attemptTimeout);
|
|
5079
|
+
});
|
|
5080
|
+
|
|
5081
|
+
const forwardingControlPolicyAddZpaGatewayBodyParam = {
|
|
5082
|
+
id: 3,
|
|
5083
|
+
name: 'string',
|
|
5084
|
+
zpaServerGroup: {
|
|
5085
|
+
id: 2,
|
|
5086
|
+
name: 'string',
|
|
5087
|
+
externalId: 'string',
|
|
5088
|
+
extensions: {}
|
|
5089
|
+
},
|
|
5090
|
+
zpaAppSegments: [
|
|
5091
|
+
{
|
|
5092
|
+
id: 7,
|
|
5093
|
+
name: 'string',
|
|
5094
|
+
externalId: 'string',
|
|
5095
|
+
extensions: {}
|
|
5096
|
+
}
|
|
5097
|
+
],
|
|
5098
|
+
zpaTenantId: 10,
|
|
5099
|
+
lastModifiedBy: {
|
|
5100
|
+
id: 5,
|
|
5101
|
+
name: 'string',
|
|
5102
|
+
externalId: 'string',
|
|
5103
|
+
extensions: {}
|
|
5104
|
+
},
|
|
5105
|
+
lastModifiedTime: 3,
|
|
5106
|
+
type: null,
|
|
5107
|
+
description: 'string'
|
|
5108
|
+
};
|
|
5109
|
+
describe('#addZpaGateway - errors', () => {
|
|
5110
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5111
|
+
try {
|
|
5112
|
+
a.addZpaGateway(forwardingControlPolicyAddZpaGatewayBodyParam, (data, error) => {
|
|
5113
|
+
try {
|
|
5114
|
+
if (stub) {
|
|
5115
|
+
const displayE = 'Error 400 received on request';
|
|
5116
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5117
|
+
} else {
|
|
5118
|
+
runCommonAsserts(data, error);
|
|
5119
|
+
}
|
|
5120
|
+
saveMockData('ForwardingControlPolicy', 'addZpaGateway', 'default', data);
|
|
5121
|
+
done();
|
|
5122
|
+
} catch (err) {
|
|
5123
|
+
log.error(`Test Failure: ${err}`);
|
|
5124
|
+
done(err);
|
|
5125
|
+
}
|
|
5126
|
+
});
|
|
5127
|
+
} catch (error) {
|
|
5128
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5129
|
+
done(error);
|
|
5130
|
+
}
|
|
5131
|
+
}).timeout(attemptTimeout);
|
|
5132
|
+
});
|
|
5133
|
+
|
|
5134
|
+
describe('#getZpaGatewayById - errors', () => {
|
|
5135
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5136
|
+
try {
|
|
5137
|
+
a.getZpaGatewayById(555, (data, error) => {
|
|
5138
|
+
try {
|
|
5139
|
+
if (stub) {
|
|
5140
|
+
const displayE = 'Error 400 received on request';
|
|
5141
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5142
|
+
} else {
|
|
5143
|
+
runCommonAsserts(data, error);
|
|
5144
|
+
}
|
|
5145
|
+
saveMockData('ForwardingControlPolicy', 'getZpaGatewayById', 'default', data);
|
|
5146
|
+
done();
|
|
5147
|
+
} catch (err) {
|
|
5148
|
+
log.error(`Test Failure: ${err}`);
|
|
5149
|
+
done(err);
|
|
5150
|
+
}
|
|
5151
|
+
});
|
|
5152
|
+
} catch (error) {
|
|
5153
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5154
|
+
done(error);
|
|
5155
|
+
}
|
|
5156
|
+
}).timeout(attemptTimeout);
|
|
5157
|
+
});
|
|
5158
|
+
|
|
5159
|
+
const forwardingControlPolicyEditZpaGatewayBodyParam = {};
|
|
5160
|
+
describe('#editZpaGateway - errors', () => {
|
|
5161
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5162
|
+
try {
|
|
5163
|
+
a.editZpaGateway(555, forwardingControlPolicyEditZpaGatewayBodyParam, (data, error) => {
|
|
5164
|
+
try {
|
|
5165
|
+
if (stub) {
|
|
5166
|
+
const displayE = 'Error 400 received on request';
|
|
5167
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5168
|
+
} else {
|
|
5169
|
+
runCommonAsserts(data, error);
|
|
5170
|
+
}
|
|
5171
|
+
saveMockData('ForwardingControlPolicy', 'editZpaGateway', 'default', data);
|
|
5172
|
+
done();
|
|
5173
|
+
} catch (err) {
|
|
5174
|
+
log.error(`Test Failure: ${err}`);
|
|
5175
|
+
done(err);
|
|
5176
|
+
}
|
|
5177
|
+
});
|
|
5178
|
+
} catch (error) {
|
|
5179
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5180
|
+
done(error);
|
|
5181
|
+
}
|
|
5182
|
+
}).timeout(attemptTimeout);
|
|
5183
|
+
});
|
|
5184
|
+
|
|
5185
|
+
describe('#deleteZpaGateway - errors', () => {
|
|
5186
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5187
|
+
try {
|
|
5188
|
+
a.deleteZpaGateway(555, (data, error) => {
|
|
5189
|
+
try {
|
|
5190
|
+
if (stub) {
|
|
5191
|
+
const displayE = 'Error 400 received on request';
|
|
5192
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5193
|
+
} else {
|
|
5194
|
+
runCommonAsserts(data, error);
|
|
5195
|
+
}
|
|
5196
|
+
saveMockData('ForwardingControlPolicy', 'deleteZpaGateway', 'default', data);
|
|
5197
|
+
done();
|
|
5198
|
+
} catch (err) {
|
|
5199
|
+
log.error(`Test Failure: ${err}`);
|
|
5200
|
+
done(err);
|
|
5201
|
+
}
|
|
5202
|
+
});
|
|
5203
|
+
} catch (error) {
|
|
5204
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5205
|
+
done(error);
|
|
5206
|
+
}
|
|
5207
|
+
}).timeout(attemptTimeout);
|
|
5208
|
+
});
|
|
5209
|
+
|
|
5210
|
+
describe('#getIntermediateCaCertificates - errors', () => {
|
|
5211
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
5212
|
+
try {
|
|
5213
|
+
a.getIntermediateCaCertificates(null, null, (data, error) => {
|
|
5214
|
+
try {
|
|
5215
|
+
if (stub) {
|
|
5216
|
+
runCommonAsserts(data, error);
|
|
5217
|
+
assert.equal('object', typeof data.response[0]);
|
|
5218
|
+
} else {
|
|
5219
|
+
runCommonAsserts(data, error);
|
|
5220
|
+
}
|
|
5221
|
+
saveMockData('IntermediateCACertificates', 'getIntermediateCaCertificates', 'default', data);
|
|
5222
|
+
done();
|
|
5223
|
+
} catch (err) {
|
|
5224
|
+
log.error(`Test Failure: ${err}`);
|
|
5225
|
+
done(err);
|
|
5226
|
+
}
|
|
5227
|
+
});
|
|
5228
|
+
} catch (error) {
|
|
5229
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5230
|
+
done(error);
|
|
5231
|
+
}
|
|
5232
|
+
}).timeout(attemptTimeout);
|
|
5233
|
+
});
|
|
5234
|
+
|
|
5235
|
+
const intermediateCACertificatesAddIntermediateCaCertificateBodyParam = {};
|
|
5236
|
+
describe('#addIntermediateCaCertificate - errors', () => {
|
|
5237
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5238
|
+
try {
|
|
5239
|
+
a.addIntermediateCaCertificate(intermediateCACertificatesAddIntermediateCaCertificateBodyParam, (data, error) => {
|
|
5240
|
+
try {
|
|
5241
|
+
if (stub) {
|
|
5242
|
+
const displayE = 'Error 400 received on request';
|
|
5243
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5244
|
+
} else {
|
|
5245
|
+
runCommonAsserts(data, error);
|
|
5246
|
+
}
|
|
5247
|
+
saveMockData('IntermediateCACertificates', 'addIntermediateCaCertificate', 'default', data);
|
|
5248
|
+
done();
|
|
5249
|
+
} catch (err) {
|
|
5250
|
+
log.error(`Test Failure: ${err}`);
|
|
5251
|
+
done(err);
|
|
5252
|
+
}
|
|
5253
|
+
});
|
|
5254
|
+
} catch (error) {
|
|
5255
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5256
|
+
done(error);
|
|
5257
|
+
}
|
|
5258
|
+
}).timeout(attemptTimeout);
|
|
5259
|
+
});
|
|
5260
|
+
|
|
5261
|
+
describe('#downloadAttestationStmt - errors', () => {
|
|
5262
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5263
|
+
try {
|
|
5264
|
+
a.downloadAttestationStmt(555, (data, error) => {
|
|
5265
|
+
try {
|
|
5266
|
+
if (stub) {
|
|
5267
|
+
const displayE = 'Error 400 received on request';
|
|
5268
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5269
|
+
} else {
|
|
5270
|
+
runCommonAsserts(data, error);
|
|
5271
|
+
}
|
|
5272
|
+
saveMockData('IntermediateCACertificates', 'downloadAttestationStmt', 'default', data);
|
|
5273
|
+
done();
|
|
5274
|
+
} catch (err) {
|
|
5275
|
+
log.error(`Test Failure: ${err}`);
|
|
5276
|
+
done(err);
|
|
5277
|
+
}
|
|
5278
|
+
});
|
|
5279
|
+
} catch (error) {
|
|
5280
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5281
|
+
done(error);
|
|
5282
|
+
}
|
|
5283
|
+
}).timeout(attemptTimeout);
|
|
5284
|
+
});
|
|
5285
|
+
|
|
5286
|
+
describe('#downloadCSR - errors', () => {
|
|
5287
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5288
|
+
try {
|
|
5289
|
+
a.downloadCSR(555, (data, error) => {
|
|
5290
|
+
try {
|
|
5291
|
+
if (stub) {
|
|
5292
|
+
const displayE = 'Error 400 received on request';
|
|
5293
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5294
|
+
} else {
|
|
5295
|
+
runCommonAsserts(data, error);
|
|
5296
|
+
}
|
|
5297
|
+
saveMockData('IntermediateCACertificates', 'downloadCSR', 'default', data);
|
|
5298
|
+
done();
|
|
5299
|
+
} catch (err) {
|
|
5300
|
+
log.error(`Test Failure: ${err}`);
|
|
5301
|
+
done(err);
|
|
5302
|
+
}
|
|
5303
|
+
});
|
|
5304
|
+
} catch (error) {
|
|
5305
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5306
|
+
done(error);
|
|
5307
|
+
}
|
|
5308
|
+
}).timeout(attemptTimeout);
|
|
5309
|
+
});
|
|
5310
|
+
|
|
5311
|
+
describe('#downloadHsmPublicKey - errors', () => {
|
|
5312
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5313
|
+
try {
|
|
5314
|
+
a.downloadHsmPublicKey(555, (data, error) => {
|
|
5315
|
+
try {
|
|
5316
|
+
if (stub) {
|
|
5317
|
+
const displayE = 'Error 400 received on request';
|
|
5318
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5319
|
+
} else {
|
|
5320
|
+
runCommonAsserts(data, error);
|
|
5321
|
+
}
|
|
5322
|
+
saveMockData('IntermediateCACertificates', 'downloadHsmPublicKey', 'default', data);
|
|
5323
|
+
done();
|
|
5324
|
+
} catch (err) {
|
|
5325
|
+
log.error(`Test Failure: ${err}`);
|
|
5326
|
+
done(err);
|
|
5327
|
+
}
|
|
5328
|
+
});
|
|
5329
|
+
} catch (error) {
|
|
5330
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5331
|
+
done(error);
|
|
5332
|
+
}
|
|
5333
|
+
}).timeout(attemptTimeout);
|
|
5334
|
+
});
|
|
5335
|
+
|
|
5336
|
+
describe('#finalizeCert - errors', () => {
|
|
5337
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5338
|
+
try {
|
|
5339
|
+
a.finalizeCert(555, (data, error) => {
|
|
5340
|
+
try {
|
|
5341
|
+
if (stub) {
|
|
5342
|
+
const displayE = 'Error 400 received on request';
|
|
5343
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5344
|
+
} else {
|
|
5345
|
+
runCommonAsserts(data, error);
|
|
5346
|
+
}
|
|
5347
|
+
saveMockData('IntermediateCACertificates', 'finalizeCert', 'default', data);
|
|
5348
|
+
done();
|
|
5349
|
+
} catch (err) {
|
|
5350
|
+
log.error(`Test Failure: ${err}`);
|
|
5351
|
+
done(err);
|
|
5352
|
+
}
|
|
5353
|
+
});
|
|
5354
|
+
} catch (error) {
|
|
5355
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5356
|
+
done(error);
|
|
5357
|
+
}
|
|
5358
|
+
}).timeout(attemptTimeout);
|
|
5359
|
+
});
|
|
5360
|
+
|
|
5361
|
+
const intermediateCACertificatesGenerateCsrBodyParam = {};
|
|
5362
|
+
describe('#generateCsr - errors', () => {
|
|
5363
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5364
|
+
try {
|
|
5365
|
+
a.generateCsr(555, intermediateCACertificatesGenerateCsrBodyParam, (data, error) => {
|
|
5366
|
+
try {
|
|
5367
|
+
if (stub) {
|
|
5368
|
+
const displayE = 'Error 400 received on request';
|
|
5369
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5370
|
+
} else {
|
|
5371
|
+
runCommonAsserts(data, error);
|
|
5372
|
+
}
|
|
5373
|
+
saveMockData('IntermediateCACertificates', 'generateCsr', 'default', data);
|
|
5374
|
+
done();
|
|
5375
|
+
} catch (err) {
|
|
5376
|
+
log.error(`Test Failure: ${err}`);
|
|
5377
|
+
done(err);
|
|
5378
|
+
}
|
|
5379
|
+
});
|
|
5380
|
+
} catch (error) {
|
|
5381
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5382
|
+
done(error);
|
|
5383
|
+
}
|
|
5384
|
+
}).timeout(attemptTimeout);
|
|
5385
|
+
});
|
|
5386
|
+
|
|
5387
|
+
describe('#generateHsmKeyPair - errors', () => {
|
|
5388
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5389
|
+
try {
|
|
5390
|
+
a.generateHsmKeyPair(555, (data, error) => {
|
|
5391
|
+
try {
|
|
5392
|
+
if (stub) {
|
|
5393
|
+
const displayE = 'Error 400 received on request';
|
|
5394
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5395
|
+
} else {
|
|
5396
|
+
runCommonAsserts(data, error);
|
|
5397
|
+
}
|
|
5398
|
+
saveMockData('IntermediateCACertificates', 'generateHsmKeyPair', 'default', data);
|
|
5399
|
+
done();
|
|
5400
|
+
} catch (err) {
|
|
5401
|
+
log.error(`Test Failure: ${err}`);
|
|
5402
|
+
done(err);
|
|
5403
|
+
}
|
|
5404
|
+
});
|
|
5405
|
+
} catch (error) {
|
|
5406
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5407
|
+
done(error);
|
|
5408
|
+
}
|
|
5409
|
+
}).timeout(attemptTimeout);
|
|
5410
|
+
});
|
|
5411
|
+
|
|
5412
|
+
describe('#getIntermediateCaCertificatesLite - errors', () => {
|
|
5413
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
5414
|
+
try {
|
|
5415
|
+
a.getIntermediateCaCertificatesLite(null, null, (data, error) => {
|
|
5416
|
+
try {
|
|
5417
|
+
if (stub) {
|
|
5418
|
+
runCommonAsserts(data, error);
|
|
5419
|
+
assert.equal('object', typeof data.response[0]);
|
|
5420
|
+
assert.equal('object', typeof data.response[1]);
|
|
5421
|
+
assert.equal('object', typeof data.response[2]);
|
|
5422
|
+
} else {
|
|
5423
|
+
runCommonAsserts(data, error);
|
|
5424
|
+
}
|
|
5425
|
+
saveMockData('IntermediateCACertificates', 'getIntermediateCaCertificatesLite', 'default', data);
|
|
5426
|
+
done();
|
|
5427
|
+
} catch (err) {
|
|
5428
|
+
log.error(`Test Failure: ${err}`);
|
|
5429
|
+
done(err);
|
|
5430
|
+
}
|
|
5431
|
+
});
|
|
5432
|
+
} catch (error) {
|
|
5433
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5434
|
+
done(error);
|
|
5435
|
+
}
|
|
5436
|
+
}).timeout(attemptTimeout);
|
|
5437
|
+
});
|
|
5438
|
+
|
|
5439
|
+
describe('#getIntermediateCaCertificateLite - errors', () => {
|
|
5440
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5441
|
+
try {
|
|
5442
|
+
a.getIntermediateCaCertificateLite(555, (data, error) => {
|
|
5443
|
+
try {
|
|
5444
|
+
if (stub) {
|
|
5445
|
+
const displayE = 'Error 400 received on request';
|
|
5446
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5447
|
+
} else {
|
|
5448
|
+
runCommonAsserts(data, error);
|
|
5449
|
+
}
|
|
5450
|
+
saveMockData('IntermediateCACertificates', 'getIntermediateCaCertificateLite', 'default', data);
|
|
5451
|
+
done();
|
|
5452
|
+
} catch (err) {
|
|
5453
|
+
log.error(`Test Failure: ${err}`);
|
|
5454
|
+
done(err);
|
|
5455
|
+
}
|
|
5456
|
+
});
|
|
5457
|
+
} catch (error) {
|
|
5458
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5459
|
+
done(error);
|
|
5460
|
+
}
|
|
5461
|
+
}).timeout(attemptTimeout);
|
|
5462
|
+
});
|
|
5463
|
+
|
|
5464
|
+
describe('#makeDefaultCertificate - errors', () => {
|
|
5465
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5466
|
+
try {
|
|
5467
|
+
a.makeDefaultCertificate(555, (data, error) => {
|
|
5468
|
+
try {
|
|
5469
|
+
if (stub) {
|
|
5470
|
+
const displayE = 'Error 400 received on request';
|
|
5471
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5472
|
+
} else {
|
|
5473
|
+
runCommonAsserts(data, error);
|
|
5474
|
+
}
|
|
5475
|
+
saveMockData('IntermediateCACertificates', 'makeDefaultCertificate', 'default', data);
|
|
5476
|
+
done();
|
|
5477
|
+
} catch (err) {
|
|
5478
|
+
log.error(`Test Failure: ${err}`);
|
|
5479
|
+
done(err);
|
|
5480
|
+
}
|
|
5481
|
+
});
|
|
5482
|
+
} catch (error) {
|
|
5483
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5484
|
+
done(error);
|
|
5485
|
+
}
|
|
5486
|
+
}).timeout(attemptTimeout);
|
|
5487
|
+
});
|
|
5488
|
+
|
|
5489
|
+
describe('#getCertificatesInReadyToUseState - errors', () => {
|
|
5490
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
5491
|
+
try {
|
|
5492
|
+
a.getCertificatesInReadyToUseState(null, null, (data, error) => {
|
|
5493
|
+
try {
|
|
5494
|
+
if (stub) {
|
|
5495
|
+
runCommonAsserts(data, error);
|
|
5496
|
+
assert.equal('object', typeof data.response[0]);
|
|
5497
|
+
assert.equal('object', typeof data.response[1]);
|
|
5498
|
+
assert.equal('object', typeof data.response[2]);
|
|
5499
|
+
assert.equal('object', typeof data.response[3]);
|
|
5500
|
+
} else {
|
|
5501
|
+
runCommonAsserts(data, error);
|
|
5502
|
+
}
|
|
5503
|
+
saveMockData('IntermediateCACertificates', 'getCertificatesInReadyToUseState', 'default', data);
|
|
5504
|
+
done();
|
|
5505
|
+
} catch (err) {
|
|
5506
|
+
log.error(`Test Failure: ${err}`);
|
|
5507
|
+
done(err);
|
|
5508
|
+
}
|
|
5509
|
+
});
|
|
5510
|
+
} catch (error) {
|
|
5511
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5512
|
+
done(error);
|
|
5513
|
+
}
|
|
5514
|
+
}).timeout(attemptTimeout);
|
|
5515
|
+
});
|
|
5516
|
+
|
|
5517
|
+
describe('#showCert - errors', () => {
|
|
5518
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5519
|
+
try {
|
|
5520
|
+
a.showCert(555, (data, error) => {
|
|
5521
|
+
try {
|
|
5522
|
+
if (stub) {
|
|
5523
|
+
const displayE = 'Error 400 received on request';
|
|
5524
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5525
|
+
} else {
|
|
5526
|
+
runCommonAsserts(data, error);
|
|
5527
|
+
}
|
|
5528
|
+
saveMockData('IntermediateCACertificates', 'showCert', 'default', data);
|
|
5529
|
+
done();
|
|
5530
|
+
} catch (err) {
|
|
5531
|
+
log.error(`Test Failure: ${err}`);
|
|
5532
|
+
done(err);
|
|
5533
|
+
}
|
|
5534
|
+
});
|
|
5535
|
+
} catch (error) {
|
|
5536
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5537
|
+
done(error);
|
|
5538
|
+
}
|
|
5539
|
+
}).timeout(attemptTimeout);
|
|
5540
|
+
});
|
|
5541
|
+
|
|
5542
|
+
describe('#showCsr - errors', () => {
|
|
5543
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5544
|
+
try {
|
|
5545
|
+
a.showCsr(555, (data, error) => {
|
|
5546
|
+
try {
|
|
5547
|
+
if (stub) {
|
|
5548
|
+
const displayE = 'Error 400 received on request';
|
|
5549
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5550
|
+
} else {
|
|
5551
|
+
runCommonAsserts(data, error);
|
|
5552
|
+
}
|
|
5553
|
+
saveMockData('IntermediateCACertificates', 'showCsr', 'default', data);
|
|
5554
|
+
done();
|
|
5555
|
+
} catch (err) {
|
|
5556
|
+
log.error(`Test Failure: ${err}`);
|
|
5557
|
+
done(err);
|
|
5558
|
+
}
|
|
5559
|
+
});
|
|
5560
|
+
} catch (error) {
|
|
5561
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5562
|
+
done(error);
|
|
5563
|
+
}
|
|
5564
|
+
}).timeout(attemptTimeout);
|
|
5565
|
+
});
|
|
5566
|
+
|
|
5567
|
+
const intermediateCACertificatesUploadCertBodyParam = {};
|
|
5568
|
+
describe('#uploadCert - errors', () => {
|
|
5569
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5570
|
+
try {
|
|
5571
|
+
a.uploadCert(555, intermediateCACertificatesUploadCertBodyParam, (data, error) => {
|
|
5572
|
+
try {
|
|
5573
|
+
if (stub) {
|
|
5574
|
+
const displayE = 'Error 400 received on request';
|
|
5575
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5576
|
+
} else {
|
|
5577
|
+
runCommonAsserts(data, error);
|
|
5578
|
+
}
|
|
5579
|
+
saveMockData('IntermediateCACertificates', 'uploadCert', 'default', data);
|
|
5580
|
+
done();
|
|
5581
|
+
} catch (err) {
|
|
5582
|
+
log.error(`Test Failure: ${err}`);
|
|
5583
|
+
done(err);
|
|
5584
|
+
}
|
|
5585
|
+
});
|
|
5586
|
+
} catch (error) {
|
|
5587
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5588
|
+
done(error);
|
|
5589
|
+
}
|
|
5590
|
+
}).timeout(attemptTimeout);
|
|
5591
|
+
});
|
|
5592
|
+
|
|
5593
|
+
const intermediateCACertificatesUploadCertChainBodyParam = {};
|
|
5594
|
+
describe('#uploadCertChain - errors', () => {
|
|
5595
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5596
|
+
try {
|
|
5597
|
+
a.uploadCertChain(555, intermediateCACertificatesUploadCertChainBodyParam, (data, error) => {
|
|
5598
|
+
try {
|
|
5599
|
+
if (stub) {
|
|
5600
|
+
const displayE = 'Error 400 received on request';
|
|
5601
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5602
|
+
} else {
|
|
5603
|
+
runCommonAsserts(data, error);
|
|
5604
|
+
}
|
|
5605
|
+
saveMockData('IntermediateCACertificates', 'uploadCertChain', 'default', data);
|
|
5606
|
+
done();
|
|
5607
|
+
} catch (err) {
|
|
5608
|
+
log.error(`Test Failure: ${err}`);
|
|
5609
|
+
done(err);
|
|
5610
|
+
}
|
|
5611
|
+
});
|
|
5612
|
+
} catch (error) {
|
|
5613
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5614
|
+
done(error);
|
|
5615
|
+
}
|
|
5616
|
+
}).timeout(attemptTimeout);
|
|
5617
|
+
});
|
|
5618
|
+
|
|
5619
|
+
describe('#verifyKeyAttestation - errors', () => {
|
|
5620
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5621
|
+
try {
|
|
5622
|
+
a.verifyKeyAttestation(555, (data, error) => {
|
|
5623
|
+
try {
|
|
5624
|
+
if (stub) {
|
|
5625
|
+
const displayE = 'Error 400 received on request';
|
|
5626
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5627
|
+
} else {
|
|
5628
|
+
runCommonAsserts(data, error);
|
|
5629
|
+
}
|
|
5630
|
+
saveMockData('IntermediateCACertificates', 'verifyKeyAttestation', 'default', data);
|
|
5631
|
+
done();
|
|
5632
|
+
} catch (err) {
|
|
5633
|
+
log.error(`Test Failure: ${err}`);
|
|
5634
|
+
done(err);
|
|
5635
|
+
}
|
|
5636
|
+
});
|
|
5637
|
+
} catch (error) {
|
|
5638
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5639
|
+
done(error);
|
|
5640
|
+
}
|
|
5641
|
+
}).timeout(attemptTimeout);
|
|
5642
|
+
});
|
|
5643
|
+
|
|
5644
|
+
describe('#getIntermediateCaCertificate - errors', () => {
|
|
5645
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5646
|
+
try {
|
|
5647
|
+
a.getIntermediateCaCertificate(555, (data, error) => {
|
|
5648
|
+
try {
|
|
5649
|
+
if (stub) {
|
|
5650
|
+
const displayE = 'Error 400 received on request';
|
|
5651
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5652
|
+
} else {
|
|
5653
|
+
runCommonAsserts(data, error);
|
|
5654
|
+
}
|
|
5655
|
+
saveMockData('IntermediateCACertificates', 'getIntermediateCaCertificate', 'default', data);
|
|
5656
|
+
done();
|
|
5657
|
+
} catch (err) {
|
|
5658
|
+
log.error(`Test Failure: ${err}`);
|
|
5659
|
+
done(err);
|
|
5660
|
+
}
|
|
5661
|
+
});
|
|
5662
|
+
} catch (error) {
|
|
5663
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5664
|
+
done(error);
|
|
5665
|
+
}
|
|
5666
|
+
}).timeout(attemptTimeout);
|
|
5667
|
+
});
|
|
5668
|
+
|
|
5669
|
+
const intermediateCACertificatesUpdateIntermediateCaCertificateBodyParam = {};
|
|
5670
|
+
describe('#updateIntermediateCaCertificate - errors', () => {
|
|
5671
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5672
|
+
try {
|
|
5673
|
+
a.updateIntermediateCaCertificate(555, intermediateCACertificatesUpdateIntermediateCaCertificateBodyParam, (data, error) => {
|
|
5674
|
+
try {
|
|
5675
|
+
if (stub) {
|
|
5676
|
+
const displayE = 'Error 400 received on request';
|
|
5677
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5678
|
+
} else {
|
|
5679
|
+
runCommonAsserts(data, error);
|
|
5680
|
+
}
|
|
5681
|
+
saveMockData('IntermediateCACertificates', 'updateIntermediateCaCertificate', 'default', data);
|
|
5682
|
+
done();
|
|
5683
|
+
} catch (err) {
|
|
5684
|
+
log.error(`Test Failure: ${err}`);
|
|
5685
|
+
done(err);
|
|
5686
|
+
}
|
|
5687
|
+
});
|
|
5688
|
+
} catch (error) {
|
|
5689
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5690
|
+
done(error);
|
|
5691
|
+
}
|
|
5692
|
+
}).timeout(attemptTimeout);
|
|
5693
|
+
});
|
|
5694
|
+
|
|
5695
|
+
describe('#deleteIntermediateCaCertificate - errors', () => {
|
|
5696
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5697
|
+
try {
|
|
5698
|
+
a.deleteIntermediateCaCertificate(555, (data, error) => {
|
|
5699
|
+
try {
|
|
5700
|
+
if (stub) {
|
|
5701
|
+
const displayE = 'Error 400 received on request';
|
|
5702
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5703
|
+
} else {
|
|
5704
|
+
runCommonAsserts(data, error);
|
|
5705
|
+
}
|
|
5706
|
+
saveMockData('IntermediateCACertificates', 'deleteIntermediateCaCertificate', 'default', data);
|
|
5707
|
+
done();
|
|
5708
|
+
} catch (err) {
|
|
5709
|
+
log.error(`Test Failure: ${err}`);
|
|
5710
|
+
done(err);
|
|
5711
|
+
}
|
|
5712
|
+
});
|
|
5713
|
+
} catch (error) {
|
|
5714
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5715
|
+
done(error);
|
|
5716
|
+
}
|
|
5717
|
+
}).timeout(attemptTimeout);
|
|
5718
|
+
});
|
|
5719
|
+
|
|
5720
|
+
describe('#getSslExemptedUrls - errors', () => {
|
|
5721
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5722
|
+
try {
|
|
5723
|
+
a.getSslExemptedUrls((data, error) => {
|
|
5724
|
+
try {
|
|
5725
|
+
if (stub) {
|
|
5726
|
+
const displayE = 'Error 400 received on request';
|
|
5727
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5728
|
+
} else {
|
|
5729
|
+
runCommonAsserts(data, error);
|
|
5730
|
+
}
|
|
5731
|
+
saveMockData('IntermediateCACertificates', 'getSslExemptedUrls', 'default', data);
|
|
5732
|
+
done();
|
|
5733
|
+
} catch (err) {
|
|
5734
|
+
log.error(`Test Failure: ${err}`);
|
|
5735
|
+
done(err);
|
|
5736
|
+
}
|
|
5737
|
+
});
|
|
5738
|
+
} catch (error) {
|
|
5739
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5740
|
+
done(error);
|
|
5741
|
+
}
|
|
5742
|
+
}).timeout(attemptTimeout);
|
|
5743
|
+
});
|
|
5744
|
+
|
|
5745
|
+
describe('#updateSslExemptedUrls - errors', () => {
|
|
5746
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5747
|
+
try {
|
|
5748
|
+
a.updateSslExemptedUrls('fakedata', (data, error) => {
|
|
5749
|
+
try {
|
|
5750
|
+
if (stub) {
|
|
5751
|
+
const displayE = 'Error 400 received on request';
|
|
5752
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5753
|
+
} else {
|
|
5754
|
+
runCommonAsserts(data, error);
|
|
5755
|
+
}
|
|
5756
|
+
saveMockData('IntermediateCACertificates', 'updateSslExemptedUrls', 'default', data);
|
|
5757
|
+
done();
|
|
5758
|
+
} catch (err) {
|
|
5759
|
+
log.error(`Test Failure: ${err}`);
|
|
5760
|
+
done(err);
|
|
5761
|
+
}
|
|
5762
|
+
});
|
|
5763
|
+
} catch (error) {
|
|
5764
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5765
|
+
done(error);
|
|
5766
|
+
}
|
|
5767
|
+
}).timeout(attemptTimeout);
|
|
5768
|
+
});
|
|
5769
|
+
|
|
5770
|
+
describe('#getDeviceTypes - errors', () => {
|
|
5771
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
5772
|
+
try {
|
|
5773
|
+
a.getDeviceTypes((data, error) => {
|
|
5774
|
+
try {
|
|
5775
|
+
if (stub) {
|
|
5776
|
+
runCommonAsserts(data, error);
|
|
5777
|
+
assert.equal('object', typeof data.response[0]);
|
|
5778
|
+
} else {
|
|
5779
|
+
runCommonAsserts(data, error);
|
|
5780
|
+
}
|
|
5781
|
+
saveMockData('IoTReport', 'getDeviceTypes', 'default', data);
|
|
5782
|
+
done();
|
|
5783
|
+
} catch (err) {
|
|
5784
|
+
log.error(`Test Failure: ${err}`);
|
|
5785
|
+
done(err);
|
|
5786
|
+
}
|
|
5787
|
+
});
|
|
5788
|
+
} catch (error) {
|
|
5789
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5790
|
+
done(error);
|
|
5791
|
+
}
|
|
5792
|
+
}).timeout(attemptTimeout);
|
|
5793
|
+
});
|
|
5794
|
+
|
|
5795
|
+
describe('#getCategories - errors', () => {
|
|
5796
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
5797
|
+
try {
|
|
5798
|
+
a.getCategories((data, error) => {
|
|
5799
|
+
try {
|
|
5800
|
+
if (stub) {
|
|
5801
|
+
runCommonAsserts(data, error);
|
|
5802
|
+
assert.equal('object', typeof data.response[0]);
|
|
5803
|
+
assert.equal('object', typeof data.response[1]);
|
|
5804
|
+
assert.equal('object', typeof data.response[2]);
|
|
5805
|
+
assert.equal('object', typeof data.response[3]);
|
|
5806
|
+
} else {
|
|
5807
|
+
runCommonAsserts(data, error);
|
|
5808
|
+
}
|
|
5809
|
+
saveMockData('IoTReport', 'getCategories', 'default', data);
|
|
5810
|
+
done();
|
|
5811
|
+
} catch (err) {
|
|
5812
|
+
log.error(`Test Failure: ${err}`);
|
|
5813
|
+
done(err);
|
|
5814
|
+
}
|
|
5815
|
+
});
|
|
5816
|
+
} catch (error) {
|
|
5817
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5818
|
+
done(error);
|
|
5819
|
+
}
|
|
5820
|
+
}).timeout(attemptTimeout);
|
|
5821
|
+
});
|
|
5822
|
+
|
|
5823
|
+
describe('#getClassifications - errors', () => {
|
|
5824
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
5825
|
+
try {
|
|
5826
|
+
a.getClassifications((data, error) => {
|
|
5827
|
+
try {
|
|
5828
|
+
if (stub) {
|
|
5829
|
+
runCommonAsserts(data, error);
|
|
5830
|
+
assert.equal('object', typeof data.response[0]);
|
|
5831
|
+
assert.equal('object', typeof data.response[1]);
|
|
5832
|
+
} else {
|
|
5833
|
+
runCommonAsserts(data, error);
|
|
5834
|
+
}
|
|
5835
|
+
saveMockData('IoTReport', 'getClassifications', 'default', data);
|
|
5836
|
+
done();
|
|
5837
|
+
} catch (err) {
|
|
5838
|
+
log.error(`Test Failure: ${err}`);
|
|
5839
|
+
done(err);
|
|
5840
|
+
}
|
|
5841
|
+
});
|
|
5842
|
+
} catch (error) {
|
|
5843
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5844
|
+
done(error);
|
|
5845
|
+
}
|
|
5846
|
+
}).timeout(attemptTimeout);
|
|
5847
|
+
});
|
|
5848
|
+
|
|
5849
|
+
describe('#getDeviceList - errors', () => {
|
|
5850
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5851
|
+
try {
|
|
5852
|
+
a.getDeviceList((data, error) => {
|
|
5853
|
+
try {
|
|
5854
|
+
if (stub) {
|
|
5855
|
+
const displayE = 'Error 400 received on request';
|
|
5856
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5857
|
+
} else {
|
|
5858
|
+
runCommonAsserts(data, error);
|
|
5859
|
+
}
|
|
5860
|
+
saveMockData('IoTReport', 'getDeviceList', 'default', data);
|
|
5861
|
+
done();
|
|
5862
|
+
} catch (err) {
|
|
5863
|
+
log.error(`Test Failure: ${err}`);
|
|
5864
|
+
done(err);
|
|
5865
|
+
}
|
|
5866
|
+
});
|
|
5867
|
+
} catch (error) {
|
|
5868
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5869
|
+
done(error);
|
|
5870
|
+
}
|
|
5871
|
+
}).timeout(attemptTimeout);
|
|
5872
|
+
});
|
|
5873
|
+
|
|
5874
|
+
describe('#getSubLocations - errors', () => {
|
|
5875
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
5876
|
+
try {
|
|
5877
|
+
a.getSubLocations(555, null, null, null, null, null, null, null, null, (data, error) => {
|
|
5878
|
+
try {
|
|
5879
|
+
if (stub) {
|
|
5880
|
+
runCommonAsserts(data, error);
|
|
5881
|
+
assert.equal('object', typeof data.response[0]);
|
|
5882
|
+
assert.equal('object', typeof data.response[1]);
|
|
5883
|
+
assert.equal('object', typeof data.response[2]);
|
|
5884
|
+
} else {
|
|
5885
|
+
runCommonAsserts(data, error);
|
|
5886
|
+
}
|
|
5887
|
+
saveMockData('LocationManagement', 'getSubLocations', 'default', data);
|
|
5888
|
+
done();
|
|
5889
|
+
} catch (err) {
|
|
5890
|
+
log.error(`Test Failure: ${err}`);
|
|
5891
|
+
done(err);
|
|
5892
|
+
}
|
|
5893
|
+
});
|
|
5894
|
+
} catch (error) {
|
|
5895
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5896
|
+
done(error);
|
|
5897
|
+
}
|
|
5898
|
+
}).timeout(attemptTimeout);
|
|
5899
|
+
});
|
|
5900
|
+
|
|
5901
|
+
describe('#getGroupsCount - errors', () => {
|
|
5902
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5903
|
+
try {
|
|
5904
|
+
a.getGroupsCount(null, null, null, null, null, null, (data, error) => {
|
|
5905
|
+
try {
|
|
5906
|
+
if (stub) {
|
|
5907
|
+
const displayE = 'Error 400 received on request';
|
|
5908
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5909
|
+
} else {
|
|
5910
|
+
runCommonAsserts(data, error);
|
|
5911
|
+
}
|
|
5912
|
+
saveMockData('LocationManagement', 'getGroupsCount', 'default', data);
|
|
5913
|
+
done();
|
|
5914
|
+
} catch (err) {
|
|
5915
|
+
log.error(`Test Failure: ${err}`);
|
|
5916
|
+
done(err);
|
|
5917
|
+
}
|
|
5918
|
+
});
|
|
5919
|
+
} catch (error) {
|
|
5920
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5921
|
+
done(error);
|
|
5922
|
+
}
|
|
5923
|
+
}).timeout(attemptTimeout);
|
|
5924
|
+
});
|
|
5925
|
+
|
|
5926
|
+
describe('#getGroupsSummary - errors', () => {
|
|
5927
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5928
|
+
try {
|
|
5929
|
+
a.getGroupsSummary(null, null, (data, error) => {
|
|
5930
|
+
try {
|
|
5931
|
+
if (stub) {
|
|
5932
|
+
const displayE = 'Error 400 received on request';
|
|
5933
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5934
|
+
} else {
|
|
5935
|
+
runCommonAsserts(data, error);
|
|
5936
|
+
}
|
|
5937
|
+
saveMockData('LocationManagement', 'getGroupsSummary', 'default', data);
|
|
5938
|
+
done();
|
|
5939
|
+
} catch (err) {
|
|
5940
|
+
log.error(`Test Failure: ${err}`);
|
|
5941
|
+
done(err);
|
|
5942
|
+
}
|
|
5943
|
+
});
|
|
5944
|
+
} catch (error) {
|
|
5945
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5946
|
+
done(error);
|
|
5947
|
+
}
|
|
5948
|
+
}).timeout(attemptTimeout);
|
|
5949
|
+
});
|
|
5950
|
+
|
|
5951
|
+
describe('#getGroupSummary - errors', () => {
|
|
5952
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5953
|
+
try {
|
|
5954
|
+
a.getGroupSummary(555, (data, error) => {
|
|
5955
|
+
try {
|
|
5956
|
+
if (stub) {
|
|
5957
|
+
const displayE = 'Error 400 received on request';
|
|
5958
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5959
|
+
} else {
|
|
5960
|
+
runCommonAsserts(data, error);
|
|
5961
|
+
}
|
|
5962
|
+
saveMockData('LocationManagement', 'getGroupSummary', 'default', data);
|
|
5963
|
+
done();
|
|
5964
|
+
} catch (err) {
|
|
5965
|
+
log.error(`Test Failure: ${err}`);
|
|
5966
|
+
done(err);
|
|
5967
|
+
}
|
|
5968
|
+
});
|
|
5969
|
+
} catch (error) {
|
|
5970
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5971
|
+
done(error);
|
|
5972
|
+
}
|
|
5973
|
+
}).timeout(attemptTimeout);
|
|
5974
|
+
});
|
|
5975
|
+
|
|
5976
|
+
describe('#getGroupById - errors', () => {
|
|
5977
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
5978
|
+
try {
|
|
5979
|
+
a.getGroupById(555, (data, error) => {
|
|
5980
|
+
try {
|
|
5981
|
+
if (stub) {
|
|
5982
|
+
const displayE = 'Error 400 received on request';
|
|
5983
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
5984
|
+
} else {
|
|
5985
|
+
runCommonAsserts(data, error);
|
|
5986
|
+
}
|
|
5987
|
+
saveMockData('LocationManagement', 'getGroupById', 'default', data);
|
|
5988
|
+
done();
|
|
5989
|
+
} catch (err) {
|
|
5990
|
+
log.error(`Test Failure: ${err}`);
|
|
5991
|
+
done(err);
|
|
5992
|
+
}
|
|
5993
|
+
});
|
|
5994
|
+
} catch (error) {
|
|
5995
|
+
log.error(`Adapter Exception: ${error}`);
|
|
5996
|
+
done(error);
|
|
5997
|
+
}
|
|
5998
|
+
}).timeout(attemptTimeout);
|
|
5999
|
+
});
|
|
6000
|
+
|
|
6001
|
+
describe('#getRuleLabels - errors', () => {
|
|
6002
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
6003
|
+
try {
|
|
6004
|
+
a.getRuleLabels(null, null, (data, error) => {
|
|
6005
|
+
try {
|
|
6006
|
+
if (stub) {
|
|
6007
|
+
runCommonAsserts(data, error);
|
|
6008
|
+
assert.equal('object', typeof data.response[0]);
|
|
6009
|
+
assert.equal('object', typeof data.response[1]);
|
|
6010
|
+
assert.equal('object', typeof data.response[2]);
|
|
6011
|
+
} else {
|
|
6012
|
+
runCommonAsserts(data, error);
|
|
6013
|
+
}
|
|
6014
|
+
saveMockData('RuleLabels', 'getRuleLabels', 'default', data);
|
|
6015
|
+
done();
|
|
6016
|
+
} catch (err) {
|
|
6017
|
+
log.error(`Test Failure: ${err}`);
|
|
6018
|
+
done(err);
|
|
6019
|
+
}
|
|
6020
|
+
});
|
|
6021
|
+
} catch (error) {
|
|
6022
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6023
|
+
done(error);
|
|
6024
|
+
}
|
|
6025
|
+
}).timeout(attemptTimeout);
|
|
6026
|
+
});
|
|
6027
|
+
|
|
6028
|
+
describe('#addRuleLabel - errors', () => {
|
|
6029
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6030
|
+
try {
|
|
6031
|
+
a.addRuleLabel((data, error) => {
|
|
6032
|
+
try {
|
|
6033
|
+
if (stub) {
|
|
6034
|
+
const displayE = 'Error 400 received on request';
|
|
6035
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6036
|
+
} else {
|
|
6037
|
+
runCommonAsserts(data, error);
|
|
6038
|
+
}
|
|
6039
|
+
saveMockData('RuleLabels', 'addRuleLabel', 'default', data);
|
|
6040
|
+
done();
|
|
6041
|
+
} catch (err) {
|
|
6042
|
+
log.error(`Test Failure: ${err}`);
|
|
6043
|
+
done(err);
|
|
6044
|
+
}
|
|
6045
|
+
});
|
|
6046
|
+
} catch (error) {
|
|
6047
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6048
|
+
done(error);
|
|
6049
|
+
}
|
|
6050
|
+
}).timeout(attemptTimeout);
|
|
6051
|
+
});
|
|
6052
|
+
|
|
6053
|
+
describe('#getRuleLabelById - errors', () => {
|
|
6054
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6055
|
+
try {
|
|
6056
|
+
a.getRuleLabelById(555, (data, error) => {
|
|
6057
|
+
try {
|
|
6058
|
+
if (stub) {
|
|
6059
|
+
const displayE = 'Error 400 received on request';
|
|
6060
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6061
|
+
} else {
|
|
6062
|
+
runCommonAsserts(data, error);
|
|
6063
|
+
}
|
|
6064
|
+
saveMockData('RuleLabels', 'getRuleLabelById', 'default', data);
|
|
6065
|
+
done();
|
|
6066
|
+
} catch (err) {
|
|
6067
|
+
log.error(`Test Failure: ${err}`);
|
|
6068
|
+
done(err);
|
|
6069
|
+
}
|
|
6070
|
+
});
|
|
6071
|
+
} catch (error) {
|
|
6072
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6073
|
+
done(error);
|
|
6074
|
+
}
|
|
6075
|
+
}).timeout(attemptTimeout);
|
|
6076
|
+
});
|
|
6077
|
+
|
|
6078
|
+
describe('#updateRuleLabel - errors', () => {
|
|
6079
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6080
|
+
try {
|
|
6081
|
+
a.updateRuleLabel(555, (data, error) => {
|
|
6082
|
+
try {
|
|
6083
|
+
if (stub) {
|
|
6084
|
+
const displayE = 'Error 400 received on request';
|
|
6085
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6086
|
+
} else {
|
|
6087
|
+
runCommonAsserts(data, error);
|
|
6088
|
+
}
|
|
6089
|
+
saveMockData('RuleLabels', 'updateRuleLabel', 'default', data);
|
|
6090
|
+
done();
|
|
6091
|
+
} catch (err) {
|
|
6092
|
+
log.error(`Test Failure: ${err}`);
|
|
6093
|
+
done(err);
|
|
6094
|
+
}
|
|
6095
|
+
});
|
|
6096
|
+
} catch (error) {
|
|
6097
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6098
|
+
done(error);
|
|
6099
|
+
}
|
|
6100
|
+
}).timeout(attemptTimeout);
|
|
6101
|
+
});
|
|
6102
|
+
|
|
6103
|
+
describe('#deleteRuleLabel - errors', () => {
|
|
6104
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6105
|
+
try {
|
|
6106
|
+
a.deleteRuleLabel(555, (data, error) => {
|
|
6107
|
+
try {
|
|
6108
|
+
if (stub) {
|
|
6109
|
+
const displayE = 'Error 400 received on request';
|
|
6110
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6111
|
+
} else {
|
|
6112
|
+
runCommonAsserts(data, error);
|
|
6113
|
+
}
|
|
6114
|
+
saveMockData('RuleLabels', 'deleteRuleLabel', 'default', data);
|
|
6115
|
+
done();
|
|
6116
|
+
} catch (err) {
|
|
6117
|
+
log.error(`Test Failure: ${err}`);
|
|
6118
|
+
done(err);
|
|
6119
|
+
}
|
|
6120
|
+
});
|
|
6121
|
+
} catch (error) {
|
|
6122
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6123
|
+
done(error);
|
|
6124
|
+
}
|
|
6125
|
+
}).timeout(attemptTimeout);
|
|
6126
|
+
});
|
|
6127
|
+
|
|
6128
|
+
describe('#getCustomFileHash - errors', () => {
|
|
6129
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6130
|
+
try {
|
|
6131
|
+
a.getCustomFileHash((data, error) => {
|
|
6132
|
+
try {
|
|
6133
|
+
if (stub) {
|
|
6134
|
+
const displayE = 'Error 400 received on request';
|
|
6135
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6136
|
+
} else {
|
|
6137
|
+
runCommonAsserts(data, error);
|
|
6138
|
+
}
|
|
6139
|
+
saveMockData('SandboxSettings', 'getCustomFileHash', 'default', data);
|
|
6140
|
+
done();
|
|
6141
|
+
} catch (err) {
|
|
6142
|
+
log.error(`Test Failure: ${err}`);
|
|
6143
|
+
done(err);
|
|
6144
|
+
}
|
|
6145
|
+
});
|
|
6146
|
+
} catch (error) {
|
|
6147
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6148
|
+
done(error);
|
|
6149
|
+
}
|
|
6150
|
+
}).timeout(attemptTimeout);
|
|
6151
|
+
});
|
|
6152
|
+
|
|
6153
|
+
const sandboxSettingsUpdateCustomFileHashBodyParam = {
|
|
6154
|
+
fileHashesToBeBlocked: [
|
|
6155
|
+
'string'
|
|
6156
|
+
]
|
|
6157
|
+
};
|
|
6158
|
+
describe('#updateCustomFileHash - errors', () => {
|
|
6159
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6160
|
+
try {
|
|
6161
|
+
a.updateCustomFileHash(sandboxSettingsUpdateCustomFileHashBodyParam, (data, error) => {
|
|
6162
|
+
try {
|
|
6163
|
+
if (stub) {
|
|
6164
|
+
const displayE = 'Error 400 received on request';
|
|
6165
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6166
|
+
} else {
|
|
6167
|
+
runCommonAsserts(data, error);
|
|
6168
|
+
}
|
|
6169
|
+
saveMockData('SandboxSettings', 'updateCustomFileHash', 'default', data);
|
|
6170
|
+
done();
|
|
6171
|
+
} catch (err) {
|
|
6172
|
+
log.error(`Test Failure: ${err}`);
|
|
6173
|
+
done(err);
|
|
6174
|
+
}
|
|
6175
|
+
});
|
|
6176
|
+
} catch (error) {
|
|
6177
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6178
|
+
done(error);
|
|
6179
|
+
}
|
|
6180
|
+
}).timeout(attemptTimeout);
|
|
6181
|
+
});
|
|
6182
|
+
|
|
6183
|
+
describe('#getCustomFileHashQuota - errors', () => {
|
|
6184
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6185
|
+
try {
|
|
6186
|
+
a.getCustomFileHashQuota((data, error) => {
|
|
6187
|
+
try {
|
|
6188
|
+
if (stub) {
|
|
6189
|
+
const displayE = 'Error 400 received on request';
|
|
6190
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6191
|
+
} else {
|
|
6192
|
+
runCommonAsserts(data, error);
|
|
6193
|
+
}
|
|
6194
|
+
saveMockData('SandboxSettings', 'getCustomFileHashQuota', 'default', data);
|
|
6195
|
+
done();
|
|
6196
|
+
} catch (err) {
|
|
6197
|
+
log.error(`Test Failure: ${err}`);
|
|
6198
|
+
done(err);
|
|
6199
|
+
}
|
|
6200
|
+
});
|
|
6201
|
+
} catch (error) {
|
|
6202
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6203
|
+
done(error);
|
|
6204
|
+
}
|
|
6205
|
+
}).timeout(attemptTimeout);
|
|
6206
|
+
});
|
|
6207
|
+
|
|
6208
|
+
const shadowITReportBulkUpdateCloudApplicationBodyParam = {
|
|
6209
|
+
sanctionedState: null,
|
|
6210
|
+
applicationIds: [
|
|
6211
|
+
3
|
|
6212
|
+
],
|
|
6213
|
+
customTags: [
|
|
6214
|
+
{
|
|
6215
|
+
id: 5,
|
|
6216
|
+
name: 'string'
|
|
6217
|
+
}
|
|
6218
|
+
]
|
|
6219
|
+
};
|
|
6220
|
+
describe('#bulkUpdateCloudApplication - errors', () => {
|
|
6221
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6222
|
+
try {
|
|
6223
|
+
a.bulkUpdateCloudApplication(shadowITReportBulkUpdateCloudApplicationBodyParam, (data, error) => {
|
|
6224
|
+
try {
|
|
6225
|
+
if (stub) {
|
|
6226
|
+
const displayE = 'Error 400 received on request';
|
|
6227
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6228
|
+
} else {
|
|
6229
|
+
runCommonAsserts(data, error);
|
|
6230
|
+
}
|
|
6231
|
+
saveMockData('ShadowITReport', 'bulkUpdateCloudApplication', 'default', data);
|
|
6232
|
+
done();
|
|
6233
|
+
} catch (err) {
|
|
6234
|
+
log.error(`Test Failure: ${err}`);
|
|
6235
|
+
done(err);
|
|
6236
|
+
}
|
|
6237
|
+
});
|
|
6238
|
+
} catch (error) {
|
|
6239
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6240
|
+
done(error);
|
|
6241
|
+
}
|
|
6242
|
+
}).timeout(attemptTimeout);
|
|
6243
|
+
});
|
|
6244
|
+
|
|
6245
|
+
describe('#getCloudApplicationsLite - errors', () => {
|
|
6246
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
6247
|
+
try {
|
|
6248
|
+
a.getCloudApplicationsLite(null, null, (data, error) => {
|
|
6249
|
+
try {
|
|
6250
|
+
if (stub) {
|
|
6251
|
+
runCommonAsserts(data, error);
|
|
6252
|
+
assert.equal('object', typeof data.response[0]);
|
|
6253
|
+
assert.equal('object', typeof data.response[1]);
|
|
6254
|
+
} else {
|
|
6255
|
+
runCommonAsserts(data, error);
|
|
6256
|
+
}
|
|
6257
|
+
saveMockData('ShadowITReport', 'getCloudApplicationsLite', 'default', data);
|
|
6258
|
+
done();
|
|
6259
|
+
} catch (err) {
|
|
6260
|
+
log.error(`Test Failure: ${err}`);
|
|
6261
|
+
done(err);
|
|
6262
|
+
}
|
|
6263
|
+
});
|
|
6264
|
+
} catch (error) {
|
|
6265
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6266
|
+
done(error);
|
|
6267
|
+
}
|
|
6268
|
+
}).timeout(attemptTimeout);
|
|
6269
|
+
});
|
|
6270
|
+
|
|
6271
|
+
describe('#getAllCustomTags - errors', () => {
|
|
6272
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
6273
|
+
try {
|
|
6274
|
+
a.getAllCustomTags((data, error) => {
|
|
6275
|
+
try {
|
|
6276
|
+
if (stub) {
|
|
6277
|
+
runCommonAsserts(data, error);
|
|
6278
|
+
assert.equal('object', typeof data.response[0]);
|
|
6279
|
+
assert.equal('object', typeof data.response[1]);
|
|
6280
|
+
} else {
|
|
6281
|
+
runCommonAsserts(data, error);
|
|
6282
|
+
}
|
|
6283
|
+
saveMockData('ShadowITReport', 'getAllCustomTags', 'default', data);
|
|
6284
|
+
done();
|
|
6285
|
+
} catch (err) {
|
|
6286
|
+
log.error(`Test Failure: ${err}`);
|
|
6287
|
+
done(err);
|
|
6288
|
+
}
|
|
6289
|
+
});
|
|
6290
|
+
} catch (error) {
|
|
6291
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6292
|
+
done(error);
|
|
6293
|
+
}
|
|
6294
|
+
}).timeout(attemptTimeout);
|
|
6295
|
+
});
|
|
6296
|
+
|
|
6297
|
+
const shadowITReportGetReportDataApplicationsExportBodyParam = {};
|
|
6298
|
+
describe('#getReportDataApplicationsExport - errors', () => {
|
|
6299
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6300
|
+
try {
|
|
6301
|
+
a.getReportDataApplicationsExport(shadowITReportGetReportDataApplicationsExportBodyParam, (data, error) => {
|
|
6302
|
+
try {
|
|
6303
|
+
if (stub) {
|
|
6304
|
+
const displayE = 'Error 400 received on request';
|
|
6305
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6306
|
+
} else {
|
|
6307
|
+
runCommonAsserts(data, error);
|
|
6308
|
+
}
|
|
6309
|
+
saveMockData('ShadowITReport', 'getReportDataApplicationsExport', 'default', data);
|
|
6310
|
+
done();
|
|
6311
|
+
} catch (err) {
|
|
6312
|
+
log.error(`Test Failure: ${err}`);
|
|
6313
|
+
done(err);
|
|
6314
|
+
}
|
|
6315
|
+
});
|
|
6316
|
+
} catch (error) {
|
|
6317
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6318
|
+
done(error);
|
|
6319
|
+
}
|
|
6320
|
+
}).timeout(attemptTimeout);
|
|
6321
|
+
});
|
|
6322
|
+
|
|
6323
|
+
const shadowITReportGetReportTransactionsExportBodyParam = {};
|
|
6324
|
+
describe('#getReportTransactionsExport - errors', () => {
|
|
6325
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6326
|
+
try {
|
|
6327
|
+
a.getReportTransactionsExport('fakedata', shadowITReportGetReportTransactionsExportBodyParam, (data, error) => {
|
|
6328
|
+
try {
|
|
6329
|
+
if (stub) {
|
|
6330
|
+
const displayE = 'Error 400 received on request';
|
|
6331
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6332
|
+
} else {
|
|
6333
|
+
runCommonAsserts(data, error);
|
|
6334
|
+
}
|
|
6335
|
+
saveMockData('ShadowITReport', 'getReportTransactionsExport', 'default', data);
|
|
6336
|
+
done();
|
|
6337
|
+
} catch (err) {
|
|
6338
|
+
log.error(`Test Failure: ${err}`);
|
|
6339
|
+
done(err);
|
|
6340
|
+
}
|
|
6341
|
+
});
|
|
6342
|
+
} catch (error) {
|
|
6343
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6344
|
+
done(error);
|
|
6345
|
+
}
|
|
6346
|
+
}).timeout(attemptTimeout);
|
|
6347
|
+
});
|
|
6348
|
+
|
|
6349
|
+
describe('#getAllGreTunnels - errors', () => {
|
|
6350
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
6351
|
+
try {
|
|
6352
|
+
a.getAllGreTunnels(null, null, (data, error) => {
|
|
6353
|
+
try {
|
|
6354
|
+
if (stub) {
|
|
6355
|
+
runCommonAsserts(data, error);
|
|
6356
|
+
assert.equal('object', typeof data.response[0]);
|
|
6357
|
+
assert.equal('object', typeof data.response[1]);
|
|
6358
|
+
} else {
|
|
6359
|
+
runCommonAsserts(data, error);
|
|
6360
|
+
}
|
|
6361
|
+
saveMockData('TrafficForwarding', 'getAllGreTunnels', 'default', data);
|
|
6362
|
+
done();
|
|
6363
|
+
} catch (err) {
|
|
6364
|
+
log.error(`Test Failure: ${err}`);
|
|
6365
|
+
done(err);
|
|
6366
|
+
}
|
|
6367
|
+
});
|
|
6368
|
+
} catch (error) {
|
|
6369
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6370
|
+
done(error);
|
|
6371
|
+
}
|
|
6372
|
+
}).timeout(attemptTimeout);
|
|
6373
|
+
});
|
|
6374
|
+
|
|
6375
|
+
const trafficForwardingAddGreTunnelBodyParam = {
|
|
6376
|
+
id: 10,
|
|
6377
|
+
sourceIp: 'string',
|
|
6378
|
+
primaryDestVip: {
|
|
6379
|
+
id: 6,
|
|
6380
|
+
virtualIp: 'string',
|
|
6381
|
+
privateServiceEdge: false,
|
|
6382
|
+
datacenter: 'string'
|
|
6383
|
+
},
|
|
6384
|
+
secondaryDestVip: {
|
|
6385
|
+
id: 6,
|
|
6386
|
+
virtualIp: 'string',
|
|
6387
|
+
privateServiceEdge: true,
|
|
6388
|
+
datacenter: 'string'
|
|
6389
|
+
},
|
|
6390
|
+
internalIpRange: 'string',
|
|
6391
|
+
managedBy: {
|
|
6392
|
+
id: 4,
|
|
6393
|
+
name: 'string',
|
|
6394
|
+
externalId: 'string',
|
|
6395
|
+
extensions: {}
|
|
6396
|
+
},
|
|
6397
|
+
lastModificationTime: 7,
|
|
6398
|
+
lastModifiedBy: {
|
|
6399
|
+
id: 4,
|
|
6400
|
+
name: 'string',
|
|
6401
|
+
externalId: 'string',
|
|
6402
|
+
extensions: {}
|
|
6403
|
+
},
|
|
6404
|
+
withinCountry: false,
|
|
6405
|
+
comment: 'string',
|
|
6406
|
+
ipUnnumbered: true,
|
|
6407
|
+
subcloud: 'string'
|
|
6408
|
+
};
|
|
6409
|
+
describe('#addGreTunnel - errors', () => {
|
|
6410
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6411
|
+
try {
|
|
6412
|
+
a.addGreTunnel(trafficForwardingAddGreTunnelBodyParam, (data, error) => {
|
|
6413
|
+
try {
|
|
6414
|
+
if (stub) {
|
|
6415
|
+
const displayE = 'Error 400 received on request';
|
|
6416
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6417
|
+
} else {
|
|
6418
|
+
runCommonAsserts(data, error);
|
|
6419
|
+
}
|
|
6420
|
+
saveMockData('TrafficForwarding', 'addGreTunnel', 'default', data);
|
|
6421
|
+
done();
|
|
6422
|
+
} catch (err) {
|
|
6423
|
+
log.error(`Test Failure: ${err}`);
|
|
6424
|
+
done(err);
|
|
6425
|
+
}
|
|
6426
|
+
});
|
|
6427
|
+
} catch (error) {
|
|
6428
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6429
|
+
done(error);
|
|
6430
|
+
}
|
|
6431
|
+
}).timeout(attemptTimeout);
|
|
6432
|
+
});
|
|
6433
|
+
|
|
6434
|
+
describe('#validateAndGetAvailableInternalIpRanges - errors', () => {
|
|
6435
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
6436
|
+
try {
|
|
6437
|
+
a.validateAndGetAvailableInternalIpRanges(null, null, null, (data, error) => {
|
|
6438
|
+
try {
|
|
6439
|
+
if (stub) {
|
|
6440
|
+
runCommonAsserts(data, error);
|
|
6441
|
+
assert.equal('object', typeof data.response[0]);
|
|
6442
|
+
assert.equal('object', typeof data.response[1]);
|
|
6443
|
+
assert.equal('object', typeof data.response[2]);
|
|
6444
|
+
assert.equal('object', typeof data.response[3]);
|
|
6445
|
+
} else {
|
|
6446
|
+
runCommonAsserts(data, error);
|
|
6447
|
+
}
|
|
6448
|
+
saveMockData('TrafficForwarding', 'validateAndGetAvailableInternalIpRanges', 'default', data);
|
|
6449
|
+
done();
|
|
6450
|
+
} catch (err) {
|
|
6451
|
+
log.error(`Test Failure: ${err}`);
|
|
6452
|
+
done(err);
|
|
6453
|
+
}
|
|
6454
|
+
});
|
|
6455
|
+
} catch (error) {
|
|
6456
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6457
|
+
done(error);
|
|
6458
|
+
}
|
|
6459
|
+
}).timeout(attemptTimeout);
|
|
6460
|
+
});
|
|
6461
|
+
|
|
6462
|
+
describe('#getGreTunelById - errors', () => {
|
|
6463
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6464
|
+
try {
|
|
6465
|
+
a.getGreTunelById(555, (data, error) => {
|
|
6466
|
+
try {
|
|
6467
|
+
if (stub) {
|
|
6468
|
+
const displayE = 'Error 400 received on request';
|
|
6469
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6470
|
+
} else {
|
|
6471
|
+
runCommonAsserts(data, error);
|
|
6472
|
+
}
|
|
6473
|
+
saveMockData('TrafficForwarding', 'getGreTunelById', 'default', data);
|
|
6474
|
+
done();
|
|
6475
|
+
} catch (err) {
|
|
6476
|
+
log.error(`Test Failure: ${err}`);
|
|
6477
|
+
done(err);
|
|
6478
|
+
}
|
|
6479
|
+
});
|
|
6480
|
+
} catch (error) {
|
|
6481
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6482
|
+
done(error);
|
|
6483
|
+
}
|
|
6484
|
+
}).timeout(attemptTimeout);
|
|
6485
|
+
});
|
|
6486
|
+
|
|
6487
|
+
const trafficForwardingUpdateGreTunnelBodyParam = {};
|
|
6488
|
+
describe('#updateGreTunnel - errors', () => {
|
|
6489
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6490
|
+
try {
|
|
6491
|
+
a.updateGreTunnel(555, trafficForwardingUpdateGreTunnelBodyParam, (data, error) => {
|
|
6492
|
+
try {
|
|
6493
|
+
if (stub) {
|
|
6494
|
+
const displayE = 'Error 400 received on request';
|
|
6495
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6496
|
+
} else {
|
|
6497
|
+
runCommonAsserts(data, error);
|
|
6498
|
+
}
|
|
6499
|
+
saveMockData('TrafficForwarding', 'updateGreTunnel', 'default', data);
|
|
6500
|
+
done();
|
|
6501
|
+
} catch (err) {
|
|
6502
|
+
log.error(`Test Failure: ${err}`);
|
|
6503
|
+
done(err);
|
|
6504
|
+
}
|
|
6505
|
+
});
|
|
6506
|
+
} catch (error) {
|
|
6507
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6508
|
+
done(error);
|
|
6509
|
+
}
|
|
6510
|
+
}).timeout(attemptTimeout);
|
|
6511
|
+
});
|
|
6512
|
+
|
|
6513
|
+
describe('#deleteGreTunnel - errors', () => {
|
|
6514
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6515
|
+
try {
|
|
6516
|
+
a.deleteGreTunnel(555, (data, error) => {
|
|
6517
|
+
try {
|
|
6518
|
+
if (stub) {
|
|
6519
|
+
const displayE = 'Error 400 received on request';
|
|
6520
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6521
|
+
} else {
|
|
6522
|
+
runCommonAsserts(data, error);
|
|
6523
|
+
}
|
|
6524
|
+
saveMockData('TrafficForwarding', 'deleteGreTunnel', 'default', data);
|
|
6525
|
+
done();
|
|
6526
|
+
} catch (err) {
|
|
6527
|
+
log.error(`Test Failure: ${err}`);
|
|
6528
|
+
done(err);
|
|
6529
|
+
}
|
|
6530
|
+
});
|
|
6531
|
+
} catch (error) {
|
|
6532
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6533
|
+
done(error);
|
|
6534
|
+
}
|
|
6535
|
+
}).timeout(attemptTimeout);
|
|
6536
|
+
});
|
|
6537
|
+
|
|
6538
|
+
describe('#getIPv6Configuration - errors', () => {
|
|
6539
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6540
|
+
try {
|
|
6541
|
+
a.getIPv6Configuration((data, error) => {
|
|
6542
|
+
try {
|
|
6543
|
+
if (stub) {
|
|
6544
|
+
const displayE = 'Error 400 received on request';
|
|
6545
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6546
|
+
} else {
|
|
6547
|
+
runCommonAsserts(data, error);
|
|
6548
|
+
}
|
|
6549
|
+
saveMockData('TrafficForwarding', 'getIPv6Configuration', 'default', data);
|
|
6550
|
+
done();
|
|
6551
|
+
} catch (err) {
|
|
6552
|
+
log.error(`Test Failure: ${err}`);
|
|
6553
|
+
done(err);
|
|
6554
|
+
}
|
|
6555
|
+
});
|
|
6556
|
+
} catch (error) {
|
|
6557
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6558
|
+
done(error);
|
|
6559
|
+
}
|
|
6560
|
+
}).timeout(attemptTimeout);
|
|
6561
|
+
});
|
|
6562
|
+
|
|
6563
|
+
describe('#getDns64Prefixes - errors', () => {
|
|
6564
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
6565
|
+
try {
|
|
6566
|
+
a.getDns64Prefixes(null, (data, error) => {
|
|
6567
|
+
try {
|
|
6568
|
+
if (stub) {
|
|
6569
|
+
runCommonAsserts(data, error);
|
|
6570
|
+
assert.equal('object', typeof data.response[0]);
|
|
6571
|
+
assert.equal('object', typeof data.response[1]);
|
|
6572
|
+
assert.equal('object', typeof data.response[2]);
|
|
6573
|
+
assert.equal('object', typeof data.response[3]);
|
|
6574
|
+
} else {
|
|
6575
|
+
runCommonAsserts(data, error);
|
|
6576
|
+
}
|
|
6577
|
+
saveMockData('TrafficForwarding', 'getDns64Prefixes', 'default', data);
|
|
6578
|
+
done();
|
|
6579
|
+
} catch (err) {
|
|
6580
|
+
log.error(`Test Failure: ${err}`);
|
|
6581
|
+
done(err);
|
|
6582
|
+
}
|
|
6583
|
+
});
|
|
6584
|
+
} catch (error) {
|
|
6585
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6586
|
+
done(error);
|
|
6587
|
+
}
|
|
6588
|
+
}).timeout(attemptTimeout);
|
|
6589
|
+
});
|
|
6590
|
+
|
|
6591
|
+
describe('#getNat64Prefixes - errors', () => {
|
|
6592
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
6593
|
+
try {
|
|
6594
|
+
a.getNat64Prefixes(null, null, null, (data, error) => {
|
|
6595
|
+
try {
|
|
6596
|
+
if (stub) {
|
|
6597
|
+
runCommonAsserts(data, error);
|
|
6598
|
+
assert.equal('object', typeof data.response[0]);
|
|
6599
|
+
assert.equal('object', typeof data.response[1]);
|
|
6600
|
+
} else {
|
|
6601
|
+
runCommonAsserts(data, error);
|
|
6602
|
+
}
|
|
6603
|
+
saveMockData('TrafficForwarding', 'getNat64Prefixes', 'default', data);
|
|
6604
|
+
done();
|
|
6605
|
+
} catch (err) {
|
|
6606
|
+
log.error(`Test Failure: ${err}`);
|
|
6607
|
+
done(err);
|
|
6608
|
+
}
|
|
6609
|
+
});
|
|
6610
|
+
} catch (error) {
|
|
6611
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6612
|
+
done(error);
|
|
6613
|
+
}
|
|
6614
|
+
}).timeout(attemptTimeout);
|
|
6615
|
+
});
|
|
6616
|
+
|
|
6617
|
+
describe('#getIPGWDetails - errors', () => {
|
|
6618
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
6619
|
+
try {
|
|
6620
|
+
a.getIPGWDetails(null, (data, error) => {
|
|
6621
|
+
try {
|
|
6622
|
+
if (stub) {
|
|
6623
|
+
runCommonAsserts(data, error);
|
|
6624
|
+
assert.equal('object', typeof data.response[0]);
|
|
6625
|
+
assert.equal('object', typeof data.response[1]);
|
|
6626
|
+
assert.equal('object', typeof data.response[2]);
|
|
6627
|
+
} else {
|
|
6628
|
+
runCommonAsserts(data, error);
|
|
6629
|
+
}
|
|
6630
|
+
saveMockData('TrafficForwarding', 'getIPGWDetails', 'default', data);
|
|
6631
|
+
done();
|
|
6632
|
+
} catch (err) {
|
|
6633
|
+
log.error(`Test Failure: ${err}`);
|
|
6634
|
+
done(err);
|
|
6635
|
+
}
|
|
6636
|
+
});
|
|
6637
|
+
} catch (error) {
|
|
6638
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6639
|
+
done(error);
|
|
6640
|
+
}
|
|
6641
|
+
}).timeout(attemptTimeout);
|
|
6642
|
+
});
|
|
6643
|
+
|
|
6644
|
+
describe('#getRegionByGeoCoordinates - errors', () => {
|
|
6645
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6646
|
+
try {
|
|
6647
|
+
a.getRegionByGeoCoordinates(555, 555, (data, error) => {
|
|
6648
|
+
try {
|
|
6649
|
+
if (stub) {
|
|
6650
|
+
const displayE = 'Error 400 received on request';
|
|
6651
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6652
|
+
} else {
|
|
6653
|
+
runCommonAsserts(data, error);
|
|
6654
|
+
}
|
|
6655
|
+
saveMockData('TrafficForwarding', 'getRegionByGeoCoordinates', 'default', data);
|
|
6656
|
+
done();
|
|
6657
|
+
} catch (err) {
|
|
6658
|
+
log.error(`Test Failure: ${err}`);
|
|
6659
|
+
done(err);
|
|
6660
|
+
}
|
|
6661
|
+
});
|
|
6662
|
+
} catch (error) {
|
|
6663
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6664
|
+
done(error);
|
|
6665
|
+
}
|
|
6666
|
+
}).timeout(attemptTimeout);
|
|
6667
|
+
});
|
|
6668
|
+
|
|
6669
|
+
describe('#getRegionBySrcIPAddress - errors', () => {
|
|
6670
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6671
|
+
try {
|
|
6672
|
+
a.getRegionBySrcIPAddress('fakedata', (data, error) => {
|
|
6673
|
+
try {
|
|
6674
|
+
if (stub) {
|
|
6675
|
+
const displayE = 'Error 400 received on request';
|
|
6676
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6677
|
+
} else {
|
|
6678
|
+
runCommonAsserts(data, error);
|
|
6679
|
+
}
|
|
6680
|
+
saveMockData('TrafficForwarding', 'getRegionBySrcIPAddress', 'default', data);
|
|
6681
|
+
done();
|
|
6682
|
+
} catch (err) {
|
|
6683
|
+
log.error(`Test Failure: ${err}`);
|
|
6684
|
+
done(err);
|
|
6685
|
+
}
|
|
6686
|
+
});
|
|
6687
|
+
} catch (error) {
|
|
6688
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6689
|
+
done(error);
|
|
6690
|
+
}
|
|
6691
|
+
}).timeout(attemptTimeout);
|
|
6692
|
+
});
|
|
6693
|
+
|
|
6694
|
+
describe('#getRegionsByPrefix - errors', () => {
|
|
6695
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
6696
|
+
try {
|
|
6697
|
+
a.getRegionsByPrefix(null, null, null, (data, error) => {
|
|
6698
|
+
try {
|
|
6699
|
+
if (stub) {
|
|
6700
|
+
runCommonAsserts(data, error);
|
|
6701
|
+
assert.equal('object', typeof data.response[0]);
|
|
6702
|
+
assert.equal('object', typeof data.response[1]);
|
|
6703
|
+
} else {
|
|
6704
|
+
runCommonAsserts(data, error);
|
|
6705
|
+
}
|
|
6706
|
+
saveMockData('TrafficForwarding', 'getRegionsByPrefix', 'default', data);
|
|
6707
|
+
done();
|
|
6708
|
+
} catch (err) {
|
|
6709
|
+
log.error(`Test Failure: ${err}`);
|
|
6710
|
+
done(err);
|
|
6711
|
+
}
|
|
6712
|
+
});
|
|
6713
|
+
} catch (error) {
|
|
6714
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6715
|
+
done(error);
|
|
6716
|
+
}
|
|
6717
|
+
}).timeout(attemptTimeout);
|
|
6718
|
+
});
|
|
6719
|
+
|
|
6720
|
+
describe('#getAllStaticIPs - errors', () => {
|
|
6721
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
6722
|
+
try {
|
|
6723
|
+
a.getAllStaticIPs(null, null, null, null, (data, error) => {
|
|
6724
|
+
try {
|
|
6725
|
+
if (stub) {
|
|
6726
|
+
runCommonAsserts(data, error);
|
|
6727
|
+
assert.equal('object', typeof data.response[0]);
|
|
6728
|
+
assert.equal('object', typeof data.response[1]);
|
|
6729
|
+
assert.equal('object', typeof data.response[2]);
|
|
6730
|
+
assert.equal('object', typeof data.response[3]);
|
|
6731
|
+
} else {
|
|
6732
|
+
runCommonAsserts(data, error);
|
|
6733
|
+
}
|
|
6734
|
+
saveMockData('TrafficForwarding', 'getAllStaticIPs', 'default', data);
|
|
6735
|
+
done();
|
|
6736
|
+
} catch (err) {
|
|
6737
|
+
log.error(`Test Failure: ${err}`);
|
|
6738
|
+
done(err);
|
|
6739
|
+
}
|
|
6740
|
+
});
|
|
6741
|
+
} catch (error) {
|
|
6742
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6743
|
+
done(error);
|
|
6744
|
+
}
|
|
6745
|
+
}).timeout(attemptTimeout);
|
|
6746
|
+
});
|
|
6747
|
+
|
|
6748
|
+
const trafficForwardingAddStaticIPBodyParam = {};
|
|
6749
|
+
describe('#addStaticIP - errors', () => {
|
|
6750
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6751
|
+
try {
|
|
6752
|
+
a.addStaticIP(trafficForwardingAddStaticIPBodyParam, (data, error) => {
|
|
6753
|
+
try {
|
|
6754
|
+
if (stub) {
|
|
6755
|
+
const displayE = 'Error 400 received on request';
|
|
6756
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6757
|
+
} else {
|
|
6758
|
+
runCommonAsserts(data, error);
|
|
6759
|
+
}
|
|
6760
|
+
saveMockData('TrafficForwarding', 'addStaticIP', 'default', data);
|
|
6761
|
+
done();
|
|
6762
|
+
} catch (err) {
|
|
6763
|
+
log.error(`Test Failure: ${err}`);
|
|
6764
|
+
done(err);
|
|
6765
|
+
}
|
|
6766
|
+
});
|
|
6767
|
+
} catch (error) {
|
|
6768
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6769
|
+
done(error);
|
|
6770
|
+
}
|
|
6771
|
+
}).timeout(attemptTimeout);
|
|
6772
|
+
});
|
|
6773
|
+
|
|
6774
|
+
const trafficForwardingValidateIPAddressBodyParam = {};
|
|
6775
|
+
describe('#validateIPAddress - errors', () => {
|
|
6776
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6777
|
+
try {
|
|
6778
|
+
a.validateIPAddress(trafficForwardingValidateIPAddressBodyParam, (data, error) => {
|
|
6779
|
+
try {
|
|
6780
|
+
if (stub) {
|
|
6781
|
+
const displayE = 'Error 400 received on request';
|
|
6782
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6783
|
+
} else {
|
|
6784
|
+
runCommonAsserts(data, error);
|
|
6785
|
+
}
|
|
6786
|
+
saveMockData('TrafficForwarding', 'validateIPAddress', 'default', data);
|
|
6787
|
+
done();
|
|
6788
|
+
} catch (err) {
|
|
6789
|
+
log.error(`Test Failure: ${err}`);
|
|
6790
|
+
done(err);
|
|
6791
|
+
}
|
|
6792
|
+
});
|
|
6793
|
+
} catch (error) {
|
|
6794
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6795
|
+
done(error);
|
|
6796
|
+
}
|
|
6797
|
+
}).timeout(attemptTimeout);
|
|
6798
|
+
});
|
|
6799
|
+
|
|
6800
|
+
describe('#getStaticIPById - errors', () => {
|
|
6801
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6802
|
+
try {
|
|
6803
|
+
a.getStaticIPById(555, (data, error) => {
|
|
6804
|
+
try {
|
|
6805
|
+
if (stub) {
|
|
6806
|
+
const displayE = 'Error 400 received on request';
|
|
6807
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6808
|
+
} else {
|
|
6809
|
+
runCommonAsserts(data, error);
|
|
6810
|
+
}
|
|
6811
|
+
saveMockData('TrafficForwarding', 'getStaticIPById', 'default', data);
|
|
6812
|
+
done();
|
|
6813
|
+
} catch (err) {
|
|
6814
|
+
log.error(`Test Failure: ${err}`);
|
|
6815
|
+
done(err);
|
|
6816
|
+
}
|
|
6817
|
+
});
|
|
6818
|
+
} catch (error) {
|
|
6819
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6820
|
+
done(error);
|
|
6821
|
+
}
|
|
6822
|
+
}).timeout(attemptTimeout);
|
|
6823
|
+
});
|
|
6824
|
+
|
|
6825
|
+
const trafficForwardingUpdateStaticIPBodyParam = {};
|
|
6826
|
+
describe('#updateStaticIP - errors', () => {
|
|
6827
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6828
|
+
try {
|
|
6829
|
+
a.updateStaticIP(555, trafficForwardingUpdateStaticIPBodyParam, (data, error) => {
|
|
6830
|
+
try {
|
|
6831
|
+
if (stub) {
|
|
6832
|
+
const displayE = 'Error 400 received on request';
|
|
6833
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6834
|
+
} else {
|
|
6835
|
+
runCommonAsserts(data, error);
|
|
6836
|
+
}
|
|
6837
|
+
saveMockData('TrafficForwarding', 'updateStaticIP', 'default', data);
|
|
6838
|
+
done();
|
|
6839
|
+
} catch (err) {
|
|
6840
|
+
log.error(`Test Failure: ${err}`);
|
|
6841
|
+
done(err);
|
|
6842
|
+
}
|
|
6843
|
+
});
|
|
6844
|
+
} catch (error) {
|
|
6845
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6846
|
+
done(error);
|
|
6847
|
+
}
|
|
6848
|
+
}).timeout(attemptTimeout);
|
|
6849
|
+
});
|
|
6850
|
+
|
|
6851
|
+
describe('#deleteStaticIP - errors', () => {
|
|
6852
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6853
|
+
try {
|
|
6854
|
+
a.deleteStaticIP(555, (data, error) => {
|
|
6855
|
+
try {
|
|
6856
|
+
if (stub) {
|
|
6857
|
+
const displayE = 'Error 400 received on request';
|
|
6858
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6859
|
+
} else {
|
|
6860
|
+
runCommonAsserts(data, error);
|
|
6861
|
+
}
|
|
6862
|
+
saveMockData('TrafficForwarding', 'deleteStaticIP', 'default', data);
|
|
6863
|
+
done();
|
|
6864
|
+
} catch (err) {
|
|
6865
|
+
log.error(`Test Failure: ${err}`);
|
|
6866
|
+
done(err);
|
|
6867
|
+
}
|
|
6868
|
+
});
|
|
6869
|
+
} catch (error) {
|
|
6870
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6871
|
+
done(error);
|
|
6872
|
+
}
|
|
6873
|
+
}).timeout(attemptTimeout);
|
|
6874
|
+
});
|
|
6875
|
+
|
|
6876
|
+
describe('#getZscalerNodesDetails - errors', () => {
|
|
6877
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
6878
|
+
try {
|
|
6879
|
+
a.getZscalerNodesDetails(null, null, null, null, null, null, (data, error) => {
|
|
6880
|
+
try {
|
|
6881
|
+
if (stub) {
|
|
6882
|
+
runCommonAsserts(data, error);
|
|
6883
|
+
assert.equal('object', typeof data.response[0]);
|
|
6884
|
+
assert.equal('object', typeof data.response[1]);
|
|
6885
|
+
assert.equal('object', typeof data.response[2]);
|
|
6886
|
+
assert.equal('object', typeof data.response[3]);
|
|
6887
|
+
} else {
|
|
6888
|
+
runCommonAsserts(data, error);
|
|
6889
|
+
}
|
|
6890
|
+
saveMockData('TrafficForwarding', 'getZscalerNodesDetails', 'default', data);
|
|
6891
|
+
done();
|
|
6892
|
+
} catch (err) {
|
|
6893
|
+
log.error(`Test Failure: ${err}`);
|
|
6894
|
+
done(err);
|
|
6895
|
+
}
|
|
6896
|
+
});
|
|
6897
|
+
} catch (error) {
|
|
6898
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6899
|
+
done(error);
|
|
6900
|
+
}
|
|
6901
|
+
}).timeout(attemptTimeout);
|
|
6902
|
+
});
|
|
6903
|
+
|
|
6904
|
+
describe('#getRecommendedVipsGroupedByDC - errors', () => {
|
|
6905
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
6906
|
+
try {
|
|
6907
|
+
a.getRecommendedVipsGroupedByDC(null, null, null, null, null, null, null, null, (data, error) => {
|
|
6908
|
+
try {
|
|
6909
|
+
if (stub) {
|
|
6910
|
+
runCommonAsserts(data, error);
|
|
6911
|
+
assert.equal('object', typeof data.response[0]);
|
|
6912
|
+
assert.equal('object', typeof data.response[1]);
|
|
6913
|
+
} else {
|
|
6914
|
+
runCommonAsserts(data, error);
|
|
6915
|
+
}
|
|
6916
|
+
saveMockData('TrafficForwarding', 'getRecommendedVipsGroupedByDC', 'default', data);
|
|
6917
|
+
done();
|
|
6918
|
+
} catch (err) {
|
|
6919
|
+
log.error(`Test Failure: ${err}`);
|
|
6920
|
+
done(err);
|
|
6921
|
+
}
|
|
6922
|
+
});
|
|
6923
|
+
} catch (error) {
|
|
6924
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6925
|
+
done(error);
|
|
6926
|
+
}
|
|
6927
|
+
}).timeout(attemptTimeout);
|
|
6928
|
+
});
|
|
6929
|
+
|
|
6930
|
+
describe('#getRecommendedGreVips - errors', () => {
|
|
6931
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
6932
|
+
try {
|
|
6933
|
+
a.getRecommendedGreVips(null, null, null, null, null, null, null, null, (data, error) => {
|
|
6934
|
+
try {
|
|
6935
|
+
if (stub) {
|
|
6936
|
+
runCommonAsserts(data, error);
|
|
6937
|
+
assert.equal('object', typeof data.response[0]);
|
|
6938
|
+
assert.equal('object', typeof data.response[1]);
|
|
6939
|
+
assert.equal('object', typeof data.response[2]);
|
|
6940
|
+
} else {
|
|
6941
|
+
runCommonAsserts(data, error);
|
|
6942
|
+
}
|
|
6943
|
+
saveMockData('TrafficForwarding', 'getRecommendedGreVips', 'default', data);
|
|
6944
|
+
done();
|
|
6945
|
+
} catch (err) {
|
|
6946
|
+
log.error(`Test Failure: ${err}`);
|
|
6947
|
+
done(err);
|
|
6948
|
+
}
|
|
6949
|
+
});
|
|
6950
|
+
} catch (error) {
|
|
6951
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6952
|
+
done(error);
|
|
6953
|
+
}
|
|
6954
|
+
}).timeout(attemptTimeout);
|
|
6955
|
+
});
|
|
6956
|
+
|
|
6957
|
+
describe('#getAuthExemptedUrls - errors', () => {
|
|
6958
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6959
|
+
try {
|
|
6960
|
+
a.getAuthExemptedUrls((data, error) => {
|
|
6961
|
+
try {
|
|
6962
|
+
if (stub) {
|
|
6963
|
+
const displayE = 'Error 400 received on request';
|
|
6964
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6965
|
+
} else {
|
|
6966
|
+
runCommonAsserts(data, error);
|
|
6967
|
+
}
|
|
6968
|
+
saveMockData('UserAuthenticationSettings', 'getAuthExemptedUrls', 'default', data);
|
|
6969
|
+
done();
|
|
6970
|
+
} catch (err) {
|
|
6971
|
+
log.error(`Test Failure: ${err}`);
|
|
6972
|
+
done(err);
|
|
6973
|
+
}
|
|
6974
|
+
});
|
|
6975
|
+
} catch (error) {
|
|
6976
|
+
log.error(`Adapter Exception: ${error}`);
|
|
6977
|
+
done(error);
|
|
6978
|
+
}
|
|
6979
|
+
}).timeout(attemptTimeout);
|
|
6980
|
+
});
|
|
6981
|
+
|
|
6982
|
+
describe('#updateAuthExemptedUrls - errors', () => {
|
|
6983
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
6984
|
+
try {
|
|
6985
|
+
a.updateAuthExemptedUrls('fakedata', (data, error) => {
|
|
6986
|
+
try {
|
|
6987
|
+
if (stub) {
|
|
6988
|
+
const displayE = 'Error 400 received on request';
|
|
6989
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-zscaler-connectorRest-handleEndResponse', displayE);
|
|
6990
|
+
} else {
|
|
6991
|
+
runCommonAsserts(data, error);
|
|
6992
|
+
}
|
|
6993
|
+
saveMockData('UserAuthenticationSettings', 'updateAuthExemptedUrls', 'default', data);
|
|
6994
|
+
done();
|
|
6995
|
+
} catch (err) {
|
|
6996
|
+
log.error(`Test Failure: ${err}`);
|
|
6997
|
+
done(err);
|
|
6998
|
+
}
|
|
6999
|
+
});
|
|
7000
|
+
} catch (error) {
|
|
7001
|
+
log.error(`Adapter Exception: ${error}`);
|
|
7002
|
+
done(error);
|
|
7003
|
+
}
|
|
7004
|
+
}).timeout(attemptTimeout);
|
|
7005
|
+
});
|
|
7006
|
+
|
|
7007
|
+
describe('#getWorkloadGroups - errors', () => {
|
|
7008
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
7009
|
+
try {
|
|
7010
|
+
a.getWorkloadGroups(null, null, (data, error) => {
|
|
7011
|
+
try {
|
|
7012
|
+
if (stub) {
|
|
7013
|
+
runCommonAsserts(data, error);
|
|
7014
|
+
assert.equal('object', typeof data.response[0]);
|
|
7015
|
+
assert.equal('object', typeof data.response[1]);
|
|
7016
|
+
} else {
|
|
7017
|
+
runCommonAsserts(data, error);
|
|
7018
|
+
}
|
|
7019
|
+
saveMockData('WorkloadGroups', 'getWorkloadGroups', 'default', data);
|
|
7020
|
+
done();
|
|
7021
|
+
} catch (err) {
|
|
7022
|
+
log.error(`Test Failure: ${err}`);
|
|
7023
|
+
done(err);
|
|
7024
|
+
}
|
|
7025
|
+
});
|
|
7026
|
+
} catch (error) {
|
|
7027
|
+
log.error(`Adapter Exception: ${error}`);
|
|
7028
|
+
done(error);
|
|
7029
|
+
}
|
|
7030
|
+
}).timeout(attemptTimeout);
|
|
7031
|
+
});
|
|
7032
|
+
|
|
7033
|
+
describe('#getLocationGroups - errors', () => {
|
|
7034
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
7035
|
+
try {
|
|
7036
|
+
a.getLocationGroups(null, null, null, null, null, null, null, null, (data, error) => {
|
|
7037
|
+
try {
|
|
7038
|
+
if (stub) {
|
|
7039
|
+
runCommonAsserts(data, error);
|
|
7040
|
+
assert.equal('object', typeof data.response[0]);
|
|
7041
|
+
assert.equal('object', typeof data.response[1]);
|
|
7042
|
+
assert.equal('object', typeof data.response[2]);
|
|
7043
|
+
} else {
|
|
7044
|
+
runCommonAsserts(data, error);
|
|
7045
|
+
}
|
|
7046
|
+
saveMockData('LocationManagement', 'getLocationGroups', 'default', data);
|
|
7047
|
+
done();
|
|
7048
|
+
} catch (err) {
|
|
7049
|
+
log.error(`Test Failure: ${err}`);
|
|
7050
|
+
done(err);
|
|
7051
|
+
}
|
|
7052
|
+
});
|
|
7053
|
+
} catch (error) {
|
|
7054
|
+
log.error(`Adapter Exception: ${error}`);
|
|
7055
|
+
done(error);
|
|
7056
|
+
}
|
|
7057
|
+
}).timeout(attemptTimeout);
|
|
7058
|
+
});
|
|
2177
7059
|
});
|
|
2178
7060
|
});
|