@itentialopensource/adapter-selector_ai 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +5 -0
- package/.eslintrc.js +19 -0
- package/.jshintrc +3 -0
- package/AUTH.md +39 -0
- package/BROKER.md +211 -0
- package/CALLS.md +405 -0
- package/CODE_OF_CONDUCT.md +43 -0
- package/CONTRIBUTING.md +13 -0
- package/ENHANCE.md +69 -0
- package/LICENSE +201 -0
- package/PROPERTIES.md +661 -0
- package/README.md +344 -0
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +14 -0
- package/TAB1.md +8 -0
- package/TAB2.md +314 -0
- package/TROUBLESHOOT.md +56 -0
- package/UTILITIES.md +473 -0
- package/adapter.js +4039 -0
- package/adapterBase.js +1488 -0
- package/entities/.generic/action.json +214 -0
- package/entities/.generic/schema.json +28 -0
- package/entities/.system/action.json +50 -0
- package/entities/.system/mockdatafiles/getToken-default.json +3 -0
- package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
- package/entities/.system/schema.json +19 -0
- package/entities/.system/schemaTokenReq.json +53 -0
- package/entities/.system/schemaTokenResp.json +53 -0
- package/entities/InventorySchemaCreation/action.json +24 -0
- package/entities/InventorySchemaCreation/schema.json +19 -0
- package/entities/InventorySchemaDelete/action.json +24 -0
- package/entities/InventorySchemaDelete/schema.json +19 -0
- package/entities/InventorySchemaDeleteType/action.json +24 -0
- package/entities/InventorySchemaDeleteType/schema.json +19 -0
- package/entities/InventorySchemaFileDownload/action.json +24 -0
- package/entities/InventorySchemaFileDownload/schema.json +19 -0
- package/entities/InventorySchemaFileUpload/action.json +24 -0
- package/entities/InventorySchemaFileUpload/schema.json +19 -0
- package/entities/InventorySchemaUpdate/action.json +24 -0
- package/entities/InventorySchemaUpdate/schema.json +19 -0
- package/entities/InventoryV2SchemaDeleteAll/action.json +24 -0
- package/entities/InventoryV2SchemaDeleteAll/schema.json +19 -0
- package/entities/InventoryV2SchemaDeleteType/action.json +24 -0
- package/entities/InventoryV2SchemaDeleteType/schema.json +19 -0
- package/entities/InventoryV2SchemaUpdate/action.json +24 -0
- package/entities/InventoryV2SchemaUpdate/schema.json +19 -0
- package/entities/InventoryV2SchemaUpload/action.json +24 -0
- package/entities/InventoryV2SchemaUpload/schema.json +19 -0
- package/entities/MetastoreInventoryBulkDataUpload/action.json +24 -0
- package/entities/MetastoreInventoryBulkDataUpload/schema.json +19 -0
- package/entities/MetastoreInventoryCSVDataUpload/action.json +24 -0
- package/entities/MetastoreInventoryCSVDataUpload/schema.json +19 -0
- package/entities/MetastoreInventoryCsvFileExport/action.json +25 -0
- package/entities/MetastoreInventoryCsvFileExport/schema.json +19 -0
- package/entities/MetastoreInventoryDataDelete/action.json +24 -0
- package/entities/MetastoreInventoryDataDelete/schema.json +19 -0
- package/entities/MetastoreInventoryDataDownload/action.json +46 -0
- package/entities/MetastoreInventoryDataDownload/schema.json +20 -0
- package/entities/MetastoreInventoryDataEdit/action.json +24 -0
- package/entities/MetastoreInventoryDataEdit/schema.json +19 -0
- package/entities/MetastoreInventoryDataUpload/action.json +24 -0
- package/entities/MetastoreInventoryDataUpload/schema.json +19 -0
- package/entities/MetastoreInventoryFilesExport/action.json +24 -0
- package/entities/MetastoreInventoryFilesExport/schema.json +19 -0
- package/entities/MetastoreInventoryFilesImport/action.json +24 -0
- package/entities/MetastoreInventoryFilesImport/schema.json +30 -0
- package/entities/MetastoreInventoryItems/action.json +25 -0
- package/entities/MetastoreInventoryItems/schema.json +19 -0
- package/entities/MetastoreInventoryNameDelete/action.json +24 -0
- package/entities/MetastoreInventoryNameDelete/schema.json +19 -0
- package/entities/MetastoreInventoryNameUpdate/action.json +24 -0
- package/entities/MetastoreInventoryNameUpdate/schema.json +19 -0
- package/entities/MetastoreInventoryNameUpload/action.json +24 -0
- package/entities/MetastoreInventoryNameUpload/schema.json +19 -0
- package/entities/MetastoreInventoryNamesDownload/action.json +25 -0
- package/entities/MetastoreInventoryNamesDownload/schema.json +19 -0
- package/entities/MetastoreInventorySchemaGet/action.json +25 -0
- package/entities/MetastoreInventorySchemaGet/schema.json +19 -0
- package/entities/MetastoreInventorySystem/action.json +130 -0
- package/entities/MetastoreInventorySystem/schema.json +24 -0
- package/entities/MetastoreV2InventorySchemaGet/action.json +25 -0
- package/entities/MetastoreV2InventorySchemaGet/schema.json +19 -0
- package/error.json +190 -0
- package/metadata.json +58 -0
- package/package.json +77 -0
- package/pronghorn.json +2508 -0
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +1635 -0
- package/report/adapterInfo.json +10 -0
- package/report/auto-adapter-openapi.json +1330 -0
- package/report/creationReport.json +765 -0
- package/report/metastore-inventory-manager.yaml-OpenApi3Json.json +2366 -0
- package/sampleProperties.json +260 -0
- package/test/integration/adapterTestBasicGet.js +117 -0
- package/test/integration/adapterTestConnectivity.js +117 -0
- package/test/integration/adapterTestIntegration.js +1295 -0
- package/test/unit/adapterBaseTestUnit.js +1626 -0
- package/test/unit/adapterTestUnit.js +2288 -0
- package/utils/adapterInfo.js +156 -0
- package/utils/argParser.js +44 -0
- package/utils/checkMigrate.js +102 -0
- package/utils/entitiesToDB.js +190 -0
- package/utils/findPath.js +74 -0
- package/utils/logger.js +26 -0
- package/utils/methodDocumentor.js +273 -0
- package/utils/modify.js +153 -0
- package/utils/mongoDbConnection.js +79 -0
- package/utils/mongoUtils.js +162 -0
- package/utils/pre-commit.sh +32 -0
- package/utils/removeHooks.js +20 -0
- package/utils/setup.js +33 -0
- package/utils/taskMover.js +308 -0
- package/utils/tbScript.js +103 -0
- package/utils/tbUtils.js +347 -0
- package/utils/testRunner.js +298 -0
- package/utils/troubleshootingAdapter.js +177 -0
- package/utils/updateAdapterConfig.js +158 -0
|
@@ -0,0 +1,1295 @@
|
|
|
1
|
+
/* @copyright Itential, LLC 2019 (pre-modifications) */
|
|
2
|
+
|
|
3
|
+
// Set globals
|
|
4
|
+
/* global describe it log pronghornProps */
|
|
5
|
+
/* eslint no-unused-vars: warn */
|
|
6
|
+
/* eslint no-underscore-dangle: warn */
|
|
7
|
+
/* eslint import/no-dynamic-require:warn */
|
|
8
|
+
|
|
9
|
+
// include required items for testing & logging
|
|
10
|
+
const assert = require('assert');
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
const util = require('util');
|
|
14
|
+
const mocha = require('mocha');
|
|
15
|
+
const winston = require('winston');
|
|
16
|
+
const { expect } = require('chai');
|
|
17
|
+
const { use } = require('chai');
|
|
18
|
+
const td = require('testdouble');
|
|
19
|
+
const log = require('../../utils/logger');
|
|
20
|
+
|
|
21
|
+
const anything = td.matchers.anything();
|
|
22
|
+
|
|
23
|
+
// stub and attemptTimeout are used throughout the code so set them here
|
|
24
|
+
const isRapidFail = false;
|
|
25
|
+
const isSaveMockData = false;
|
|
26
|
+
|
|
27
|
+
// read in the properties from the sampleProperties files
|
|
28
|
+
let adaptdir = __dirname;
|
|
29
|
+
if (adaptdir.endsWith('/test/integration')) {
|
|
30
|
+
adaptdir = adaptdir.substring(0, adaptdir.length - 17);
|
|
31
|
+
} else if (adaptdir.endsWith('/test/unit')) {
|
|
32
|
+
adaptdir = adaptdir.substring(0, adaptdir.length - 10);
|
|
33
|
+
}
|
|
34
|
+
const samProps = require(`${adaptdir}/sampleProperties.json`).properties;
|
|
35
|
+
|
|
36
|
+
// these variables can be changed to run in integrated mode so easier to set them here
|
|
37
|
+
// always check these in with bogus data!!!
|
|
38
|
+
samProps.stub = true;
|
|
39
|
+
|
|
40
|
+
// uncomment if connecting
|
|
41
|
+
// samProps.host = 'replace.hostorip.here';
|
|
42
|
+
// samProps.authentication.username = 'username';
|
|
43
|
+
// samProps.authentication.password = 'password';
|
|
44
|
+
// samProps.authentication.token = 'password';
|
|
45
|
+
// samProps.protocol = 'http';
|
|
46
|
+
// samProps.port = 80;
|
|
47
|
+
// samProps.ssl.enabled = false;
|
|
48
|
+
// samProps.ssl.accept_invalid_cert = false;
|
|
49
|
+
|
|
50
|
+
if (samProps.request.attempt_timeout < 30000) {
|
|
51
|
+
samProps.request.attempt_timeout = 30000;
|
|
52
|
+
}
|
|
53
|
+
samProps.devicebroker.enabled = true;
|
|
54
|
+
const attemptTimeout = samProps.request.attempt_timeout;
|
|
55
|
+
const { stub } = samProps;
|
|
56
|
+
|
|
57
|
+
// these are the adapter properties. You generally should not need to alter
|
|
58
|
+
// any of these after they are initially set up
|
|
59
|
+
global.pronghornProps = {
|
|
60
|
+
pathProps: {
|
|
61
|
+
encrypted: false
|
|
62
|
+
},
|
|
63
|
+
adapterProps: {
|
|
64
|
+
adapters: [{
|
|
65
|
+
id: 'Test-selector_ai',
|
|
66
|
+
type: 'SelectorAi',
|
|
67
|
+
properties: samProps
|
|
68
|
+
}]
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
global.$HOME = `${__dirname}/../..`;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Runs the common asserts for test
|
|
76
|
+
*/
|
|
77
|
+
function runCommonAsserts(data, error) {
|
|
78
|
+
assert.equal(undefined, error);
|
|
79
|
+
assert.notEqual(undefined, data);
|
|
80
|
+
assert.notEqual(null, data);
|
|
81
|
+
assert.notEqual(undefined, data.response);
|
|
82
|
+
assert.notEqual(null, data.response);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Runs the error asserts for the test
|
|
87
|
+
*/
|
|
88
|
+
function runErrorAsserts(data, error, code, origin, displayStr) {
|
|
89
|
+
assert.equal(null, data);
|
|
90
|
+
assert.notEqual(undefined, error);
|
|
91
|
+
assert.notEqual(null, error);
|
|
92
|
+
assert.notEqual(undefined, error.IAPerror);
|
|
93
|
+
assert.notEqual(null, error.IAPerror);
|
|
94
|
+
assert.notEqual(undefined, error.IAPerror.displayString);
|
|
95
|
+
assert.notEqual(null, error.IAPerror.displayString);
|
|
96
|
+
assert.equal(code, error.icode);
|
|
97
|
+
assert.equal(origin, error.IAPerror.origin);
|
|
98
|
+
assert.equal(displayStr, error.IAPerror.displayString);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @function saveMockData
|
|
103
|
+
* Attempts to take data from responses and place them in MockDataFiles to help create Mockdata.
|
|
104
|
+
* Note, this was built based on entity file structure for Adapter-Engine 1.6.x
|
|
105
|
+
* @param {string} entityName - Name of the entity saving mock data for
|
|
106
|
+
* @param {string} actionName - Name of the action saving mock data for
|
|
107
|
+
* @param {string} descriptor - Something to describe this test (used as a type)
|
|
108
|
+
* @param {string or object} responseData - The data to put in the mock file.
|
|
109
|
+
*/
|
|
110
|
+
function saveMockData(entityName, actionName, descriptor, responseData) {
|
|
111
|
+
// do not need to save mockdata if we are running in stub mode (already has mock data) or if told not to save
|
|
112
|
+
if (stub || !isSaveMockData) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// must have a response in order to store the response
|
|
117
|
+
if (responseData && responseData.response) {
|
|
118
|
+
let data = responseData.response;
|
|
119
|
+
|
|
120
|
+
// if there was a raw response that one is better as it is untranslated
|
|
121
|
+
if (responseData.raw) {
|
|
122
|
+
data = responseData.raw;
|
|
123
|
+
|
|
124
|
+
try {
|
|
125
|
+
const temp = JSON.parse(data);
|
|
126
|
+
data = temp;
|
|
127
|
+
} catch (pex) {
|
|
128
|
+
// do not care if it did not parse as we will just use data
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
try {
|
|
133
|
+
const base = path.join(__dirname, `../../entities/${entityName}/`);
|
|
134
|
+
const mockdatafolder = 'mockdatafiles';
|
|
135
|
+
const filename = `mockdatafiles/${actionName}-${descriptor}.json`;
|
|
136
|
+
|
|
137
|
+
if (!fs.existsSync(base + mockdatafolder)) {
|
|
138
|
+
fs.mkdirSync(base + mockdatafolder);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// write the data we retrieved
|
|
142
|
+
fs.writeFile(base + filename, JSON.stringify(data, null, 2), 'utf8', (errWritingMock) => {
|
|
143
|
+
if (errWritingMock) throw errWritingMock;
|
|
144
|
+
|
|
145
|
+
// update the action file to reflect the changes. Note: We're replacing the default object for now!
|
|
146
|
+
fs.readFile(`${base}action.json`, (errRead, content) => {
|
|
147
|
+
if (errRead) throw errRead;
|
|
148
|
+
|
|
149
|
+
// parse the action file into JSON
|
|
150
|
+
const parsedJson = JSON.parse(content);
|
|
151
|
+
|
|
152
|
+
// The object update we'll write in.
|
|
153
|
+
const responseObj = {
|
|
154
|
+
type: descriptor,
|
|
155
|
+
key: '',
|
|
156
|
+
mockFile: filename
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
// get the object for method we're trying to change.
|
|
160
|
+
const currentMethodAction = parsedJson.actions.find((obj) => obj.name === actionName);
|
|
161
|
+
|
|
162
|
+
// if the method was not found - should never happen but...
|
|
163
|
+
if (!currentMethodAction) {
|
|
164
|
+
throw Error('Can\'t find an action for this method in the provided entity.');
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// if there is a response object, we want to replace the Response object. Otherwise we'll create one.
|
|
168
|
+
const actionResponseObj = currentMethodAction.responseObjects.find((obj) => obj.type === descriptor);
|
|
169
|
+
|
|
170
|
+
// Add the action responseObj back into the array of response objects.
|
|
171
|
+
if (!actionResponseObj) {
|
|
172
|
+
// if there is a default response object, we want to get the key.
|
|
173
|
+
const defaultResponseObj = currentMethodAction.responseObjects.find((obj) => obj.type === 'default');
|
|
174
|
+
|
|
175
|
+
// save the default key into the new response object
|
|
176
|
+
if (defaultResponseObj) {
|
|
177
|
+
responseObj.key = defaultResponseObj.key;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// save the new response object
|
|
181
|
+
currentMethodAction.responseObjects = [responseObj];
|
|
182
|
+
} else {
|
|
183
|
+
// update the location of the mock data file
|
|
184
|
+
actionResponseObj.mockFile = responseObj.mockFile;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Save results
|
|
188
|
+
fs.writeFile(`${base}action.json`, JSON.stringify(parsedJson, null, 2), (err) => {
|
|
189
|
+
if (err) throw err;
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
} catch (e) {
|
|
194
|
+
log.debug(`Failed to save mock data for ${actionName}. ${e.message}`);
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// no response to save
|
|
200
|
+
log.debug(`No data passed to save into mockdata for ${actionName}`);
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// require the adapter that we are going to be using
|
|
205
|
+
const SelectorAi = require('../../adapter');
|
|
206
|
+
|
|
207
|
+
// begin the testing - these should be pretty well defined between the describe and the it!
|
|
208
|
+
describe('[integration] Selector_ai Adapter Test', () => {
|
|
209
|
+
describe('SelectorAi Class Tests', () => {
|
|
210
|
+
const a = new SelectorAi(
|
|
211
|
+
pronghornProps.adapterProps.adapters[0].id,
|
|
212
|
+
pronghornProps.adapterProps.adapters[0].properties
|
|
213
|
+
);
|
|
214
|
+
|
|
215
|
+
if (isRapidFail) {
|
|
216
|
+
const state = {};
|
|
217
|
+
state.passed = true;
|
|
218
|
+
|
|
219
|
+
mocha.afterEach(function x() {
|
|
220
|
+
state.passed = state.passed
|
|
221
|
+
&& (this.currentTest.state === 'passed');
|
|
222
|
+
});
|
|
223
|
+
mocha.beforeEach(function x() {
|
|
224
|
+
if (!state.passed) {
|
|
225
|
+
return this.currentTest.skip();
|
|
226
|
+
}
|
|
227
|
+
return true;
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
describe('#class instance created', () => {
|
|
232
|
+
it('should be a class with properties', (done) => {
|
|
233
|
+
try {
|
|
234
|
+
assert.notEqual(null, a);
|
|
235
|
+
assert.notEqual(undefined, a);
|
|
236
|
+
const checkId = global.pronghornProps.adapterProps.adapters[0].id;
|
|
237
|
+
assert.equal(checkId, a.id);
|
|
238
|
+
assert.notEqual(null, a.allProps);
|
|
239
|
+
const check = global.pronghornProps.adapterProps.adapters[0].properties.healthcheck.type;
|
|
240
|
+
assert.equal(check, a.healthcheckType);
|
|
241
|
+
done();
|
|
242
|
+
} catch (error) {
|
|
243
|
+
log.error(`Test Failure: ${error}`);
|
|
244
|
+
done(error);
|
|
245
|
+
}
|
|
246
|
+
}).timeout(attemptTimeout);
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
describe('#connect', () => {
|
|
250
|
+
it('should get connected - no healthcheck', (done) => {
|
|
251
|
+
try {
|
|
252
|
+
a.healthcheckType = 'none';
|
|
253
|
+
a.connect();
|
|
254
|
+
|
|
255
|
+
try {
|
|
256
|
+
assert.equal(true, a.alive);
|
|
257
|
+
done();
|
|
258
|
+
} catch (error) {
|
|
259
|
+
log.error(`Test Failure: ${error}`);
|
|
260
|
+
done(error);
|
|
261
|
+
}
|
|
262
|
+
} catch (error) {
|
|
263
|
+
log.error(`Adapter Exception: ${error}`);
|
|
264
|
+
done(error);
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
it('should get connected - startup healthcheck', (done) => {
|
|
268
|
+
try {
|
|
269
|
+
a.healthcheckType = 'startup';
|
|
270
|
+
a.connect();
|
|
271
|
+
|
|
272
|
+
try {
|
|
273
|
+
assert.equal(true, a.alive);
|
|
274
|
+
done();
|
|
275
|
+
} catch (error) {
|
|
276
|
+
log.error(`Test Failure: ${error}`);
|
|
277
|
+
done(error);
|
|
278
|
+
}
|
|
279
|
+
} catch (error) {
|
|
280
|
+
log.error(`Adapter Exception: ${error}`);
|
|
281
|
+
done(error);
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
describe('#healthCheck', () => {
|
|
287
|
+
it('should be healthy', (done) => {
|
|
288
|
+
try {
|
|
289
|
+
a.healthCheck(null, (data) => {
|
|
290
|
+
try {
|
|
291
|
+
assert.equal(true, a.healthy);
|
|
292
|
+
saveMockData('system', 'healthcheck', 'default', data);
|
|
293
|
+
done();
|
|
294
|
+
} catch (err) {
|
|
295
|
+
log.error(`Test Failure: ${err}`);
|
|
296
|
+
done(err);
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
} catch (error) {
|
|
300
|
+
log.error(`Adapter Exception: ${error}`);
|
|
301
|
+
done(error);
|
|
302
|
+
}
|
|
303
|
+
}).timeout(attemptTimeout);
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
// broker tests
|
|
307
|
+
describe('#getDevicesFiltered - errors', () => {
|
|
308
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
309
|
+
try {
|
|
310
|
+
const opts = {
|
|
311
|
+
filter: {
|
|
312
|
+
name: 'deviceName'
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
a.getDevicesFiltered(opts, (data, error) => {
|
|
316
|
+
try {
|
|
317
|
+
if (stub) {
|
|
318
|
+
if (samProps.devicebroker.getDevicesFiltered[0].handleFailure === 'ignore') {
|
|
319
|
+
assert.equal(null, error);
|
|
320
|
+
assert.notEqual(undefined, data);
|
|
321
|
+
assert.notEqual(null, data);
|
|
322
|
+
assert.equal(0, data.total);
|
|
323
|
+
assert.equal(0, data.list.length);
|
|
324
|
+
} else {
|
|
325
|
+
const displayE = 'Error 400 received on request';
|
|
326
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
327
|
+
}
|
|
328
|
+
} else {
|
|
329
|
+
runCommonAsserts(data, error);
|
|
330
|
+
}
|
|
331
|
+
done();
|
|
332
|
+
} catch (err) {
|
|
333
|
+
log.error(`Test Failure: ${err}`);
|
|
334
|
+
done(err);
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
} catch (error) {
|
|
338
|
+
log.error(`Adapter Exception: ${error}`);
|
|
339
|
+
done(error);
|
|
340
|
+
}
|
|
341
|
+
}).timeout(attemptTimeout);
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
describe('#iapGetDeviceCount - errors', () => {
|
|
345
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
346
|
+
try {
|
|
347
|
+
const opts = {
|
|
348
|
+
filter: {
|
|
349
|
+
name: 'deviceName'
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
a.iapGetDeviceCount((data, error) => {
|
|
353
|
+
try {
|
|
354
|
+
if (stub) {
|
|
355
|
+
if (samProps.devicebroker.getDevicesFiltered[0].handleFailure === 'ignore') {
|
|
356
|
+
assert.equal(null, error);
|
|
357
|
+
assert.notEqual(undefined, data);
|
|
358
|
+
assert.notEqual(null, data);
|
|
359
|
+
assert.equal(0, data.count);
|
|
360
|
+
} else {
|
|
361
|
+
const displayE = 'Error 400 received on request';
|
|
362
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
363
|
+
}
|
|
364
|
+
} else {
|
|
365
|
+
runCommonAsserts(data, error);
|
|
366
|
+
}
|
|
367
|
+
done();
|
|
368
|
+
} catch (err) {
|
|
369
|
+
log.error(`Test Failure: ${err}`);
|
|
370
|
+
done(err);
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
} catch (error) {
|
|
374
|
+
log.error(`Adapter Exception: ${error}`);
|
|
375
|
+
done(error);
|
|
376
|
+
}
|
|
377
|
+
}).timeout(attemptTimeout);
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
// exposed cache tests
|
|
381
|
+
describe('#iapPopulateEntityCache - errors', () => {
|
|
382
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
383
|
+
try {
|
|
384
|
+
a.iapPopulateEntityCache('Device', (data, error) => {
|
|
385
|
+
try {
|
|
386
|
+
if (stub) {
|
|
387
|
+
assert.equal(null, data);
|
|
388
|
+
assert.notEqual(undefined, error);
|
|
389
|
+
assert.notEqual(null, error);
|
|
390
|
+
done();
|
|
391
|
+
} else {
|
|
392
|
+
assert.equal(undefined, error);
|
|
393
|
+
assert.equal('success', data[0]);
|
|
394
|
+
done();
|
|
395
|
+
}
|
|
396
|
+
} catch (err) {
|
|
397
|
+
log.error(`Test Failure: ${err}`);
|
|
398
|
+
done(err);
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
} catch (error) {
|
|
402
|
+
log.error(`Adapter Exception: ${error}`);
|
|
403
|
+
done(error);
|
|
404
|
+
}
|
|
405
|
+
}).timeout(attemptTimeout);
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
describe('#iapRetrieveEntitiesCache - errors', () => {
|
|
409
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
410
|
+
try {
|
|
411
|
+
a.iapRetrieveEntitiesCache('Device', {}, (data, error) => {
|
|
412
|
+
try {
|
|
413
|
+
if (stub) {
|
|
414
|
+
assert.equal(null, data);
|
|
415
|
+
assert.notEqual(null, error);
|
|
416
|
+
assert.notEqual(undefined, error);
|
|
417
|
+
} else {
|
|
418
|
+
assert.equal(undefined, error);
|
|
419
|
+
assert.notEqual(null, data);
|
|
420
|
+
assert.notEqual(undefined, data);
|
|
421
|
+
}
|
|
422
|
+
done();
|
|
423
|
+
} catch (err) {
|
|
424
|
+
log.error(`Test Failure: ${err}`);
|
|
425
|
+
done(err);
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
} catch (error) {
|
|
429
|
+
log.error(`Adapter Exception: ${error}`);
|
|
430
|
+
done(error);
|
|
431
|
+
}
|
|
432
|
+
}).timeout(attemptTimeout);
|
|
433
|
+
});
|
|
434
|
+
/*
|
|
435
|
+
-----------------------------------------------------------------------
|
|
436
|
+
-----------------------------------------------------------------------
|
|
437
|
+
*** All code above this comment will be replaced during a migration ***
|
|
438
|
+
******************* DO NOT REMOVE THIS COMMENT BLOCK ******************
|
|
439
|
+
-----------------------------------------------------------------------
|
|
440
|
+
-----------------------------------------------------------------------
|
|
441
|
+
*/
|
|
442
|
+
|
|
443
|
+
describe('#getAllInventoryV1InventoryGet - errors', () => {
|
|
444
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
445
|
+
try {
|
|
446
|
+
a.getAllInventoryV1InventoryGet(null, (data, error) => {
|
|
447
|
+
try {
|
|
448
|
+
if (stub) {
|
|
449
|
+
const displayE = 'Error 400 received on request';
|
|
450
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
451
|
+
} else {
|
|
452
|
+
runCommonAsserts(data, error);
|
|
453
|
+
}
|
|
454
|
+
saveMockData('MetastoreInventoryNamesDownload', 'getAllInventoryV1InventoryGet', 'default', data);
|
|
455
|
+
done();
|
|
456
|
+
} catch (err) {
|
|
457
|
+
log.error(`Test Failure: ${err}`);
|
|
458
|
+
done(err);
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
} catch (error) {
|
|
462
|
+
log.error(`Adapter Exception: ${error}`);
|
|
463
|
+
done(error);
|
|
464
|
+
}
|
|
465
|
+
}).timeout(attemptTimeout);
|
|
466
|
+
});
|
|
467
|
+
|
|
468
|
+
const metastoreInventoryNameUploadInventoryCreationV1InventoryPostBodyParam = {};
|
|
469
|
+
describe('#inventoryCreationV1InventoryPost - errors', () => {
|
|
470
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
471
|
+
try {
|
|
472
|
+
a.inventoryCreationV1InventoryPost(metastoreInventoryNameUploadInventoryCreationV1InventoryPostBodyParam, null, (data, error) => {
|
|
473
|
+
try {
|
|
474
|
+
if (stub) {
|
|
475
|
+
const displayE = 'Error 400 received on request';
|
|
476
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
477
|
+
} else {
|
|
478
|
+
runCommonAsserts(data, error);
|
|
479
|
+
}
|
|
480
|
+
saveMockData('MetastoreInventoryNameUpload', 'inventoryCreationV1InventoryPost', 'default', data);
|
|
481
|
+
done();
|
|
482
|
+
} catch (err) {
|
|
483
|
+
log.error(`Test Failure: ${err}`);
|
|
484
|
+
done(err);
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
} catch (error) {
|
|
488
|
+
log.error(`Adapter Exception: ${error}`);
|
|
489
|
+
done(error);
|
|
490
|
+
}
|
|
491
|
+
}).timeout(attemptTimeout);
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
const metastoreInventoryNameUpdateName = 'fakedata';
|
|
495
|
+
const metastoreInventoryNameUpdateInventoryUpdateV1InventoryNamePutBodyParam = {};
|
|
496
|
+
describe('#inventoryUpdateV1InventoryNamePut - errors', () => {
|
|
497
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
498
|
+
try {
|
|
499
|
+
a.inventoryUpdateV1InventoryNamePut(metastoreInventoryNameUpdateName, metastoreInventoryNameUpdateInventoryUpdateV1InventoryNamePutBodyParam, null, (data, error) => {
|
|
500
|
+
try {
|
|
501
|
+
if (stub) {
|
|
502
|
+
const displayE = 'Error 400 received on request';
|
|
503
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
504
|
+
} else {
|
|
505
|
+
runCommonAsserts(data, error);
|
|
506
|
+
}
|
|
507
|
+
saveMockData('MetastoreInventoryNameUpdate', 'inventoryUpdateV1InventoryNamePut', 'default', data);
|
|
508
|
+
done();
|
|
509
|
+
} catch (err) {
|
|
510
|
+
log.error(`Test Failure: ${err}`);
|
|
511
|
+
done(err);
|
|
512
|
+
}
|
|
513
|
+
});
|
|
514
|
+
} catch (error) {
|
|
515
|
+
log.error(`Adapter Exception: ${error}`);
|
|
516
|
+
done(error);
|
|
517
|
+
}
|
|
518
|
+
}).timeout(attemptTimeout);
|
|
519
|
+
});
|
|
520
|
+
|
|
521
|
+
const metastoreInventoryDataDownloadName = 'fakedata';
|
|
522
|
+
describe('#inventoryItemGetV1InventoryNameGet - errors', () => {
|
|
523
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
524
|
+
try {
|
|
525
|
+
a.inventoryItemGetV1InventoryNameGet(metastoreInventoryDataDownloadName, null, null, (data, error) => {
|
|
526
|
+
try {
|
|
527
|
+
if (stub) {
|
|
528
|
+
const displayE = 'Error 400 received on request';
|
|
529
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
530
|
+
} else {
|
|
531
|
+
runCommonAsserts(data, error);
|
|
532
|
+
}
|
|
533
|
+
saveMockData('MetastoreInventoryDataDownload', 'inventoryItemGetV1InventoryNameGet', 'default', data);
|
|
534
|
+
done();
|
|
535
|
+
} catch (err) {
|
|
536
|
+
log.error(`Test Failure: ${err}`);
|
|
537
|
+
done(err);
|
|
538
|
+
}
|
|
539
|
+
});
|
|
540
|
+
} catch (error) {
|
|
541
|
+
log.error(`Adapter Exception: ${error}`);
|
|
542
|
+
done(error);
|
|
543
|
+
}
|
|
544
|
+
}).timeout(attemptTimeout);
|
|
545
|
+
});
|
|
546
|
+
|
|
547
|
+
const metastoreInventoryDataDownloadId = 'fakedata';
|
|
548
|
+
describe('#inventoryItemGetV1InventoryNameIdGet - errors', () => {
|
|
549
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
550
|
+
try {
|
|
551
|
+
a.inventoryItemGetV1InventoryNameIdGet(metastoreInventoryDataDownloadName, metastoreInventoryDataDownloadId, null, (data, error) => {
|
|
552
|
+
try {
|
|
553
|
+
if (stub) {
|
|
554
|
+
const displayE = 'Error 400 received on request';
|
|
555
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
556
|
+
} else {
|
|
557
|
+
runCommonAsserts(data, error);
|
|
558
|
+
}
|
|
559
|
+
saveMockData('MetastoreInventoryDataDownload', 'inventoryItemGetV1InventoryNameIdGet', 'default', data);
|
|
560
|
+
done();
|
|
561
|
+
} catch (err) {
|
|
562
|
+
log.error(`Test Failure: ${err}`);
|
|
563
|
+
done(err);
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
} catch (error) {
|
|
567
|
+
log.error(`Adapter Exception: ${error}`);
|
|
568
|
+
done(error);
|
|
569
|
+
}
|
|
570
|
+
}).timeout(attemptTimeout);
|
|
571
|
+
});
|
|
572
|
+
|
|
573
|
+
const metastoreInventoryDataUploadName = 'fakedata';
|
|
574
|
+
const metastoreInventoryDataUploadInventoryItemCreationV1InventoryNamePostBodyParam = {};
|
|
575
|
+
describe('#inventoryItemCreationV1InventoryNamePost - errors', () => {
|
|
576
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
577
|
+
try {
|
|
578
|
+
a.inventoryItemCreationV1InventoryNamePost(metastoreInventoryDataUploadName, metastoreInventoryDataUploadInventoryItemCreationV1InventoryNamePostBodyParam, null, (data, error) => {
|
|
579
|
+
try {
|
|
580
|
+
if (stub) {
|
|
581
|
+
const displayE = 'Error 400 received on request';
|
|
582
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
583
|
+
} else {
|
|
584
|
+
runCommonAsserts(data, error);
|
|
585
|
+
}
|
|
586
|
+
saveMockData('MetastoreInventoryDataUpload', 'inventoryItemCreationV1InventoryNamePost', 'default', data);
|
|
587
|
+
done();
|
|
588
|
+
} catch (err) {
|
|
589
|
+
log.error(`Test Failure: ${err}`);
|
|
590
|
+
done(err);
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
} catch (error) {
|
|
594
|
+
log.error(`Adapter Exception: ${error}`);
|
|
595
|
+
done(error);
|
|
596
|
+
}
|
|
597
|
+
}).timeout(attemptTimeout);
|
|
598
|
+
});
|
|
599
|
+
|
|
600
|
+
const metastoreInventoryDataEditName = 'fakedata';
|
|
601
|
+
const metastoreInventoryDataEditId = 'fakedata';
|
|
602
|
+
const metastoreInventoryDataEditInventoryItemCreationV1InventoryNameIdPutBodyParam = {};
|
|
603
|
+
describe('#inventoryItemCreationV1InventoryNameIdPut - errors', () => {
|
|
604
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
605
|
+
try {
|
|
606
|
+
a.inventoryItemCreationV1InventoryNameIdPut(metastoreInventoryDataEditName, metastoreInventoryDataEditId, metastoreInventoryDataEditInventoryItemCreationV1InventoryNameIdPutBodyParam, null, (data, error) => {
|
|
607
|
+
try {
|
|
608
|
+
if (stub) {
|
|
609
|
+
const displayE = 'Error 400 received on request';
|
|
610
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
611
|
+
} else {
|
|
612
|
+
runCommonAsserts(data, error);
|
|
613
|
+
}
|
|
614
|
+
saveMockData('MetastoreInventoryDataEdit', 'inventoryItemCreationV1InventoryNameIdPut', 'default', data);
|
|
615
|
+
done();
|
|
616
|
+
} catch (err) {
|
|
617
|
+
log.error(`Test Failure: ${err}`);
|
|
618
|
+
done(err);
|
|
619
|
+
}
|
|
620
|
+
});
|
|
621
|
+
} catch (error) {
|
|
622
|
+
log.error(`Adapter Exception: ${error}`);
|
|
623
|
+
done(error);
|
|
624
|
+
}
|
|
625
|
+
}).timeout(attemptTimeout);
|
|
626
|
+
});
|
|
627
|
+
|
|
628
|
+
const metastoreInventoryBulkDataUploadName = 'fakedata';
|
|
629
|
+
const metastoreInventoryBulkDataUploadInventoryItemCreationV1InventoryBulkNamePostBodyParam = [
|
|
630
|
+
{}
|
|
631
|
+
];
|
|
632
|
+
describe('#inventoryItemCreationV1InventoryBulkNamePost - errors', () => {
|
|
633
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
634
|
+
try {
|
|
635
|
+
a.inventoryItemCreationV1InventoryBulkNamePost(metastoreInventoryBulkDataUploadName, null, metastoreInventoryBulkDataUploadInventoryItemCreationV1InventoryBulkNamePostBodyParam, null, (data, error) => {
|
|
636
|
+
try {
|
|
637
|
+
if (stub) {
|
|
638
|
+
const displayE = 'Error 400 received on request';
|
|
639
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
640
|
+
} else {
|
|
641
|
+
runCommonAsserts(data, error);
|
|
642
|
+
}
|
|
643
|
+
saveMockData('MetastoreInventoryBulkDataUpload', 'inventoryItemCreationV1InventoryBulkNamePost', 'default', data);
|
|
644
|
+
done();
|
|
645
|
+
} catch (err) {
|
|
646
|
+
log.error(`Test Failure: ${err}`);
|
|
647
|
+
done(err);
|
|
648
|
+
}
|
|
649
|
+
});
|
|
650
|
+
} catch (error) {
|
|
651
|
+
log.error(`Adapter Exception: ${error}`);
|
|
652
|
+
done(error);
|
|
653
|
+
}
|
|
654
|
+
}).timeout(attemptTimeout);
|
|
655
|
+
});
|
|
656
|
+
|
|
657
|
+
const metastoreInventoryCSVDataUploadName = 'fakedata';
|
|
658
|
+
const metastoreInventoryCSVDataUploadFile = 'fakedata';
|
|
659
|
+
describe('#inventoryItemCreationV1InventoryCsvNamePost - errors', () => {
|
|
660
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
661
|
+
try {
|
|
662
|
+
a.inventoryItemCreationV1InventoryCsvNamePost(metastoreInventoryCSVDataUploadName, null, metastoreInventoryCSVDataUploadFile, null, (data, error) => {
|
|
663
|
+
try {
|
|
664
|
+
if (stub) {
|
|
665
|
+
const displayE = 'Error 400 received on request';
|
|
666
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
667
|
+
} else {
|
|
668
|
+
runCommonAsserts(data, error);
|
|
669
|
+
}
|
|
670
|
+
saveMockData('MetastoreInventoryCSVDataUpload', 'inventoryItemCreationV1InventoryCsvNamePost', 'default', data);
|
|
671
|
+
done();
|
|
672
|
+
} catch (err) {
|
|
673
|
+
log.error(`Test Failure: ${err}`);
|
|
674
|
+
done(err);
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
} catch (error) {
|
|
678
|
+
log.error(`Adapter Exception: ${error}`);
|
|
679
|
+
done(error);
|
|
680
|
+
}
|
|
681
|
+
}).timeout(attemptTimeout);
|
|
682
|
+
});
|
|
683
|
+
|
|
684
|
+
describe('#inventoryItemGetV1InventoryItemsGet - errors', () => {
|
|
685
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
686
|
+
try {
|
|
687
|
+
a.inventoryItemGetV1InventoryItemsGet(null, null, (data, error) => {
|
|
688
|
+
try {
|
|
689
|
+
if (stub) {
|
|
690
|
+
const displayE = 'Error 400 received on request';
|
|
691
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
692
|
+
} else {
|
|
693
|
+
runCommonAsserts(data, error);
|
|
694
|
+
}
|
|
695
|
+
saveMockData('MetastoreInventoryItems', 'inventoryItemGetV1InventoryItemsGet', 'default', data);
|
|
696
|
+
done();
|
|
697
|
+
} catch (err) {
|
|
698
|
+
log.error(`Test Failure: ${err}`);
|
|
699
|
+
done(err);
|
|
700
|
+
}
|
|
701
|
+
});
|
|
702
|
+
} catch (error) {
|
|
703
|
+
log.error(`Adapter Exception: ${error}`);
|
|
704
|
+
done(error);
|
|
705
|
+
}
|
|
706
|
+
}).timeout(attemptTimeout);
|
|
707
|
+
});
|
|
708
|
+
|
|
709
|
+
describe('#getAllInventoryV1InventorySchemaGet - errors', () => {
|
|
710
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
711
|
+
try {
|
|
712
|
+
a.getAllInventoryV1InventorySchemaGet(null, (data, error) => {
|
|
713
|
+
try {
|
|
714
|
+
if (stub) {
|
|
715
|
+
const displayE = 'Error 400 received on request';
|
|
716
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
717
|
+
} else {
|
|
718
|
+
runCommonAsserts(data, error);
|
|
719
|
+
}
|
|
720
|
+
saveMockData('MetastoreInventorySchemaGet', 'getAllInventoryV1InventorySchemaGet', 'default', data);
|
|
721
|
+
done();
|
|
722
|
+
} catch (err) {
|
|
723
|
+
log.error(`Test Failure: ${err}`);
|
|
724
|
+
done(err);
|
|
725
|
+
}
|
|
726
|
+
});
|
|
727
|
+
} catch (error) {
|
|
728
|
+
log.error(`Adapter Exception: ${error}`);
|
|
729
|
+
done(error);
|
|
730
|
+
}
|
|
731
|
+
}).timeout(attemptTimeout);
|
|
732
|
+
});
|
|
733
|
+
|
|
734
|
+
describe('#postInventoryV1InventorySchema - errors', () => {
|
|
735
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
736
|
+
try {
|
|
737
|
+
a.postInventoryV1InventorySchema(null, null, (data, error) => {
|
|
738
|
+
try {
|
|
739
|
+
if (stub) {
|
|
740
|
+
const displayE = 'Error 400 received on request';
|
|
741
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
742
|
+
} else {
|
|
743
|
+
runCommonAsserts(data, error);
|
|
744
|
+
}
|
|
745
|
+
saveMockData('InventorySchemaCreation', 'postInventoryV1InventorySchema', 'default', data);
|
|
746
|
+
done();
|
|
747
|
+
} catch (err) {
|
|
748
|
+
log.error(`Test Failure: ${err}`);
|
|
749
|
+
done(err);
|
|
750
|
+
}
|
|
751
|
+
});
|
|
752
|
+
} catch (error) {
|
|
753
|
+
log.error(`Adapter Exception: ${error}`);
|
|
754
|
+
done(error);
|
|
755
|
+
}
|
|
756
|
+
}).timeout(attemptTimeout);
|
|
757
|
+
});
|
|
758
|
+
|
|
759
|
+
describe('#putInventoryV1InventorySchema - errors', () => {
|
|
760
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
761
|
+
try {
|
|
762
|
+
a.putInventoryV1InventorySchema(null, null, (data, error) => {
|
|
763
|
+
try {
|
|
764
|
+
if (stub) {
|
|
765
|
+
const displayE = 'Error 400 received on request';
|
|
766
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
767
|
+
} else {
|
|
768
|
+
runCommonAsserts(data, error);
|
|
769
|
+
}
|
|
770
|
+
saveMockData('InventorySchemaUpdate', 'putInventoryV1InventorySchema', 'default', data);
|
|
771
|
+
done();
|
|
772
|
+
} catch (err) {
|
|
773
|
+
log.error(`Test Failure: ${err}`);
|
|
774
|
+
done(err);
|
|
775
|
+
}
|
|
776
|
+
});
|
|
777
|
+
} catch (error) {
|
|
778
|
+
log.error(`Adapter Exception: ${error}`);
|
|
779
|
+
done(error);
|
|
780
|
+
}
|
|
781
|
+
}).timeout(attemptTimeout);
|
|
782
|
+
});
|
|
783
|
+
|
|
784
|
+
describe('#getsAllInventoryschema - errors', () => {
|
|
785
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
786
|
+
try {
|
|
787
|
+
a.getsAllInventoryschema(null, (data, error) => {
|
|
788
|
+
try {
|
|
789
|
+
if (stub) {
|
|
790
|
+
const displayE = 'Error 400 received on request';
|
|
791
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
792
|
+
} else {
|
|
793
|
+
runCommonAsserts(data, error);
|
|
794
|
+
}
|
|
795
|
+
saveMockData('MetastoreV2InventorySchemaGet', 'getsAllInventoryschema', 'default', data);
|
|
796
|
+
done();
|
|
797
|
+
} catch (err) {
|
|
798
|
+
log.error(`Test Failure: ${err}`);
|
|
799
|
+
done(err);
|
|
800
|
+
}
|
|
801
|
+
});
|
|
802
|
+
} catch (error) {
|
|
803
|
+
log.error(`Adapter Exception: ${error}`);
|
|
804
|
+
done(error);
|
|
805
|
+
}
|
|
806
|
+
}).timeout(attemptTimeout);
|
|
807
|
+
});
|
|
808
|
+
|
|
809
|
+
const inventoryV2SchemaUploadProcessinventoryschemaJSONinputBodyParam = {};
|
|
810
|
+
describe('#processinventoryschemaJSONinput - errors', () => {
|
|
811
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
812
|
+
try {
|
|
813
|
+
a.processinventoryschemaJSONinput(inventoryV2SchemaUploadProcessinventoryschemaJSONinputBodyParam, null, (data, error) => {
|
|
814
|
+
try {
|
|
815
|
+
if (stub) {
|
|
816
|
+
const displayE = 'Error 400 received on request';
|
|
817
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
818
|
+
} else {
|
|
819
|
+
runCommonAsserts(data, error);
|
|
820
|
+
}
|
|
821
|
+
saveMockData('InventoryV2SchemaUpload', 'processinventoryschemaJSONinput', 'default', data);
|
|
822
|
+
done();
|
|
823
|
+
} catch (err) {
|
|
824
|
+
log.error(`Test Failure: ${err}`);
|
|
825
|
+
done(err);
|
|
826
|
+
}
|
|
827
|
+
});
|
|
828
|
+
} catch (error) {
|
|
829
|
+
log.error(`Adapter Exception: ${error}`);
|
|
830
|
+
done(error);
|
|
831
|
+
}
|
|
832
|
+
}).timeout(attemptTimeout);
|
|
833
|
+
});
|
|
834
|
+
|
|
835
|
+
const inventoryV2SchemaUpdateType = 'fakedata';
|
|
836
|
+
const inventoryV2SchemaUpdatePutProcessinventoryschemaJSONinputBodyParam = {};
|
|
837
|
+
describe('#putProcessinventoryschemaJSONinput - errors', () => {
|
|
838
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
839
|
+
try {
|
|
840
|
+
a.putProcessinventoryschemaJSONinput(inventoryV2SchemaUpdateType, inventoryV2SchemaUpdatePutProcessinventoryschemaJSONinputBodyParam, null, (data, error) => {
|
|
841
|
+
try {
|
|
842
|
+
if (stub) {
|
|
843
|
+
const displayE = 'Error 400 received on request';
|
|
844
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
845
|
+
} else {
|
|
846
|
+
runCommonAsserts(data, error);
|
|
847
|
+
}
|
|
848
|
+
saveMockData('InventoryV2SchemaUpdate', 'putProcessinventoryschemaJSONinput', 'default', data);
|
|
849
|
+
done();
|
|
850
|
+
} catch (err) {
|
|
851
|
+
log.error(`Test Failure: ${err}`);
|
|
852
|
+
done(err);
|
|
853
|
+
}
|
|
854
|
+
});
|
|
855
|
+
} catch (error) {
|
|
856
|
+
log.error(`Adapter Exception: ${error}`);
|
|
857
|
+
done(error);
|
|
858
|
+
}
|
|
859
|
+
}).timeout(attemptTimeout);
|
|
860
|
+
});
|
|
861
|
+
|
|
862
|
+
describe('#porcessuploadJSONfile - errors', () => {
|
|
863
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
864
|
+
try {
|
|
865
|
+
a.porcessuploadJSONfile(null, null, null, (data, error) => {
|
|
866
|
+
try {
|
|
867
|
+
if (stub) {
|
|
868
|
+
const displayE = 'Error 400 received on request';
|
|
869
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
870
|
+
} else {
|
|
871
|
+
runCommonAsserts(data, error);
|
|
872
|
+
}
|
|
873
|
+
saveMockData('InventorySchemaFileUpload', 'porcessuploadJSONfile', 'default', data);
|
|
874
|
+
done();
|
|
875
|
+
} catch (err) {
|
|
876
|
+
log.error(`Test Failure: ${err}`);
|
|
877
|
+
done(err);
|
|
878
|
+
}
|
|
879
|
+
});
|
|
880
|
+
} catch (error) {
|
|
881
|
+
log.error(`Adapter Exception: ${error}`);
|
|
882
|
+
done(error);
|
|
883
|
+
}
|
|
884
|
+
}).timeout(attemptTimeout);
|
|
885
|
+
});
|
|
886
|
+
|
|
887
|
+
const inventorySchemaFileDownloadDownloadinventoryschemaJSONfileBodyParam = {};
|
|
888
|
+
describe('#downloadinventoryschemaJSONfile - errors', () => {
|
|
889
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
890
|
+
try {
|
|
891
|
+
a.downloadinventoryschemaJSONfile(null, inventorySchemaFileDownloadDownloadinventoryschemaJSONfileBodyParam, null, (data, error) => {
|
|
892
|
+
try {
|
|
893
|
+
if (stub) {
|
|
894
|
+
const displayE = 'Error 400 received on request';
|
|
895
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
896
|
+
} else {
|
|
897
|
+
runCommonAsserts(data, error);
|
|
898
|
+
}
|
|
899
|
+
saveMockData('InventorySchemaFileDownload', 'downloadinventoryschemaJSONfile', 'default', data);
|
|
900
|
+
done();
|
|
901
|
+
} catch (err) {
|
|
902
|
+
log.error(`Test Failure: ${err}`);
|
|
903
|
+
done(err);
|
|
904
|
+
}
|
|
905
|
+
});
|
|
906
|
+
} catch (error) {
|
|
907
|
+
log.error(`Adapter Exception: ${error}`);
|
|
908
|
+
done(error);
|
|
909
|
+
}
|
|
910
|
+
}).timeout(attemptTimeout);
|
|
911
|
+
});
|
|
912
|
+
|
|
913
|
+
describe('#handleInventoryFilesPostInventoryFilesImportPost - errors', () => {
|
|
914
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
915
|
+
try {
|
|
916
|
+
a.handleInventoryFilesPostInventoryFilesImportPost(null, null, null, (data, error) => {
|
|
917
|
+
try {
|
|
918
|
+
if (stub) {
|
|
919
|
+
const displayE = 'Error 400 received on request';
|
|
920
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
921
|
+
} else {
|
|
922
|
+
runCommonAsserts(data, error);
|
|
923
|
+
}
|
|
924
|
+
saveMockData('MetastoreInventoryFilesImport', 'handleInventoryFilesPostInventoryFilesImportPost', 'default', data);
|
|
925
|
+
done();
|
|
926
|
+
} catch (err) {
|
|
927
|
+
log.error(`Test Failure: ${err}`);
|
|
928
|
+
done(err);
|
|
929
|
+
}
|
|
930
|
+
});
|
|
931
|
+
} catch (error) {
|
|
932
|
+
log.error(`Adapter Exception: ${error}`);
|
|
933
|
+
done(error);
|
|
934
|
+
}
|
|
935
|
+
}).timeout(attemptTimeout);
|
|
936
|
+
});
|
|
937
|
+
|
|
938
|
+
const metastoreInventoryFilesExportHandleInventoryFilesGetInventoryFilesExportPostBodyParam = {};
|
|
939
|
+
describe('#handleInventoryFilesGetInventoryFilesExportPost - errors', () => {
|
|
940
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
941
|
+
try {
|
|
942
|
+
a.handleInventoryFilesGetInventoryFilesExportPost(null, metastoreInventoryFilesExportHandleInventoryFilesGetInventoryFilesExportPostBodyParam, null, (data, error) => {
|
|
943
|
+
try {
|
|
944
|
+
if (stub) {
|
|
945
|
+
const displayE = 'Error 400 received on request';
|
|
946
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
947
|
+
} else {
|
|
948
|
+
runCommonAsserts(data, error);
|
|
949
|
+
}
|
|
950
|
+
saveMockData('MetastoreInventoryFilesExport', 'handleInventoryFilesGetInventoryFilesExportPost', 'default', data);
|
|
951
|
+
done();
|
|
952
|
+
} catch (err) {
|
|
953
|
+
log.error(`Test Failure: ${err}`);
|
|
954
|
+
done(err);
|
|
955
|
+
}
|
|
956
|
+
});
|
|
957
|
+
} catch (error) {
|
|
958
|
+
log.error(`Adapter Exception: ${error}`);
|
|
959
|
+
done(error);
|
|
960
|
+
}
|
|
961
|
+
}).timeout(attemptTimeout);
|
|
962
|
+
});
|
|
963
|
+
|
|
964
|
+
const metastoreInventoryCsvFileExportName = 'fakedata';
|
|
965
|
+
describe('#handleInventoryCsvFileGet - errors', () => {
|
|
966
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
967
|
+
try {
|
|
968
|
+
a.handleInventoryCsvFileGet(metastoreInventoryCsvFileExportName, null, (data, error) => {
|
|
969
|
+
try {
|
|
970
|
+
if (stub) {
|
|
971
|
+
const displayE = 'Error 400 received on request';
|
|
972
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
973
|
+
} else {
|
|
974
|
+
runCommonAsserts(data, error);
|
|
975
|
+
}
|
|
976
|
+
saveMockData('MetastoreInventoryCsvFileExport', 'handleInventoryCsvFileGet', 'default', data);
|
|
977
|
+
done();
|
|
978
|
+
} catch (err) {
|
|
979
|
+
log.error(`Test Failure: ${err}`);
|
|
980
|
+
done(err);
|
|
981
|
+
}
|
|
982
|
+
});
|
|
983
|
+
} catch (error) {
|
|
984
|
+
log.error(`Adapter Exception: ${error}`);
|
|
985
|
+
done(error);
|
|
986
|
+
}
|
|
987
|
+
}).timeout(attemptTimeout);
|
|
988
|
+
});
|
|
989
|
+
|
|
990
|
+
describe('#get - errors', () => {
|
|
991
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
992
|
+
try {
|
|
993
|
+
a.get(null, (data, error) => {
|
|
994
|
+
try {
|
|
995
|
+
if (stub) {
|
|
996
|
+
const displayE = 'Error 400 received on request';
|
|
997
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
998
|
+
} else {
|
|
999
|
+
runCommonAsserts(data, error);
|
|
1000
|
+
}
|
|
1001
|
+
saveMockData('MetastoreInventorySystem', 'get', 'default', data);
|
|
1002
|
+
done();
|
|
1003
|
+
} catch (err) {
|
|
1004
|
+
log.error(`Test Failure: ${err}`);
|
|
1005
|
+
done(err);
|
|
1006
|
+
}
|
|
1007
|
+
});
|
|
1008
|
+
} catch (error) {
|
|
1009
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1010
|
+
done(error);
|
|
1011
|
+
}
|
|
1012
|
+
}).timeout(attemptTimeout);
|
|
1013
|
+
});
|
|
1014
|
+
|
|
1015
|
+
describe('#getAIConfig - errors', () => {
|
|
1016
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1017
|
+
try {
|
|
1018
|
+
a.getAIConfig(null, (data, error) => {
|
|
1019
|
+
try {
|
|
1020
|
+
if (stub) {
|
|
1021
|
+
const displayE = 'Error 400 received on request';
|
|
1022
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
1023
|
+
} else {
|
|
1024
|
+
runCommonAsserts(data, error);
|
|
1025
|
+
}
|
|
1026
|
+
saveMockData('MetastoreInventorySystem', 'getConfig', 'default', data);
|
|
1027
|
+
done();
|
|
1028
|
+
} catch (err) {
|
|
1029
|
+
log.error(`Test Failure: ${err}`);
|
|
1030
|
+
done(err);
|
|
1031
|
+
}
|
|
1032
|
+
});
|
|
1033
|
+
} catch (error) {
|
|
1034
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1035
|
+
done(error);
|
|
1036
|
+
}
|
|
1037
|
+
}).timeout(attemptTimeout);
|
|
1038
|
+
});
|
|
1039
|
+
|
|
1040
|
+
describe('#getHealth - errors', () => {
|
|
1041
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1042
|
+
try {
|
|
1043
|
+
a.getHealth(null, (data, error) => {
|
|
1044
|
+
try {
|
|
1045
|
+
if (stub) {
|
|
1046
|
+
const displayE = 'Error 400 received on request';
|
|
1047
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
1048
|
+
} else {
|
|
1049
|
+
runCommonAsserts(data, error);
|
|
1050
|
+
}
|
|
1051
|
+
saveMockData('MetastoreInventorySystem', 'getHealth', 'default', data);
|
|
1052
|
+
done();
|
|
1053
|
+
} catch (err) {
|
|
1054
|
+
log.error(`Test Failure: ${err}`);
|
|
1055
|
+
done(err);
|
|
1056
|
+
}
|
|
1057
|
+
});
|
|
1058
|
+
} catch (error) {
|
|
1059
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1060
|
+
done(error);
|
|
1061
|
+
}
|
|
1062
|
+
}).timeout(attemptTimeout);
|
|
1063
|
+
});
|
|
1064
|
+
|
|
1065
|
+
describe('#healthLogsGet - errors', () => {
|
|
1066
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1067
|
+
try {
|
|
1068
|
+
a.healthLogsGet(null, (data, error) => {
|
|
1069
|
+
try {
|
|
1070
|
+
if (stub) {
|
|
1071
|
+
const displayE = 'Error 400 received on request';
|
|
1072
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
1073
|
+
} else {
|
|
1074
|
+
runCommonAsserts(data, error);
|
|
1075
|
+
}
|
|
1076
|
+
saveMockData('MetastoreInventorySystem', 'healthLogsGet', 'default', data);
|
|
1077
|
+
done();
|
|
1078
|
+
} catch (err) {
|
|
1079
|
+
log.error(`Test Failure: ${err}`);
|
|
1080
|
+
done(err);
|
|
1081
|
+
}
|
|
1082
|
+
});
|
|
1083
|
+
} catch (error) {
|
|
1084
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1085
|
+
done(error);
|
|
1086
|
+
}
|
|
1087
|
+
}).timeout(attemptTimeout);
|
|
1088
|
+
});
|
|
1089
|
+
|
|
1090
|
+
describe('#getOpstats - errors', () => {
|
|
1091
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1092
|
+
try {
|
|
1093
|
+
a.getOpstats(null, (data, error) => {
|
|
1094
|
+
try {
|
|
1095
|
+
if (stub) {
|
|
1096
|
+
const displayE = 'Error 400 received on request';
|
|
1097
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
1098
|
+
} else {
|
|
1099
|
+
runCommonAsserts(data, error);
|
|
1100
|
+
}
|
|
1101
|
+
saveMockData('MetastoreInventorySystem', 'getOpstats', 'default', data);
|
|
1102
|
+
done();
|
|
1103
|
+
} catch (err) {
|
|
1104
|
+
log.error(`Test Failure: ${err}`);
|
|
1105
|
+
done(err);
|
|
1106
|
+
}
|
|
1107
|
+
});
|
|
1108
|
+
} catch (error) {
|
|
1109
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1110
|
+
done(error);
|
|
1111
|
+
}
|
|
1112
|
+
}).timeout(attemptTimeout);
|
|
1113
|
+
});
|
|
1114
|
+
|
|
1115
|
+
describe('#getVersion - errors', () => {
|
|
1116
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1117
|
+
try {
|
|
1118
|
+
a.getVersion(null, (data, error) => {
|
|
1119
|
+
try {
|
|
1120
|
+
if (stub) {
|
|
1121
|
+
const displayE = 'Error 400 received on request';
|
|
1122
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
1123
|
+
} else {
|
|
1124
|
+
runCommonAsserts(data, error);
|
|
1125
|
+
}
|
|
1126
|
+
saveMockData('MetastoreInventorySystem', 'getVersion', 'default', data);
|
|
1127
|
+
done();
|
|
1128
|
+
} catch (err) {
|
|
1129
|
+
log.error(`Test Failure: ${err}`);
|
|
1130
|
+
done(err);
|
|
1131
|
+
}
|
|
1132
|
+
});
|
|
1133
|
+
} catch (error) {
|
|
1134
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1135
|
+
done(error);
|
|
1136
|
+
}
|
|
1137
|
+
}).timeout(attemptTimeout);
|
|
1138
|
+
});
|
|
1139
|
+
|
|
1140
|
+
const metastoreInventoryNameDeleteName = 'fakedata';
|
|
1141
|
+
describe('#deletingSpecificInventoryV1InventoryNameDelete - errors', () => {
|
|
1142
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1143
|
+
try {
|
|
1144
|
+
a.deletingSpecificInventoryV1InventoryNameDelete(metastoreInventoryNameDeleteName, null, (data, error) => {
|
|
1145
|
+
try {
|
|
1146
|
+
if (stub) {
|
|
1147
|
+
const displayE = 'Error 400 received on request';
|
|
1148
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
1149
|
+
} else {
|
|
1150
|
+
runCommonAsserts(data, error);
|
|
1151
|
+
}
|
|
1152
|
+
saveMockData('MetastoreInventoryNameDelete', 'deletingSpecificInventoryV1InventoryNameDelete', 'default', data);
|
|
1153
|
+
done();
|
|
1154
|
+
} catch (err) {
|
|
1155
|
+
log.error(`Test Failure: ${err}`);
|
|
1156
|
+
done(err);
|
|
1157
|
+
}
|
|
1158
|
+
});
|
|
1159
|
+
} catch (error) {
|
|
1160
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1161
|
+
done(error);
|
|
1162
|
+
}
|
|
1163
|
+
}).timeout(attemptTimeout);
|
|
1164
|
+
});
|
|
1165
|
+
|
|
1166
|
+
const metastoreInventoryDataDeleteName = 'fakedata';
|
|
1167
|
+
const metastoreInventoryDataDeleteId = 'fakedata';
|
|
1168
|
+
describe('#inventoryItemDeletionV1InventoryNameIdDelete - errors', () => {
|
|
1169
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1170
|
+
try {
|
|
1171
|
+
a.inventoryItemDeletionV1InventoryNameIdDelete(metastoreInventoryDataDeleteName, metastoreInventoryDataDeleteId, null, (data, error) => {
|
|
1172
|
+
try {
|
|
1173
|
+
if (stub) {
|
|
1174
|
+
const displayE = 'Error 400 received on request';
|
|
1175
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
1176
|
+
} else {
|
|
1177
|
+
runCommonAsserts(data, error);
|
|
1178
|
+
}
|
|
1179
|
+
saveMockData('MetastoreInventoryDataDelete', 'inventoryItemDeletionV1InventoryNameIdDelete', 'default', data);
|
|
1180
|
+
done();
|
|
1181
|
+
} catch (err) {
|
|
1182
|
+
log.error(`Test Failure: ${err}`);
|
|
1183
|
+
done(err);
|
|
1184
|
+
}
|
|
1185
|
+
});
|
|
1186
|
+
} catch (error) {
|
|
1187
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1188
|
+
done(error);
|
|
1189
|
+
}
|
|
1190
|
+
}).timeout(attemptTimeout);
|
|
1191
|
+
});
|
|
1192
|
+
|
|
1193
|
+
describe('#processinventoryschemadelete - errors', () => {
|
|
1194
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1195
|
+
try {
|
|
1196
|
+
a.processinventoryschemadelete(null, (data, error) => {
|
|
1197
|
+
try {
|
|
1198
|
+
if (stub) {
|
|
1199
|
+
const displayE = 'Error 400 received on request';
|
|
1200
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
1201
|
+
} else {
|
|
1202
|
+
runCommonAsserts(data, error);
|
|
1203
|
+
}
|
|
1204
|
+
saveMockData('InventorySchemaDelete', 'processinventoryschemadelete', 'default', data);
|
|
1205
|
+
done();
|
|
1206
|
+
} catch (err) {
|
|
1207
|
+
log.error(`Test Failure: ${err}`);
|
|
1208
|
+
done(err);
|
|
1209
|
+
}
|
|
1210
|
+
});
|
|
1211
|
+
} catch (error) {
|
|
1212
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1213
|
+
done(error);
|
|
1214
|
+
}
|
|
1215
|
+
}).timeout(attemptTimeout);
|
|
1216
|
+
});
|
|
1217
|
+
|
|
1218
|
+
const inventorySchemaDeleteTypeType = 'fakedata';
|
|
1219
|
+
describe('#deleteProcessinventoryschemadelete - errors', () => {
|
|
1220
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1221
|
+
try {
|
|
1222
|
+
a.deleteProcessinventoryschemadelete(inventorySchemaDeleteTypeType, null, (data, error) => {
|
|
1223
|
+
try {
|
|
1224
|
+
if (stub) {
|
|
1225
|
+
const displayE = 'Error 400 received on request';
|
|
1226
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
1227
|
+
} else {
|
|
1228
|
+
runCommonAsserts(data, error);
|
|
1229
|
+
}
|
|
1230
|
+
saveMockData('InventorySchemaDeleteType', 'deleteProcessinventoryschemadelete', 'default', data);
|
|
1231
|
+
done();
|
|
1232
|
+
} catch (err) {
|
|
1233
|
+
log.error(`Test Failure: ${err}`);
|
|
1234
|
+
done(err);
|
|
1235
|
+
}
|
|
1236
|
+
});
|
|
1237
|
+
} catch (error) {
|
|
1238
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1239
|
+
done(error);
|
|
1240
|
+
}
|
|
1241
|
+
}).timeout(attemptTimeout);
|
|
1242
|
+
});
|
|
1243
|
+
|
|
1244
|
+
describe('#deleteProcessinventoryschemadelete1 - errors', () => {
|
|
1245
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1246
|
+
try {
|
|
1247
|
+
a.deleteProcessinventoryschemadelete1(null, (data, error) => {
|
|
1248
|
+
try {
|
|
1249
|
+
if (stub) {
|
|
1250
|
+
const displayE = 'Error 400 received on request';
|
|
1251
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
1252
|
+
} else {
|
|
1253
|
+
runCommonAsserts(data, error);
|
|
1254
|
+
}
|
|
1255
|
+
saveMockData('InventoryV2SchemaDeleteAll', 'deleteProcessinventoryschemadelete1', 'default', data);
|
|
1256
|
+
done();
|
|
1257
|
+
} catch (err) {
|
|
1258
|
+
log.error(`Test Failure: ${err}`);
|
|
1259
|
+
done(err);
|
|
1260
|
+
}
|
|
1261
|
+
});
|
|
1262
|
+
} catch (error) {
|
|
1263
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1264
|
+
done(error);
|
|
1265
|
+
}
|
|
1266
|
+
}).timeout(attemptTimeout);
|
|
1267
|
+
});
|
|
1268
|
+
|
|
1269
|
+
const inventoryV2SchemaDeleteTypeType = 'fakedata';
|
|
1270
|
+
describe('#deleteProcessinventoryschemadelete2 - errors', () => {
|
|
1271
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
1272
|
+
try {
|
|
1273
|
+
a.deleteProcessinventoryschemadelete2(inventoryV2SchemaDeleteTypeType, null, (data, error) => {
|
|
1274
|
+
try {
|
|
1275
|
+
if (stub) {
|
|
1276
|
+
const displayE = 'Error 400 received on request';
|
|
1277
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-selector_ai-connectorRest-handleEndResponse', displayE);
|
|
1278
|
+
} else {
|
|
1279
|
+
runCommonAsserts(data, error);
|
|
1280
|
+
}
|
|
1281
|
+
saveMockData('InventoryV2SchemaDeleteType', 'deleteProcessinventoryschemadelete2', 'default', data);
|
|
1282
|
+
done();
|
|
1283
|
+
} catch (err) {
|
|
1284
|
+
log.error(`Test Failure: ${err}`);
|
|
1285
|
+
done(err);
|
|
1286
|
+
}
|
|
1287
|
+
});
|
|
1288
|
+
} catch (error) {
|
|
1289
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1290
|
+
done(error);
|
|
1291
|
+
}
|
|
1292
|
+
}).timeout(attemptTimeout);
|
|
1293
|
+
});
|
|
1294
|
+
});
|
|
1295
|
+
});
|