@itentialopensource/adapter-nokia_altiplano 0.1.3 → 0.4.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 +37 -0
- package/CALLS.md +95 -0
- package/CHANGELOG.md +24 -0
- package/ENHANCE.md +69 -0
- package/PROPERTIES.md +241 -0
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +12 -0
- package/TROUBLESHOOT.md +46 -0
- package/adapter.js +1135 -148
- package/adapterBase.js +1 -1
- package/entities/Intent/action.json +116 -0
- package/entities/Intent/schema.json +6 -1
- package/package.json +3 -3
- package/pronghorn.json +591 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/updateReport1647623246588.json +95 -0
- package/sampleProperties.json +2 -2
- package/test/integration/adapterTestIntegration.js +154 -0
- package/test/unit/adapterTestUnit.js +287 -0
- package/utils/basicGet.js +0 -17
- package/utils/modify.js +1 -1
- package/utils/patches2bundledDeps.js +90 -0
- package/utils/tbScript.js +4 -4
- package/utils/tbUtils.js +51 -6
- package/utils/troubleshootingAdapter.js +2 -26
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"errors": [],
|
|
3
|
+
"statistics": [
|
|
4
|
+
{
|
|
5
|
+
"owner": "errorJson",
|
|
6
|
+
"description": "New adapter errors available for use",
|
|
7
|
+
"value": 0
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"owner": "errorJson",
|
|
11
|
+
"description": "Adapter errors no longer available for use",
|
|
12
|
+
"value": 0
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"owner": "errorJson",
|
|
16
|
+
"description": "Adapter errors that have been updated (e.g. recommendation changes)",
|
|
17
|
+
"value": 30
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"owner": "packageJson",
|
|
21
|
+
"description": "Number of production dependencies",
|
|
22
|
+
"value": 13
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"owner": "packageJson",
|
|
26
|
+
"description": "Number of development dependencies",
|
|
27
|
+
"value": 7
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"owner": "packageJson",
|
|
31
|
+
"description": "Number of npm scripts",
|
|
32
|
+
"value": 23
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"owner": "packageJson",
|
|
36
|
+
"description": "Runtime Library dependency",
|
|
37
|
+
"value": "^4.44.11"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"owner": "propertiesSchemaJson",
|
|
41
|
+
"description": "Adapter properties defined in the propertiesSchema file",
|
|
42
|
+
"value": 64
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"owner": "readmeMd",
|
|
46
|
+
"description": "Number of lines in the README.md",
|
|
47
|
+
"value": 688
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"owner": "unitTestJS",
|
|
51
|
+
"description": "Number of lines of code in unit tests",
|
|
52
|
+
"value": 1822
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"owner": "unitTestJS",
|
|
56
|
+
"description": "Number of unit tests",
|
|
57
|
+
"value": 86
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"owner": "integrationTestJS",
|
|
61
|
+
"description": "Number of lines of code in integration tests",
|
|
62
|
+
"value": 859
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"owner": "integrationTestJS",
|
|
66
|
+
"description": "Number of integration tests",
|
|
67
|
+
"value": 20
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"owner": "staticFile",
|
|
71
|
+
"description": "Number of lines of code in adapterBase.js",
|
|
72
|
+
"value": 1029
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"owner": "staticFile",
|
|
76
|
+
"description": "Number of static files added",
|
|
77
|
+
"value": 34
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"owner": "Overall",
|
|
81
|
+
"description": "Total lines of Code",
|
|
82
|
+
"value": 3710
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"owner": "Overall",
|
|
86
|
+
"description": "Total Tests",
|
|
87
|
+
"value": 106
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"owner": "Overall",
|
|
91
|
+
"description": "Total Files",
|
|
92
|
+
"value": 6
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|
package/sampleProperties.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"base_path": "/rest",
|
|
8
8
|
"version": "",
|
|
9
9
|
"cache_location": "none",
|
|
10
|
-
"encode_pathvars":
|
|
10
|
+
"encode_pathvars": false,
|
|
11
11
|
"save_metric": true,
|
|
12
12
|
"stub": true,
|
|
13
13
|
"protocol": "https",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"token_cache": "local",
|
|
21
21
|
"invalid_token_error": 401,
|
|
22
22
|
"auth_field": "header.headers.Authorization",
|
|
23
|
-
"auth_field_format": "{token}",
|
|
23
|
+
"auth_field_format": "Bearer {token}",
|
|
24
24
|
"auth_logging": false,
|
|
25
25
|
"client_id": "",
|
|
26
26
|
"client_secret": "",
|
|
@@ -13,7 +13,10 @@ const winston = require('winston');
|
|
|
13
13
|
const { expect } = require('chai');
|
|
14
14
|
const { use } = require('chai');
|
|
15
15
|
const td = require('testdouble');
|
|
16
|
+
const util = require('util');
|
|
17
|
+
const pronghorn = require('../../pronghorn.json');
|
|
16
18
|
|
|
19
|
+
pronghorn.methodsByName = pronghorn.methods.reduce((result, meth) => ({ ...result, [meth.name]: meth }), {});
|
|
17
20
|
const anything = td.matchers.anything();
|
|
18
21
|
|
|
19
22
|
// stub and attemptTimeout are used throughout the code so set them here
|
|
@@ -468,6 +471,7 @@ describe('[integration] Nokia_altiplano Adapter Test', () => {
|
|
|
468
471
|
}
|
|
469
472
|
}
|
|
470
473
|
};
|
|
474
|
+
|
|
471
475
|
describe('#createOnt - errors', () => {
|
|
472
476
|
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
473
477
|
try {
|
|
@@ -493,6 +497,31 @@ describe('[integration] Nokia_altiplano Adapter Test', () => {
|
|
|
493
497
|
}).timeout(attemptTimeout);
|
|
494
498
|
});
|
|
495
499
|
|
|
500
|
+
describe('#createOntWithQuery - errors', () => {
|
|
501
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
502
|
+
try {
|
|
503
|
+
a.createOntWithQuery(intentCreateOntBodyParam, {}, (data, error) => {
|
|
504
|
+
try {
|
|
505
|
+
if (stub) {
|
|
506
|
+
const displayE = 'Error 400 received on request';
|
|
507
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-nokia_altiplano-connectorRest-handleEndResponse', displayE);
|
|
508
|
+
} else {
|
|
509
|
+
runCommonAsserts(data, error);
|
|
510
|
+
}
|
|
511
|
+
saveMockData('Intent', 'createOnt', 'default', data);
|
|
512
|
+
done();
|
|
513
|
+
} catch (err) {
|
|
514
|
+
log.error(`Test Failure: ${err}`);
|
|
515
|
+
done(err);
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
} catch (error) {
|
|
519
|
+
log.error(`Adapter Exception: ${error}`);
|
|
520
|
+
done(error);
|
|
521
|
+
}
|
|
522
|
+
}).timeout(attemptTimeout);
|
|
523
|
+
});
|
|
524
|
+
|
|
496
525
|
const intentIntent = 'fakedata';
|
|
497
526
|
describe('#dependentsSummaryFiber - errors', () => {
|
|
498
527
|
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
@@ -619,6 +648,56 @@ describe('[integration] Nokia_altiplano Adapter Test', () => {
|
|
|
619
648
|
}).timeout(attemptTimeout);
|
|
620
649
|
});
|
|
621
650
|
|
|
651
|
+
describe('#auditIbnIntent - errors', () => {
|
|
652
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
653
|
+
try {
|
|
654
|
+
a.auditIbnIntent(intentIntent, (data, error) => {
|
|
655
|
+
try {
|
|
656
|
+
if (stub) {
|
|
657
|
+
const displayE = 'Error 400 received on request';
|
|
658
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-nokia_altiplano-connectorRest-handleEndResponse', displayE);
|
|
659
|
+
} else {
|
|
660
|
+
runCommonAsserts(data, error);
|
|
661
|
+
}
|
|
662
|
+
saveMockData('Intent', 'auditIbnIntent', 'default', data);
|
|
663
|
+
done();
|
|
664
|
+
} catch (err) {
|
|
665
|
+
log.error(`Test Failure: ${err}`);
|
|
666
|
+
done(err);
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
} catch (error) {
|
|
670
|
+
log.error(`Adapter Exception: ${error}`);
|
|
671
|
+
done(error);
|
|
672
|
+
}
|
|
673
|
+
}).timeout(attemptTimeout);
|
|
674
|
+
});
|
|
675
|
+
|
|
676
|
+
describe('#synchronizeIbnIntent - errors', () => {
|
|
677
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
678
|
+
try {
|
|
679
|
+
a.synchronizeIbnIntent(intentIntent, (data, error) => {
|
|
680
|
+
try {
|
|
681
|
+
if (stub) {
|
|
682
|
+
const displayE = 'Error 400 received on request';
|
|
683
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-nokia_altiplano-connectorRest-handleEndResponse', displayE);
|
|
684
|
+
} else {
|
|
685
|
+
runCommonAsserts(data, error);
|
|
686
|
+
}
|
|
687
|
+
saveMockData('Intent', 'synchronizeIbnIntent', 'default', data);
|
|
688
|
+
done();
|
|
689
|
+
} catch (err) {
|
|
690
|
+
log.error(`Test Failure: ${err}`);
|
|
691
|
+
done(err);
|
|
692
|
+
}
|
|
693
|
+
});
|
|
694
|
+
} catch (error) {
|
|
695
|
+
log.error(`Adapter Exception: ${error}`);
|
|
696
|
+
done(error);
|
|
697
|
+
}
|
|
698
|
+
}).timeout(attemptTimeout);
|
|
699
|
+
});
|
|
700
|
+
|
|
622
701
|
describe('#dependentsSummaryForDevice - errors', () => {
|
|
623
702
|
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
624
703
|
try {
|
|
@@ -802,6 +881,56 @@ describe('[integration] Nokia_altiplano Adapter Test', () => {
|
|
|
802
881
|
}).timeout(attemptTimeout);
|
|
803
882
|
});
|
|
804
883
|
|
|
884
|
+
describe('#modifyIbnIntent - errors', () => {
|
|
885
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
886
|
+
try {
|
|
887
|
+
a.modifyIbnIntent(intentIntent, intentLockOntBodyParam, (data, error) => {
|
|
888
|
+
try {
|
|
889
|
+
if (stub) {
|
|
890
|
+
const displayE = 'Error 400 received on request';
|
|
891
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-nokia_altiplano-connectorRest-handleEndResponse', displayE);
|
|
892
|
+
} else {
|
|
893
|
+
runCommonAsserts(data, error);
|
|
894
|
+
}
|
|
895
|
+
saveMockData('Intent', 'modifyIbnIntent', 'default', data);
|
|
896
|
+
done();
|
|
897
|
+
} catch (err) {
|
|
898
|
+
log.error(`Test Failure: ${err}`);
|
|
899
|
+
done(err);
|
|
900
|
+
}
|
|
901
|
+
});
|
|
902
|
+
} catch (error) {
|
|
903
|
+
log.error(`Adapter Exception: ${error}`);
|
|
904
|
+
done(error);
|
|
905
|
+
}
|
|
906
|
+
}).timeout(attemptTimeout);
|
|
907
|
+
});
|
|
908
|
+
|
|
909
|
+
describe('#getIbnIntent - errors', () => {
|
|
910
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
911
|
+
try {
|
|
912
|
+
a.getIbnIntent(intentIntent, (data, error) => {
|
|
913
|
+
try {
|
|
914
|
+
if (stub) {
|
|
915
|
+
const displayE = 'Error 400 received on request';
|
|
916
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-nokia_altiplano-connectorRest-handleEndResponse', displayE);
|
|
917
|
+
} else {
|
|
918
|
+
runCommonAsserts(data, error);
|
|
919
|
+
}
|
|
920
|
+
saveMockData('Intent', 'getIbnIntent', 'default', data);
|
|
921
|
+
done();
|
|
922
|
+
} catch (err) {
|
|
923
|
+
log.error(`Test Failure: ${err}`);
|
|
924
|
+
done(err);
|
|
925
|
+
}
|
|
926
|
+
});
|
|
927
|
+
} catch (error) {
|
|
928
|
+
log.error(`Adapter Exception: ${error}`);
|
|
929
|
+
done(error);
|
|
930
|
+
}
|
|
931
|
+
}).timeout(attemptTimeout);
|
|
932
|
+
});
|
|
933
|
+
|
|
805
934
|
describe('#deletel2User - errors', () => {
|
|
806
935
|
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
807
936
|
try {
|
|
@@ -851,5 +980,30 @@ describe('[integration] Nokia_altiplano Adapter Test', () => {
|
|
|
851
980
|
}
|
|
852
981
|
}).timeout(attemptTimeout);
|
|
853
982
|
});
|
|
983
|
+
|
|
984
|
+
describe('#deleteIbnIntent - errors', () => {
|
|
985
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
986
|
+
try {
|
|
987
|
+
a.deleteIbnIntent(intentIntent, (data, error) => {
|
|
988
|
+
try {
|
|
989
|
+
if (stub) {
|
|
990
|
+
const displayE = 'Error 400 received on request';
|
|
991
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-nokia_altiplano-connectorRest-handleEndResponse', displayE);
|
|
992
|
+
} else {
|
|
993
|
+
runCommonAsserts(data, error);
|
|
994
|
+
}
|
|
995
|
+
saveMockData('Intent', 'deleteIbnIntent', 'default', data);
|
|
996
|
+
done();
|
|
997
|
+
} catch (err) {
|
|
998
|
+
log.error(`Test Failure: ${err}`);
|
|
999
|
+
done(err);
|
|
1000
|
+
}
|
|
1001
|
+
});
|
|
1002
|
+
} catch (error) {
|
|
1003
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1004
|
+
done(error);
|
|
1005
|
+
}
|
|
1006
|
+
}).timeout(attemptTimeout);
|
|
1007
|
+
});
|
|
854
1008
|
});
|
|
855
1009
|
});
|
|
@@ -1132,6 +1132,18 @@ describe('[unit] Nokia_altiplano Adapter Test', () => {
|
|
|
1132
1132
|
});
|
|
1133
1133
|
});
|
|
1134
1134
|
|
|
1135
|
+
describe('#moveEntitiesToDB', () => {
|
|
1136
|
+
it('should have a moveEntitiesToDB function', (done) => {
|
|
1137
|
+
try {
|
|
1138
|
+
assert.equal(true, typeof a.moveEntitiesToDB === 'function');
|
|
1139
|
+
done();
|
|
1140
|
+
} catch (error) {
|
|
1141
|
+
log.error(`Test Failure: ${error}`);
|
|
1142
|
+
done(error);
|
|
1143
|
+
}
|
|
1144
|
+
});
|
|
1145
|
+
});
|
|
1146
|
+
|
|
1135
1147
|
describe('#checkActionFiles', () => {
|
|
1136
1148
|
it('should have a checkActionFiles function', (done) => {
|
|
1137
1149
|
try {
|
|
@@ -1261,6 +1273,90 @@ describe('[unit] Nokia_altiplano Adapter Test', () => {
|
|
|
1261
1273
|
// }).timeout(attemptTimeout);
|
|
1262
1274
|
// });
|
|
1263
1275
|
|
|
1276
|
+
describe('#hasEntities', () => {
|
|
1277
|
+
it('should have a hasEntities function', (done) => {
|
|
1278
|
+
try {
|
|
1279
|
+
assert.equal(true, typeof a.hasEntities === 'function');
|
|
1280
|
+
done();
|
|
1281
|
+
} catch (error) {
|
|
1282
|
+
log.error(`Test Failure: ${error}`);
|
|
1283
|
+
done(error);
|
|
1284
|
+
}
|
|
1285
|
+
});
|
|
1286
|
+
});
|
|
1287
|
+
|
|
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
|
+
describe('#getDevice', () => {
|
|
1301
|
+
it('should have a getDevice function', (done) => {
|
|
1302
|
+
try {
|
|
1303
|
+
assert.equal(true, typeof a.getDevice === 'function');
|
|
1304
|
+
done();
|
|
1305
|
+
} catch (error) {
|
|
1306
|
+
log.error(`Test Failure: ${error}`);
|
|
1307
|
+
done(error);
|
|
1308
|
+
}
|
|
1309
|
+
});
|
|
1310
|
+
});
|
|
1311
|
+
|
|
1312
|
+
describe('#getDevicesFiltered', () => {
|
|
1313
|
+
it('should have a getDevicesFiltered function', (done) => {
|
|
1314
|
+
try {
|
|
1315
|
+
assert.equal(true, typeof a.getDevicesFiltered === 'function');
|
|
1316
|
+
done();
|
|
1317
|
+
} catch (error) {
|
|
1318
|
+
log.error(`Test Failure: ${error}`);
|
|
1319
|
+
done(error);
|
|
1320
|
+
}
|
|
1321
|
+
});
|
|
1322
|
+
});
|
|
1323
|
+
|
|
1324
|
+
describe('#isAlive', () => {
|
|
1325
|
+
it('should have a isAlive function', (done) => {
|
|
1326
|
+
try {
|
|
1327
|
+
assert.equal(true, typeof a.isAlive === 'function');
|
|
1328
|
+
done();
|
|
1329
|
+
} catch (error) {
|
|
1330
|
+
log.error(`Test Failure: ${error}`);
|
|
1331
|
+
done(error);
|
|
1332
|
+
}
|
|
1333
|
+
});
|
|
1334
|
+
});
|
|
1335
|
+
|
|
1336
|
+
describe('#getConfig', () => {
|
|
1337
|
+
it('should have a getConfig function', (done) => {
|
|
1338
|
+
try {
|
|
1339
|
+
assert.equal(true, typeof a.getConfig === 'function');
|
|
1340
|
+
done();
|
|
1341
|
+
} catch (error) {
|
|
1342
|
+
log.error(`Test Failure: ${error}`);
|
|
1343
|
+
done(error);
|
|
1344
|
+
}
|
|
1345
|
+
});
|
|
1346
|
+
});
|
|
1347
|
+
|
|
1348
|
+
describe('#getCount', () => {
|
|
1349
|
+
it('should have a getCount function', (done) => {
|
|
1350
|
+
try {
|
|
1351
|
+
assert.equal(true, typeof a.getCount === 'function');
|
|
1352
|
+
done();
|
|
1353
|
+
} catch (error) {
|
|
1354
|
+
log.error(`Test Failure: ${error}`);
|
|
1355
|
+
done(error);
|
|
1356
|
+
}
|
|
1357
|
+
});
|
|
1358
|
+
});
|
|
1359
|
+
|
|
1264
1360
|
/*
|
|
1265
1361
|
-----------------------------------------------------------------------
|
|
1266
1362
|
-----------------------------------------------------------------------
|
|
@@ -1398,6 +1494,35 @@ describe('[unit] Nokia_altiplano Adapter Test', () => {
|
|
|
1398
1494
|
}).timeout(attemptTimeout);
|
|
1399
1495
|
});
|
|
1400
1496
|
|
|
1497
|
+
describe('#createOntWithQuery - errors', () => {
|
|
1498
|
+
it('should have a createOntWithQuery function', (done) => {
|
|
1499
|
+
try {
|
|
1500
|
+
assert.equal(true, typeof a.createOntWithQuery === 'function');
|
|
1501
|
+
done();
|
|
1502
|
+
} catch (error) {
|
|
1503
|
+
log.error(`Test Failure: ${error}`);
|
|
1504
|
+
done(error);
|
|
1505
|
+
}
|
|
1506
|
+
}).timeout(attemptTimeout);
|
|
1507
|
+
it('should error if - missing body', (done) => {
|
|
1508
|
+
try {
|
|
1509
|
+
a.createOntWithQuery(null, null, (data, error) => {
|
|
1510
|
+
try {
|
|
1511
|
+
const displayE = 'body is required';
|
|
1512
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-nokia_altiplano-adapter-createOntWithQuery', displayE);
|
|
1513
|
+
done();
|
|
1514
|
+
} catch (err) {
|
|
1515
|
+
log.error(`Test Failure: ${err}`);
|
|
1516
|
+
done(err);
|
|
1517
|
+
}
|
|
1518
|
+
});
|
|
1519
|
+
} catch (error) {
|
|
1520
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1521
|
+
done(error);
|
|
1522
|
+
}
|
|
1523
|
+
}).timeout(attemptTimeout);
|
|
1524
|
+
});
|
|
1525
|
+
|
|
1401
1526
|
describe('#getOnt - errors', () => {
|
|
1402
1527
|
it('should have a getOnt function', (done) => {
|
|
1403
1528
|
try {
|
|
@@ -1721,5 +1846,167 @@ describe('[unit] Nokia_altiplano Adapter Test', () => {
|
|
|
1721
1846
|
}
|
|
1722
1847
|
}).timeout(attemptTimeout);
|
|
1723
1848
|
});
|
|
1849
|
+
|
|
1850
|
+
describe('#getIbnIntent - errors', () => {
|
|
1851
|
+
it('should have a getIbnIntent function', (done) => {
|
|
1852
|
+
try {
|
|
1853
|
+
assert.equal(true, typeof a.getIbnIntent === 'function');
|
|
1854
|
+
done();
|
|
1855
|
+
} catch (error) {
|
|
1856
|
+
log.error(`Test Failure: ${error}`);
|
|
1857
|
+
done(error);
|
|
1858
|
+
}
|
|
1859
|
+
}).timeout(attemptTimeout);
|
|
1860
|
+
it('should error if - missing intent', (done) => {
|
|
1861
|
+
try {
|
|
1862
|
+
a.getIbnIntent(null, (data, error) => {
|
|
1863
|
+
try {
|
|
1864
|
+
const displayE = 'intent is required';
|
|
1865
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-nokia_altiplano-adapter-getIbnIntent', displayE);
|
|
1866
|
+
done();
|
|
1867
|
+
} catch (err) {
|
|
1868
|
+
log.error(`Test Failure: ${err}`);
|
|
1869
|
+
done(err);
|
|
1870
|
+
}
|
|
1871
|
+
});
|
|
1872
|
+
} catch (error) {
|
|
1873
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1874
|
+
done(error);
|
|
1875
|
+
}
|
|
1876
|
+
}).timeout(attemptTimeout);
|
|
1877
|
+
});
|
|
1878
|
+
|
|
1879
|
+
describe('#modifyIbnIntent - errors', () => {
|
|
1880
|
+
it('should have a modifyIbnIntent function', (done) => {
|
|
1881
|
+
try {
|
|
1882
|
+
assert.equal(true, typeof a.modifyIbnIntent === 'function');
|
|
1883
|
+
done();
|
|
1884
|
+
} catch (error) {
|
|
1885
|
+
log.error(`Test Failure: ${error}`);
|
|
1886
|
+
done(error);
|
|
1887
|
+
}
|
|
1888
|
+
}).timeout(attemptTimeout);
|
|
1889
|
+
it('should error if - missing intent', (done) => {
|
|
1890
|
+
try {
|
|
1891
|
+
a.modifyIbnIntent(null, null, (data, error) => {
|
|
1892
|
+
try {
|
|
1893
|
+
const displayE = 'intent is required';
|
|
1894
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-nokia_altiplano-adapter-modifyIbnIntent', displayE);
|
|
1895
|
+
done();
|
|
1896
|
+
} catch (err) {
|
|
1897
|
+
log.error(`Test Failure: ${err}`);
|
|
1898
|
+
done(err);
|
|
1899
|
+
}
|
|
1900
|
+
});
|
|
1901
|
+
} catch (error) {
|
|
1902
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1903
|
+
done(error);
|
|
1904
|
+
}
|
|
1905
|
+
}).timeout(attemptTimeout);
|
|
1906
|
+
it('should error if - missing body', (done) => {
|
|
1907
|
+
try {
|
|
1908
|
+
a.modifyIbnIntent('fakeparam', null, (data, error) => {
|
|
1909
|
+
try {
|
|
1910
|
+
const displayE = 'body is required';
|
|
1911
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-nokia_altiplano-adapter-modifyIbnIntent', displayE);
|
|
1912
|
+
done();
|
|
1913
|
+
} catch (err) {
|
|
1914
|
+
log.error(`Test Failure: ${err}`);
|
|
1915
|
+
done(err);
|
|
1916
|
+
}
|
|
1917
|
+
});
|
|
1918
|
+
} catch (error) {
|
|
1919
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1920
|
+
done(error);
|
|
1921
|
+
}
|
|
1922
|
+
}).timeout(attemptTimeout);
|
|
1923
|
+
});
|
|
1924
|
+
|
|
1925
|
+
describe('#deleteIbnIntent - errors', () => {
|
|
1926
|
+
it('should have a deleteIbnIntent function', (done) => {
|
|
1927
|
+
try {
|
|
1928
|
+
assert.equal(true, typeof a.deleteIbnIntent === 'function');
|
|
1929
|
+
done();
|
|
1930
|
+
} catch (error) {
|
|
1931
|
+
log.error(`Test Failure: ${error}`);
|
|
1932
|
+
done(error);
|
|
1933
|
+
}
|
|
1934
|
+
}).timeout(attemptTimeout);
|
|
1935
|
+
it('should error if - missing intent', (done) => {
|
|
1936
|
+
try {
|
|
1937
|
+
a.deleteIbnIntent(null, (data, error) => {
|
|
1938
|
+
try {
|
|
1939
|
+
const displayE = 'intent is required';
|
|
1940
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-nokia_altiplano-adapter-deleteIbnIntent', displayE);
|
|
1941
|
+
done();
|
|
1942
|
+
} catch (err) {
|
|
1943
|
+
log.error(`Test Failure: ${err}`);
|
|
1944
|
+
done(err);
|
|
1945
|
+
}
|
|
1946
|
+
});
|
|
1947
|
+
} catch (error) {
|
|
1948
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1949
|
+
done(error);
|
|
1950
|
+
}
|
|
1951
|
+
}).timeout(attemptTimeout);
|
|
1952
|
+
});
|
|
1953
|
+
|
|
1954
|
+
describe('#synchronizeIbnIntent - errors', () => {
|
|
1955
|
+
it('should have a synchronizeIbnIntent function', (done) => {
|
|
1956
|
+
try {
|
|
1957
|
+
assert.equal(true, typeof a.synchronizeIbnIntent === 'function');
|
|
1958
|
+
done();
|
|
1959
|
+
} catch (error) {
|
|
1960
|
+
log.error(`Test Failure: ${error}`);
|
|
1961
|
+
done(error);
|
|
1962
|
+
}
|
|
1963
|
+
}).timeout(attemptTimeout);
|
|
1964
|
+
it('should error if - missing intent', (done) => {
|
|
1965
|
+
try {
|
|
1966
|
+
a.synchronizeIbnIntent(null, (data, error) => {
|
|
1967
|
+
try {
|
|
1968
|
+
const displayE = 'intent is required';
|
|
1969
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-nokia_altiplano-adapter-synchronizeIbnIntent', displayE);
|
|
1970
|
+
done();
|
|
1971
|
+
} catch (err) {
|
|
1972
|
+
log.error(`Test Failure: ${err}`);
|
|
1973
|
+
done(err);
|
|
1974
|
+
}
|
|
1975
|
+
});
|
|
1976
|
+
} catch (error) {
|
|
1977
|
+
log.error(`Adapter Exception: ${error}`);
|
|
1978
|
+
done(error);
|
|
1979
|
+
}
|
|
1980
|
+
}).timeout(attemptTimeout);
|
|
1981
|
+
});
|
|
1982
|
+
|
|
1983
|
+
describe('#auditIbnIntent - errors', () => {
|
|
1984
|
+
it('should have a auditIbnIntent function', (done) => {
|
|
1985
|
+
try {
|
|
1986
|
+
assert.equal(true, typeof a.auditIbnIntent === 'function');
|
|
1987
|
+
done();
|
|
1988
|
+
} catch (error) {
|
|
1989
|
+
log.error(`Test Failure: ${error}`);
|
|
1990
|
+
done(error);
|
|
1991
|
+
}
|
|
1992
|
+
}).timeout(attemptTimeout);
|
|
1993
|
+
it('should error if - missing intent', (done) => {
|
|
1994
|
+
try {
|
|
1995
|
+
a.auditIbnIntent(null, (data, error) => {
|
|
1996
|
+
try {
|
|
1997
|
+
const displayE = 'intent is required';
|
|
1998
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-nokia_altiplano-adapter-auditIbnIntent', displayE);
|
|
1999
|
+
done();
|
|
2000
|
+
} catch (err) {
|
|
2001
|
+
log.error(`Test Failure: ${err}`);
|
|
2002
|
+
done(err);
|
|
2003
|
+
}
|
|
2004
|
+
});
|
|
2005
|
+
} catch (error) {
|
|
2006
|
+
log.error(`Adapter Exception: ${error}`);
|
|
2007
|
+
done(error);
|
|
2008
|
+
}
|
|
2009
|
+
}).timeout(attemptTimeout);
|
|
2010
|
+
});
|
|
1724
2011
|
});
|
|
1725
2012
|
});
|
package/utils/basicGet.js
CHANGED
|
@@ -6,11 +6,8 @@
|
|
|
6
6
|
/* eslint import/no-unresolved: warn */
|
|
7
7
|
/* eslint import/no-dynamic-require: warn */
|
|
8
8
|
|
|
9
|
-
const path = require('path');
|
|
10
9
|
const winston = require('winston');
|
|
11
10
|
|
|
12
|
-
const utils = require(path.join(__dirname, 'tbUtils'));
|
|
13
|
-
|
|
14
11
|
const logLevel = 'none';
|
|
15
12
|
const myCustomLevels = {
|
|
16
13
|
levels: {
|
|
@@ -47,20 +44,6 @@ const basicGet = {
|
|
|
47
44
|
adapter.id,
|
|
48
45
|
adapterProps
|
|
49
46
|
);
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* @summary connect to mongodb
|
|
54
|
-
*
|
|
55
|
-
* @function connect
|
|
56
|
-
* @param {Object} properties - pronghornProps
|
|
57
|
-
*/
|
|
58
|
-
connect: async function connect(properties) {
|
|
59
|
-
// Connect to Mongo
|
|
60
|
-
const { MongoDBConnection } = require(path.join(utils.getDirname(), '../../../', '@itential/database'));
|
|
61
|
-
const connection = new MongoDBConnection(properties.mongoProps);
|
|
62
|
-
const database = await connection.connect(true);
|
|
63
|
-
return database;
|
|
64
47
|
}
|
|
65
48
|
};
|
|
66
49
|
|
package/utils/modify.js
CHANGED
|
@@ -3,7 +3,7 @@ const Ajv = require('ajv');
|
|
|
3
3
|
const rls = require('readline-sync');
|
|
4
4
|
const { execSync } = require('child_process');
|
|
5
5
|
const { existsSync } = require('fs-extra');
|
|
6
|
-
const { getAdapterConfig } = require('./
|
|
6
|
+
const { getAdapterConfig } = require('./tbUtils');
|
|
7
7
|
const { name } = require('../package.json');
|
|
8
8
|
const propertiesSchema = require('../propertiesSchema.json');
|
|
9
9
|
|