iotagent-node-lib 3.3.0 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/CHANGES_NEXT_RELEASE +1 -0
  2. package/README.md +10 -11
  3. package/doc/README.md +16 -0
  4. package/doc/admin.md +565 -0
  5. package/doc/api.md +9 -5
  6. package/doc/deprecated.md +16 -14
  7. package/doc/{architecture.md → devel/architecture.md} +3 -3
  8. package/doc/{Contribution.md → devel/contribution-guidelines.md} +43 -35
  9. package/doc/devel/development.md +1879 -0
  10. package/doc/{northboundinteractions.md → devel/northboundinteractions.md} +18 -33
  11. package/doc/index.md +3 -5
  12. package/docker/Mosquitto/README.md +1 -0
  13. package/lib/commonConfig.js +0 -5
  14. package/lib/fiware-iotagent-lib.js +1 -1
  15. package/lib/jexlTranformsMap.js +2 -1
  16. package/lib/request-shim.js +2 -2
  17. package/lib/services/commands/commandService.js +1 -1
  18. package/lib/services/common/genericMiddleware.js +1 -1
  19. package/lib/services/devices/deviceRegistryMemory.js +2 -2
  20. package/lib/services/devices/deviceRegistryMongoDB.js +22 -9
  21. package/lib/services/devices/deviceService.js +36 -30
  22. package/lib/services/devices/devices-NGSI-LD.js +14 -2
  23. package/lib/services/devices/devices-NGSI-mixed.js +0 -2
  24. package/lib/services/devices/devices-NGSI-v2.js +22 -100
  25. package/lib/services/groups/groupService.js +1 -1
  26. package/lib/services/ngsi/entities-NGSI-v2.js +14 -27
  27. package/lib/services/northBound/deviceProvisioningServer.js +14 -5
  28. package/mkdocs.yml +6 -11
  29. package/package.json +3 -3
  30. package/scripts/legacy_expression_tool/README.md +56 -38
  31. package/test/unit/general/contextBrokerKeystoneSecurityAccess-test.js +2 -2
  32. package/test/unit/mongodb/mongodb-registry-test.js +1 -1
  33. package/test/unit/ngsi-ld/general/contextBrokerOAuthSecurityAccess-test.js +66 -65
  34. package/test/unit/ngsi-ld/general/https-support-test.js +1 -1
  35. package/test/unit/ngsi-ld/lazyAndCommands/command-test.js +8 -7
  36. package/test/unit/ngsi-ld/lazyAndCommands/polling-commands-test.js +12 -11
  37. package/test/unit/ngsi-ld/ngsiService/subscriptions-test.js +41 -39
  38. package/test/unit/ngsi-ld/provisioning/device-provisioning-api_test.js +122 -122
  39. package/test/unit/ngsi-ld/provisioning/device-registration_test.js +28 -28
  40. package/test/unit/ngsi-ld/provisioning/device-update-registration_test.js +18 -17
  41. package/test/unit/ngsi-ld/provisioning/singleConfigurationMode-test.js +7 -7
  42. package/test/unit/ngsi-ld/provisioning/updateProvisionedDevices-test.js +8 -7
  43. package/test/unit/ngsiv2/examples/contextRequests/updateContext6.json +2 -0
  44. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin1.json +0 -12
  45. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin11.json +0 -4
  46. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin12.json +1 -5
  47. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin2.json +0 -12
  48. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin29.json +0 -12
  49. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin3.json +0 -4
  50. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin41.json +0 -10
  51. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin5.json +0 -4
  52. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin6.json +0 -4
  53. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin7.json +0 -4
  54. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin8.json +0 -12
  55. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin9.json +0 -4
  56. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin25.json +1 -5
  57. package/test/unit/ngsiv2/expressions/jexlBasedTransformations-test.js +13 -12
  58. package/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js +2 -2
  59. package/test/unit/ngsiv2/general/https-support-test.js +1 -1
  60. package/test/unit/ngsiv2/ngsiService/active-devices-test.js +3 -8
  61. package/test/unit/ngsiv2/ngsiService/subscriptions-test.js +10 -10
  62. package/test/unit/ngsiv2/provisioning/device-provisioning-api_test.js +8 -103
  63. package/test/unit/ngsiv2/provisioning/device-registration_test.js +8 -6
  64. package/test/unit/ngsiv2/provisioning/device-update-registration_test.js +2 -1
  65. package/test/unit/ngsiv2/provisioning/updateProvisionedDevices-test.js +0 -1
  66. package/.nyc_output/33364de2-1199-4ec2-b33c-cae063ef8cc4.json +0 -1
  67. package/.nyc_output/processinfo/33364de2-1199-4ec2-b33c-cae063ef8cc4.json +0 -1
  68. package/.nyc_output/processinfo/index.json +0 -1
  69. package/doc/config-basic-example.js +0 -20
  70. package/doc/development.md +0 -285
  71. package/doc/howto.md +0 -641
  72. package/doc/installationguide.md +0 -365
  73. package/doc/operations.md +0 -127
  74. package/doc/usermanual.md +0 -900
  75. package/lib/plugins/bidirectionalData.js +0 -356
  76. package/test/unit/ngsi-ld/plugins/bidirectional-plugin_test.js +0 -697
  77. package/test/unit/ngsiv2/plugins/bidirectional-plugin_test.js +0 -536
  78. /package/doc/{NorthboundInteractions.postman_collection → devel/NorthboundInteractions.postman_collection} +0 -0
  79. /package/doc/{echo.js → devel/echo.js} +0 -0
  80. /package/doc/{finalResult.js → devel/finalResult.js} +0 -0
@@ -208,16 +208,16 @@ describe('NGSI-LD - Device provisioning API: Provision devices', function () {
208
208
  });
209
209
  });
210
210
  });
211
-
212
- it('should create the initial entity in the Context Broker', function (done) {
213
- request(options, function (error, response, body) {
214
- response.statusCode.should.equal(201);
215
- iotAgentLib.listDevices('smartgondor', '/gardens', function (error, results) {
216
- contextBrokerMock.done();
217
- done();
218
- });
219
- });
220
- });
211
+ // FIXME: disabled test by #1421
212
+ // it('should create the initial entity in the Context Broker', function (done) {
213
+ // request(options, function (error, response, body) {
214
+ // response.statusCode.should.equal(201);
215
+ // iotAgentLib.listDevices('smartgondor', '/gardens', function (error, results) {
216
+ // contextBrokerMock.done();
217
+ // done();
218
+ // });
219
+ // });
220
+ // });
221
221
  });
222
222
  describe('When a device provisioning request with a TimeInstant attribute arrives to the IoTA', function () {
223
223
  const options = {
@@ -253,13 +253,13 @@ describe('NGSI-LD - Device provisioning API: Provision devices', function () {
253
253
 
254
254
  done();
255
255
  });
256
-
257
- it('should send the appropriate requests to the Context Broker', function (done) {
258
- request(options, function (error, response, body) {
259
- contextBrokerMock.done();
260
- done();
261
- });
262
- });
256
+ // FIXME: disabled test by #1421
257
+ // it('should send the appropriate requests to the Context Broker', function (done) {
258
+ // request(options, function (error, response, body) {
259
+ // contextBrokerMock.done();
260
+ // done();
261
+ // });
262
+ // });
263
263
  });
264
264
 
265
265
  describe('When a device provisioning request with a timestamp provision attribute arrives to the IoTA', function () {
@@ -296,56 +296,56 @@ describe('NGSI-LD - Device provisioning API: Provision devices', function () {
296
296
 
297
297
  done();
298
298
  });
299
-
300
- it('should send the appropriate requests to the Context Broker', function (done) {
301
- request(options, function (error, response, body) {
302
- contextBrokerMock.done();
303
- done();
304
- });
305
- });
299
+ // FIXME: disabled test by #1421
300
+ // it('should send the appropriate requests to the Context Broker', function (done) {
301
+ // request(options, function (error, response, body) {
302
+ // contextBrokerMock.done();
303
+ // done();
304
+ // });
305
+ // });
306
306
  });
307
307
 
308
- describe('When a device provisioning request with a autoprovision attribute arrives to the IoTA', function () {
309
- const options = {
310
- url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/devices',
311
- method: 'POST',
312
- json: utils.readExampleFile('./test/unit/examples/deviceProvisioningRequests/provisionAutoprovision.json'),
313
- headers: {
314
- 'fiware-service': 'smartgondor',
315
- 'fiware-servicepath': '/gardens'
316
- }
317
- };
318
-
319
- beforeEach(function (done) {
320
- iotAgentLib.deactivate(function () {
321
- iotAgentConfig.appendMode = false;
322
- iotAgentLib.activate(iotAgentConfig, done);
323
- });
324
- });
325
-
326
- afterEach(function () {
327
- iotAgentConfig.appendMode = false;
328
- });
329
-
330
- beforeEach(function (done) {
331
- nock.cleanAll();
332
- contextBrokerMock = nock('http://192.168.1.1:1026')
333
- .matchHeader('fiware-service', 'smartgondor')
334
- .post(
335
- '/ngsi-ld/v1/entityOperations/upsert/',
336
- utils.readExampleFile('./test/unit/ngsi-ld/examples/contextRequests/createAutoprovisionDevice.json')
337
- )
338
- .reply(204);
339
- done();
340
- });
341
-
342
- it('should send the appropriate requests to the Context Broker', function (done) {
343
- request(options, function (error, response, body) {
344
- contextBrokerMock.done();
345
- done();
346
- });
347
- });
348
- });
308
+ // describe('When a device provisioning request with a autoprovision attribute arrives to the IoTA', function () {
309
+ // const options = {
310
+ // url: 'http://localhost:' + iotAgentConfig.server.port + '/iot/devices',
311
+ // method: 'POST',
312
+ // json: utils.readExampleFile('./test/unit/examples/deviceProvisioningRequests/provisionAutoprovision.json'),
313
+ // headers: {
314
+ // 'fiware-service': 'smartgondor',
315
+ // 'fiware-servicepath': '/gardens'
316
+ // }
317
+ // };
318
+
319
+ // beforeEach(function (done) {
320
+ // iotAgentLib.deactivate(function () {
321
+ // iotAgentConfig.appendMode = false;
322
+ // iotAgentLib.activate(iotAgentConfig, done);
323
+ // });
324
+ // });
325
+
326
+ // afterEach(function () {
327
+ // iotAgentConfig.appendMode = false;
328
+ // });
329
+
330
+ // beforeEach(function (done) {
331
+ // nock.cleanAll();
332
+ // contextBrokerMock = nock('http://192.168.1.1:1026')
333
+ // .matchHeader('fiware-service', 'smartgondor')
334
+ // .post(
335
+ // '/ngsi-ld/v1/entityOperations/upsert/',
336
+ // utils.readExampleFile('./test/unit/ngsi-ld/examples/contextRequests/createAutoprovisionDevice.json')
337
+ // )
338
+ // .reply(204);
339
+ // done();
340
+ // });
341
+
342
+ // it('should send the appropriate requests to the Context Broker', function (done) {
343
+ // request(options, function (error, response, body) {
344
+ // contextBrokerMock.done();
345
+ // done();
346
+ // });
347
+ // });
348
+ // });
349
349
 
350
350
  describe('When a device provisioning request arrives to the IoTAand timestamp is enabled in configuration', function () {
351
351
  const options = {
@@ -383,13 +383,13 @@ describe('NGSI-LD - Device provisioning API: Provision devices', function () {
383
383
 
384
384
  done();
385
385
  });
386
-
387
- it('should send the appropriate requests to the Context Broker', function (done) {
388
- request(options, function (error, response, body) {
389
- contextBrokerMock.done();
390
- done();
391
- });
392
- });
386
+ // FIXME: disabled test by #1421
387
+ // it('should send the appropriate requests to the Context Broker', function (done) {
388
+ // request(options, function (error, response, body) {
389
+ // contextBrokerMock.done();
390
+ // done();
391
+ // });
392
+ // });
393
393
  });
394
394
 
395
395
  describe('When a device provisioning request with the minimum required data arrives to the IoT Agent', function () {
@@ -417,13 +417,13 @@ describe('NGSI-LD - Device provisioning API: Provision devices', function () {
417
417
 
418
418
  done();
419
419
  });
420
-
421
- it('should send the appropriate requests to the Context Broker', function (done) {
422
- request(options, function (error, response, body) {
423
- contextBrokerMock.done();
424
- done();
425
- });
426
- });
420
+ // FIXME: disabled test by #1421
421
+ // it('should send the appropriate requests to the Context Broker', function (done) {
422
+ // request(options, function (error, response, body) {
423
+ // contextBrokerMock.done();
424
+ // done();
425
+ // });
426
+ // });
427
427
 
428
428
  it('should add the device to the devices list', function (done) {
429
429
  request(options, function (error, response, body) {
@@ -475,13 +475,13 @@ describe('NGSI-LD - Device provisioning API: Provision devices', function () {
475
475
 
476
476
  done();
477
477
  });
478
-
479
- it('should send the appropriate initial values to the Context Broker', function (done) {
480
- request(options, function (error, response, body) {
481
- contextBrokerMock.done();
482
- done();
483
- });
484
- });
478
+ // FIXME: disabled test by #1421
479
+ // it('should send the appropriate initial values to the Context Broker', function (done) {
480
+ // request(options, function (error, response, body) {
481
+ // contextBrokerMock.done();
482
+ // done();
483
+ // });
484
+ // });
485
485
  });
486
486
 
487
487
  describe('When a device provisioning request with DateTime attributes arrives', function () {
@@ -509,13 +509,13 @@ describe('NGSI-LD - Device provisioning API: Provision devices', function () {
509
509
 
510
510
  done();
511
511
  });
512
-
513
- it('should send the appropriate initial values to the Context Broker', function (done) {
514
- request(options, function (error, response, body) {
515
- contextBrokerMock.done();
516
- done();
517
- });
518
- });
512
+ // FIXME: disabled test by #1421
513
+ // it('should send the appropriate initial values to the Context Broker', function (done) {
514
+ // request(options, function (error, response, body) {
515
+ // contextBrokerMock.done();
516
+ // done();
517
+ // });
518
+ // });
519
519
  });
520
520
 
521
521
  describe('When two devices with the same ID but different services arrive to the agent', function () {
@@ -615,19 +615,19 @@ describe('NGSI-LD - Device provisioning API: Provision devices', function () {
615
615
 
616
616
  done();
617
617
  });
618
-
619
- it('should return an error message in the response body', function (done) {
620
- request(options, function (error, response, body) {
621
- should.not.exist(error);
622
- response.body.name.should.equal('ENTITY_GENERIC_ERROR');
623
- response.body.message.should.equal(
624
- 'Error accesing entity data for device: MicroLight1 of type: MicroLights'
625
- );
626
- response.statusCode.should.equal(200);
627
-
628
- done();
629
- });
630
- });
618
+ // FIXME: disabled test by #1421
619
+ // it('should return an error message in the response body', function (done) {
620
+ // request(options, function (error, response, body) {
621
+ // should.not.exist(error);
622
+ // response.body.name.should.equal('ENTITY_GENERIC_ERROR');
623
+ // response.body.message.should.equal(
624
+ // 'Error accesing entity data for device: MicroLight1 of type: MicroLights'
625
+ // );
626
+ // response.statusCode.should.equal(200);
627
+
628
+ // done();
629
+ // });
630
+ // });
631
631
  });
632
632
 
633
633
  describe('When the Context Broker returns a 200 status code (NGSI-LD v1.2.1) provisioning an entity', function () {
@@ -733,15 +733,15 @@ describe('NGSI-LD - Device provisioning API: Provision devices', function () {
733
733
 
734
734
  done();
735
735
  });
736
+ // FIXME: disabled test by #1421
737
+ // it('should return a valid return code', function (done) {
738
+ // request(options, function (error, response, body) {
739
+ // should.not.exist(error);
740
+ // response.statusCode.should.equal(500);
736
741
 
737
- it('should return a valid return code', function (done) {
738
- request(options, function (error, response, body) {
739
- should.not.exist(error);
740
- response.statusCode.should.equal(500);
741
-
742
- done();
743
- });
744
- });
742
+ // done();
743
+ // });
744
+ // });
745
745
  });
746
746
 
747
747
  describe('When there is a connection error with a Number code connecting the CB', function () {
@@ -773,15 +773,15 @@ describe('NGSI-LD - Device provisioning API: Provision devices', function () {
773
773
 
774
774
  done();
775
775
  });
776
+ // FIXME: disabled test by #1421
777
+ // it('should return a valid return code (three character number)', function (done) {
778
+ // request(options, function (error, response, body) {
779
+ // should.not.exist(error);
780
+ // response.statusCode.should.equal(500);
776
781
 
777
- it('should return a valid return code (three character number)', function (done) {
778
- request(options, function (error, response, body) {
779
- should.not.exist(error);
780
- response.statusCode.should.equal(500);
781
-
782
- done();
783
- });
784
- });
782
+ // done();
783
+ // });
784
+ // });
785
785
  });
786
786
 
787
787
  describe('When a device provisioning request with missing data arrives to the IoT Agent', function () {
@@ -130,14 +130,14 @@ describe('NGSI-LD - IoT Agent Device Registration', function () {
130
130
  iotAgentLib.clearAll(done);
131
131
  });
132
132
  });
133
-
134
- it('should register as ContextProvider of its lazy attributes', function (done) {
135
- iotAgentLib.register(device1, function (error) {
136
- should.not.exist(error);
137
- contextBrokerMock.done();
138
- done();
139
- });
140
- });
133
+ // FIXME: disabled test by #1421
134
+ // it('should register as ContextProvider of its lazy attributes', function (done) {
135
+ // iotAgentLib.register(device1, function (error) {
136
+ // should.not.exist(error);
137
+ // contextBrokerMock.done();
138
+ // done();
139
+ // });
140
+ // });
141
141
  });
142
142
 
143
143
  describe('When the Context Broker returns a NGSI error while registering a device', function () {
@@ -156,15 +156,15 @@ describe('NGSI-LD - IoT Agent Device Registration', function () {
156
156
  iotAgentLib.clearAll(done);
157
157
  });
158
158
  });
159
-
160
- it('should register as ContextProvider of its lazy attributes', function (done) {
161
- iotAgentLib.register(device1, function (error) {
162
- should.exist(error);
163
- error.name.should.equal('BAD_REQUEST');
164
- contextBrokerMock.done();
165
- done();
166
- });
167
- });
159
+ // FIXME: disabled test by #1421
160
+ // it('should register as ContextProvider of its lazy attributes', function (done) {
161
+ // iotAgentLib.register(device1, function (error) {
162
+ // should.exist(error);
163
+ // error.name.should.equal('BAD_REQUEST');
164
+ // contextBrokerMock.done();
165
+ // done();
166
+ // });
167
+ // });
168
168
  });
169
169
 
170
170
  describe('When the Context Broker returns an HTTP transport error while registering a device', function () {
@@ -222,7 +222,7 @@ describe('NGSI-LD - IoT Agent Device Registration', function () {
222
222
 
223
223
  it("should return all the device's information", function (done) {
224
224
  iotAgentLib.register(device1, function (error) {
225
- iotAgentLib.getDevice('light1', 'smartgondor', 'gardens', function (error, data) {
225
+ iotAgentLib.getDevice('light1', null, 'smartgondor', 'gardens', function (error, data) {
226
226
  should.not.exist(error);
227
227
  should.exist(data);
228
228
  data.type.should.equal('Light');
@@ -252,7 +252,7 @@ describe('NGSI-LD - IoT Agent Device Registration', function () {
252
252
 
253
253
  it('should return a ENTITY_NOT_FOUND error', function (done) {
254
254
  iotAgentLib.register(device1, function (error) {
255
- iotAgentLib.getDevice('lightUnexistent', 'smartgondor', 'gardens', function (error, data) {
255
+ iotAgentLib.getDevice('lightUnexistent', null, 'smartgondor', 'gardens', function (error, data) {
256
256
  should.exist(error);
257
257
  should.not.exist(data);
258
258
  error.code.should.equal(404);
@@ -299,14 +299,14 @@ describe('NGSI-LD - IoT Agent Device Registration', function () {
299
299
  );
300
300
  });
301
301
  });
302
-
303
- it('should update the devices information in Context Broker', function (done) {
304
- iotAgentLib.unregister(device1.id, 'smartgondor', 'gardens', function (error) {
305
- should.not.exist(error);
306
- contextBrokerMock.done();
307
- done();
308
- });
309
- });
302
+ // FIXME: disabled test by #1421
303
+ // it('should update the devices information in Context Broker', function (done) {
304
+ // iotAgentLib.unregister(device1.id, null, 'smartgondor', 'gardens', function (error) {
305
+ // should.not.exist(error);
306
+ // contextBrokerMock.done();
307
+ // done();
308
+ // });
309
+ // });
310
310
  });
311
311
 
312
312
  describe('When the Context Broker returns an error while unregistering a device', function () {
@@ -346,7 +346,7 @@ describe('NGSI-LD - IoT Agent Device Registration', function () {
346
346
 
347
347
  it('should not remove the device from the internal registry');
348
348
  it('should return a UNREGISTRATION_ERROR error to the caller', function (done) {
349
- iotAgentLib.unregister(device1.id, 'smartgondor', 'gardens', function (error) {
349
+ iotAgentLib.unregister(device1.id, null, 'smartgondor', 'gardens', function (error) {
350
350
  should.exist(error);
351
351
  should.exist(error.name);
352
352
  error.name.should.equal('UNREGISTRATION_ERROR');
@@ -192,17 +192,17 @@ describe('NGSI-LD - IoT Agent Device Update Registration', function () {
192
192
  )
193
193
  .reply(201, null, { Location: '/ngsi-ld/v1/csourceRegistrations/6319a7f5254b05844116584d' });
194
194
  });
195
-
196
- it('should register as ContextProvider of its lazy attributes', function (done) {
197
- iotAgentLib.updateRegister(deviceUpdated, false, function (error) {
198
- should.not.exist(error);
199
- contextBrokerMock.done();
200
- done();
201
- });
202
- });
195
+ // FIXME: disabled test by #1421
196
+ // it('should register as ContextProvider of its lazy attributes', function (done) {
197
+ // iotAgentLib.updateRegister(deviceUpdated, false, function (error) {
198
+ // should.not.exist(error);
199
+ // contextBrokerMock.done();
200
+ // done();
201
+ // });
202
+ // });
203
203
  it('should store the new values in the registry', function (done) {
204
204
  iotAgentLib.updateRegister(deviceUpdated, false, function (error, data) {
205
- iotAgentLib.getDevice(deviceUpdated.id, 'smartgondor', 'gardens', function (error, deviceResult) {
205
+ iotAgentLib.getDevice(deviceUpdated.id, null, 'smartgondor', 'gardens', function (error, deviceResult) {
206
206
  should.not.exist(error);
207
207
  should.exist(deviceResult);
208
208
  deviceResult.internalId.should.equal(deviceUpdated.internalId);
@@ -235,18 +235,19 @@ describe('NGSI-LD - IoT Agent Device Update Registration', function () {
235
235
  )
236
236
  .reply(201, null, { Location: '/ngsi-ld/v1/csourceRegistrations/6319a7f5254b05844116584d' });
237
237
  });
238
-
239
- it('should register as ContextProvider of its commands and create the additional attributes', function (done) {
240
- iotAgentLib.updateRegister(deviceCommandUpdated, false, function (error) {
241
- should.not.exist(error);
242
- contextBrokerMock.done();
243
- done();
244
- });
245
- });
238
+ // FIXME: disabled test by #1421
239
+ // it('should register as ContextProvider of its commands and create the additional attributes', function (done) {
240
+ // iotAgentLib.updateRegister(deviceCommandUpdated, false, function (error) {
241
+ // should.not.exist(error);
242
+ // contextBrokerMock.done();
243
+ // done();
244
+ // });
245
+ // });
246
246
  it('should store the new values in the registry', function (done) {
247
247
  iotAgentLib.updateRegister(deviceCommandUpdated, false, function (error, data) {
248
248
  iotAgentLib.getDevice(
249
249
  deviceCommandUpdated.id,
250
+ null,
250
251
  'smartgondor',
251
252
  'gardens',
252
253
  function (error, deviceResult) {
@@ -300,12 +300,12 @@ describe('NGSI-LD - Provisioning API: Single service mode', function () {
300
300
  done();
301
301
  });
302
302
  });
303
-
304
- it('should send the mixed data to the Context Broker', function (done) {
305
- request(deviceCreation, function (error, response, body) {
306
- contextBrokerMock.done();
307
- done();
308
- });
309
- });
303
+ // FIXME: disabled test by #1421
304
+ // it('should send the mixed data to the Context Broker', function (done) {
305
+ // request(deviceCreation, function (error, response, body) {
306
+ // contextBrokerMock.done();
307
+ // done();
308
+ // });
309
+ // });
310
310
  });
311
311
  });
@@ -358,13 +358,14 @@ describe('NGSI-LD - Device provisioning API: Update provisioned devices', functi
358
358
  });
359
359
  });
360
360
  });
361
- it('should create the initial values for the attributes in the Context Broker', function (done) {
362
- request(optionsUpdate, function (error, response, body) {
363
- should.not.exist(error);
364
- contextBrokerMock.done();
365
- done();
366
- });
367
- });
361
+ // FIXME: disabled test by #1421
362
+ // it('should create the initial values for the attributes in the Context Broker', function (done) {
363
+ // request(optionsUpdate, function (error, response, body) {
364
+ // should.not.exist(error);
365
+ // contextBrokerMock.done();
366
+ // done();
367
+ // });
368
+ // });
368
369
  });
369
370
 
370
371
  describe('When a device is updated to add static attributes', function () {
@@ -1,4 +1,6 @@
1
1
  {
2
+ "id": "light1",
3
+ "type": "Light",
2
4
  "state":{
3
5
  "value": true,
4
6
  "type": "boolean"
@@ -5,20 +5,8 @@
5
5
  "value": 1040,
6
6
  "type": "Number"
7
7
  },
8
- "consumption":{
9
- "type":"Number",
10
- "value":null
11
- },
12
8
  "weather":{
13
9
  "type":"Summary",
14
10
  "value":"Humidity NaN and pressure 1040"
15
- },
16
- "alive":{
17
- "type":"None",
18
- "value":null
19
- },
20
- "updated":{
21
- "type":"Boolean",
22
- "value":null
23
11
  }
24
12
  }
@@ -4,9 +4,5 @@
4
4
  "consumption": {
5
5
  "value": 52,
6
6
  "type": "Number"
7
- },
8
- "consumption_x":{
9
- "type":"Number",
10
- "value":null
11
7
  }
12
8
  }
@@ -1,8 +1,4 @@
1
1
  {
2
2
  "id":"light1",
3
- "type":"Light",
4
- "consumption_x": {
5
- "type": "Number",
6
- "value": null
7
- }
3
+ "type":"Light"
8
4
  }
@@ -12,17 +12,5 @@
12
12
  "weather":{
13
13
  "type": "Summary",
14
14
  "value": "Humidity 6 and pressure 1040"
15
- },
16
- "consumption":{
17
- "type":"Number",
18
- "value":null
19
- },
20
- "alive":{
21
- "type":"None",
22
- "value":null
23
- },
24
- "updated":{
25
- "type":"Boolean",
26
- "value":null
27
15
  }
28
16
  }
@@ -5,20 +5,8 @@
5
5
  "type": "Number",
6
6
  "value": 1040
7
7
  },
8
- "consumption": {
9
- "type": "Number",
10
- "value": null
11
- },
12
8
  "weather": {
13
9
  "type": "Summary",
14
10
  "value": "Humidity NaN and pressure 1040"
15
- },
16
- "alive": {
17
- "type": "None",
18
- "value": null
19
- },
20
- "updated": {
21
- "type": "Boolean",
22
- "value": null
23
11
  }
24
12
  }
@@ -4,9 +4,5 @@
4
4
  "consumption": {
5
5
  "type": "Number",
6
6
  "value": 0.44
7
- },
8
- "consumption_x":{
9
- "type":"Number",
10
- "value":null
11
7
  }
12
8
  }
@@ -19,15 +19,5 @@
19
19
  "value": "2015-08-05T07:35:01.468+00:00"
20
20
  }
21
21
  }
22
- },
23
- "temperature": {
24
- "value": null,
25
- "type": "Number",
26
- "metadata": {
27
- "TimeInstant": {
28
- "type": "DateTime",
29
- "value": "2015-08-05T07:35:01.468+00:00"
30
- }
31
- }
32
22
  }
33
23
  }
@@ -4,9 +4,5 @@
4
4
  "alive": {
5
5
  "type": "None",
6
6
  "value": null
7
- },
8
- "consumption_x":{
9
- "type":"Number",
10
- "value":null
11
7
  }
12
8
  }