iotagent-node-lib 4.6.0 → 4.7.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.
Files changed (56) hide show
  1. package/.github/workflows/ci.yml +0 -1
  2. package/Changelog +12 -0
  3. package/config.js +3 -1
  4. package/doc/admin.md +39 -5
  5. package/doc/api.md +67 -6
  6. package/doc/requirements.txt +1 -1
  7. package/lib/commonConfig.js +21 -2
  8. package/lib/model/Command.js +2 -2
  9. package/lib/model/Device.js +7 -3
  10. package/lib/model/Group.js +5 -3
  11. package/lib/model/dbConn.js +53 -112
  12. package/lib/services/commands/commandRegistryMongoDB.js +115 -75
  13. package/lib/services/common/iotManagerService.js +3 -1
  14. package/lib/services/devices/deviceRegistryMemory.js +36 -0
  15. package/lib/services/devices/deviceRegistryMongoDB.js +160 -87
  16. package/lib/services/devices/deviceService.js +33 -3
  17. package/lib/services/devices/devices-NGSI-v2.js +6 -1
  18. package/lib/services/groups/groupRegistryMongoDB.js +120 -83
  19. package/lib/services/ngsi/entities-NGSI-v2.js +14 -1
  20. package/lib/services/ngsi/ngsiService.js +32 -1
  21. package/lib/services/northBound/deviceProvisioningServer.js +12 -3
  22. package/lib/templates/updateDevice.json +12 -0
  23. package/lib/templates/updateDeviceLax.json +12 -0
  24. package/package.json +4 -4
  25. package/test/functional/config-test.js +3 -2
  26. package/test/functional/testUtils.js +2 -2
  27. package/test/unit/examples/groupProvisioningRequests/provisionFullGroup.json +1 -0
  28. package/test/unit/general/config-multi-core-test.js +1 -2
  29. package/test/unit/general/contextBrokerKeystoneSecurityAccess-test.js +5 -4
  30. package/test/unit/general/deviceService-test.js +6 -5
  31. package/test/unit/memoryRegistry/deviceRegistryMemory_test.js +6 -5
  32. package/test/unit/mongodb/mongodb-connectionoptions-test.js +7 -39
  33. package/test/unit/ngsi-ld/expressions/jexlBasedTransformations-test.js +1 -2
  34. package/test/unit/ngsi-ld/general/config-jsonld-contexts-test.js +1 -2
  35. package/test/unit/ngsi-mixed/provisioning/ngsi-versioning-test.js +8 -5
  36. package/test/unit/ngsiv2/expressions/jexlBasedTransformations-test.js +42 -41
  37. package/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js +11 -10
  38. package/test/unit/ngsiv2/general/deviceService-test.js +6 -5
  39. package/test/unit/ngsiv2/general/https-support-test.js +1 -1
  40. package/test/unit/ngsiv2/lazyAndCommands/active-devices-attribute-update-test.js +4 -3
  41. package/test/unit/ngsiv2/lazyAndCommands/command-test.js +6 -5
  42. package/test/unit/ngsiv2/lazyAndCommands/lazy-devices-test.js +17 -16
  43. package/test/unit/ngsiv2/lazyAndCommands/polling-commands-test.js +10 -18
  44. package/test/unit/ngsiv2/ngsiService/active-devices-test.js +21 -20
  45. package/test/unit/ngsiv2/ngsiService/staticAttributes-test.js +8 -7
  46. package/test/unit/ngsiv2/plugins/alias-plugin_test.js +12 -11
  47. package/test/unit/ngsiv2/plugins/custom-plugin_test.js +3 -2
  48. package/test/unit/ngsiv2/plugins/multientity-plugin_test.js +28 -27
  49. package/test/unit/ngsiv2/provisioning/device-group-api-test.js +6 -4
  50. package/test/unit/ngsiv2/provisioning/device-provisioning-api_test.js +12 -11
  51. package/test/unit/ngsiv2/provisioning/device-provisioning-configGroup-api_test.js +11 -10
  52. package/test/unit/ngsiv2/provisioning/device-registration_test.js +5 -4
  53. package/test/unit/ngsiv2/provisioning/listProvisionedDevices-test.js +6 -5
  54. package/test/unit/ngsiv2/provisioning/provisionDeviceMultientity-test.js +1 -1
  55. package/test/unit/ngsiv2/provisioning/removeProvisionedDevice-test.js +5 -4
  56. package/test/unit/ngsiv2/provisioning/updateProvisionedDevices-test.js +8 -7
@@ -730,7 +730,7 @@ const iotAgentConfig = {
730
730
  subservice: 'gardens',
731
731
  providerUrl: 'http://smartgondor.com',
732
732
  deviceRegistrationDuration: 'P1M',
733
- throttling: 'PT5S'
733
+ useCBflowControl: true
734
734
  };
735
735
 
736
736
  const iotAgentConfigTS = {
@@ -812,7 +812,8 @@ const iotAgentConfigTS = {
812
812
  timestamp: true,
813
813
  service: 'smartgondor',
814
814
  subservice: 'gardens',
815
- providerUrl: 'http://smartgondor.com'
815
+ providerUrl: 'http://smartgondor.com',
816
+ useCBflowControl: true
816
817
  };
817
818
 
818
819
  describe('Java expression language (JEXL) based transformations plugin', function () {
@@ -849,7 +850,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
849
850
  .matchHeader('fiware-service', 'smartgondor')
850
851
  .matchHeader('fiware-servicepath', 'gardens')
851
852
  .post(
852
- '/v2/entities?options=upsert',
853
+ '/v2/entities?options=upsert,flowControl',
853
854
  utils.readExampleFile(
854
855
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin30.json'
855
856
  )
@@ -882,7 +883,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
882
883
  contextBrokerMock = nock('http://192.168.1.1:1026')
883
884
  .matchHeader('fiware-service', 'smartgondor')
884
885
  .matchHeader('fiware-servicepath', 'gardens')
885
- .post('/v2/entities?options=upsert', {
886
+ .post('/v2/entities?options=upsert,flowControl', {
886
887
  id: 'testNull1',
887
888
  type: 'testNull',
888
889
  v: {
@@ -938,7 +939,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
938
939
  contextBrokerMock = nock('http://192.168.1.1:1026')
939
940
  .matchHeader('fiware-service', 'smartgondor')
940
941
  .matchHeader('fiware-servicepath', 'gardens')
941
- .post('/v2/entities?options=upsert', {
942
+ .post('/v2/entities?options=upsert,flowControl', {
942
943
  id: 'testNull2',
943
944
  type: 'testNull',
944
945
  z: {
@@ -994,7 +995,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
994
995
  contextBrokerMock = nock('http://192.168.1.1:1026')
995
996
  .matchHeader('fiware-service', 'smartgondor')
996
997
  .matchHeader('fiware-servicepath', 'gardens')
997
- .post('/v2/entities?options=upsert', {
998
+ .post('/v2/entities?options=upsert,flowControl', {
998
999
  id: 'testNullSkip1',
999
1000
  type: 'testNullSkip',
1000
1001
  v: {
@@ -1058,7 +1059,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1058
1059
  contextBrokerMock = nock('http://192.168.1.1:1026')
1059
1060
  .matchHeader('fiware-service', 'smartgondor')
1060
1061
  .matchHeader('fiware-servicepath', 'gardens')
1061
- .post('/v2/entities?options=upsert', {
1062
+ .post('/v2/entities?options=upsert,flowControl', {
1062
1063
  id: 'testNullSkip2',
1063
1064
  type: 'testNullSkip',
1064
1065
  z: {
@@ -1122,7 +1123,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1122
1123
  contextBrokerMock = nock('http://192.168.1.1:1026')
1123
1124
  .matchHeader('fiware-service', 'smartgondor')
1124
1125
  .matchHeader('fiware-servicepath', 'gardens')
1125
- .post('/v2/entities?options=upsert', {
1126
+ .post('/v2/entities?options=upsert,flowControl', {
1126
1127
  id: 'testNullExplicit1',
1127
1128
  type: 'testNullExplicit',
1128
1129
  c: {
@@ -1179,7 +1180,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1179
1180
  .matchHeader('fiware-service', 'smartgondor')
1180
1181
  .matchHeader('fiware-servicepath', 'gardens')
1181
1182
  .post(
1182
- '/v2/entities?options=upsert',
1183
+ '/v2/entities?options=upsert,flowControl',
1183
1184
  utils.readExampleFile(
1184
1185
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin2.json'
1185
1186
  )
@@ -1219,7 +1220,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1219
1220
  .matchHeader('fiware-service', 'smartgondor')
1220
1221
  .matchHeader('fiware-servicepath', 'gardens')
1221
1222
  .post(
1222
- '/v2/entities?options=upsert',
1223
+ '/v2/entities?options=upsert,flowControl',
1223
1224
  utils.readExampleFile(
1224
1225
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin4.json'
1225
1226
  )
@@ -1253,7 +1254,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1253
1254
  .matchHeader('fiware-service', 'smartgondor')
1254
1255
  .matchHeader('fiware-servicepath', 'gardens')
1255
1256
  .post(
1256
- '/v2/entities?options=upsert',
1257
+ '/v2/entities?options=upsert,flowControl',
1257
1258
  utils.readExampleFile(
1258
1259
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin11.json'
1259
1260
  )
@@ -1287,7 +1288,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1287
1288
  .matchHeader('fiware-service', 'smartgondor')
1288
1289
  .matchHeader('fiware-servicepath', 'gardens')
1289
1290
  .post(
1290
- '/v2/entities?options=upsert',
1291
+ '/v2/entities?options=upsert,flowControl',
1291
1292
  utils.readExampleFile(
1292
1293
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin1.json'
1293
1294
  )
@@ -1322,7 +1323,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1322
1323
  .matchHeader('fiware-service', 'smartgondor')
1323
1324
  .matchHeader('fiware-servicepath', 'gardens')
1324
1325
  .post(
1325
- '/v2/entities?options=upsert',
1326
+ '/v2/entities?options=upsert,flowControl',
1326
1327
  utils.readExampleFile(
1327
1328
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin3.json'
1328
1329
  )
@@ -1357,7 +1358,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1357
1358
  .matchHeader('fiware-service', 'smartgondor')
1358
1359
  .matchHeader('fiware-servicepath', 'gardens')
1359
1360
  .post(
1360
- '/v2/entities?options=upsert',
1361
+ '/v2/entities?options=upsert,flowControl',
1361
1362
  utils.readExampleFile(
1362
1363
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin8.json'
1363
1364
  )
@@ -1391,7 +1392,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1391
1392
  .matchHeader('fiware-service', 'smartgondor')
1392
1393
  .matchHeader('fiware-servicepath', 'gardens')
1393
1394
  .post(
1394
- '/v2/entities?options=upsert',
1395
+ '/v2/entities?options=upsert,flowControl',
1395
1396
  utils.readExampleFile(
1396
1397
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin5.json'
1397
1398
  )
@@ -1426,7 +1427,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1426
1427
  .matchHeader('fiware-service', 'smartgondor')
1427
1428
  .matchHeader('fiware-servicepath', 'gardens')
1428
1429
  .post(
1429
- '/v2/entities?options=upsert',
1430
+ '/v2/entities?options=upsert,flowControl',
1430
1431
  utils.readExampleFile(
1431
1432
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin9.json'
1432
1433
  )
@@ -1460,7 +1461,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1460
1461
  .matchHeader('fiware-service', 'smartgondor')
1461
1462
  .matchHeader('fiware-servicepath', 'gardens')
1462
1463
  .post(
1463
- '/v2/entities?options=upsert',
1464
+ '/v2/entities?options=upsert,flowControl',
1464
1465
  utils.readExampleFile(
1465
1466
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin6.json'
1466
1467
  )
@@ -1495,7 +1496,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1495
1496
  .matchHeader('fiware-service', 'smartgondor')
1496
1497
  .matchHeader('fiware-servicepath', 'gardens')
1497
1498
  .post(
1498
- '/v2/entities?options=upsert',
1499
+ '/v2/entities?options=upsert,flowControl',
1499
1500
  utils.readExampleFile(
1500
1501
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin7.json'
1501
1502
  )
@@ -1549,7 +1550,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1549
1550
  .matchHeader('fiware-service', 'smartgondor')
1550
1551
  .matchHeader('fiware-servicepath', 'gardens')
1551
1552
  .post(
1552
- '/v2/entities?options=upsert',
1553
+ '/v2/entities?options=upsert,flowControl',
1553
1554
  utils.readExampleFile(
1554
1555
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin13.json'
1555
1556
  )
@@ -1587,7 +1588,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1587
1588
  .matchHeader('fiware-service', 'smartgondor')
1588
1589
  .matchHeader('fiware-servicepath', 'gardens')
1589
1590
  .post(
1590
- '/v2/entities?options=upsert',
1591
+ '/v2/entities?options=upsert,flowControl',
1591
1592
  utils.readExampleFile(
1592
1593
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin13.json'
1593
1594
  )
@@ -1620,7 +1621,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1620
1621
  .matchHeader('fiware-service', 'smartgondor')
1621
1622
  .matchHeader('fiware-servicepath', 'gardens')
1622
1623
  .post(
1623
- '/v2/entities?options=upsert',
1624
+ '/v2/entities?options=upsert,flowControl',
1624
1625
  utils.readExampleFile(
1625
1626
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin29.json'
1626
1627
  )
@@ -1661,7 +1662,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1661
1662
  .matchHeader('fiware-service', 'smartgondor')
1662
1663
  .matchHeader('fiware-servicepath', 'gardens')
1663
1664
  .post(
1664
- '/v2/entities?options=upsert',
1665
+ '/v2/entities?options=upsert,flowControl',
1665
1666
  utils.readExampleFile(
1666
1667
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin29b.json'
1667
1668
  )
@@ -1694,7 +1695,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1694
1695
  .matchHeader('fiware-service', 'smartgondor')
1695
1696
  .matchHeader('fiware-servicepath', 'gardens')
1696
1697
  .post(
1697
- '/v2/entities?options=upsert',
1698
+ '/v2/entities?options=upsert,flowControl',
1698
1699
  utils.readExampleFile(
1699
1700
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin31.json'
1700
1701
  )
@@ -1737,7 +1738,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1737
1738
  .matchHeader('fiware-service', 'smartgondor')
1738
1739
  .matchHeader('fiware-servicepath', 'gardens')
1739
1740
  .post(
1740
- '/v2/entities?options=upsert',
1741
+ '/v2/entities?options=upsert,flowControl',
1741
1742
  utils.readExampleFile(
1742
1743
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin32.json'
1743
1744
  )
@@ -1780,7 +1781,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1780
1781
  .matchHeader('fiware-service', 'smartgondor')
1781
1782
  .matchHeader('fiware-servicepath', 'gardens')
1782
1783
  .post(
1783
- '/v2/entities?options=upsert',
1784
+ '/v2/entities?options=upsert,flowControl',
1784
1785
  utils.readExampleFile(
1785
1786
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin35.json'
1786
1787
  )
@@ -1828,7 +1829,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1828
1829
  .matchHeader('fiware-service', 'smartgondor')
1829
1830
  .matchHeader('fiware-servicepath', 'gardens')
1830
1831
  .post(
1831
- '/v2/entities?options=upsert',
1832
+ '/v2/entities?options=upsert,flowControl',
1832
1833
  utils.readExampleFile(
1833
1834
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin41.json'
1834
1835
  )
@@ -1871,7 +1872,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1871
1872
  .matchHeader('fiware-service', 'smartgondor')
1872
1873
  .matchHeader('fiware-servicepath', 'gardens')
1873
1874
  .post(
1874
- '/v2/entities?options=upsert',
1875
+ '/v2/entities?options=upsert,flowControl',
1875
1876
  utils.readExampleFile(
1876
1877
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin34b.json'
1877
1878
  )
@@ -1914,7 +1915,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1914
1915
  .matchHeader('fiware-service', 'smartgondor')
1915
1916
  .matchHeader('fiware-servicepath', 'gardens')
1916
1917
  .post(
1917
- '/v2/entities?options=upsert',
1918
+ '/v2/entities?options=upsert,flowControl',
1918
1919
  utils.readExampleFile(
1919
1920
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin34b.json'
1920
1921
  )
@@ -1962,7 +1963,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
1962
1963
  .matchHeader('fiware-service', 'smartgondor')
1963
1964
  .matchHeader('fiware-servicepath', 'gardens')
1964
1965
  .post(
1965
- '/v2/entities?options=upsert',
1966
+ '/v2/entities?options=upsert,flowControl',
1966
1967
  utils.readExampleFile(
1967
1968
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin36.json'
1968
1969
  )
@@ -2000,7 +2001,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
2000
2001
  .matchHeader('fiware-service', 'smartgondor')
2001
2002
  .matchHeader('fiware-servicepath', 'gardens')
2002
2003
  .post(
2003
- '/v2/entities?options=upsert',
2004
+ '/v2/entities?options=upsert,flowControl',
2004
2005
  utils.readExampleFile(
2005
2006
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin36b.json'
2006
2007
  )
@@ -2033,7 +2034,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
2033
2034
  .matchHeader('fiware-service', 'smartgondor')
2034
2035
  .matchHeader('fiware-servicepath', 'gardens')
2035
2036
  .post(
2036
- '/v2/entities?options=upsert',
2037
+ '/v2/entities?options=upsert,flowControl',
2037
2038
  utils.readExampleFile(
2038
2039
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin34.json'
2039
2040
  )
@@ -2081,7 +2082,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
2081
2082
  .matchHeader('fiware-service', 'smartgondor')
2082
2083
  .matchHeader('fiware-servicepath', 'gardens')
2083
2084
  .post(
2084
- '/v2/entities?options=upsert',
2085
+ '/v2/entities?options=upsert,flowControl',
2085
2086
  utils.readExampleFile(
2086
2087
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin37.json'
2087
2088
  )
@@ -2128,7 +2129,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
2128
2129
  .matchHeader('fiware-service', 'smartgondor')
2129
2130
  .matchHeader('fiware-servicepath', 'gardens')
2130
2131
  .post(
2131
- '/v2/entities?options=upsert',
2132
+ '/v2/entities?options=upsert,flowControl',
2132
2133
  utils.readExampleFile(
2133
2134
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionSkip.json'
2134
2135
  )
@@ -2163,7 +2164,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
2163
2164
  contextBrokerMock = nock('http://192.168.1.1:1026')
2164
2165
  .matchHeader('fiware-service', 'smartgondor')
2165
2166
  .matchHeader('fiware-servicepath', 'gardens')
2166
- .post('/v2/entities?options=upsert', {
2167
+ .post('/v2/entities?options=upsert,flowControl', {
2167
2168
  id: 'nested1',
2168
2169
  type: 'nestedExpressionsObj',
2169
2170
  v: {
@@ -2206,7 +2207,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
2206
2207
  contextBrokerMock = nock('http://192.168.1.1:1026')
2207
2208
  .matchHeader('fiware-service', 'smartgondor')
2208
2209
  .matchHeader('fiware-servicepath', 'gardens')
2209
- .post('/v2/entities?options=upsert', {
2210
+ .post('/v2/entities?options=upsert,flowControl', {
2210
2211
  id: 'nested2',
2211
2212
  type: 'nestedExpressionsName',
2212
2213
  t: {
@@ -2253,7 +2254,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
2253
2254
  contextBrokerMock = nock('http://192.168.1.1:1026')
2254
2255
  .matchHeader('fiware-service', 'smartgondor')
2255
2256
  .matchHeader('fiware-servicepath', 'gardens')
2256
- .post('/v2/entities?options=upsert', {
2257
+ .post('/v2/entities?options=upsert,flowControl', {
2257
2258
  id: 'nested3',
2258
2259
  type: 'nestedExpressionsSkip',
2259
2260
  prefix: {
@@ -2296,7 +2297,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
2296
2297
  contextBrokerMock = nock('http://192.168.1.1:1026')
2297
2298
  .matchHeader('fiware-service', 'smartgondor')
2298
2299
  .matchHeader('fiware-servicepath', 'gardens')
2299
- .post('/v2/entities?options=upsert', {
2300
+ .post('/v2/entities?options=upsert,flowControl', {
2300
2301
  id: 'nestedDirect',
2301
2302
  type: 'nestedExpressionsDirect',
2302
2303
  level: {
@@ -2343,7 +2344,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
2343
2344
  contextBrokerMock = nock('http://192.168.1.1:1026')
2344
2345
  .matchHeader('fiware-service', 'smartgondor')
2345
2346
  .matchHeader('fiware-servicepath', 'gardens')
2346
- .post('/v2/entities?options=upsert', {
2347
+ .post('/v2/entities?options=upsert,flowControl', {
2347
2348
  id: 'nestedReverse',
2348
2349
  type: 'nestedExpressionsReverse',
2349
2350
  level: {
@@ -2391,7 +2392,7 @@ describe('Java expression language (JEXL) based transformations plugin', functio
2391
2392
  contextBrokerMock = nock('http://192.168.1.1:1026')
2392
2393
  .matchHeader('fiware-service', 'smartgondor')
2393
2394
  .matchHeader('fiware-servicepath', 'gardens')
2394
- .post('/v2/entities?options=upsert', {
2395
+ .post('/v2/entities?options=upsert,flowControl', {
2395
2396
  id: 'nestedAnti',
2396
2397
  type: 'nestedExpressionsAnti',
2397
2398
  a: {
@@ -2467,7 +2468,7 @@ describe('Java expression language (JEXL) based transformations plugin - Timesta
2467
2468
  .matchHeader('fiware-service', 'smartgondor')
2468
2469
  .matchHeader('fiware-servicepath', 'gardens')
2469
2470
  .post(
2470
- '/v2/entities?options=upsert',
2471
+ '/v2/entities?options=upsert,flowControl',
2471
2472
  utils.readExampleFile(
2472
2473
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin33.json'
2473
2474
  )
@@ -2508,7 +2509,7 @@ describe('Java expression language (JEXL) based transformations plugin - Timesta
2508
2509
  .matchHeader('fiware-service', 'smartgondor')
2509
2510
  .matchHeader('fiware-servicepath', 'gardens')
2510
2511
  .post(
2511
- '/v2/op/update',
2512
+ '/v2/op/update?options=flowControl',
2512
2513
  utils.readExampleFile(
2513
2514
  './test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin40.json'
2514
2515
  )
@@ -88,7 +88,8 @@ const iotAgentConfig = {
88
88
  },
89
89
  service: 'smartgondor',
90
90
  subservice: 'gardens',
91
- providerUrl: 'http://smartgondor.com'
91
+ providerUrl: 'http://smartgondor.com',
92
+ useCBflowControl: true
92
93
  };
93
94
 
94
95
  describe('NGSI-v2 - Secured access to the Context Broker with OAuth2 provider', function () {
@@ -130,7 +131,7 @@ describe('NGSI-v2 - Secured access to the Context Broker with OAuth2 provider',
130
131
  .matchHeader('fiware-servicepath', 'electricity')
131
132
  .matchHeader('Authorization', 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJ3cHdWclJ3')
132
133
  .post(
133
- '/v2/entities?options=upsert',
134
+ '/v2/entities?options=upsert,flowControl',
134
135
  utils.readExampleFile('./test/unit/ngsiv2/examples/contextRequests/updateContext1.json')
135
136
  )
136
137
  .reply(204, {});
@@ -169,7 +170,7 @@ describe('NGSI-v2 - Secured access to the Context Broker with OAuth2 provider',
169
170
  .matchHeader('fiware-servicepath', 'electricity')
170
171
  .matchHeader('Authorization', 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJ3cHdWclJ3')
171
172
  .post(
172
- '/v2/entities?options=upsert',
173
+ '/v2/entities?options=upsert,flowControl',
173
174
  utils.readExampleFile('./test/unit/ngsiv2/examples/contextRequests/updateContext1.json')
174
175
  )
175
176
  .reply(403, {});
@@ -204,7 +205,7 @@ describe('NGSI-v2 - Secured access to the Context Broker with OAuth2 provider',
204
205
  .matchHeader('fiware-servicepath', 'electricity')
205
206
  .matchHeader('Authorization', 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJ3cHdWclJ3')
206
207
  .post(
207
- '/v2/entities?options=upsert',
208
+ '/v2/entities?options=upsert,flowControl',
208
209
  utils.readExampleFile('./test/unit/ngsiv2/examples/contextRequests/updateContext1.json')
209
210
  )
210
211
  .reply(204, {});
@@ -386,7 +387,7 @@ describe('NGSI-v2 - Secured access to the Context Broker with OAuth2 provider (F
386
387
  .matchHeader('fiware-servicepath', 'electricity')
387
388
  .matchHeader('Authorization', 'Bearer c1b752e377680acd1349a3ed59db855a1db07605')
388
389
  .post(
389
- '/v2/entities?options=upsert',
390
+ '/v2/entities?options=upsert,flowControl',
390
391
  utils.readExampleFile('./test/unit/ngsiv2/examples/contextRequests/updateContext1.json')
391
392
  )
392
393
  .reply(204, {});
@@ -525,7 +526,7 @@ describe('NGSI-v2 - Secured access to the Context Broker with OAuth2 provider (F
525
526
  .matchHeader('fiware-servicepath', 'electricity')
526
527
  .matchHeader('Authorization', 'Bearer c1b752e377680acd1349a3ed59db855a1db07605')
527
528
  .post(
528
- '/v2/entities?options=upsert',
529
+ '/v2/entities?options=upsert,flowControl',
529
530
  utils.readExampleFile('./test/unit/ngsiv2/examples/contextRequests/updateContext1.json')
530
531
  )
531
532
  .reply(401, 'Auth-token not found in request header');
@@ -612,7 +613,7 @@ describe(
612
613
  .matchHeader('fiware-servicepath', '/testingPath')
613
614
  .matchHeader('Authorization', 'Bearer c1b752e377680acd1349a3ed59db855a1db07605')
614
615
  .post(
615
- '/v2/entities?options=upsert',
616
+ '/v2/entities?options=upsert,flowControl',
616
617
  utils.readExampleFile(
617
618
  './test/unit/ngsiv2/examples/contextRequests/updateContext3WithStatic.json'
618
619
  )
@@ -624,7 +625,7 @@ describe(
624
625
  .matchHeader('fiware-servicepath', '/testingPath')
625
626
  .matchHeader('Authorization', 'Bearer bbb752e377680acd1349a3ed59db855a1db076aa')
626
627
  .post(
627
- '/v2/entities?options=upsert',
628
+ '/v2/entities?options=upsert,flowControl',
628
629
  utils.readExampleFile(
629
630
  './test/unit/ngsiv2/examples/contextRequests/updateContext3WithStatic.json'
630
631
  )
@@ -739,7 +740,7 @@ describe(
739
740
  .matchHeader('fiware-servicepath', '/testingPath')
740
741
  .matchHeader('authorization', 'Bearer bea752e377680acd1349a3ed59db855a1db07zxc')
741
742
  .post(
742
- '/v2/entities?options=upsert',
743
+ '/v2/entities?options=upsert,flowControl',
743
744
  utils.readExampleFile('./test/unit/ngsiv2/examples/contextRequests/updateContext4.json')
744
745
  )
745
746
  .reply(204, {});
@@ -817,7 +818,7 @@ describe(
817
818
  .matchHeader('fiware-servicepath', '/testingPath')
818
819
  .matchHeader('Authorization', 'Bearer 000210dacf913772606c95dd0b895d5506cbc700')
819
820
  .post(
820
- '/v2/entities?options=upsert',
821
+ '/v2/entities?options=upsert,flowControl',
821
822
  utils.readExampleFile(
822
823
  './test/unit/ngsiv2/examples/contextRequests/updateContext3WithStatic.json'
823
824
  )
@@ -126,7 +126,8 @@ const iotAgentConfig = {
126
126
  },
127
127
  service: 'smartgondor',
128
128
  subservice: 'gardens',
129
- providerUrl: 'http://smartgondor.com'
129
+ providerUrl: 'http://smartgondor.com',
130
+ useCBflowControl: true
130
131
  };
131
132
  const groupCreation = {
132
133
  url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/services',
@@ -219,7 +220,7 @@ describe('NGSI-v2 - Device Service: utils', function () {
219
220
  contextBrokerMock = nock('http://192.168.1.1:1026')
220
221
  .matchHeader('fiware-service', 'testservice')
221
222
  .matchHeader('fiware-servicepath', '/testingPath')
222
- .post('/v2/entities?options=upsert')
223
+ .post('/v2/entities?options=upsert,flowControl')
223
224
  .reply(204);
224
225
 
225
226
  async.series(
@@ -248,7 +249,7 @@ describe('NGSI-v2 - Device Service: utils', function () {
248
249
  contextBrokerMock = nock('http://192.168.1.1:1026')
249
250
  .matchHeader('fiware-service', 'testservice')
250
251
  .matchHeader('fiware-servicepath', '/testingPath')
251
- .post('/v2/entities?options=upsert')
252
+ .post('/v2/entities?options=upsert,flowControl')
252
253
  .reply(204);
253
254
 
254
255
  async.series(
@@ -281,7 +282,7 @@ describe('NGSI-v2 - Device Service: utils', function () {
281
282
  contextBrokerMock = nock('http://192.168.1.1:1026')
282
283
  .matchHeader('fiware-service', 'testservice')
283
284
  .matchHeader('fiware-servicepath', '/testingPath')
284
- .post('/v2/entities?options=upsert')
285
+ .post('/v2/entities?options=upsert,flowControl')
285
286
  .reply(204);
286
287
 
287
288
  async.series([utils.request.bind(utils.request, groupCreation)], function (error, results) {
@@ -314,7 +315,7 @@ describe('NGSI-v2 - Device Service: utils', function () {
314
315
  contextBrokerMock = nock('http://192.168.1.1:1026')
315
316
  .matchHeader('fiware-service', 'testservice')
316
317
  .matchHeader('fiware-servicepath', '/testingPath')
317
- .post('/v2/entities?options=upsert')
318
+ .post('/v2/entities?options=upsert,flowControl')
318
319
  .reply(204);
319
320
 
320
321
  async.series([utils.request.bind(utils.request, configGroupCreation)], function (error, results) {
@@ -175,7 +175,7 @@ describe('NGSI-v2 - HTTPS support tests', function () {
175
175
  .matchHeader('fiware-service', 'smartgondor')
176
176
  .matchHeader('fiware-servicepath', '/gardens')
177
177
  .post(
178
- '/v2/entities?options=upsert',
178
+ '/v2/entities?options=upsert,flowControl',
179
179
  utils.readExampleFile(
180
180
  './test/unit/ngsiv2/examples/contextRequests/createMinimumProvisionedDevice.json'
181
181
  )
@@ -58,7 +58,8 @@ const iotAgentConfig = {
58
58
  },
59
59
  service: 'smartgondor',
60
60
  subservice: 'gardens',
61
- providerUrl: 'http://smartgondor.com'
61
+ providerUrl: 'http://smartgondor.com',
62
+ useCBflowControl: true
62
63
  };
63
64
  const device = {
64
65
  id: 'somelight',
@@ -82,7 +83,7 @@ describe('NGSI-v2 - Update attribute functionalities', function () {
82
83
  contextBrokerMock
83
84
  .matchHeader('fiware-service', 'smartgondor')
84
85
  .matchHeader('fiware-servicepath', 'gardens')
85
- .post('/v2/entities?options=upsert')
86
+ .post('/v2/entities?options=upsert,flowControl')
86
87
  .reply(204);
87
88
 
88
89
  iotAgentLib.activate(iotAgentConfig, done);
@@ -103,7 +104,7 @@ describe('NGSI-v2 - Update attribute functionalities', function () {
103
104
 
104
105
  describe('When a attribute update arrives to the IoT Agent as Context Provider', function () {
105
106
  const options = {
106
- url: 'http://localhost:' + iotAgentConfig.server.port + '/v2/op/update',
107
+ url: 'http://localhost:' + iotAgentConfig.server.port + '/v2/op/update?options=flowControl',
107
108
  method: 'POST',
108
109
  json: {
109
110
  actionType: 'update',
@@ -103,7 +103,8 @@ const iotAgentConfig = {
103
103
  },
104
104
  service: 'smartgondor',
105
105
  subservice: 'gardens',
106
- providerUrl: 'http://smartgondor.com'
106
+ providerUrl: 'http://smartgondor.com',
107
+ useCBflowControl: true
107
108
  };
108
109
  const device3 = {
109
110
  id: 'r2d2',
@@ -159,7 +160,7 @@ describe('NGSI-v2 - Command functionalities', function () {
159
160
  });
160
161
  describe('When a command update arrives to the IoT Agent as Context Provider', function () {
161
162
  const options = {
162
- url: 'http://localhost:' + iotAgentConfig.server.port + '/v2/op/update',
163
+ url: 'http://localhost:' + iotAgentConfig.server.port + '/v2/op/update?options=flowControl',
163
164
  method: 'POST',
164
165
  json: {
165
166
  actionType: 'update',
@@ -264,7 +265,7 @@ describe('NGSI-v2 - Command functionalities', function () {
264
265
  .matchHeader('fiware-service', 'smartgondor')
265
266
  .matchHeader('fiware-servicepath', 'gardens')
266
267
  .post(
267
- '/v2/entities?options=upsert',
268
+ '/v2/entities?options=upsert,flowControl',
268
269
  utils.readExampleFile('./test/unit/ngsiv2/examples/contextRequests/updateContextCommandFinish.json')
269
270
  )
270
271
  .reply(204);
@@ -288,7 +289,7 @@ describe('NGSI-v2 - Command functionalities', function () {
288
289
  .matchHeader('fiware-service', 'smartgondor')
289
290
  .matchHeader('fiware-servicepath', 'gardens')
290
291
  .post(
291
- '/v2/entities?options=upsert',
292
+ '/v2/entities?options=upsert,flowControl',
292
293
  utils.readExampleFile('./test/unit/ngsiv2/examples/contextRequests/updateContextCommandError.json')
293
294
  )
294
295
  .reply(204);
@@ -309,7 +310,7 @@ describe('NGSI-v2 - Command functionalities', function () {
309
310
 
310
311
  describe('When a command update with metadata arrives to the IoT Agent as Context Provider', function () {
311
312
  const options = {
312
- url: 'http://localhost:' + iotAgentConfig.server.port + '/v2/op/update',
313
+ url: 'http://localhost:' + iotAgentConfig.server.port + '/v2/op/update?options=flowControl',
313
314
  method: 'POST',
314
315
  json: {
315
316
  actionType: 'update',