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