From 8f10be26ccbf333c5ad26b8845f22555c32527fc Mon Sep 17 00:00:00 2001 From: Jagatjot Singh <42174460+Jagatjot@users.noreply.github.com> Date: Fri, 18 Jan 2019 14:28:33 +0530 Subject: [PATCH 01/46] Update iotManagerService.js --- lib/services/common/iotManagerService.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/services/common/iotManagerService.js b/lib/services/common/iotManagerService.js index 0c96675e0..41826c73b 100644 --- a/lib/services/common/iotManagerService.js +++ b/lib/services/common/iotManagerService.js @@ -132,6 +132,8 @@ function register(callback) { alarms.raise(constants.IOTAM_ALARM, 'Unknown error connecting with the IoTAM'); + setTimeout(1000); + callback(error); } else { callback(); From d765faf603a55fe2c737399a9a061ef447fed29d Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Tue, 19 Feb 2019 13:56:37 +0530 Subject: [PATCH 02/46] Update commandLine.js --- lib/command/commandLine.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/command/commandLine.js b/lib/command/commandLine.js index 8206c06f0..cb142d235 100644 --- a/lib/command/commandLine.js +++ b/lib/command/commandLine.js @@ -525,7 +525,7 @@ function addGroup(commands, callback) { function generateOptions(deviceConfig, callback) { var options = { - uri: protocol + configIot.host + ':' + configIot.port + '/iot/services', + uri: protocol + configIot.host + ':' + configIot.port + '/iot/services?/cgroups', method: 'POST', headers: { 'fiware-service': configIot.service, From bcfaeae63ea06b5c440ad27607dbfdf47d3e559a Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Tue, 19 Feb 2019 14:06:40 +0530 Subject: [PATCH 03/46] Update commandLine.js --- lib/command/commandLine.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/command/commandLine.js b/lib/command/commandLine.js index cb142d235..76d0a6813 100644 --- a/lib/command/commandLine.js +++ b/lib/command/commandLine.js @@ -525,7 +525,7 @@ function addGroup(commands, callback) { function generateOptions(deviceConfig, callback) { var options = { - uri: protocol + configIot.host + ':' + configIot.port + '/iot/services?/cgroups', + uri: protocol + configIot.host + ':' + configIot.port + '/iot/cgroups', method: 'POST', headers: { 'fiware-service': configIot.service, From dcc675253b9d20a77b608bc4c478244e5b7d5485 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Tue, 19 Feb 2019 14:14:17 +0530 Subject: [PATCH 04/46] Update deviceGroupAdministrationServer.js --- lib/services/northBound/deviceGroupAdministrationServer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/services/northBound/deviceGroupAdministrationServer.js b/lib/services/northBound/deviceGroupAdministrationServer.js index 77af696b2..63c0bbace 100644 --- a/lib/services/northBound/deviceGroupAdministrationServer.js +++ b/lib/services/northBound/deviceGroupAdministrationServer.js @@ -255,7 +255,7 @@ function handleDeleteDeviceGroups(req, res, next) { * @param {Object} router Express request router object. */ function loadContextRoutes(router) { - router.post('/iot/services', + router.post('/iot/cgroups', restUtils.checkRequestAttributes('headers', mandatoryHeaders), restUtils.checkBody(templateGroup), handleCreateDeviceGroup); From 244e8f435dc733f85fc2a6789182bce28e711828 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Tue, 16 Apr 2019 14:55:45 +0530 Subject: [PATCH 05/46] Update deviceGroupAdministrationServer.js --- .../northBound/deviceGroupAdministrationServer.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/services/northBound/deviceGroupAdministrationServer.js b/lib/services/northBound/deviceGroupAdministrationServer.js index 63c0bbace..7ce78a763 100644 --- a/lib/services/northBound/deviceGroupAdministrationServer.js +++ b/lib/services/northBound/deviceGroupAdministrationServer.js @@ -255,21 +255,21 @@ function handleDeleteDeviceGroups(req, res, next) { * @param {Object} router Express request router object. */ function loadContextRoutes(router) { - router.post('/iot/cgroups', + router.post('/iot/:services?/:cgroups?', restUtils.checkRequestAttributes('headers', mandatoryHeaders), restUtils.checkBody(templateGroup), handleCreateDeviceGroup); - router.get('/iot/services', + router.get('/iot/:services?/:cgroups?', restUtils.checkRequestAttributes('headers', mandatoryHeaders), handleListDeviceGroups); - router.put('/iot/services', + router.put('/iot/:services?/:cgroups?', restUtils.checkRequestAttributes('headers', mandatoryHeaders), restUtils.checkRequestAttributes('query', mandatoryParameters), handleModifyDeviceGroups); - router.delete('/iot/services', + router.delete('/iot/:services?/:cgroups?', restUtils.checkRequestAttributes('headers', mandatoryHeaders), restUtils.checkRequestAttributes('query', mandatoryParameters), handleDeleteDeviceGroups); From 18daef2f5a4ebbc603bbda7dfa226c760b91abc0 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 11:36:01 +0530 Subject: [PATCH 06/46] Update iotManagerService.js --- lib/services/common/iotManagerService.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/services/common/iotManagerService.js b/lib/services/common/iotManagerService.js index 41826c73b..80e516934 100644 --- a/lib/services/common/iotManagerService.js +++ b/lib/services/common/iotManagerService.js @@ -130,10 +130,7 @@ function register(callback) { if (error) { logger.error(context, 'Error connecting to IoT Manager: %j', error); - alarms.raise(constants.IOTAM_ALARM, 'Unknown error connecting with the IoTAM'); - - setTimeout(1000); - + alarms.raise(constants.IOTAM_ALARM, 'Unknown error connecting with the IoTAM'); callback(error); } else { callback(); From 14bf7eef3fb5b14dee41bc6c72e741b0e80a9d25 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 11:39:40 +0530 Subject: [PATCH 07/46] Update iotManagerService.js --- lib/services/common/iotManagerService.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/services/common/iotManagerService.js b/lib/services/common/iotManagerService.js index 80e516934..511efa979 100644 --- a/lib/services/common/iotManagerService.js +++ b/lib/services/common/iotManagerService.js @@ -130,7 +130,8 @@ function register(callback) { if (error) { logger.error(context, 'Error connecting to IoT Manager: %j', error); - alarms.raise(constants.IOTAM_ALARM, 'Unknown error connecting with the IoTAM'); + alarms.raise(constants.IOTAM_ALARM, 'Unknown error connecting with the IoTAM'); + callback(error); } else { callback(); From fb366b63f98069335c79683c9b379e6c38a914a4 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 11:43:02 +0530 Subject: [PATCH 08/46] Update commandLine.js --- lib/command/commandLine.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/command/commandLine.js b/lib/command/commandLine.js index 76d0a6813..8206c06f0 100644 --- a/lib/command/commandLine.js +++ b/lib/command/commandLine.js @@ -525,7 +525,7 @@ function addGroup(commands, callback) { function generateOptions(deviceConfig, callback) { var options = { - uri: protocol + configIot.host + ':' + configIot.port + '/iot/cgroups', + uri: protocol + configIot.host + ':' + configIot.port + '/iot/services', method: 'POST', headers: { 'fiware-service': configIot.service, From 8a3db3c22e5e853d66838125e2a9ad8f7acc463f Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 11:46:09 +0530 Subject: [PATCH 09/46] Update iotManagerService.js --- lib/services/common/iotManagerService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/services/common/iotManagerService.js b/lib/services/common/iotManagerService.js index 511efa979..36439b864 100644 --- a/lib/services/common/iotManagerService.js +++ b/lib/services/common/iotManagerService.js @@ -130,7 +130,7 @@ function register(callback) { if (error) { logger.error(context, 'Error connecting to IoT Manager: %j', error); - alarms.raise(constants.IOTAM_ALARM, 'Unknown error connecting with the IoTAM'); + alarms.raise(constants.IOTAM_ALARM, 'Unknown error connecting with the IoTAM'); callback(error); } else { From 8bc477dd8678cb606efd686cdecbcc46a524ce96 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 11:48:53 +0530 Subject: [PATCH 10/46] Update iotManagerService.js --- lib/services/common/iotManagerService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/services/common/iotManagerService.js b/lib/services/common/iotManagerService.js index 36439b864..0c96675e0 100644 --- a/lib/services/common/iotManagerService.js +++ b/lib/services/common/iotManagerService.js @@ -131,7 +131,7 @@ function register(callback) { logger.error(context, 'Error connecting to IoT Manager: %j', error); alarms.raise(constants.IOTAM_ALARM, 'Unknown error connecting with the IoTAM'); - + callback(error); } else { callback(); From 7b273979bbcedbe51b778cac0e80ec2a802ded7d Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 11:54:28 +0530 Subject: [PATCH 11/46] Update iotam-autoregistration-test.js --- .../general/iotam-autoregistration-test.js | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/test/unit/general/iotam-autoregistration-test.js b/test/unit/general/iotam-autoregistration-test.js index b0b2728a5..632193aa1 100644 --- a/test/unit/general/iotam-autoregistration-test.js +++ b/test/unit/general/iotam-autoregistration-test.js @@ -134,6 +134,43 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': 'theSubService' } }, + optionsCreationcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'POST', + json: { + services: [ + { + resource: '/deviceTest', + apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732', + entity_type: 'SensorMachine', + trust: '8970A9078A803H3BL98PINEQRW8342HBAMS', + cbHost: 'http://unexistentHost:1026', + commands: [ + { + name: 'wheel1', + type: 'Wheel' + } + ], + lazy: [ + { + name: 'luminescence', + type: 'Lumens' + } + ], + attributes: [ + { + name: 'status', + type: 'Boolean' + } + ] + } + ] + }, + headers: { + 'fiware-service': 'theService', + 'fiware-servicepath': 'theSubService' + } + }, optionsCreationStatic = { url: 'http://localhost:4041/iot/services', method: 'POST', @@ -172,6 +209,44 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': 'theSubService' } }, + optionsCreationStaticcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'POST', + json: { + services: [ + { + resource: '/deviceTest', + apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732', + entity_type: 'SensorMachine', + trust: '8970A9078A803H3BL98PINEQRW8342HBAMS', + cbHost: 'http://unexistentHost:1026', + commands: [ + { + name: 'wheel1', + type: 'Wheel' + } + ], + static_attributes: [ + { + name: 'position', + type: 'location', + values: '123,12' + } + ], + attributes: [ + { + name: 'status', + type: 'Boolean' + } + ] + } + ] + }, + headers: { + 'fiware-service': 'theService', + 'fiware-servicepath': 'theSubService' + } + }, optionsDelete = { url: 'http://localhost:4041/iot/services', method: 'DELETE', @@ -185,6 +260,19 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732' } }, + optionsDeletecgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'DELETE', + json: {}, + headers: { + 'fiware-service': 'theService', + 'fiware-servicepath': 'theSubService' + }, + qs: { + resource: '/deviceTest', + apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732' + } + }, iotamMock; describe('IoT Manager autoregistration', function() { From 7c8510566ff26e8c8ca75c0af4a45b70a623662f Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 11:58:17 +0530 Subject: [PATCH 12/46] Update iotam-autoregistration-test.js --- .../general/iotam-autoregistration-test.js | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/test/unit/ngsiv2/general/iotam-autoregistration-test.js b/test/unit/ngsiv2/general/iotam-autoregistration-test.js index 2012bed4f..770408cd1 100644 --- a/test/unit/ngsiv2/general/iotam-autoregistration-test.js +++ b/test/unit/ngsiv2/general/iotam-autoregistration-test.js @@ -135,6 +135,43 @@ var iotAgentLib = require('../../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': 'theSubService' } }, + optionsCreationcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'POST', + json: { + services: [ + { + resource: '/deviceTest', + apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732', + entity_type: 'SensorMachine', + trust: '8970A9078A803H3BL98PINEQRW8342HBAMS', + cbHost: 'http://unexistentHost:1026', + commands: [ + { + name: 'wheel1', + type: 'Wheel' + } + ], + lazy: [ + { + name: 'luminescence', + type: 'Lumens' + } + ], + attributes: [ + { + name: 'status', + type: 'Boolean' + } + ] + } + ] + }, + headers: { + 'fiware-service': 'theService', + 'fiware-servicepath': 'theSubService' + } + }, optionsCreationStatic = { url: 'http://localhost:4041/iot/services', method: 'POST', @@ -173,6 +210,44 @@ var iotAgentLib = require('../../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': 'theSubService' } }, + optionsCreationStaticcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'POST', + json: { + services: [ + { + resource: '/deviceTest', + apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732', + entity_type: 'SensorMachine', + trust: '8970A9078A803H3BL98PINEQRW8342HBAMS', + cbHost: 'http://unexistentHost:1026', + commands: [ + { + name: 'wheel1', + type: 'Wheel' + } + ], + static_attributes: [ + { + name: 'position', + type: 'location', + values: '123,12' + } + ], + attributes: [ + { + name: 'status', + type: 'Boolean' + } + ] + } + ] + }, + headers: { + 'fiware-service': 'theService', + 'fiware-servicepath': 'theSubService' + } + }, optionsDelete = { url: 'http://localhost:4041/iot/services', method: 'DELETE', @@ -186,6 +261,19 @@ var iotAgentLib = require('../../../../lib/fiware-iotagent-lib'), apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732' } }, + optionsDeletecgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'DELETE', + json: {}, + headers: { + 'fiware-service': 'theService', + 'fiware-servicepath': 'theSubService' + }, + qs: { + resource: '/deviceTest', + apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732' + } + }, iotamMock; describe('IoT Manager autoregistration', function() { From dc3e21fb91cdfe392e198406ab1df8fbc34f78d3 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 12:04:27 +0530 Subject: [PATCH 13/46] Update mongodb-group-registry-test.js --- .../mongodb/mongodb-group-registry-test.js | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) diff --git a/test/unit/mongodb/mongodb-group-registry-test.js b/test/unit/mongodb/mongodb-group-registry-test.js index cb8fb0e8e..d3e4a2255 100644 --- a/test/unit/mongodb/mongodb-group-registry-test.js +++ b/test/unit/mongodb/mongodb-group-registry-test.js @@ -102,6 +102,48 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': '/testingPath' } }, + optionsCreationcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'POST', + json: { + services: [ + { + resource: '/deviceTest', + apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732', + entity_type: 'Light', + trust: '8970A9078A803H3BL98PINEQRW8342HBAMS', + cbHost: 'http://unexistentHost:1026', + commands: [ + { + name: 'wheel1', + type: 'Wheel' + } + ], + lazy: [ + { + name: 'luminescence', + type: 'Lumens' + } + ], + attributes: [ + { + name: 'status', + type: 'Boolean' + } + ], + internal_attributes: [ + { + customField: 'customValue' + } + ] + } + ] + }, + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/testingPath' + } + }, optionsDelete = { url: 'http://localhost:4041/iot/services', method: 'DELETE', @@ -115,6 +157,19 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732' } }, + optionsDeletecgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'DELETE', + json: {}, + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/testingPath' + }, + qs: { + resource: '/deviceTest', + apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732' + } + }, optionsList = { url: 'http://localhost:4041/iot/services', method: 'GET', @@ -124,6 +179,15 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': '/*' } }, + optionsListcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'GET', + json: {}, + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/*' + } + }, optionsUpdate = { url: 'http://localhost:4041/iot/services', method: 'PUT', @@ -166,6 +230,48 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732' } }, + optionsUpdatecgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'PUT', + json: { + apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732', + trust: '8970A9078A803H3BL98PINEQRW8342HBAMS', + cbHost: 'http://anotherUnexistentHost:1026', + commands: [ + { + name: 'wheel1', + type: 'Wheel' + } + ], + lazy: [ + { + name: 'luminescence', + type: 'Lumens' + } + ], + attributes: [ + { + name: 'status', + type: 'Boolean' + } + ], + static_attributes: [ + { + name: 'bootstrapServer', + type: 'Address', + value: '127.0.0.1' + } + ] + }, + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/testingPath' + }, + qs: { + resource: '/deviceTest', + apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732' + } + }, optionsGet = { url: 'http://localhost:4041/iot/services', method: 'GET', @@ -175,6 +281,15 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': '/testingPath' } }, + optionsGetcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'GET', + json: {}, + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/testingPath' + } + }, iotAgentDb; describe('MongoDB Group Registry test', function() { @@ -357,6 +472,19 @@ describe('MongoDB Group Registry test', function() { 'fiware-service': 'TestService', 'fiware-servicepath': '/*' } + }, + optionsConstrainedcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'GET', + qs: { + limit: 3, + offset: 2 + }, + json: {}, + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/*' + } }; beforeEach(function(done) { From d74de4b75781defeb101c24c29cea6682909adda Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 12:12:45 +0530 Subject: [PATCH 14/46] Update device-group-api-test.js --- .../provisioning/device-group-api-test.js | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) diff --git a/test/unit/provisioning/device-group-api-test.js b/test/unit/provisioning/device-group-api-test.js index 42c770855..afb43b738 100644 --- a/test/unit/provisioning/device-group-api-test.js +++ b/test/unit/provisioning/device-group-api-test.js @@ -94,6 +94,50 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': '/testingPath' } }, + optionsCreationcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'POST', + json: { + services: [ + { + resource: '/deviceTest', + apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732', + entity_type: 'SensorMachine', + trust: '8970A9078A803H3BL98PINEQRW8342HBAMS', + cbHost: 'http://unexistentHost:1026', + commands: [ + { + name: 'wheel1', + type: 'Wheel' + } + ], + lazy: [ + { + name: 'luminescence', + type: 'Lumens' + } + ], + attributes: [ + { + name: 'status', + type: 'Boolean' + } + ], + static_attributes: [ + { + name: 'bootstrapServer', + type: 'Address', + value: '127.0.0.1' + } + ] + } + ] + }, + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/testingPath' + } + }, optionsDeviceCreation = { url: 'http://localhost:4041/iot/devices', method: 'POST', @@ -116,6 +160,19 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732' } }, + optionsDeletecgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'DELETE', + json: {}, + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/testingPath' + }, + qs: { + resource: '/deviceTest', + apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732' + } + }, optionsDeleteDevice = { url: 'http://localhost:4041/iot/services', method: 'DELETE', @@ -130,6 +187,20 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), device: 'true' } }, + optionsDeleteDevicecgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'DELETE', + json: {}, + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/testingPath' + }, + qs: { + resource: '/deviceTest', + apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732', + device: 'true' + } + }, optionsUpdate = { url: 'http://localhost:4041/iot/services', method: 'PUT', @@ -171,6 +242,47 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732' } }, + optionsUpdatecgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'PUT', + json: { + trust: '8970A9078A803H3BL98PINEQRW8342HBAMS', + cbHost: 'http://anotherUnexistentHost:1026', + commands: [ + { + name: 'wheel1', + type: 'Wheel' + } + ], + lazy: [ + { + name: 'luminescence', + type: 'Lumens' + } + ], + attributes: [ + { + name: 'status', + type: 'Boolean' + } + ], + static_attributes: [ + { + name: 'identifier', + type: 'UUID', + value: 'WERTYUIOP234567890' + } + ] + }, + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/testingPath' + }, + qs: { + resource: '/deviceTest', + apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732' + } + }, optionsList = { url: 'http://localhost:4041/iot/services', method: 'GET', @@ -180,6 +292,15 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': '/*' } }, + optionsListcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'GET', + json: {}, + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/*' + } + }, optionsGet = { url: 'http://localhost:4041/iot/services', method: 'GET', @@ -188,6 +309,15 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-service': 'TestService', 'fiware-servicepath': '/testingPath' } + }, + optionsGetcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'GET', + json: {}, + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/testingPath' + } }; describe('Device Group Configuration API', function() { @@ -849,8 +979,22 @@ describe('Device Group Configuration API', function() { 'fiware-service': 'TestService', 'fiware-servicepath': '/*' } + }, + optConstrainedListcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'GET', + qs: { + limit: 3, + offset: 2 + }, + json: {}, + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/*' + } }; + beforeEach(function(done) { var optionsCreationList = [], creationFns = []; From 3ef44e0c404811bd56de086c2a880ea2d9e9efeb Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 12:15:00 +0530 Subject: [PATCH 15/46] Update device-group-utils_test.js --- .../provisioning/device-group-utils_test.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/unit/provisioning/device-group-utils_test.js b/test/unit/provisioning/device-group-utils_test.js index 92d247353..3eab50151 100644 --- a/test/unit/provisioning/device-group-utils_test.js +++ b/test/unit/provisioning/device-group-utils_test.js @@ -39,6 +39,15 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': '/testingPath' } }, + groupCreationcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'POST', + json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/testingPath' + } + }, alternateGroupCreation = { url: 'http://localhost:4041/iot/services', method: 'POST', @@ -48,6 +57,15 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': '/testingPath' } }, + alternateGroupCreationcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'POST', + json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroupAlternate.json'), + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/testingPath' + } + }, iotAgentConfig = { logLevel: 'FATAL', contextBroker: { From 29ac2199ed0e8e20b854b9100d74029043d5d452 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 12:17:39 +0530 Subject: [PATCH 16/46] Update capture-configuration-inPlugins_test.js --- .../capture-configuration-inPlugins_test.js | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/test/unit/plugins/capture-configuration-inPlugins_test.js b/test/unit/plugins/capture-configuration-inPlugins_test.js index 40d4d3733..0dd9a6955 100644 --- a/test/unit/plugins/capture-configuration-inPlugins_test.js +++ b/test/unit/plugins/capture-configuration-inPlugins_test.js @@ -104,6 +104,50 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-service': 'TestService', 'fiware-servicepath': '/testingPath' } + }, +optionsCreationcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'POST', + json: { + services: [ + { + resource: '/deviceTest', + apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732', + entity_type: 'SensorMachine', + trust: '8970A9078A803H3BL98PINEQRW8342HBAMS', + cbHost: 'http://unexistentHost:1026', + commands: [ + { + name: 'wheel1', + type: 'Wheel' + } + ], + lazy: [ + { + name: 'luminescence', + type: 'Lumens' + } + ], + attributes: [ + { + name: 'status', + type: 'Boolean' + } + ], + static_attributes: [ + { + name: 'bootstrapServer', + type: 'Address', + value: '127.0.0.1' + } + ] + } + ] + }, + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/testingPath' + } }; describe('Data Mapping Plugins: configuration provision', function() { From 3896252483856e562e18f17815f5ba69b7835b06 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 12:21:06 +0530 Subject: [PATCH 17/46] Update singleConfigurationMode-test.js --- .../singleConfigurationMode-test.js | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/test/unit/provisioning/singleConfigurationMode-test.js b/test/unit/provisioning/singleConfigurationMode-test.js index c0addcbb9..74189ad5a 100644 --- a/test/unit/provisioning/singleConfigurationMode-test.js +++ b/test/unit/provisioning/singleConfigurationMode-test.js @@ -58,6 +58,15 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': '/testingPath' } }, + groupCreationcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'POST', + json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/testingPath' + } + }, deviceCreation = { url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/devices', method: 'POST', @@ -92,6 +101,15 @@ describe('Provisioning API: Single service mode', function() { 'fiware-service': 'TestService', 'fiware-servicepath': '/testingPath' } + }, + groupCreationDuplicatedcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'POST', + json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionDuplicateGroup.json'), + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/testingPath' + } }; beforeEach(function(done) { @@ -171,6 +189,15 @@ describe('Provisioning API: Single service mode', function() { 'fiware-service': 'AlternateService', 'fiware-servicepath': '/testingPath' } + }, + alternativeGroupCreationcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'POST', + json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), + headers: { + 'fiware-service': 'AlternateService', + 'fiware-servicepath': '/testingPath' + } }; beforeEach(function(done) { From 9274e02bf249cef4dbc9eca0ff36cfe15fbbba63 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 12:24:13 +0530 Subject: [PATCH 18/46] Update singleConfigurationMode-test.js --- .../singleConfigurationMode-test.js | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test/unit/ngsiv2/provisioning/singleConfigurationMode-test.js b/test/unit/ngsiv2/provisioning/singleConfigurationMode-test.js index 8cec398fb..f54752646 100644 --- a/test/unit/ngsiv2/provisioning/singleConfigurationMode-test.js +++ b/test/unit/ngsiv2/provisioning/singleConfigurationMode-test.js @@ -62,6 +62,15 @@ var iotAgentLib = require('../../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': '/testingPath' } }, + groupCreationcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'POST', + json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/testingPath' + } + }, deviceCreation = { url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/devices', method: 'POST', @@ -96,8 +105,18 @@ describe('Provisioning API: Single service mode', function() { 'fiware-service': 'TestService', 'fiware-servicepath': '/testingPath' } + }, + groupCreationDuplicatedcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'POST', + json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionDuplicateGroup.json'), + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/testingPath' + } }; + beforeEach(function(done) { request(groupCreation, done); }); @@ -176,6 +195,15 @@ describe('Provisioning API: Single service mode', function() { 'fiware-service': 'AlternateService', 'fiware-servicepath': '/testingPath' } + }, + alternativeGroupCreationcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'POST', + json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), + headers: { + 'fiware-service': 'AlternateService', + 'fiware-servicepath': '/testingPath' + } }; beforeEach(function(done) { From 86339ac8c053a6ad0b1d775c0f06747630f62144 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 12:27:41 +0530 Subject: [PATCH 19/46] Update bidirectional-plugin_test.js --- .../plugins/bidirectional-plugin_test.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/unit/ngsiv2/plugins/bidirectional-plugin_test.js b/test/unit/ngsiv2/plugins/bidirectional-plugin_test.js index a09bd3011..c0f4f92c6 100644 --- a/test/unit/ngsiv2/plugins/bidirectional-plugin_test.js +++ b/test/unit/ngsiv2/plugins/bidirectional-plugin_test.js @@ -353,6 +353,16 @@ describe('Bidirectional data plugin', function() { 'fiware-servicepath': '/gardens' } }, + provisionGroupcgroups = { + url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/cgroups', + method: 'POST', + json: + utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/bidirectionalGroup.json'), + headers: { + 'fiware-service': 'smartGondor', + 'fiware-servicepath': '/gardens' + } + }, provisionDevice = { url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/devices', method: 'POST', @@ -427,6 +437,16 @@ describe('Bidirectional data plugin', function() { 'fiware-servicepath': '/gardens' } }, + provisionGroupcgroups = { + url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/cgroups', + method: 'POST', + json: + utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/bidirectionalGroup.json'), + headers: { + 'fiware-service': 'smartGondor', + 'fiware-servicepath': '/gardens' + } + }, notificationOptions = { url: 'http://localhost:' + iotAgentConfig.server.port + '/notify', method: 'POST', From 4b6e21f1a8938f2d168a21dd02b817d6dc0d4fae Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 12:29:59 +0530 Subject: [PATCH 20/46] Update bidirectional-plugin_test.js --- .../unit/plugins/bidirectional-plugin_test.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/unit/plugins/bidirectional-plugin_test.js b/test/unit/plugins/bidirectional-plugin_test.js index ac6a8fe60..e6bdb7a6d 100644 --- a/test/unit/plugins/bidirectional-plugin_test.js +++ b/test/unit/plugins/bidirectional-plugin_test.js @@ -290,6 +290,16 @@ describe('Bidirectional data plugin', function() { 'fiware-servicepath': '/gardens' } }, + provisionGroupcgroups = { + url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/cgroups', + method: 'POST', + json: + utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/bidirectionalGroup.json'), + headers: { + 'fiware-service': 'smartGondor', + 'fiware-servicepath': '/gardens' + } + }, provisionDevice = { url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/devices', method: 'POST', @@ -341,6 +351,16 @@ describe('Bidirectional data plugin', function() { 'fiware-servicepath': '/gardens' } }, + provisionGroupcgroups = { + url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/cgroups', + method: 'POST', + json: + utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/bidirectionalGroup.json'), + headers: { + 'fiware-service': 'smartGondor', + 'fiware-servicepath': '/gardens' + } + }, notificationOptions = { url: 'http://localhost:' + iotAgentConfig.server.port + '/notify', method: 'POST', From 1f74e30c08186da379824b092f0335e682b819fb Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 12:33:23 +0530 Subject: [PATCH 21/46] Update contextBrokerOAuthSecurityAccess-test.js --- .../contextBrokerOAuthSecurityAccess-test.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/unit/general/contextBrokerOAuthSecurityAccess-test.js b/test/unit/general/contextBrokerOAuthSecurityAccess-test.js index 3b082f01b..65d5bd500 100644 --- a/test/unit/general/contextBrokerOAuthSecurityAccess-test.js +++ b/test/unit/general/contextBrokerOAuthSecurityAccess-test.js @@ -454,6 +454,15 @@ describe('Secured access to the Context Broker with OAuth2 provider (FIWARE Keyr 'fiware-service': 'TestService', 'fiware-servicepath': '/testingPath' } + }, + groupCreationcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'POST', + json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/testingPath' + } }; var values = [ @@ -648,6 +657,15 @@ describe('Secured access to the Context Broker with OAuth2 provider (FIWARE Keyr 'fiware-service': 'TestService', 'fiware-servicepath': '/testingPath' } + }, + groupCreationcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'POST', + json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/testingPath' + } }; var values = [ From 8fe63ec4b9190cdbb65f7991dad8329b9193e2b2 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 12:36:17 +0530 Subject: [PATCH 22/46] Update contextBrokerOAuthSecurityAccess-test.js --- .../contextBrokerOAuthSecurityAccess-test.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js b/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js index 4623007ed..1572c448d 100644 --- a/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js +++ b/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js @@ -445,6 +445,15 @@ describe('Secured access to the Context Broker with OAuth2 provider (FIWARE Keyr 'fiware-service': 'TestService', 'fiware-servicepath': '/testingPath' } + }, + groupCreationcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'POST', + json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/testingPath' + } }; var values = [ @@ -642,6 +651,15 @@ describe('Secured access to the Context Broker with OAuth2 provider (FIWARE Keyr 'fiware-service': 'TestService', 'fiware-servicepath': '/testingPath' } + }, + groupCreationcgroups = { + url: 'http://localhost:4041/iot/cgroups', + method: 'POST', + json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), + headers: { + 'fiware-service': 'TestService', + 'fiware-servicepath': '/testingPath' + } }; var values = [ From 5e0d32273f5db54efa8cfa9d39f1328ae9bbd63a Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 12:42:28 +0530 Subject: [PATCH 23/46] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0fea3034d..8287f1d34 100644 --- a/README.md +++ b/README.md @@ -715,7 +715,7 @@ The IoT Agents provide two means to define those device groups: - Static **Type Configuration**: configuring the `ngsi.types` property in the `config.js` file. - Dynamic **Configuration API**: making use of the API URLS in the - configuration URI, `/iot/services`. Please, note that the configuration API + configuration URI, `/iot/services`or `/iot/cgroups` . Please, note that the configuration API manage servers under an URL that requires the `server.name` parameter to be set (the name of the IoT Agent we are using). If no name is configured `default` is taken as the default one. @@ -764,7 +764,7 @@ same fields in the database model. | static_attributes | staticAttributes | this attributes will be added to all the entities of this group 'as is'. | | internal_attributes | internalAttributes | optional section with free format, to allow specific IoT Agents to store information along with the devices in the Device Registry. | -##### POST /iot/services +##### POST /iot/services or /iot/cgroups Creates a set of device groups for the given service and service path. The service and subservice information will taken from the headers, overwritting any @@ -816,7 +816,7 @@ Returns: - 400 WRONG_SYNTAX if the body doesn't comply with the schema. - 500 SERVER ERROR if there was any error not contemplated above. -##### GET /iot/services +##### GET /iot/services or /iot/cgroups Retrieves device groups from the database. If the servicepath header has the wildcard expression, `/*`, all the subservices for the service are returned. The @@ -828,7 +828,7 @@ Returns: - 400 MISSING_HEADERS if any of the mandatory headers is not present. - 500 SERVER ERROR if there was any error not contemplated above. -##### PUT /iot/services +##### PUT /iot/services or /iot/cgroups Modifies the information for a device group configuration, identified by the `resource` and `apikey` query parameters. Takes a device group body as the @@ -850,7 +850,7 @@ Returns: - 400 MISSING_HEADERS if any of the mandatory headers is not present. - 500 SERVER ERROR if there was any error not contemplated above. -##### DELETE /iot/services +##### DELETE /iot/services or /iot/cgroups Removes a device group configuration from the DB, specified by the `resource` and `apikey` query parameters. From 3075c56dcc425caca76aaa5643ca2830e91337bd Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 12:57:05 +0530 Subject: [PATCH 24/46] Update iotam-autoregistration-test.js --- test/unit/general/iotam-autoregistration-test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/general/iotam-autoregistration-test.js b/test/unit/general/iotam-autoregistration-test.js index 632193aa1..e32e41acb 100644 --- a/test/unit/general/iotam-autoregistration-test.js +++ b/test/unit/general/iotam-autoregistration-test.js @@ -134,7 +134,7 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': 'theSubService' } }, - optionsCreationcgroups = { + optionsCreation = { url: 'http://localhost:4041/iot/cgroups', method: 'POST', json: { @@ -209,7 +209,7 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': 'theSubService' } }, - optionsCreationStaticcgroups = { + optionsCreationStatic = { url: 'http://localhost:4041/iot/cgroups', method: 'POST', json: { @@ -260,7 +260,7 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732' } }, - optionsDeletecgroups = { + optionsDelete = { url: 'http://localhost:4041/iot/cgroups', method: 'DELETE', json: {}, From 900adb5f5c60691deab32c23aa7b185fade9720e Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 13:04:59 +0530 Subject: [PATCH 25/46] Update iotam-autoregistration-test.js --- test/unit/ngsiv2/general/iotam-autoregistration-test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/ngsiv2/general/iotam-autoregistration-test.js b/test/unit/ngsiv2/general/iotam-autoregistration-test.js index 770408cd1..ba743f6d8 100644 --- a/test/unit/ngsiv2/general/iotam-autoregistration-test.js +++ b/test/unit/ngsiv2/general/iotam-autoregistration-test.js @@ -135,7 +135,7 @@ var iotAgentLib = require('../../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': 'theSubService' } }, - optionsCreationcgroups = { + optionsCreation = { url: 'http://localhost:4041/iot/cgroups', method: 'POST', json: { @@ -210,7 +210,7 @@ var iotAgentLib = require('../../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': 'theSubService' } }, - optionsCreationStaticcgroups = { + optionsCreationStatic = { url: 'http://localhost:4041/iot/cgroups', method: 'POST', json: { @@ -261,7 +261,7 @@ var iotAgentLib = require('../../../../lib/fiware-iotagent-lib'), apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732' } }, - optionsDeletecgroups = { + optionsDelete = { url: 'http://localhost:4041/iot/cgroups', method: 'DELETE', json: {}, From e3616ebdce7b152d94bbd3c7b19aa67baadbabf4 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 13:07:31 +0530 Subject: [PATCH 26/46] Update mongodb-group-registry-test.js --- test/unit/mongodb/mongodb-group-registry-test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/unit/mongodb/mongodb-group-registry-test.js b/test/unit/mongodb/mongodb-group-registry-test.js index d3e4a2255..11498baf3 100644 --- a/test/unit/mongodb/mongodb-group-registry-test.js +++ b/test/unit/mongodb/mongodb-group-registry-test.js @@ -102,7 +102,7 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': '/testingPath' } }, - optionsCreationcgroups = { + optionsCreation = { url: 'http://localhost:4041/iot/cgroups', method: 'POST', json: { @@ -157,7 +157,7 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732' } }, - optionsDeletecgroups = { + optionsDelete = { url: 'http://localhost:4041/iot/cgroups', method: 'DELETE', json: {}, @@ -179,7 +179,7 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': '/*' } }, - optionsListcgroups = { + optionsList = { url: 'http://localhost:4041/iot/cgroups', method: 'GET', json: {}, @@ -230,7 +230,7 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732' } }, - optionsUpdatecgroups = { + optionsUpdate = { url: 'http://localhost:4041/iot/cgroups', method: 'PUT', json: { @@ -281,7 +281,7 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': '/testingPath' } }, - optionsGetcgroups = { + optionsGet = { url: 'http://localhost:4041/iot/cgroups', method: 'GET', json: {}, @@ -473,7 +473,7 @@ describe('MongoDB Group Registry test', function() { 'fiware-servicepath': '/*' } }, - optionsConstrainedcgroups = { + optionsConstrained = { url: 'http://localhost:4041/iot/cgroups', method: 'GET', qs: { From f0e5cadd2c35d7a7dd3fec42931f821d996e8d52 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 13:11:40 +0530 Subject: [PATCH 27/46] Update device-group-api-test.js --- test/unit/provisioning/device-group-api-test.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/unit/provisioning/device-group-api-test.js b/test/unit/provisioning/device-group-api-test.js index afb43b738..78b33d257 100644 --- a/test/unit/provisioning/device-group-api-test.js +++ b/test/unit/provisioning/device-group-api-test.js @@ -94,7 +94,7 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': '/testingPath' } }, - optionsCreationcgroups = { + optionsCreation = { url: 'http://localhost:4041/iot/cgroups', method: 'POST', json: { @@ -160,7 +160,7 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732' } }, - optionsDeletecgroups = { + optionsDelete = { url: 'http://localhost:4041/iot/cgroups', method: 'DELETE', json: {}, @@ -187,7 +187,7 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), device: 'true' } }, - optionsDeleteDevicecgroups = { + optionsDeleteDevice = { url: 'http://localhost:4041/iot/cgroups', method: 'DELETE', json: {}, @@ -242,7 +242,7 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732' } }, - optionsUpdatecgroups = { + optionsUpdate = { url: 'http://localhost:4041/iot/cgroups', method: 'PUT', json: { @@ -292,7 +292,7 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': '/*' } }, - optionsListcgroups = { + optionsList = { url: 'http://localhost:4041/iot/cgroups', method: 'GET', json: {}, @@ -310,7 +310,7 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': '/testingPath' } }, - optionsGetcgroups = { + optionsGet = { url: 'http://localhost:4041/iot/cgroups', method: 'GET', json: {}, @@ -980,7 +980,7 @@ describe('Device Group Configuration API', function() { 'fiware-servicepath': '/*' } }, - optConstrainedListcgroups = { + optConstrainedList = { url: 'http://localhost:4041/iot/cgroups', method: 'GET', qs: { From fcb2b033368a836cea8cd6a91954e054b9777b71 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 13:12:45 +0530 Subject: [PATCH 28/46] Update device-group-utils_test.js --- test/unit/provisioning/device-group-utils_test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/provisioning/device-group-utils_test.js b/test/unit/provisioning/device-group-utils_test.js index 3eab50151..4d1d0fb25 100644 --- a/test/unit/provisioning/device-group-utils_test.js +++ b/test/unit/provisioning/device-group-utils_test.js @@ -39,7 +39,7 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': '/testingPath' } }, - groupCreationcgroups = { + groupCreation = { url: 'http://localhost:4041/iot/cgroups', method: 'POST', json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), @@ -57,7 +57,7 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': '/testingPath' } }, - alternateGroupCreationcgroups = { + alternateGroupCreation = { url: 'http://localhost:4041/iot/cgroups', method: 'POST', json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroupAlternate.json'), From dbd9046b7460cc5d1c7bc312d6d26a35fa4b79dd Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 13:16:58 +0530 Subject: [PATCH 29/46] Update capture-configuration-inPlugins_test.js --- test/unit/plugins/capture-configuration-inPlugins_test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/plugins/capture-configuration-inPlugins_test.js b/test/unit/plugins/capture-configuration-inPlugins_test.js index 0dd9a6955..28d68e629 100644 --- a/test/unit/plugins/capture-configuration-inPlugins_test.js +++ b/test/unit/plugins/capture-configuration-inPlugins_test.js @@ -105,7 +105,7 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': '/testingPath' } }, -optionsCreationcgroups = { +optionsCreation = { url: 'http://localhost:4041/iot/cgroups', method: 'POST', json: { From 63743029bcdd930f75d860e2a0fcced48188ffb3 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 13:19:18 +0530 Subject: [PATCH 30/46] Update singleConfigurationMode-test.js --- test/unit/provisioning/singleConfigurationMode-test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/provisioning/singleConfigurationMode-test.js b/test/unit/provisioning/singleConfigurationMode-test.js index 74189ad5a..08c9b7264 100644 --- a/test/unit/provisioning/singleConfigurationMode-test.js +++ b/test/unit/provisioning/singleConfigurationMode-test.js @@ -58,7 +58,7 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': '/testingPath' } }, - groupCreationcgroups = { + groupCreation = { url: 'http://localhost:4041/iot/cgroups', method: 'POST', json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), @@ -102,7 +102,7 @@ describe('Provisioning API: Single service mode', function() { 'fiware-servicepath': '/testingPath' } }, - groupCreationDuplicatedcgroups = { + groupCreationDuplicated = { url: 'http://localhost:4041/iot/cgroups', method: 'POST', json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionDuplicateGroup.json'), @@ -190,7 +190,7 @@ describe('Provisioning API: Single service mode', function() { 'fiware-servicepath': '/testingPath' } }, - alternativeGroupCreationcgroups = { + alternativeGroupCreation = { url: 'http://localhost:4041/iot/cgroups', method: 'POST', json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), From 81d869b24e7bf2b858e19c7b8e2e3ffae0243348 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 13:21:13 +0530 Subject: [PATCH 31/46] Update singleConfigurationMode-test.js --- .../ngsiv2/provisioning/singleConfigurationMode-test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/ngsiv2/provisioning/singleConfigurationMode-test.js b/test/unit/ngsiv2/provisioning/singleConfigurationMode-test.js index f54752646..c023dd510 100644 --- a/test/unit/ngsiv2/provisioning/singleConfigurationMode-test.js +++ b/test/unit/ngsiv2/provisioning/singleConfigurationMode-test.js @@ -62,7 +62,7 @@ var iotAgentLib = require('../../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': '/testingPath' } }, - groupCreationcgroups = { + groupCreation = { url: 'http://localhost:4041/iot/cgroups', method: 'POST', json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), @@ -106,7 +106,7 @@ describe('Provisioning API: Single service mode', function() { 'fiware-servicepath': '/testingPath' } }, - groupCreationDuplicatedcgroups = { + groupCreationDuplicated = { url: 'http://localhost:4041/iot/cgroups', method: 'POST', json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionDuplicateGroup.json'), @@ -196,7 +196,7 @@ describe('Provisioning API: Single service mode', function() { 'fiware-servicepath': '/testingPath' } }, - alternativeGroupCreationcgroups = { + alternativeGroupCreation = { url: 'http://localhost:4041/iot/cgroups', method: 'POST', json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), From 8362de02b5eab51474a7bfebf9bcb0105c4ba7fc Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 13:23:26 +0530 Subject: [PATCH 32/46] Update bidirectional-plugin_test.js --- test/unit/ngsiv2/plugins/bidirectional-plugin_test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/ngsiv2/plugins/bidirectional-plugin_test.js b/test/unit/ngsiv2/plugins/bidirectional-plugin_test.js index c0f4f92c6..05f251bbe 100644 --- a/test/unit/ngsiv2/plugins/bidirectional-plugin_test.js +++ b/test/unit/ngsiv2/plugins/bidirectional-plugin_test.js @@ -353,7 +353,7 @@ describe('Bidirectional data plugin', function() { 'fiware-servicepath': '/gardens' } }, - provisionGroupcgroups = { + provisionGroup = { url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/cgroups', method: 'POST', json: @@ -437,7 +437,7 @@ describe('Bidirectional data plugin', function() { 'fiware-servicepath': '/gardens' } }, - provisionGroupcgroups = { + provisionGroup = { url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/cgroups', method: 'POST', json: From 2c0a1f35a888ee26ee22e8c88aa54b69cbc41f87 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 13:24:51 +0530 Subject: [PATCH 33/46] Update bidirectional-plugin_test.js --- test/unit/plugins/bidirectional-plugin_test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/plugins/bidirectional-plugin_test.js b/test/unit/plugins/bidirectional-plugin_test.js index e6bdb7a6d..942d92624 100644 --- a/test/unit/plugins/bidirectional-plugin_test.js +++ b/test/unit/plugins/bidirectional-plugin_test.js @@ -290,7 +290,7 @@ describe('Bidirectional data plugin', function() { 'fiware-servicepath': '/gardens' } }, - provisionGroupcgroups = { + provisionGroup = { url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/cgroups', method: 'POST', json: @@ -351,7 +351,7 @@ describe('Bidirectional data plugin', function() { 'fiware-servicepath': '/gardens' } }, - provisionGroupcgroups = { + provisionGroup = { url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/cgroups', method: 'POST', json: From d091b66ce3dbd1ba1cb1d993bee45a9a25d7fccb Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 13:27:30 +0530 Subject: [PATCH 34/46] Update contextBrokerOAuthSecurityAccess-test.js --- test/unit/general/contextBrokerOAuthSecurityAccess-test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/general/contextBrokerOAuthSecurityAccess-test.js b/test/unit/general/contextBrokerOAuthSecurityAccess-test.js index 65d5bd500..e3b142b45 100644 --- a/test/unit/general/contextBrokerOAuthSecurityAccess-test.js +++ b/test/unit/general/contextBrokerOAuthSecurityAccess-test.js @@ -455,7 +455,7 @@ describe('Secured access to the Context Broker with OAuth2 provider (FIWARE Keyr 'fiware-servicepath': '/testingPath' } }, - groupCreationcgroups = { + groupCreation = { url: 'http://localhost:4041/iot/cgroups', method: 'POST', json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), @@ -658,7 +658,7 @@ describe('Secured access to the Context Broker with OAuth2 provider (FIWARE Keyr 'fiware-servicepath': '/testingPath' } }, - groupCreationcgroups = { + groupCreation = { url: 'http://localhost:4041/iot/cgroups', method: 'POST', json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), From feb692ade7ecdd6756dfd9c6c4ca506c1dcb1d3b Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 13:29:39 +0530 Subject: [PATCH 35/46] Update contextBrokerOAuthSecurityAccess-test.js --- .../ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js b/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js index 1572c448d..0678c601e 100644 --- a/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js +++ b/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js @@ -446,7 +446,7 @@ describe('Secured access to the Context Broker with OAuth2 provider (FIWARE Keyr 'fiware-servicepath': '/testingPath' } }, - groupCreationcgroups = { + groupCreation = { url: 'http://localhost:4041/iot/cgroups', method: 'POST', json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), @@ -652,7 +652,7 @@ describe('Secured access to the Context Broker with OAuth2 provider (FIWARE Keyr 'fiware-servicepath': '/testingPath' } }, - groupCreationcgroups = { + groupCreation = { url: 'http://localhost:4041/iot/cgroups', method: 'POST', json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), From e8267825956520cf36aec4765374b756c12b7f3d Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 13:42:25 +0530 Subject: [PATCH 36/46] Update contextBrokerOAuthSecurityAccess-test.js --- .../contextBrokerOAuthSecurityAccess-test.js | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/test/unit/general/contextBrokerOAuthSecurityAccess-test.js b/test/unit/general/contextBrokerOAuthSecurityAccess-test.js index e3b142b45..2a4b7ccf1 100644 --- a/test/unit/general/contextBrokerOAuthSecurityAccess-test.js +++ b/test/unit/general/contextBrokerOAuthSecurityAccess-test.js @@ -455,15 +455,6 @@ describe('Secured access to the Context Broker with OAuth2 provider (FIWARE Keyr 'fiware-servicepath': '/testingPath' } }, - groupCreation = { - url: 'http://localhost:4041/iot/cgroups', - method: 'POST', - json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), - headers: { - 'fiware-service': 'TestService', - 'fiware-servicepath': '/testingPath' - } - }; var values = [ { @@ -658,16 +649,7 @@ describe('Secured access to the Context Broker with OAuth2 provider (FIWARE Keyr 'fiware-servicepath': '/testingPath' } }, - groupCreation = { - url: 'http://localhost:4041/iot/cgroups', - method: 'POST', - json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), - headers: { - 'fiware-service': 'TestService', - 'fiware-servicepath': '/testingPath' - } - }; - + var values = [ { name: 'status', From 60b07ce5febf924e8bbf9095f2bcec2618bcc431 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 14:59:48 +0530 Subject: [PATCH 37/46] Update mongodb-group-registry-test.js --- test/unit/mongodb/mongodb-group-registry-test.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/test/unit/mongodb/mongodb-group-registry-test.js b/test/unit/mongodb/mongodb-group-registry-test.js index 11498baf3..cb0d00e11 100644 --- a/test/unit/mongodb/mongodb-group-registry-test.js +++ b/test/unit/mongodb/mongodb-group-registry-test.js @@ -472,21 +472,8 @@ describe('MongoDB Group Registry test', function() { 'fiware-service': 'TestService', 'fiware-servicepath': '/*' } - }, - optionsConstrained = { - url: 'http://localhost:4041/iot/cgroups', - method: 'GET', - qs: { - limit: 3, - offset: 2 - }, - json: {}, - headers: { - 'fiware-service': 'TestService', - 'fiware-servicepath': '/*' - } }; - + beforeEach(function(done) { var optionsCreationList = [], creationFns = []; From 5a6d0d59ee53020ccd6af597a5eeb4fe858db789 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 15:02:14 +0530 Subject: [PATCH 38/46] Update contextBrokerOAuthSecurityAccess-test.js --- .../contextBrokerOAuthSecurityAccess-test.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js b/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js index 0678c601e..4623007ed 100644 --- a/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js +++ b/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js @@ -445,15 +445,6 @@ describe('Secured access to the Context Broker with OAuth2 provider (FIWARE Keyr 'fiware-service': 'TestService', 'fiware-servicepath': '/testingPath' } - }, - groupCreation = { - url: 'http://localhost:4041/iot/cgroups', - method: 'POST', - json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), - headers: { - 'fiware-service': 'TestService', - 'fiware-servicepath': '/testingPath' - } }; var values = [ @@ -651,15 +642,6 @@ describe('Secured access to the Context Broker with OAuth2 provider (FIWARE Keyr 'fiware-service': 'TestService', 'fiware-servicepath': '/testingPath' } - }, - groupCreation = { - url: 'http://localhost:4041/iot/cgroups', - method: 'POST', - json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), - headers: { - 'fiware-service': 'TestService', - 'fiware-servicepath': '/testingPath' - } }; var values = [ From de2df5ed1a7281ee8f09e0df91c52278f899d373 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 15:05:15 +0530 Subject: [PATCH 39/46] Update bidirectional-plugin_test.js --- .../plugins/bidirectional-plugin_test.js | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/test/unit/ngsiv2/plugins/bidirectional-plugin_test.js b/test/unit/ngsiv2/plugins/bidirectional-plugin_test.js index 05f251bbe..a09bd3011 100644 --- a/test/unit/ngsiv2/plugins/bidirectional-plugin_test.js +++ b/test/unit/ngsiv2/plugins/bidirectional-plugin_test.js @@ -353,16 +353,6 @@ describe('Bidirectional data plugin', function() { 'fiware-servicepath': '/gardens' } }, - provisionGroup = { - url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/cgroups', - method: 'POST', - json: - utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/bidirectionalGroup.json'), - headers: { - 'fiware-service': 'smartGondor', - 'fiware-servicepath': '/gardens' - } - }, provisionDevice = { url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/devices', method: 'POST', @@ -437,16 +427,6 @@ describe('Bidirectional data plugin', function() { 'fiware-servicepath': '/gardens' } }, - provisionGroup = { - url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/cgroups', - method: 'POST', - json: - utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/bidirectionalGroup.json'), - headers: { - 'fiware-service': 'smartGondor', - 'fiware-servicepath': '/gardens' - } - }, notificationOptions = { url: 'http://localhost:' + iotAgentConfig.server.port + '/notify', method: 'POST', From 17f76538ee6d1762f9a6e52843568346cb609986 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 15:07:16 +0530 Subject: [PATCH 40/46] Update singleConfigurationMode-test.js --- .../singleConfigurationMode-test.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/test/unit/ngsiv2/provisioning/singleConfigurationMode-test.js b/test/unit/ngsiv2/provisioning/singleConfigurationMode-test.js index c023dd510..efbffdb68 100644 --- a/test/unit/ngsiv2/provisioning/singleConfigurationMode-test.js +++ b/test/unit/ngsiv2/provisioning/singleConfigurationMode-test.js @@ -105,15 +105,6 @@ describe('Provisioning API: Single service mode', function() { 'fiware-service': 'TestService', 'fiware-servicepath': '/testingPath' } - }, - groupCreationDuplicated = { - url: 'http://localhost:4041/iot/cgroups', - method: 'POST', - json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionDuplicateGroup.json'), - headers: { - 'fiware-service': 'TestService', - 'fiware-servicepath': '/testingPath' - } }; @@ -195,15 +186,6 @@ describe('Provisioning API: Single service mode', function() { 'fiware-service': 'AlternateService', 'fiware-servicepath': '/testingPath' } - }, - alternativeGroupCreation = { - url: 'http://localhost:4041/iot/cgroups', - method: 'POST', - json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), - headers: { - 'fiware-service': 'AlternateService', - 'fiware-servicepath': '/testingPath' - } }; beforeEach(function(done) { From 5dbddebe4bb9896aea34cbcb74718bd32a6cf628 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 15:09:46 +0530 Subject: [PATCH 41/46] Update bidirectional-plugin_test.js --- .../unit/plugins/bidirectional-plugin_test.js | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/test/unit/plugins/bidirectional-plugin_test.js b/test/unit/plugins/bidirectional-plugin_test.js index 942d92624..ac6a8fe60 100644 --- a/test/unit/plugins/bidirectional-plugin_test.js +++ b/test/unit/plugins/bidirectional-plugin_test.js @@ -290,16 +290,6 @@ describe('Bidirectional data plugin', function() { 'fiware-servicepath': '/gardens' } }, - provisionGroup = { - url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/cgroups', - method: 'POST', - json: - utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/bidirectionalGroup.json'), - headers: { - 'fiware-service': 'smartGondor', - 'fiware-servicepath': '/gardens' - } - }, provisionDevice = { url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/devices', method: 'POST', @@ -351,16 +341,6 @@ describe('Bidirectional data plugin', function() { 'fiware-servicepath': '/gardens' } }, - provisionGroup = { - url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/cgroups', - method: 'POST', - json: - utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/bidirectionalGroup.json'), - headers: { - 'fiware-service': 'smartGondor', - 'fiware-servicepath': '/gardens' - } - }, notificationOptions = { url: 'http://localhost:' + iotAgentConfig.server.port + '/notify', method: 'POST', From 0ab3ffa06e555a2fae95c5b9e3195cde3711a479 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 15:12:33 +0530 Subject: [PATCH 42/46] Update device-group-api-test.js --- test/unit/provisioning/device-group-api-test.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/test/unit/provisioning/device-group-api-test.js b/test/unit/provisioning/device-group-api-test.js index 78b33d257..82e4b2c22 100644 --- a/test/unit/provisioning/device-group-api-test.js +++ b/test/unit/provisioning/device-group-api-test.js @@ -979,19 +979,6 @@ describe('Device Group Configuration API', function() { 'fiware-service': 'TestService', 'fiware-servicepath': '/*' } - }, - optConstrainedList = { - url: 'http://localhost:4041/iot/cgroups', - method: 'GET', - qs: { - limit: 3, - offset: 2 - }, - json: {}, - headers: { - 'fiware-service': 'TestService', - 'fiware-servicepath': '/*' - } }; From afa2b09ec8391e812ae19c98b2d1d81f008571fd Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 15:14:08 +0530 Subject: [PATCH 43/46] Update singleConfigurationMode-test.js --- .../singleConfigurationMode-test.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/test/unit/provisioning/singleConfigurationMode-test.js b/test/unit/provisioning/singleConfigurationMode-test.js index 08c9b7264..77c2fa3ca 100644 --- a/test/unit/provisioning/singleConfigurationMode-test.js +++ b/test/unit/provisioning/singleConfigurationMode-test.js @@ -101,15 +101,6 @@ describe('Provisioning API: Single service mode', function() { 'fiware-service': 'TestService', 'fiware-servicepath': '/testingPath' } - }, - groupCreationDuplicated = { - url: 'http://localhost:4041/iot/cgroups', - method: 'POST', - json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionDuplicateGroup.json'), - headers: { - 'fiware-service': 'TestService', - 'fiware-servicepath': '/testingPath' - } }; beforeEach(function(done) { @@ -189,15 +180,6 @@ describe('Provisioning API: Single service mode', function() { 'fiware-service': 'AlternateService', 'fiware-servicepath': '/testingPath' } - }, - alternativeGroupCreation = { - url: 'http://localhost:4041/iot/cgroups', - method: 'POST', - json: utils.readExampleFile('./test/unit/examples/groupProvisioningRequests/provisionFullGroup.json'), - headers: { - 'fiware-service': 'AlternateService', - 'fiware-servicepath': '/testingPath' - } }; beforeEach(function(done) { From fd72b229db5cbf7bd37cdea19ef9243ebf733026 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Wed, 17 Apr 2019 15:22:56 +0530 Subject: [PATCH 44/46] Update contextBrokerOAuthSecurityAccess-test.js --- test/unit/general/contextBrokerOAuthSecurityAccess-test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/general/contextBrokerOAuthSecurityAccess-test.js b/test/unit/general/contextBrokerOAuthSecurityAccess-test.js index 2a4b7ccf1..598a8b09e 100644 --- a/test/unit/general/contextBrokerOAuthSecurityAccess-test.js +++ b/test/unit/general/contextBrokerOAuthSecurityAccess-test.js @@ -454,7 +454,7 @@ describe('Secured access to the Context Broker with OAuth2 provider (FIWARE Keyr 'fiware-service': 'TestService', 'fiware-servicepath': '/testingPath' } - }, + }; var values = [ { @@ -648,7 +648,7 @@ describe('Secured access to the Context Broker with OAuth2 provider (FIWARE Keyr 'fiware-service': 'TestService', 'fiware-servicepath': '/testingPath' } - }, + }; var values = [ { From d4c83de7837a8fb77d77ba1f8f838b4a9898b98c Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Mon, 22 Apr 2019 11:44:45 +0530 Subject: [PATCH 45/46] Update iotam-autoregistration-test.js --- .../general/iotam-autoregistration-test.js | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/test/unit/general/iotam-autoregistration-test.js b/test/unit/general/iotam-autoregistration-test.js index e32e41acb..33fbb6926 100644 --- a/test/unit/general/iotam-autoregistration-test.js +++ b/test/unit/general/iotam-autoregistration-test.js @@ -134,7 +134,7 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': 'theSubService' } }, - optionsCreation = { + optionsCreationcgroups = { url: 'http://localhost:4041/iot/cgroups', method: 'POST', json: { @@ -209,7 +209,7 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), 'fiware-servicepath': 'theSubService' } }, - optionsCreationStatic = { + optionsCreationStaticcgroups = { url: 'http://localhost:4041/iot/cgroups', method: 'POST', json: { @@ -260,7 +260,7 @@ var iotAgentLib = require('../../../lib/fiware-iotagent-lib'), apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732' } }, - optionsDelete = { + optionsDeletecgroups = { url: 'http://localhost:4041/iot/cgroups', method: 'DELETE', json: {}, @@ -388,6 +388,14 @@ describe('IoT Manager autoregistration', function() { done(); }); }); + + t('should update the registration in the IoT Manager', function(done) { + request(optionsCreationcgroups, function(error, result, body) { + should.not.exist(error); + iotamMock.done(); + done(); + }); + }); }); describe('When a service is removed from the IoT Agent', function() { @@ -424,6 +432,14 @@ describe('IoT Manager autoregistration', function() { done(); }); }); + + it('should update the registration in the IoT Manager', function(done) { + request(optionsDeletecgroups, function(error, result, body) { + should.not.exist(error); + iotamMock.done(); + done(); + }); + }); }); describe('When a new service with static attributes is created in the IoT Agent', function() { @@ -460,5 +476,13 @@ describe('IoT Manager autoregistration', function() { done(); }); }); + + it('should update the registration in the IoT Manager', function(done) { + request(optionsCreationStaticcgroups, function(error, result, body) { + should.not.exist(error); + iotamMock.done(); + done(); + }); + }); }); }); From cbd26c6047994ddec5b16c114d105003273b9dc7 Mon Sep 17 00:00:00 2001 From: Jagatjot Singh Date: Mon, 22 Apr 2019 11:49:18 +0530 Subject: [PATCH 46/46] Update iotam-autoregistration-test.js --- test/unit/general/iotam-autoregistration-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/general/iotam-autoregistration-test.js b/test/unit/general/iotam-autoregistration-test.js index 33fbb6926..2a6c385d7 100644 --- a/test/unit/general/iotam-autoregistration-test.js +++ b/test/unit/general/iotam-autoregistration-test.js @@ -389,7 +389,7 @@ describe('IoT Manager autoregistration', function() { }); }); - t('should update the registration in the IoT Manager', function(done) { + it('should update the registration in the IoT Manager', function(done) { request(optionsCreationcgroups, function(error, result, body) { should.not.exist(error); iotamMock.done();