iotagent-node-lib 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.yml +134 -0
- package/.github/ISSUE_TEMPLATE/config.yml +16 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +55 -0
- package/.github/advanced-issue-labeler.yml +30 -0
- package/.github/workflows/issue-labeler.yml +43 -0
- package/doc/api.md +23 -80
- package/doc/deprecated.md +4 -0
- package/doc/howto.md +58 -62
- package/doc/installationguide.md +0 -5
- package/doc/requirements.txt +1 -1
- package/docker/Mosquitto/Dockerfile +1 -1
- package/lib/model/Device.js +0 -1
- package/lib/model/Group.js +0 -1
- package/lib/model/dbConn.js +1 -7
- package/lib/plugins/jexlParser.js +1 -1
- package/lib/services/common/iotManagerService.js +0 -1
- package/lib/services/devices/deviceRegistryMongoDB.js +10 -10
- package/lib/services/devices/deviceService.js +14 -19
- package/lib/services/devices/devices-NGSI-v2.js +2 -5
- package/lib/services/ngsi/entities-NGSI-LD.js +3 -3
- package/lib/services/ngsi/entities-NGSI-v2.js +34 -11
- package/lib/services/northBound/deviceProvisioningServer.js +0 -3
- package/lib/templates/createDevice.json +0 -4
- package/lib/templates/createDeviceLax.json +0 -4
- package/lib/templates/deviceGroup.json +1 -5
- package/lib/templates/updateDevice.json +4 -0
- package/lib/templates/updateDeviceLax.json +11 -0
- package/package.json +1 -1
- package/scripts/legacy_expression_tool/README.md +262 -0
- package/scripts/legacy_expression_tool/legacy_expression_tool.py +423 -0
- package/scripts/legacy_expression_tool/requirements.txt +3 -0
- package/test/unit/examples/deviceProvisioningRequests/provisionMinimumDevice4.json +0 -1
- package/test/unit/general/contextBrokerKeystoneSecurityAccess-test.js +3 -13
- package/test/unit/ngsi-ld/lazyAndCommands/merge-patch-test.js +31 -30
- package/test/unit/ngsi-mixed/provisioning/ngsi-versioning-test.js +33 -37
- package/test/unit/ngsiv2/examples/contextRequests/updateContext.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContext1.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContext3WithStatic.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContext4.json +4 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContext5.json +12 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContext6.json +10 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextAliasPlugin1.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextAliasPlugin2.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextAliasPlugin3.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextAliasPlugin4.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextAliasPlugin5.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextAliasPlugin6.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextAliasPlugin7.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextAliasPlugin8.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextAliasPlugin9.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextAutocast1.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextAutocast2.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextAutocast3.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextAutocast4.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextAutocast5.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextAutocast6.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextAutocast7.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextCommandError.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextCommandExpired.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextCommandFinish.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextCommandStatus.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextCommandStatus2.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextCompressTimestamp1.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextCompressTimestamp2.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin1.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin11.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin12.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin13.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin2.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin29.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin3.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin30.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin31.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin32.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin33.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin34.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin35.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin36.json +1 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin4.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin40.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin41.json +1 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin5.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin6.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin7.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin8.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin9.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionSkip.json +12 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityJexlExpressionPlugin1.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin1.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin10.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin11.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin12.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin13.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin14.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin15.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin16.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin17.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin2.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin25.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin3.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin4.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin5.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin6.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin7.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin8.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin9.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityTimestampPlugin1.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityTimestampPlugin2.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityTimestampPlugin3.json +1 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityTimestampPlugin4.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextProcessTimestamp.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextStaticAttributes.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextStaticAttributesMetadata.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextTimestamp.json +3 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextTimestampFalse.json +12 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextTimestampFalseTimeInstant.json +12 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextTimestampOverride.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextTimestampOverrideWithoutMilis.json +2 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextTimestampTimezone.json +3 -1
- package/test/unit/ngsiv2/expressions/jexlBasedTransformations-test.js +133 -75
- package/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js +18 -51
- package/test/unit/ngsiv2/general/https-support-test.js +1 -5
- package/test/unit/ngsiv2/lazyAndCommands/command-test.js +4 -10
- package/test/unit/ngsiv2/lazyAndCommands/polling-commands-test.js +8 -24
- package/test/unit/ngsiv2/ngsiService/active-devices-test.js +143 -57
- package/test/unit/ngsiv2/ngsiService/autocast-test.js +14 -21
- package/test/unit/ngsiv2/ngsiService/staticAttributes-test.js +3 -5
- package/test/unit/ngsiv2/ngsiService/subscriptions-test.js +1 -10
- package/test/unit/ngsiv2/plugins/alias-plugin_test.js +20 -30
- package/test/unit/ngsiv2/plugins/bidirectional-plugin_test.js +0 -63
- package/test/unit/ngsiv2/plugins/compress-timestamp-plugin_test.js +4 -6
- package/test/unit/ngsiv2/plugins/custom-plugin_test.js +1 -2
- package/test/unit/ngsiv2/plugins/multientity-plugin_test.js +3 -5
- package/test/unit/ngsiv2/plugins/timestamp-processing-plugin_test.js +2 -3
- package/test/unit/ngsiv2/provisioning/device-group-api-test.js +2 -3
- package/test/unit/ngsiv2/provisioning/device-provisioning-api_test.js +5 -53
- package/test/unit/ngsiv2/provisioning/device-registration_test.js +1 -7
- package/test/unit/ngsiv2/provisioning/device-update-registration_test.js +2 -9
- package/test/unit/ngsiv2/provisioning/singleConfigurationMode-test.js +0 -11
- package/test/unit/ngsiv2/provisioning/updateProvisionedDevices-test.js +0 -7
- package/test/unit/plugins/capture-provision-inPlugins_test.js +0 -6
|
@@ -412,6 +412,36 @@ const iotAgentConfig = {
|
|
|
412
412
|
}
|
|
413
413
|
],
|
|
414
414
|
explicitAttrs: '[ ]'
|
|
415
|
+
},
|
|
416
|
+
skipvalue: {
|
|
417
|
+
commands: [],
|
|
418
|
+
type: 'skipvalue',
|
|
419
|
+
lazy: [],
|
|
420
|
+
active: [
|
|
421
|
+
{
|
|
422
|
+
name: 'alwaysSkip',
|
|
423
|
+
type: 'Number',
|
|
424
|
+
skipValue: true,
|
|
425
|
+
expression: 'true'
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
name: 'neverSkip',
|
|
429
|
+
type: 'Number',
|
|
430
|
+
skipValue: true,
|
|
431
|
+
expression: 'false'
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
name: 'skip',
|
|
435
|
+
type: 'Number',
|
|
436
|
+
skipValue: 33,
|
|
437
|
+
expression: 'condition'
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
object_id: 'condition',
|
|
441
|
+
name: 'condition',
|
|
442
|
+
type: 'Number'
|
|
443
|
+
}
|
|
444
|
+
]
|
|
415
445
|
}
|
|
416
446
|
},
|
|
417
447
|
service: 'smartgondor',
|
|
@@ -537,13 +567,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
537
567
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
538
568
|
.matchHeader('fiware-service', 'smartgondor')
|
|
539
569
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
540
|
-
.
|
|
541
|
-
'/v2/entities
|
|
570
|
+
.post(
|
|
571
|
+
'/v2/entities?options=upsert',
|
|
542
572
|
utils.readExampleFile(
|
|
543
573
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin30.json'
|
|
544
574
|
)
|
|
545
575
|
)
|
|
546
|
-
.query({ type: 'Light' })
|
|
547
576
|
.reply(204);
|
|
548
577
|
});
|
|
549
578
|
|
|
@@ -577,13 +606,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
577
606
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
578
607
|
.matchHeader('fiware-service', 'smartgondor')
|
|
579
608
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
580
|
-
.
|
|
581
|
-
'/v2/entities
|
|
609
|
+
.post(
|
|
610
|
+
'/v2/entities?options=upsert',
|
|
582
611
|
utils.readExampleFile(
|
|
583
612
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin2.json'
|
|
584
613
|
)
|
|
585
614
|
)
|
|
586
|
-
.query({ type: 'WeatherStation' })
|
|
587
615
|
.reply(204);
|
|
588
616
|
});
|
|
589
617
|
|
|
@@ -618,13 +646,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
618
646
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
619
647
|
.matchHeader('fiware-service', 'smartgondor')
|
|
620
648
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
621
|
-
.
|
|
622
|
-
'/v2/entities
|
|
649
|
+
.post(
|
|
650
|
+
'/v2/entities?options=upsert',
|
|
623
651
|
utils.readExampleFile(
|
|
624
652
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin4.json'
|
|
625
653
|
)
|
|
626
654
|
)
|
|
627
|
-
.query({ type: 'WeatherStation' })
|
|
628
655
|
.reply(204);
|
|
629
656
|
});
|
|
630
657
|
|
|
@@ -653,13 +680,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
653
680
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
654
681
|
.matchHeader('fiware-service', 'smartgondor')
|
|
655
682
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
656
|
-
.
|
|
657
|
-
'/v2/entities
|
|
683
|
+
.post(
|
|
684
|
+
'/v2/entities?options=upsert',
|
|
658
685
|
utils.readExampleFile(
|
|
659
686
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin11.json'
|
|
660
687
|
)
|
|
661
688
|
)
|
|
662
|
-
.query({ type: 'Light' })
|
|
663
689
|
.reply(204);
|
|
664
690
|
});
|
|
665
691
|
|
|
@@ -688,13 +714,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
688
714
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
689
715
|
.matchHeader('fiware-service', 'smartgondor')
|
|
690
716
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
691
|
-
.
|
|
692
|
-
'/v2/entities
|
|
717
|
+
.post(
|
|
718
|
+
'/v2/entities?options=upsert',
|
|
693
719
|
utils.readExampleFile(
|
|
694
720
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin1.json'
|
|
695
721
|
)
|
|
696
722
|
)
|
|
697
|
-
.query({ type: 'WeatherStation' })
|
|
698
723
|
.reply(204);
|
|
699
724
|
});
|
|
700
725
|
|
|
@@ -724,13 +749,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
724
749
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
725
750
|
.matchHeader('fiware-service', 'smartgondor')
|
|
726
751
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
727
|
-
.
|
|
728
|
-
'/v2/entities
|
|
752
|
+
.post(
|
|
753
|
+
'/v2/entities?options=upsert',
|
|
729
754
|
utils.readExampleFile(
|
|
730
755
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin3.json'
|
|
731
756
|
)
|
|
732
757
|
)
|
|
733
|
-
.query({ type: 'Light' })
|
|
734
758
|
.reply(204);
|
|
735
759
|
});
|
|
736
760
|
|
|
@@ -760,13 +784,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
760
784
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
761
785
|
.matchHeader('fiware-service', 'smartgondor')
|
|
762
786
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
763
|
-
.
|
|
764
|
-
'/v2/entities
|
|
787
|
+
.post(
|
|
788
|
+
'/v2/entities?options=upsert',
|
|
765
789
|
utils.readExampleFile(
|
|
766
790
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin8.json'
|
|
767
791
|
)
|
|
768
792
|
)
|
|
769
|
-
.query({ type: 'WeatherStation' })
|
|
770
793
|
.reply(204);
|
|
771
794
|
});
|
|
772
795
|
|
|
@@ -796,13 +819,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
796
819
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
797
820
|
.matchHeader('fiware-service', 'smartgondor')
|
|
798
821
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
799
|
-
.
|
|
800
|
-
'/v2/entities
|
|
822
|
+
.post(
|
|
823
|
+
'/v2/entities?options=upsert',
|
|
801
824
|
utils.readExampleFile(
|
|
802
825
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin5.json'
|
|
803
826
|
)
|
|
804
827
|
)
|
|
805
|
-
.query({ type: 'Light' })
|
|
806
828
|
.reply(204);
|
|
807
829
|
});
|
|
808
830
|
|
|
@@ -832,13 +854,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
832
854
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
833
855
|
.matchHeader('fiware-service', 'smartgondor')
|
|
834
856
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
835
|
-
.
|
|
836
|
-
'/v2/entities
|
|
857
|
+
.post(
|
|
858
|
+
'/v2/entities?options=upsert',
|
|
837
859
|
utils.readExampleFile(
|
|
838
860
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin9.json'
|
|
839
861
|
)
|
|
840
862
|
)
|
|
841
|
-
.query({ type: 'Light' })
|
|
842
863
|
.reply(204);
|
|
843
864
|
});
|
|
844
865
|
|
|
@@ -867,13 +888,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
867
888
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
868
889
|
.matchHeader('fiware-service', 'smartgondor')
|
|
869
890
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
870
|
-
.
|
|
871
|
-
'/v2/entities
|
|
891
|
+
.post(
|
|
892
|
+
'/v2/entities?options=upsert',
|
|
872
893
|
utils.readExampleFile(
|
|
873
894
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin6.json'
|
|
874
895
|
)
|
|
875
896
|
)
|
|
876
|
-
.query({ type: 'Light' })
|
|
877
897
|
.reply(204);
|
|
878
898
|
});
|
|
879
899
|
|
|
@@ -903,13 +923,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
903
923
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
904
924
|
.matchHeader('fiware-service', 'smartgondor')
|
|
905
925
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
906
|
-
.
|
|
907
|
-
'/v2/entities
|
|
926
|
+
.post(
|
|
927
|
+
'/v2/entities?options=upsert',
|
|
908
928
|
utils.readExampleFile(
|
|
909
929
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin7.json'
|
|
910
930
|
)
|
|
911
931
|
)
|
|
912
|
-
.query({ type: 'Light' })
|
|
913
932
|
.reply(204);
|
|
914
933
|
});
|
|
915
934
|
|
|
@@ -937,13 +956,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
937
956
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
938
957
|
.matchHeader('fiware-service', 'smartgondor')
|
|
939
958
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
940
|
-
.
|
|
941
|
-
'/v2/entities
|
|
959
|
+
.post(
|
|
960
|
+
'/v2/entities?options=upsert',
|
|
942
961
|
utils.readExampleFile(
|
|
943
962
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin12.json'
|
|
944
963
|
)
|
|
945
964
|
)
|
|
946
|
-
.query({ type: 'Light' })
|
|
947
965
|
.reply(204);
|
|
948
966
|
});
|
|
949
967
|
|
|
@@ -971,13 +989,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
971
989
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
972
990
|
.matchHeader('fiware-service', 'smartgondor')
|
|
973
991
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
974
|
-
.
|
|
975
|
-
'/v2/entities
|
|
992
|
+
.post(
|
|
993
|
+
'/v2/entities?options=upsert',
|
|
976
994
|
utils.readExampleFile(
|
|
977
995
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin13.json'
|
|
978
996
|
)
|
|
979
997
|
)
|
|
980
|
-
.query({ type: 'Light' })
|
|
981
998
|
.reply(204);
|
|
982
999
|
});
|
|
983
1000
|
|
|
@@ -1010,13 +1027,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
1010
1027
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
1011
1028
|
.matchHeader('fiware-service', 'smartgondor')
|
|
1012
1029
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
1013
|
-
.
|
|
1014
|
-
'/v2/entities
|
|
1030
|
+
.post(
|
|
1031
|
+
'/v2/entities?options=upsert',
|
|
1015
1032
|
utils.readExampleFile(
|
|
1016
1033
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin13.json'
|
|
1017
1034
|
)
|
|
1018
1035
|
)
|
|
1019
|
-
.query({ type: 'Light' })
|
|
1020
1036
|
.reply(204);
|
|
1021
1037
|
});
|
|
1022
1038
|
|
|
@@ -1044,13 +1060,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
1044
1060
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
1045
1061
|
.matchHeader('fiware-service', 'smartgondor')
|
|
1046
1062
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
1047
|
-
.
|
|
1048
|
-
'/v2/entities
|
|
1063
|
+
.post(
|
|
1064
|
+
'/v2/entities?options=upsert',
|
|
1049
1065
|
utils.readExampleFile(
|
|
1050
1066
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin29.json'
|
|
1051
1067
|
)
|
|
1052
1068
|
)
|
|
1053
|
-
.query({ type: 'WeatherStation' })
|
|
1054
1069
|
.reply(204);
|
|
1055
1070
|
});
|
|
1056
1071
|
|
|
@@ -1077,13 +1092,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
1077
1092
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
1078
1093
|
.matchHeader('fiware-service', 'smartgondor')
|
|
1079
1094
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
1080
|
-
.
|
|
1081
|
-
'/v2/entities
|
|
1095
|
+
.post(
|
|
1096
|
+
'/v2/entities?options=upsert',
|
|
1082
1097
|
utils.readExampleFile(
|
|
1083
1098
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin31.json'
|
|
1084
1099
|
)
|
|
1085
1100
|
)
|
|
1086
|
-
.query({ type: 'WeatherStation' })
|
|
1087
1101
|
.reply(204);
|
|
1088
1102
|
});
|
|
1089
1103
|
|
|
@@ -1122,13 +1136,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
1122
1136
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
1123
1137
|
.matchHeader('fiware-service', 'smartgondor')
|
|
1124
1138
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
1125
|
-
.
|
|
1126
|
-
'/v2/entities
|
|
1139
|
+
.post(
|
|
1140
|
+
'/v2/entities?options=upsert',
|
|
1127
1141
|
utils.readExampleFile(
|
|
1128
1142
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin32.json'
|
|
1129
1143
|
)
|
|
1130
1144
|
)
|
|
1131
|
-
.query({ type: 'GPS' })
|
|
1132
1145
|
.reply(204);
|
|
1133
1146
|
});
|
|
1134
1147
|
|
|
@@ -1167,13 +1180,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
1167
1180
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
1168
1181
|
.matchHeader('fiware-service', 'smartgondor')
|
|
1169
1182
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
1170
|
-
.
|
|
1171
|
-
'/v2/entities
|
|
1183
|
+
.post(
|
|
1184
|
+
'/v2/entities?options=upsert',
|
|
1172
1185
|
utils.readExampleFile(
|
|
1173
1186
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin35.json'
|
|
1174
1187
|
)
|
|
1175
1188
|
)
|
|
1176
|
-
.query({ type: 'GPS' })
|
|
1177
1189
|
.reply(204);
|
|
1178
1190
|
});
|
|
1179
1191
|
|
|
@@ -1217,13 +1229,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
1217
1229
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
1218
1230
|
.matchHeader('fiware-service', 'smartgondor')
|
|
1219
1231
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
1220
|
-
.
|
|
1221
|
-
'/v2/entities
|
|
1232
|
+
.post(
|
|
1233
|
+
'/v2/entities?options=upsert',
|
|
1222
1234
|
utils.readExampleFile(
|
|
1223
1235
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin41.json'
|
|
1224
1236
|
)
|
|
1225
1237
|
)
|
|
1226
|
-
.query({ type: 'GPS' })
|
|
1227
1238
|
.reply(204);
|
|
1228
1239
|
});
|
|
1229
1240
|
|
|
@@ -1262,13 +1273,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
1262
1273
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
1263
1274
|
.matchHeader('fiware-service', 'smartgondor')
|
|
1264
1275
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
1265
|
-
.
|
|
1266
|
-
'/v2/entities
|
|
1276
|
+
.post(
|
|
1277
|
+
'/v2/entities?options=upsert',
|
|
1267
1278
|
utils.readExampleFile(
|
|
1268
1279
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin34.json'
|
|
1269
1280
|
)
|
|
1270
1281
|
)
|
|
1271
|
-
.query({ type: 'GPS' })
|
|
1272
1282
|
.reply(204);
|
|
1273
1283
|
});
|
|
1274
1284
|
|
|
@@ -1307,13 +1317,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
1307
1317
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
1308
1318
|
.matchHeader('fiware-service', 'smartgondor')
|
|
1309
1319
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
1310
|
-
.
|
|
1311
|
-
'/v2/entities
|
|
1320
|
+
.post(
|
|
1321
|
+
'/v2/entities?options=upsert',
|
|
1312
1322
|
utils.readExampleFile(
|
|
1313
1323
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin34.json'
|
|
1314
1324
|
)
|
|
1315
1325
|
)
|
|
1316
|
-
.query({ type: 'GPS' })
|
|
1317
1326
|
.reply(204);
|
|
1318
1327
|
});
|
|
1319
1328
|
|
|
@@ -1357,13 +1366,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
1357
1366
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
1358
1367
|
.matchHeader('fiware-service', 'smartgondor')
|
|
1359
1368
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
1360
|
-
.
|
|
1361
|
-
'/v2/entities
|
|
1369
|
+
.post(
|
|
1370
|
+
'/v2/entities?options=upsert',
|
|
1362
1371
|
utils.readExampleFile(
|
|
1363
1372
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin36.json'
|
|
1364
1373
|
)
|
|
1365
1374
|
)
|
|
1366
|
-
.query({ type: 'GPS' })
|
|
1367
1375
|
.reply(204);
|
|
1368
1376
|
});
|
|
1369
1377
|
|
|
@@ -1397,13 +1405,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
1397
1405
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
1398
1406
|
.matchHeader('fiware-service', 'smartgondor')
|
|
1399
1407
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
1400
|
-
.
|
|
1401
|
-
'/v2/entities
|
|
1408
|
+
.post(
|
|
1409
|
+
'/v2/entities?options=upsert',
|
|
1402
1410
|
utils.readExampleFile(
|
|
1403
1411
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin36.json'
|
|
1404
1412
|
)
|
|
1405
1413
|
)
|
|
1406
|
-
.query({ type: 'GPS' })
|
|
1407
1414
|
.reply(204);
|
|
1408
1415
|
});
|
|
1409
1416
|
|
|
@@ -1432,13 +1439,12 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
1432
1439
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
1433
1440
|
.matchHeader('fiware-service', 'smartgondor')
|
|
1434
1441
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
1435
|
-
.
|
|
1436
|
-
'/v2/entities
|
|
1442
|
+
.post(
|
|
1443
|
+
'/v2/entities?options=upsert',
|
|
1437
1444
|
utils.readExampleFile(
|
|
1438
1445
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin34.json'
|
|
1439
1446
|
)
|
|
1440
1447
|
)
|
|
1441
|
-
.query({ type: 'GPS' })
|
|
1442
1448
|
.reply(204);
|
|
1443
1449
|
});
|
|
1444
1450
|
|
|
@@ -1487,6 +1493,59 @@ describe('Java expression language (JEXL) based transformations plugin', functio
|
|
|
1487
1493
|
});
|
|
1488
1494
|
});
|
|
1489
1495
|
});
|
|
1496
|
+
|
|
1497
|
+
describe('When using skipValue is expression in a device', function () {
|
|
1498
|
+
// Case: Expression which results is sent as a new attribute
|
|
1499
|
+
const values = [
|
|
1500
|
+
{
|
|
1501
|
+
name: 'alwaysSkip',
|
|
1502
|
+
type: 'Number',
|
|
1503
|
+
value: 1
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
name: 'neverSkip',
|
|
1507
|
+
type: 'Number',
|
|
1508
|
+
value: 2
|
|
1509
|
+
},
|
|
1510
|
+
{
|
|
1511
|
+
name: 'skip',
|
|
1512
|
+
type: 'Number',
|
|
1513
|
+
value: 3
|
|
1514
|
+
},
|
|
1515
|
+
{
|
|
1516
|
+
name: 'condition',
|
|
1517
|
+
type: 'Number',
|
|
1518
|
+
value: 33
|
|
1519
|
+
}
|
|
1520
|
+
];
|
|
1521
|
+
|
|
1522
|
+
beforeEach(function () {
|
|
1523
|
+
nock.cleanAll();
|
|
1524
|
+
|
|
1525
|
+
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
1526
|
+
.matchHeader('fiware-service', 'smartgondor')
|
|
1527
|
+
.matchHeader('fiware-servicepath', 'gardens')
|
|
1528
|
+
.post(
|
|
1529
|
+
'/v2/entities?options=upsert',
|
|
1530
|
+
utils.readExampleFile(
|
|
1531
|
+
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionSkip.json'
|
|
1532
|
+
)
|
|
1533
|
+
)
|
|
1534
|
+
.reply(204);
|
|
1535
|
+
});
|
|
1536
|
+
|
|
1537
|
+
afterEach(function (done) {
|
|
1538
|
+
done();
|
|
1539
|
+
});
|
|
1540
|
+
|
|
1541
|
+
it('should not propagate skipped values', function (done) {
|
|
1542
|
+
iotAgentLib.update('skip1', 'skipvalue', '', values, function (error) {
|
|
1543
|
+
should.not.exist(error);
|
|
1544
|
+
contextBrokerMock.done();
|
|
1545
|
+
done();
|
|
1546
|
+
});
|
|
1547
|
+
});
|
|
1548
|
+
});
|
|
1490
1549
|
});
|
|
1491
1550
|
|
|
1492
1551
|
describe('Java expression language (JEXL) based transformations plugin - Timestamps', function () {
|
|
@@ -1535,13 +1594,12 @@ describe('Java expression language (JEXL) based transformations plugin - Timesta
|
|
|
1535
1594
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
1536
1595
|
.matchHeader('fiware-service', 'smartgondor')
|
|
1537
1596
|
.matchHeader('fiware-servicepath', 'gardens')
|
|
1538
|
-
.
|
|
1539
|
-
'/v2/entities
|
|
1597
|
+
.post(
|
|
1598
|
+
'/v2/entities?options=upsert',
|
|
1540
1599
|
utils.readExampleFile(
|
|
1541
1600
|
'./test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin33.json'
|
|
1542
1601
|
)
|
|
1543
1602
|
)
|
|
1544
|
-
.query({ type: 'GPS' })
|
|
1545
1603
|
.reply(204);
|
|
1546
1604
|
});
|
|
1547
1605
|
|