@itentialopensource/adapter-etsi_sol005 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AUTH.md +39 -0
- package/BROKER.md +199 -0
- package/CALLS.md +169 -0
- package/CHANGELOG.md +9 -2
- package/CODE_OF_CONDUCT.md +12 -17
- package/CONTRIBUTING.md +88 -74
- package/ENHANCE.md +69 -0
- package/PROPERTIES.md +641 -0
- package/README.md +221 -571
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +11 -0
- package/TROUBLESHOOT.md +47 -0
- package/adapter.js +292 -469
- package/adapterBase.js +1006 -252
- package/entities/.generic/action.json +105 -0
- package/entities/.generic/schema.json +6 -1
- package/error.json +6 -0
- package/package.json +5 -3
- package/pronghorn.json +642 -570
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +421 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +10 -0
- package/report/updateReport1653138350600.json +120 -0
- package/sampleProperties.json +90 -1
- package/test/integration/adapterTestBasicGet.js +1 -1
- package/test/integration/adapterTestIntegration.js +2097 -2747
- package/test/unit/adapterBaseTestUnit.js +30 -25
- package/test/unit/adapterTestUnit.js +90 -177
- package/utils/adapterInfo.js +206 -0
- package/utils/entitiesToDB.js +12 -57
- package/utils/pre-commit.sh +3 -0
- package/utils/tbScript.js +35 -20
- package/utils/tbUtils.js +49 -31
- package/utils/testRunner.js +16 -16
|
@@ -317,8 +317,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
317
317
|
});
|
|
318
318
|
it('should return a list of functions', (done) => {
|
|
319
319
|
const returnedFunctions = ['addEntityCache', 'capabilityResults', 'checkActionFiles', 'checkProperties', 'connect', 'encryptProperty',
|
|
320
|
-
'entityInList', '
|
|
321
|
-
'
|
|
320
|
+
'entityInList', 'getAllCapabilities', 'getAllFunctions', 'getConfig', 'getDevice', 'getDevicesFiltered', 'hasDevices', 'hasEntities',
|
|
321
|
+
'healthCheck', 'iapFindAdapterPath', 'iapGetAdapterQueue', 'iapGetAdapterWorkflowFunctions', 'iapGetDeviceCount', 'iapMakeBrokerCall',
|
|
322
|
+
'iapMoveAdapterEntitiesToDB', 'iapRunAdapterBasicGet', 'iapRunAdapterConnectivity', 'iapRunAdapterHealthcheck', 'iapSuspendAdapter',
|
|
323
|
+
'iapTroubleshootAdapter', 'iapUnsuspendAdapter', 'iapUpdateAdapterConfiguration', 'isAlive', 'refreshProperties', 'addListener',
|
|
322
324
|
'emit', 'eventNames', 'getMaxListeners', 'listenerCount', 'listeners', 'off', 'on', 'once', 'prependListener',
|
|
323
325
|
'prependOnceListener', 'rawListeners', 'removeAllListeners', 'removeListener', 'setMaxListeners'];
|
|
324
326
|
try {
|
|
@@ -337,10 +339,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
337
339
|
}).timeout(attemptTimeout);
|
|
338
340
|
});
|
|
339
341
|
|
|
340
|
-
describe('#
|
|
341
|
-
it('should have a
|
|
342
|
+
describe('#iapGetAdapterWorkflowFunctions', () => {
|
|
343
|
+
it('should have a iapGetAdapterWorkflowFunctions function', (done) => {
|
|
342
344
|
try {
|
|
343
|
-
assert.equal(true, typeof a.
|
|
345
|
+
assert.equal(true, typeof a.iapGetAdapterWorkflowFunctions === 'function');
|
|
344
346
|
done();
|
|
345
347
|
} catch (error) {
|
|
346
348
|
log.error(`Test Failure: ${error}`);
|
|
@@ -349,7 +351,7 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
349
351
|
});
|
|
350
352
|
it('should retrieve workflow functions', (done) => {
|
|
351
353
|
try {
|
|
352
|
-
const expectedFunctions = a.
|
|
354
|
+
const expectedFunctions = a.iapGetAdapterWorkflowFunctions([]);
|
|
353
355
|
try {
|
|
354
356
|
assert.equal(0, expectedFunctions.length);
|
|
355
357
|
done();
|
|
@@ -426,10 +428,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
426
428
|
}).timeout(attemptTimeout);
|
|
427
429
|
});
|
|
428
430
|
|
|
429
|
-
describe('#
|
|
430
|
-
it('should have a
|
|
431
|
+
describe('#iapGetAdapterQueue', () => {
|
|
432
|
+
it('should have a iapGetAdapterQueue function', (done) => {
|
|
431
433
|
try {
|
|
432
|
-
assert.equal(true, typeof a.
|
|
434
|
+
assert.equal(true, typeof a.iapGetAdapterQueue === 'function');
|
|
433
435
|
done();
|
|
434
436
|
} catch (error) {
|
|
435
437
|
log.error(`Test Failure: ${error}`);
|
|
@@ -438,7 +440,7 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
438
440
|
});
|
|
439
441
|
it('should get information for all of the requests currently in the queue', (done) => {
|
|
440
442
|
try {
|
|
441
|
-
const expectedFunctions = a.
|
|
443
|
+
const expectedFunctions = a.iapGetAdapterQueue();
|
|
442
444
|
try {
|
|
443
445
|
assert.equal(0, expectedFunctions.length);
|
|
444
446
|
done();
|
|
@@ -817,12 +819,17 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
817
819
|
try {
|
|
818
820
|
assert.notEqual(0, expectedCapabilities.length);
|
|
819
821
|
assert.equal('.generic', expectedCapabilities[0].entity);
|
|
820
|
-
assert.equal(
|
|
822
|
+
assert.equal(10, expectedCapabilities[0].actions.length);
|
|
821
823
|
assert.equal('getGenerics', expectedCapabilities[0].actions[0]);
|
|
822
824
|
assert.equal('createGeneric', expectedCapabilities[0].actions[1]);
|
|
823
825
|
assert.equal('updateGeneric', expectedCapabilities[0].actions[2]);
|
|
824
826
|
assert.equal('patchGeneric', expectedCapabilities[0].actions[3]);
|
|
825
827
|
assert.equal('deleteGeneric', expectedCapabilities[0].actions[4]);
|
|
828
|
+
assert.equal('getGenericsNoBase', expectedCapabilities[0].actions[5]);
|
|
829
|
+
assert.equal('createGenericNoBase', expectedCapabilities[0].actions[6]);
|
|
830
|
+
assert.equal('updateGenericNoBase', expectedCapabilities[0].actions[7]);
|
|
831
|
+
assert.equal('patchGenericNoBase', expectedCapabilities[0].actions[8]);
|
|
832
|
+
assert.equal('deleteGenericNoBase', expectedCapabilities[0].actions[9]);
|
|
826
833
|
assert.equal('.system', expectedCapabilities[1].entity);
|
|
827
834
|
assert.equal(2, expectedCapabilities[1].actions.length);
|
|
828
835
|
assert.equal('getToken', expectedCapabilities[1].actions[0]);
|
|
@@ -843,12 +850,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
843
850
|
}).timeout(attemptTimeout);
|
|
844
851
|
});
|
|
845
852
|
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
describe('#updateAdapterConfiguration', () => {
|
|
849
|
-
it('should have a updateAdapterConfiguration function', (done) => {
|
|
853
|
+
describe('#iapUpdateAdapterConfiguration', () => {
|
|
854
|
+
it('should have a iapUpdateAdapterConfiguration function', (done) => {
|
|
850
855
|
try {
|
|
851
|
-
assert.equal(true, typeof a.
|
|
856
|
+
assert.equal(true, typeof a.iapUpdateAdapterConfiguration === 'function');
|
|
852
857
|
done();
|
|
853
858
|
} catch (error) {
|
|
854
859
|
log.error(`Test Failure: ${error}`);
|
|
@@ -857,7 +862,7 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
857
862
|
});
|
|
858
863
|
it('should return no updated if no changes are provided', (done) => {
|
|
859
864
|
try {
|
|
860
|
-
a.
|
|
865
|
+
a.iapUpdateAdapterConfiguration(null, null, null, null, null, (data, error) => {
|
|
861
866
|
try {
|
|
862
867
|
assert.equal('No configuration updates to make', data.response);
|
|
863
868
|
done();
|
|
@@ -873,10 +878,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
873
878
|
}).timeout(attemptTimeout);
|
|
874
879
|
it('should throw an error if missing configuration file', (done) => {
|
|
875
880
|
try {
|
|
876
|
-
a.
|
|
881
|
+
a.iapUpdateAdapterConfiguration(null, { name: 'fakeChange' }, null, null, null, (data, error) => {
|
|
877
882
|
try {
|
|
878
883
|
const displayE = 'configFile is required';
|
|
879
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-Base-adapterBase-
|
|
884
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
|
|
880
885
|
done();
|
|
881
886
|
} catch (err) {
|
|
882
887
|
log.error(`Test Failure: ${err}`);
|
|
@@ -890,10 +895,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
890
895
|
}).timeout(attemptTimeout);
|
|
891
896
|
it('if not package.json, entity is required', (done) => {
|
|
892
897
|
try {
|
|
893
|
-
a.
|
|
898
|
+
a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, null, null, null, (data, error) => {
|
|
894
899
|
try {
|
|
895
900
|
const displayE = 'Unsupported Configuration Change or Missing Entity';
|
|
896
|
-
runErrorAsserts(data, error, 'AD.999', 'Test-Base-adapterBase-
|
|
901
|
+
runErrorAsserts(data, error, 'AD.999', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
|
|
897
902
|
done();
|
|
898
903
|
} catch (err) {
|
|
899
904
|
log.error(`Test Failure: ${err}`);
|
|
@@ -907,10 +912,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
907
912
|
}).timeout(attemptTimeout);
|
|
908
913
|
it('if not package.json, type is required', (done) => {
|
|
909
914
|
try {
|
|
910
|
-
a.
|
|
915
|
+
a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, 'entity', null, null, (data, error) => {
|
|
911
916
|
try {
|
|
912
917
|
const displayE = 'type is required';
|
|
913
|
-
runErrorAsserts(data, error, 'AD.300', 'Test-Base-adapterBase-
|
|
918
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
|
|
914
919
|
done();
|
|
915
920
|
} catch (err) {
|
|
916
921
|
log.error(`Test Failure: ${err}`);
|
|
@@ -924,10 +929,10 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
924
929
|
}).timeout(attemptTimeout);
|
|
925
930
|
it('if not package.json, entity must be valid', (done) => {
|
|
926
931
|
try {
|
|
927
|
-
a.
|
|
932
|
+
a.iapUpdateAdapterConfiguration('notPackage', { name: 'fakeChange' }, 'fakeEntity', 'fakeType', null, (data, error) => {
|
|
928
933
|
try {
|
|
929
934
|
const displayE = 'Incomplete Configuration Change: Invalid Entity - fakeEntity';
|
|
930
|
-
runErrorAsserts(data, error, 'AD.999', 'Test-Base-adapterBase-
|
|
935
|
+
runErrorAsserts(data, error, 'AD.999', 'Test-Base-adapterBase-iapUpdateAdapterConfiguration', displayE);
|
|
931
936
|
done();
|
|
932
937
|
} catch (err) {
|
|
933
938
|
log.error(`Test Failure: ${err}`);
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
/* global describe it log pronghornProps */
|
|
5
5
|
/* eslint global-require: warn */
|
|
6
6
|
/* eslint no-unused-vars: warn */
|
|
7
|
+
/* eslint import/no-dynamic-require:warn */
|
|
7
8
|
|
|
8
9
|
// include required items for testing & logging
|
|
9
10
|
const assert = require('assert');
|
|
@@ -18,22 +19,31 @@ const { use } = require('chai');
|
|
|
18
19
|
const td = require('testdouble');
|
|
19
20
|
|
|
20
21
|
const anything = td.matchers.anything();
|
|
21
|
-
|
|
22
|
-
// stub and attemptTimeout are used throughout the code so set them here
|
|
23
22
|
let logLevel = 'none';
|
|
24
|
-
const stub = true;
|
|
25
23
|
const isRapidFail = false;
|
|
26
|
-
|
|
24
|
+
|
|
25
|
+
// read in the properties from the sampleProperties files
|
|
26
|
+
let adaptdir = __dirname;
|
|
27
|
+
if (adaptdir.endsWith('/test/integration')) {
|
|
28
|
+
adaptdir = adaptdir.substring(0, adaptdir.length - 17);
|
|
29
|
+
} else if (adaptdir.endsWith('/test/unit')) {
|
|
30
|
+
adaptdir = adaptdir.substring(0, adaptdir.length - 10);
|
|
31
|
+
}
|
|
32
|
+
const samProps = require(`${adaptdir}/sampleProperties.json`).properties;
|
|
27
33
|
|
|
28
34
|
// these variables can be changed to run in integrated mode so easier to set them here
|
|
29
35
|
// always check these in with bogus data!!!
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
samProps.stub = true;
|
|
37
|
+
samProps.host = 'replace.hostorip.here';
|
|
38
|
+
samProps.authentication.username = 'username';
|
|
39
|
+
samProps.authentication.password = 'password';
|
|
40
|
+
samProps.protocol = 'http';
|
|
41
|
+
samProps.port = 80;
|
|
42
|
+
samProps.ssl.enabled = false;
|
|
43
|
+
samProps.ssl.accept_invalid_cert = false;
|
|
44
|
+
samProps.request.attempt_timeout = 60000;
|
|
45
|
+
const attemptTimeout = samProps.request.attempt_timeout;
|
|
46
|
+
const { stub } = samProps;
|
|
37
47
|
|
|
38
48
|
// these are the adapter properties. You generally should not need to alter
|
|
39
49
|
// any of these after they are initially set up
|
|
@@ -45,102 +55,7 @@ global.pronghornProps = {
|
|
|
45
55
|
adapters: [{
|
|
46
56
|
id: 'Test-etsi_sol005',
|
|
47
57
|
type: 'EtsiSol005',
|
|
48
|
-
properties:
|
|
49
|
-
host,
|
|
50
|
-
port,
|
|
51
|
-
base_path: '/',
|
|
52
|
-
version: '',
|
|
53
|
-
cache_location: 'none',
|
|
54
|
-
encode_pathvars: true,
|
|
55
|
-
save_metric: false,
|
|
56
|
-
stub,
|
|
57
|
-
protocol,
|
|
58
|
-
authentication: {
|
|
59
|
-
auth_method: 'request_token',
|
|
60
|
-
username,
|
|
61
|
-
password,
|
|
62
|
-
token: '',
|
|
63
|
-
invalid_token_error: 401,
|
|
64
|
-
token_timeout: 1800000,
|
|
65
|
-
token_cache: 'local',
|
|
66
|
-
auth_field: 'header.headers.Authorization',
|
|
67
|
-
auth_field_format: 'Bearer {token}',
|
|
68
|
-
auth_logging: false,
|
|
69
|
-
client_id: '',
|
|
70
|
-
client_secret: '',
|
|
71
|
-
grant_type: ''
|
|
72
|
-
},
|
|
73
|
-
healthcheck: {
|
|
74
|
-
type: 'none',
|
|
75
|
-
frequency: 60000,
|
|
76
|
-
query_object: {}
|
|
77
|
-
},
|
|
78
|
-
throttle: {
|
|
79
|
-
throttle_enabled: false,
|
|
80
|
-
number_pronghorns: 1,
|
|
81
|
-
sync_async: 'sync',
|
|
82
|
-
max_in_queue: 1000,
|
|
83
|
-
concurrent_max: 1,
|
|
84
|
-
expire_timeout: 0,
|
|
85
|
-
avg_runtime: 200,
|
|
86
|
-
priorities: [
|
|
87
|
-
{
|
|
88
|
-
value: 0,
|
|
89
|
-
percent: 100
|
|
90
|
-
}
|
|
91
|
-
]
|
|
92
|
-
},
|
|
93
|
-
request: {
|
|
94
|
-
number_redirects: 0,
|
|
95
|
-
number_retries: 3,
|
|
96
|
-
limit_retry_error: [0],
|
|
97
|
-
failover_codes: [],
|
|
98
|
-
attempt_timeout: attemptTimeout,
|
|
99
|
-
global_request: {
|
|
100
|
-
payload: {},
|
|
101
|
-
uriOptions: {},
|
|
102
|
-
addlHeaders: {},
|
|
103
|
-
authData: {}
|
|
104
|
-
},
|
|
105
|
-
healthcheck_on_timeout: true,
|
|
106
|
-
return_raw: true,
|
|
107
|
-
archiving: false,
|
|
108
|
-
return_request: false
|
|
109
|
-
},
|
|
110
|
-
proxy: {
|
|
111
|
-
enabled: false,
|
|
112
|
-
host: '',
|
|
113
|
-
port: 1,
|
|
114
|
-
protocol: 'http',
|
|
115
|
-
username: '',
|
|
116
|
-
password: ''
|
|
117
|
-
},
|
|
118
|
-
ssl: {
|
|
119
|
-
ecdhCurve: '',
|
|
120
|
-
enabled: sslenable,
|
|
121
|
-
accept_invalid_cert: sslinvalid,
|
|
122
|
-
ca_file: '',
|
|
123
|
-
key_file: '',
|
|
124
|
-
cert_file: '',
|
|
125
|
-
secure_protocol: '',
|
|
126
|
-
ciphers: ''
|
|
127
|
-
},
|
|
128
|
-
mongo: {
|
|
129
|
-
host: '',
|
|
130
|
-
port: 0,
|
|
131
|
-
database: '',
|
|
132
|
-
username: '',
|
|
133
|
-
password: '',
|
|
134
|
-
replSet: '',
|
|
135
|
-
db_ssl: {
|
|
136
|
-
enabled: false,
|
|
137
|
-
accept_invalid_cert: false,
|
|
138
|
-
ca_file: '',
|
|
139
|
-
key_file: '',
|
|
140
|
-
cert_file: ''
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
58
|
+
properties: samProps
|
|
144
59
|
}]
|
|
145
60
|
}
|
|
146
61
|
};
|
|
@@ -271,10 +186,10 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
271
186
|
});
|
|
272
187
|
|
|
273
188
|
let wffunctions = [];
|
|
274
|
-
describe('#
|
|
189
|
+
describe('#iapGetAdapterWorkflowFunctions', () => {
|
|
275
190
|
it('should retrieve workflow functions', (done) => {
|
|
276
191
|
try {
|
|
277
|
-
wffunctions = a.
|
|
192
|
+
wffunctions = a.iapGetAdapterWorkflowFunctions([]);
|
|
278
193
|
|
|
279
194
|
try {
|
|
280
195
|
assert.notEqual(0, wffunctions.length);
|
|
@@ -465,16 +380,17 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
465
380
|
assert.notEqual('', pronghornDotJson.methods);
|
|
466
381
|
assert.equal(true, Array.isArray(pronghornDotJson.methods));
|
|
467
382
|
assert.notEqual(0, pronghornDotJson.methods.length);
|
|
468
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
469
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
470
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
471
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
472
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
473
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
474
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
475
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
476
|
-
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === '
|
|
383
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUpdateAdapterConfiguration'));
|
|
384
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapFindAdapterPath'));
|
|
385
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapTroubleshootAdapter'));
|
|
386
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterHealthcheck'));
|
|
387
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterConnectivity'));
|
|
388
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapRunAdapterBasicGet'));
|
|
389
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapSuspendAdapter'));
|
|
390
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapUnsuspendAdapter'));
|
|
391
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'iapGetAdapterQueue'));
|
|
477
392
|
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequest'));
|
|
393
|
+
assert.notEqual(undefined, pronghornDotJson.methods.find((e) => e.name === 'genericAdapterRequestNoBasePath'));
|
|
478
394
|
done();
|
|
479
395
|
} catch (error) {
|
|
480
396
|
log.error(`Test Failure: ${error}`);
|
|
@@ -646,6 +562,8 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
646
562
|
assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_id.type);
|
|
647
563
|
assert.equal('string', propertiesDotJson.definitions.authentication.properties.client_secret.type);
|
|
648
564
|
assert.equal('string', propertiesDotJson.definitions.authentication.properties.grant_type.type);
|
|
565
|
+
assert.notEqual(undefined, propertiesDotJson.definitions.ssl);
|
|
566
|
+
assert.notEqual(null, propertiesDotJson.definitions.ssl);
|
|
649
567
|
assert.notEqual('', propertiesDotJson.definitions.ssl);
|
|
650
568
|
assert.equal('string', propertiesDotJson.definitions.ssl.properties.ecdhCurve.type);
|
|
651
569
|
assert.equal('boolean', propertiesDotJson.definitions.ssl.properties.enabled.type);
|
|
@@ -659,6 +577,7 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
659
577
|
assert.equal('string', propertiesDotJson.properties.version.type);
|
|
660
578
|
assert.equal('string', propertiesDotJson.properties.cache_location.type);
|
|
661
579
|
assert.equal('boolean', propertiesDotJson.properties.encode_pathvars.type);
|
|
580
|
+
assert.equal('boolean', propertiesDotJson.properties.encode_queryvars.type);
|
|
662
581
|
assert.equal(true, Array.isArray(propertiesDotJson.properties.save_metric.type));
|
|
663
582
|
assert.equal('string', propertiesDotJson.properties.protocol.type);
|
|
664
583
|
assert.notEqual(undefined, propertiesDotJson.definitions);
|
|
@@ -707,8 +626,6 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
707
626
|
assert.equal('string', propertiesDotJson.definitions.proxy.properties.protocol.type);
|
|
708
627
|
assert.equal('string', propertiesDotJson.definitions.proxy.properties.username.type);
|
|
709
628
|
assert.equal('string', propertiesDotJson.definitions.proxy.properties.password.type);
|
|
710
|
-
assert.notEqual(undefined, propertiesDotJson.definitions.ssl);
|
|
711
|
-
assert.notEqual(null, propertiesDotJson.definitions.ssl);
|
|
712
629
|
assert.notEqual(undefined, propertiesDotJson.definitions.mongo);
|
|
713
630
|
assert.notEqual(null, propertiesDotJson.definitions.mongo);
|
|
714
631
|
assert.notEqual('', propertiesDotJson.definitions.mongo);
|
|
@@ -724,6 +641,12 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
724
641
|
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.ca_file.type);
|
|
725
642
|
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.key_file.type);
|
|
726
643
|
assert.equal('string', propertiesDotJson.definitions.mongo.properties.db_ssl.properties.cert_file.type);
|
|
644
|
+
assert.notEqual('', propertiesDotJson.definitions.devicebroker);
|
|
645
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevice.type);
|
|
646
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getDevicesFiltered.type);
|
|
647
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.isAlive.type);
|
|
648
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getConfig.type);
|
|
649
|
+
assert.equal('array', propertiesDotJson.definitions.devicebroker.properties.getCount.type);
|
|
727
650
|
done();
|
|
728
651
|
} catch (error) {
|
|
729
652
|
log.error(`Test Failure: ${error}`);
|
|
@@ -840,17 +763,13 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
840
763
|
assert.notEqual(undefined, sampleDotJson.properties.ssl.cert_file);
|
|
841
764
|
assert.notEqual(undefined, sampleDotJson.properties.ssl.secure_protocol);
|
|
842
765
|
assert.notEqual(undefined, sampleDotJson.properties.ssl.ciphers);
|
|
843
|
-
|
|
844
766
|
assert.notEqual(undefined, sampleDotJson.properties.base_path);
|
|
845
767
|
assert.notEqual(undefined, sampleDotJson.properties.version);
|
|
846
768
|
assert.notEqual(undefined, sampleDotJson.properties.cache_location);
|
|
847
769
|
assert.notEqual(undefined, sampleDotJson.properties.encode_pathvars);
|
|
770
|
+
assert.notEqual(undefined, sampleDotJson.properties.encode_queryvars);
|
|
848
771
|
assert.notEqual(undefined, sampleDotJson.properties.save_metric);
|
|
849
772
|
assert.notEqual(undefined, sampleDotJson.properties.protocol);
|
|
850
|
-
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
851
|
-
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
852
|
-
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
853
|
-
assert.notEqual(undefined, sampleDotJson.properties.stub);
|
|
854
773
|
assert.notEqual(undefined, sampleDotJson.properties.healthcheck);
|
|
855
774
|
assert.notEqual(null, sampleDotJson.properties.healthcheck);
|
|
856
775
|
assert.notEqual('', sampleDotJson.properties.healthcheck);
|
|
@@ -909,6 +828,12 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
909
828
|
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.ca_file);
|
|
910
829
|
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.key_file);
|
|
911
830
|
assert.notEqual(undefined, sampleDotJson.properties.mongo.db_ssl.cert_file);
|
|
831
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker);
|
|
832
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevice);
|
|
833
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getDevicesFiltered);
|
|
834
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.isAlive);
|
|
835
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getConfig);
|
|
836
|
+
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getCount);
|
|
912
837
|
done();
|
|
913
838
|
} catch (error) {
|
|
914
839
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1002,10 +927,10 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
1002
927
|
});
|
|
1003
928
|
});
|
|
1004
929
|
|
|
1005
|
-
describe('#
|
|
1006
|
-
it('should have a
|
|
930
|
+
describe('#iapUpdateAdapterConfiguration', () => {
|
|
931
|
+
it('should have a iapUpdateAdapterConfiguration function', (done) => {
|
|
1007
932
|
try {
|
|
1008
|
-
assert.equal(true, typeof a.
|
|
933
|
+
assert.equal(true, typeof a.iapUpdateAdapterConfiguration === 'function');
|
|
1009
934
|
done();
|
|
1010
935
|
} catch (error) {
|
|
1011
936
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1014,19 +939,19 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
1014
939
|
});
|
|
1015
940
|
});
|
|
1016
941
|
|
|
1017
|
-
describe('#
|
|
1018
|
-
it('should have a
|
|
942
|
+
describe('#iapFindAdapterPath', () => {
|
|
943
|
+
it('should have a iapFindAdapterPath function', (done) => {
|
|
1019
944
|
try {
|
|
1020
|
-
assert.equal(true, typeof a.
|
|
945
|
+
assert.equal(true, typeof a.iapFindAdapterPath === 'function');
|
|
1021
946
|
done();
|
|
1022
947
|
} catch (error) {
|
|
1023
948
|
log.error(`Test Failure: ${error}`);
|
|
1024
949
|
done(error);
|
|
1025
950
|
}
|
|
1026
951
|
});
|
|
1027
|
-
it('
|
|
952
|
+
it('iapFindAdapterPath should find atleast one path that matches', (done) => {
|
|
1028
953
|
try {
|
|
1029
|
-
a.
|
|
954
|
+
a.iapFindAdapterPath('{base_path}/{version}', (data, error) => {
|
|
1030
955
|
try {
|
|
1031
956
|
assert.equal(undefined, error);
|
|
1032
957
|
assert.notEqual(undefined, data);
|
|
@@ -1048,10 +973,10 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
1048
973
|
}).timeout(attemptTimeout);
|
|
1049
974
|
});
|
|
1050
975
|
|
|
1051
|
-
describe('#
|
|
1052
|
-
it('should have a
|
|
976
|
+
describe('#iapSuspendAdapter', () => {
|
|
977
|
+
it('should have a iapSuspendAdapter function', (done) => {
|
|
1053
978
|
try {
|
|
1054
|
-
assert.equal(true, typeof a.
|
|
979
|
+
assert.equal(true, typeof a.iapSuspendAdapter === 'function');
|
|
1055
980
|
done();
|
|
1056
981
|
} catch (error) {
|
|
1057
982
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1060,10 +985,10 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
1060
985
|
});
|
|
1061
986
|
});
|
|
1062
987
|
|
|
1063
|
-
describe('#
|
|
1064
|
-
it('should have a
|
|
988
|
+
describe('#iapUnsuspendAdapter', () => {
|
|
989
|
+
it('should have a iapUnsuspendAdapter function', (done) => {
|
|
1065
990
|
try {
|
|
1066
|
-
assert.equal(true, typeof a.
|
|
991
|
+
assert.equal(true, typeof a.iapUnsuspendAdapter === 'function');
|
|
1067
992
|
done();
|
|
1068
993
|
} catch (error) {
|
|
1069
994
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1072,10 +997,10 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
1072
997
|
});
|
|
1073
998
|
});
|
|
1074
999
|
|
|
1075
|
-
describe('#
|
|
1076
|
-
it('should have a
|
|
1000
|
+
describe('#iapGetAdapterQueue', () => {
|
|
1001
|
+
it('should have a iapGetAdapterQueue function', (done) => {
|
|
1077
1002
|
try {
|
|
1078
|
-
assert.equal(true, typeof a.
|
|
1003
|
+
assert.equal(true, typeof a.iapGetAdapterQueue === 'function');
|
|
1079
1004
|
done();
|
|
1080
1005
|
} catch (error) {
|
|
1081
1006
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1084,10 +1009,10 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
1084
1009
|
});
|
|
1085
1010
|
});
|
|
1086
1011
|
|
|
1087
|
-
describe('#
|
|
1088
|
-
it('should have a
|
|
1012
|
+
describe('#iapTroubleshootAdapter', () => {
|
|
1013
|
+
it('should have a iapTroubleshootAdapter function', (done) => {
|
|
1089
1014
|
try {
|
|
1090
|
-
assert.equal(true, typeof a.
|
|
1015
|
+
assert.equal(true, typeof a.iapTroubleshootAdapter === 'function');
|
|
1091
1016
|
done();
|
|
1092
1017
|
} catch (error) {
|
|
1093
1018
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1096,10 +1021,10 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
1096
1021
|
});
|
|
1097
1022
|
});
|
|
1098
1023
|
|
|
1099
|
-
describe('#
|
|
1100
|
-
it('should have a
|
|
1024
|
+
describe('#iapRunAdapterHealthcheck', () => {
|
|
1025
|
+
it('should have a iapRunAdapterHealthcheck function', (done) => {
|
|
1101
1026
|
try {
|
|
1102
|
-
assert.equal(true, typeof a.
|
|
1027
|
+
assert.equal(true, typeof a.iapRunAdapterHealthcheck === 'function');
|
|
1103
1028
|
done();
|
|
1104
1029
|
} catch (error) {
|
|
1105
1030
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1108,10 +1033,10 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
1108
1033
|
});
|
|
1109
1034
|
});
|
|
1110
1035
|
|
|
1111
|
-
describe('#
|
|
1112
|
-
it('should have a
|
|
1036
|
+
describe('#iapRunAdapterConnectivity', () => {
|
|
1037
|
+
it('should have a iapRunAdapterConnectivity function', (done) => {
|
|
1113
1038
|
try {
|
|
1114
|
-
assert.equal(true, typeof a.
|
|
1039
|
+
assert.equal(true, typeof a.iapRunAdapterConnectivity === 'function');
|
|
1115
1040
|
done();
|
|
1116
1041
|
} catch (error) {
|
|
1117
1042
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1120,10 +1045,10 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
1120
1045
|
});
|
|
1121
1046
|
});
|
|
1122
1047
|
|
|
1123
|
-
describe('#
|
|
1124
|
-
it('should have a
|
|
1048
|
+
describe('#iapRunAdapterBasicGet', () => {
|
|
1049
|
+
it('should have a iapRunAdapterBasicGet function', (done) => {
|
|
1125
1050
|
try {
|
|
1126
|
-
assert.equal(true, typeof a.
|
|
1051
|
+
assert.equal(true, typeof a.iapRunAdapterBasicGet === 'function');
|
|
1127
1052
|
done();
|
|
1128
1053
|
} catch (error) {
|
|
1129
1054
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1132,10 +1057,10 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
1132
1057
|
});
|
|
1133
1058
|
});
|
|
1134
1059
|
|
|
1135
|
-
describe('#
|
|
1136
|
-
it('should have a
|
|
1060
|
+
describe('#iapMoveAdapterEntitiesToDB', () => {
|
|
1061
|
+
it('should have a iapMoveAdapterEntitiesToDB function', (done) => {
|
|
1137
1062
|
try {
|
|
1138
|
-
assert.equal(true, typeof a.
|
|
1063
|
+
assert.equal(true, typeof a.iapMoveAdapterEntitiesToDB === 'function');
|
|
1139
1064
|
done();
|
|
1140
1065
|
} catch (error) {
|
|
1141
1066
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1229,10 +1154,10 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
1229
1154
|
}).timeout(attemptTimeout);
|
|
1230
1155
|
});
|
|
1231
1156
|
|
|
1232
|
-
// describe('#
|
|
1233
|
-
// it('should have a
|
|
1157
|
+
// describe('#iapHasAdapterEntity', () => {
|
|
1158
|
+
// it('should have a iapHasAdapterEntity function', (done) => {
|
|
1234
1159
|
// try {
|
|
1235
|
-
// assert.equal(true, typeof a.
|
|
1160
|
+
// assert.equal(true, typeof a.iapHasAdapterEntity === 'function');
|
|
1236
1161
|
// done();
|
|
1237
1162
|
// } catch (error) {
|
|
1238
1163
|
// log.error(`Test Failure: ${error}`);
|
|
@@ -1241,7 +1166,7 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
1241
1166
|
// });
|
|
1242
1167
|
// it('should find entity', (done) => {
|
|
1243
1168
|
// try {
|
|
1244
|
-
// a.
|
|
1169
|
+
// a.iapHasAdapterEntity('template_entity', // 'a9e9c33dc61122760072455df62663d2', (data) => {
|
|
1245
1170
|
// try {
|
|
1246
1171
|
// assert.equal(true, data[0]);
|
|
1247
1172
|
// done();
|
|
@@ -1257,7 +1182,7 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
1257
1182
|
// }).timeout(attemptTimeout);
|
|
1258
1183
|
// it('should not find entity', (done) => {
|
|
1259
1184
|
// try {
|
|
1260
|
-
// a.
|
|
1185
|
+
// a.iapHasAdapterEntity('template_entity', 'blah', (data) => {
|
|
1261
1186
|
// try {
|
|
1262
1187
|
// assert.equal(false, data[0]);
|
|
1263
1188
|
// done();
|
|
@@ -1285,18 +1210,6 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
1285
1210
|
});
|
|
1286
1211
|
});
|
|
1287
1212
|
|
|
1288
|
-
describe('#hasDevices', () => {
|
|
1289
|
-
it('should have a hasDevices function', (done) => {
|
|
1290
|
-
try {
|
|
1291
|
-
assert.equal(true, typeof a.hasDevices === 'function');
|
|
1292
|
-
done();
|
|
1293
|
-
} catch (error) {
|
|
1294
|
-
log.error(`Test Failure: ${error}`);
|
|
1295
|
-
done(error);
|
|
1296
|
-
}
|
|
1297
|
-
});
|
|
1298
|
-
});
|
|
1299
|
-
|
|
1300
1213
|
describe('#getDevice', () => {
|
|
1301
1214
|
it('should have a getDevice function', (done) => {
|
|
1302
1215
|
try {
|
|
@@ -1345,10 +1258,10 @@ describe('[unit] Etsi_sol005 Adapter Test', () => {
|
|
|
1345
1258
|
});
|
|
1346
1259
|
});
|
|
1347
1260
|
|
|
1348
|
-
describe('#
|
|
1349
|
-
it('should have a
|
|
1261
|
+
describe('#iapGetDeviceCount', () => {
|
|
1262
|
+
it('should have a iapGetDeviceCount function', (done) => {
|
|
1350
1263
|
try {
|
|
1351
|
-
assert.equal(true, typeof a.
|
|
1264
|
+
assert.equal(true, typeof a.iapGetDeviceCount === 'function');
|
|
1352
1265
|
done();
|
|
1353
1266
|
} catch (error) {
|
|
1354
1267
|
log.error(`Test Failure: ${error}`);
|