iotagent-node-lib 4.4.0 → 4.5.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/config.js +2 -1
- package/doc/admin.md +16 -7
- package/doc/api.md +183 -52
- package/doc/requirements.txt +1 -1
- package/lib/commonConfig.js +7 -1
- package/lib/services/devices/deviceRegistryMemory.js +1 -1
- package/lib/services/devices/deviceRegistryMongoDB.js +2 -2
- package/lib/services/devices/deviceService.js +4 -3
- package/lib/services/devices/devices-NGSI-LD.js +5 -5
- package/lib/services/devices/devices-NGSI-mixed.js +3 -3
- package/lib/services/devices/devices-NGSI-v2.js +5 -5
- package/lib/services/ngsi/entities-NGSI-LD.js +1 -1
- package/lib/services/ngsi/entities-NGSI-v2.js +313 -281
- package/lib/services/ngsi/subscription-NGSI-LD.js +2 -2
- package/lib/services/ngsi/subscription-NGSI-v2.js +2 -2
- package/lib/services/northBound/deviceProvisioningServer.js +5 -4
- package/lib/services/northBound/northboundServer.js +2 -2
- package/package.json +1 -1
- package/test/functional/README.md +60 -37
- package/test/functional/testCases.js +1017 -264
- package/test/functional/testUtils.js +53 -20
- package/test/unit/examples/deviceProvisioningRequests/updateProvisionDeviceWithApikey.json +4 -0
- package/test/unit/ngsi-ld/provisioning/device-update-registration_test.js +5 -5
- package/test/unit/ngsiv2/provisioning/device-update-registration_test.js +6 -6
- package/test/unit/ngsiv2/provisioning/updateProvisionedDevices-test.js +35 -0
|
@@ -446,7 +446,7 @@ const testCases = [
|
|
|
446
446
|
]
|
|
447
447
|
},
|
|
448
448
|
{
|
|
449
|
-
describeName: '0021
|
|
449
|
+
describeName: '0021 - Simple group with active attributes with metadata',
|
|
450
450
|
provision: {
|
|
451
451
|
url: 'http://localhost:' + config.iota.server.port + '/iot/services',
|
|
452
452
|
method: 'POST',
|
|
@@ -513,6 +513,399 @@ const testCases = [
|
|
|
513
513
|
}
|
|
514
514
|
]
|
|
515
515
|
},
|
|
516
|
+
{
|
|
517
|
+
describeName: '0022 - Simple group with active attributes and multimeasures',
|
|
518
|
+
provision: {
|
|
519
|
+
url: 'http://localhost:' + config.iota.server.port + '/iot/services',
|
|
520
|
+
method: 'POST',
|
|
521
|
+
json: {
|
|
522
|
+
services: [
|
|
523
|
+
{
|
|
524
|
+
resource: '/iot/json',
|
|
525
|
+
apikey: globalEnv.apikey,
|
|
526
|
+
entity_type: globalEnv.entity_type,
|
|
527
|
+
commands: [],
|
|
528
|
+
lazy: [],
|
|
529
|
+
attributes: [
|
|
530
|
+
{
|
|
531
|
+
object_id: 'a',
|
|
532
|
+
name: 'attr_a',
|
|
533
|
+
type: 'Number'
|
|
534
|
+
}
|
|
535
|
+
],
|
|
536
|
+
static_attributes: []
|
|
537
|
+
}
|
|
538
|
+
]
|
|
539
|
+
},
|
|
540
|
+
headers: {
|
|
541
|
+
'fiware-service': globalEnv.service,
|
|
542
|
+
'fiware-servicepath': globalEnv.servicePath
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
should: [
|
|
546
|
+
{
|
|
547
|
+
shouldName:
|
|
548
|
+
'A - WHEN sending defined object_ids (measures) through http IT should send measures to Context Broker preserving value types and name mappings',
|
|
549
|
+
type: 'multimeasure',
|
|
550
|
+
measure: {
|
|
551
|
+
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
552
|
+
method: 'POST',
|
|
553
|
+
qs: {
|
|
554
|
+
i: globalEnv.deviceId,
|
|
555
|
+
k: globalEnv.apikey
|
|
556
|
+
},
|
|
557
|
+
json: [
|
|
558
|
+
{
|
|
559
|
+
a: 0
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
a: 1
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
a: 2
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
a: 3
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
a: 4
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
a: 5
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
a: 6
|
|
578
|
+
}
|
|
579
|
+
]
|
|
580
|
+
},
|
|
581
|
+
expectation: {
|
|
582
|
+
actionType: 'append',
|
|
583
|
+
entities: [
|
|
584
|
+
{
|
|
585
|
+
attr_a: {
|
|
586
|
+
type: 'Number',
|
|
587
|
+
value: 0
|
|
588
|
+
},
|
|
589
|
+
id: globalEnv.entity_name,
|
|
590
|
+
type: globalEnv.entity_type
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
attr_a: {
|
|
594
|
+
type: 'Number',
|
|
595
|
+
value: 1
|
|
596
|
+
},
|
|
597
|
+
id: globalEnv.entity_name,
|
|
598
|
+
type: globalEnv.entity_type
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
attr_a: {
|
|
602
|
+
type: 'Number',
|
|
603
|
+
value: 2
|
|
604
|
+
},
|
|
605
|
+
id: globalEnv.entity_name,
|
|
606
|
+
type: globalEnv.entity_type
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
attr_a: {
|
|
610
|
+
type: 'Number',
|
|
611
|
+
value: 3
|
|
612
|
+
},
|
|
613
|
+
id: globalEnv.entity_name,
|
|
614
|
+
type: globalEnv.entity_type
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
attr_a: {
|
|
618
|
+
type: 'Number',
|
|
619
|
+
value: 4
|
|
620
|
+
},
|
|
621
|
+
id: globalEnv.entity_name,
|
|
622
|
+
type: globalEnv.entity_type
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
attr_a: {
|
|
626
|
+
type: 'Number',
|
|
627
|
+
value: 5
|
|
628
|
+
},
|
|
629
|
+
id: globalEnv.entity_name,
|
|
630
|
+
type: globalEnv.entity_type
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
attr_a: {
|
|
634
|
+
type: 'Number',
|
|
635
|
+
value: 6
|
|
636
|
+
},
|
|
637
|
+
id: globalEnv.entity_name,
|
|
638
|
+
type: globalEnv.entity_type
|
|
639
|
+
}
|
|
640
|
+
]
|
|
641
|
+
}
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
shouldName:
|
|
645
|
+
'A - WHEN sending defined object_ids (measures) through http IT should send measures with TimeInstant to Context Broker preserving value types and name mappings and order',
|
|
646
|
+
type: 'multimeasure',
|
|
647
|
+
measure: {
|
|
648
|
+
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
649
|
+
method: 'POST',
|
|
650
|
+
qs: {
|
|
651
|
+
i: globalEnv.deviceId,
|
|
652
|
+
k: globalEnv.apikey
|
|
653
|
+
},
|
|
654
|
+
json: [
|
|
655
|
+
{
|
|
656
|
+
a: 0,
|
|
657
|
+
TimeInstant: '2024-04-10T10:00:00Z'
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
a: 1,
|
|
661
|
+
TimeInstant: '2024-04-10T10:05:00Z'
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
a: 2,
|
|
665
|
+
TimeInstant: '2024-04-10T10:10:00Z'
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
a: 3,
|
|
669
|
+
TimeInstant: '2024-04-10T10:15:00Z'
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
a: 4,
|
|
673
|
+
TimeInstant: '2024-04-10T10:20:00Z'
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
a: 5,
|
|
677
|
+
TimeInstant: '2024-04-10T10:25:00Z'
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
a: 6,
|
|
681
|
+
TimeInstant: '2024-04-10T10:30:00Z'
|
|
682
|
+
}
|
|
683
|
+
]
|
|
684
|
+
},
|
|
685
|
+
expectation: {
|
|
686
|
+
actionType: 'append',
|
|
687
|
+
entities: [
|
|
688
|
+
{
|
|
689
|
+
attr_a: {
|
|
690
|
+
type: 'Number',
|
|
691
|
+
value: 0
|
|
692
|
+
},
|
|
693
|
+
TimeInstant: {
|
|
694
|
+
type: 'DateTime',
|
|
695
|
+
value: '2024-04-10T10:00:00Z'
|
|
696
|
+
},
|
|
697
|
+
id: globalEnv.entity_name,
|
|
698
|
+
type: globalEnv.entity_type
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
attr_a: {
|
|
702
|
+
type: 'Number',
|
|
703
|
+
value: 1
|
|
704
|
+
},
|
|
705
|
+
TimeInstant: {
|
|
706
|
+
type: 'DateTime',
|
|
707
|
+
value: '2024-04-10T10:05:00Z'
|
|
708
|
+
},
|
|
709
|
+
id: globalEnv.entity_name,
|
|
710
|
+
type: globalEnv.entity_type
|
|
711
|
+
},
|
|
712
|
+
{
|
|
713
|
+
attr_a: {
|
|
714
|
+
type: 'Number',
|
|
715
|
+
value: 2
|
|
716
|
+
},
|
|
717
|
+
TimeInstant: {
|
|
718
|
+
type: 'DateTime',
|
|
719
|
+
value: '2024-04-10T10:10:00Z'
|
|
720
|
+
},
|
|
721
|
+
id: globalEnv.entity_name,
|
|
722
|
+
type: globalEnv.entity_type
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
attr_a: {
|
|
726
|
+
type: 'Number',
|
|
727
|
+
value: 3
|
|
728
|
+
},
|
|
729
|
+
TimeInstant: {
|
|
730
|
+
type: 'DateTime',
|
|
731
|
+
value: '2024-04-10T10:15:00Z'
|
|
732
|
+
},
|
|
733
|
+
id: globalEnv.entity_name,
|
|
734
|
+
type: globalEnv.entity_type
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
attr_a: {
|
|
738
|
+
type: 'Number',
|
|
739
|
+
value: 4
|
|
740
|
+
},
|
|
741
|
+
TimeInstant: {
|
|
742
|
+
type: 'DateTime',
|
|
743
|
+
value: '2024-04-10T10:20:00Z'
|
|
744
|
+
},
|
|
745
|
+
id: globalEnv.entity_name,
|
|
746
|
+
type: globalEnv.entity_type
|
|
747
|
+
},
|
|
748
|
+
{
|
|
749
|
+
attr_a: {
|
|
750
|
+
type: 'Number',
|
|
751
|
+
value: 5
|
|
752
|
+
},
|
|
753
|
+
TimeInstant: {
|
|
754
|
+
type: 'DateTime',
|
|
755
|
+
value: '2024-04-10T10:25:00Z'
|
|
756
|
+
},
|
|
757
|
+
id: globalEnv.entity_name,
|
|
758
|
+
type: globalEnv.entity_type
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
attr_a: {
|
|
762
|
+
type: 'Number',
|
|
763
|
+
value: 6
|
|
764
|
+
},
|
|
765
|
+
TimeInstant: {
|
|
766
|
+
type: 'DateTime',
|
|
767
|
+
value: '2024-04-10T10:30:00Z'
|
|
768
|
+
},
|
|
769
|
+
id: globalEnv.entity_name,
|
|
770
|
+
type: globalEnv.entity_type
|
|
771
|
+
}
|
|
772
|
+
]
|
|
773
|
+
}
|
|
774
|
+
},
|
|
775
|
+
{
|
|
776
|
+
shouldName:
|
|
777
|
+
'A - WHEN sending defined object_ids (measures) through http IT should send measures with TimeInstant to Context Broker preserving value types and name mappings and sorted by TimeInstant',
|
|
778
|
+
type: 'multimeasure',
|
|
779
|
+
measure: {
|
|
780
|
+
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
781
|
+
method: 'POST',
|
|
782
|
+
qs: {
|
|
783
|
+
i: globalEnv.deviceId,
|
|
784
|
+
k: globalEnv.apikey
|
|
785
|
+
},
|
|
786
|
+
json: [
|
|
787
|
+
{
|
|
788
|
+
a: 0,
|
|
789
|
+
TimeInstant: '2024-04-10T10:15:00Z'
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
a: 1,
|
|
793
|
+
TimeInstant: '2024-04-10T10:05:00Z'
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
a: 2,
|
|
797
|
+
TimeInstant: '2024-04-10T10:20:00Z'
|
|
798
|
+
},
|
|
799
|
+
{
|
|
800
|
+
a: 3,
|
|
801
|
+
TimeInstant: '2024-04-10T10:00:00Z'
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
a: 4,
|
|
805
|
+
TimeInstant: '2024-04-10T10:10:00Z'
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
a: 5,
|
|
809
|
+
TimeInstant: '2024-04-10T10:30:00Z'
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
a: 6,
|
|
813
|
+
TimeInstant: '2024-04-10T10:25:00Z'
|
|
814
|
+
}
|
|
815
|
+
]
|
|
816
|
+
},
|
|
817
|
+
expectation: {
|
|
818
|
+
actionType: 'append',
|
|
819
|
+
entities: [
|
|
820
|
+
{
|
|
821
|
+
attr_a: {
|
|
822
|
+
type: 'Number',
|
|
823
|
+
value: 3
|
|
824
|
+
},
|
|
825
|
+
TimeInstant: {
|
|
826
|
+
type: 'DateTime',
|
|
827
|
+
value: '2024-04-10T10:00:00Z'
|
|
828
|
+
},
|
|
829
|
+
id: globalEnv.entity_name,
|
|
830
|
+
type: globalEnv.entity_type
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
attr_a: {
|
|
834
|
+
type: 'Number',
|
|
835
|
+
value: 1
|
|
836
|
+
},
|
|
837
|
+
TimeInstant: {
|
|
838
|
+
type: 'DateTime',
|
|
839
|
+
value: '2024-04-10T10:05:00Z'
|
|
840
|
+
},
|
|
841
|
+
id: globalEnv.entity_name,
|
|
842
|
+
type: globalEnv.entity_type
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
attr_a: {
|
|
846
|
+
type: 'Number',
|
|
847
|
+
value: 4
|
|
848
|
+
},
|
|
849
|
+
TimeInstant: {
|
|
850
|
+
type: 'DateTime',
|
|
851
|
+
value: '2024-04-10T10:10:00Z'
|
|
852
|
+
},
|
|
853
|
+
id: globalEnv.entity_name,
|
|
854
|
+
type: globalEnv.entity_type
|
|
855
|
+
},
|
|
856
|
+
{
|
|
857
|
+
attr_a: {
|
|
858
|
+
type: 'Number',
|
|
859
|
+
value: 0
|
|
860
|
+
},
|
|
861
|
+
TimeInstant: {
|
|
862
|
+
type: 'DateTime',
|
|
863
|
+
value: '2024-04-10T10:15:00Z'
|
|
864
|
+
},
|
|
865
|
+
id: globalEnv.entity_name,
|
|
866
|
+
type: globalEnv.entity_type
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
attr_a: {
|
|
870
|
+
type: 'Number',
|
|
871
|
+
value: 2
|
|
872
|
+
},
|
|
873
|
+
TimeInstant: {
|
|
874
|
+
type: 'DateTime',
|
|
875
|
+
value: '2024-04-10T10:20:00Z'
|
|
876
|
+
},
|
|
877
|
+
id: globalEnv.entity_name,
|
|
878
|
+
type: globalEnv.entity_type
|
|
879
|
+
},
|
|
880
|
+
{
|
|
881
|
+
attr_a: {
|
|
882
|
+
type: 'Number',
|
|
883
|
+
value: 6
|
|
884
|
+
},
|
|
885
|
+
TimeInstant: {
|
|
886
|
+
type: 'DateTime',
|
|
887
|
+
value: '2024-04-10T10:25:00Z'
|
|
888
|
+
},
|
|
889
|
+
id: globalEnv.entity_name,
|
|
890
|
+
type: globalEnv.entity_type
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
attr_a: {
|
|
894
|
+
type: 'Number',
|
|
895
|
+
value: 5
|
|
896
|
+
},
|
|
897
|
+
TimeInstant: {
|
|
898
|
+
type: 'DateTime',
|
|
899
|
+
value: '2024-04-10T10:30:00Z'
|
|
900
|
+
},
|
|
901
|
+
id: globalEnv.entity_name,
|
|
902
|
+
type: globalEnv.entity_type
|
|
903
|
+
}
|
|
904
|
+
]
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
]
|
|
908
|
+
},
|
|
516
909
|
// 0100 - JEXL TESTS
|
|
517
910
|
{
|
|
518
911
|
describeName: '0100 - Simple group with active attribute + JEXL expression boolean (!)',
|
|
@@ -2086,13 +2479,97 @@ const testCases = [
|
|
|
2086
2479
|
type: globalEnv.entity_type,
|
|
2087
2480
|
attr_a: {
|
|
2088
2481
|
value: 23,
|
|
2089
|
-
type: 'Number',
|
|
2090
|
-
metadata: {
|
|
2091
|
-
TimeInstant: {
|
|
2092
|
-
type: 'DateTime',
|
|
2093
|
-
value: '2015-12-14T08:06:01.468Z'
|
|
2094
|
-
}
|
|
2095
|
-
}
|
|
2482
|
+
type: 'Number',
|
|
2483
|
+
metadata: {
|
|
2484
|
+
TimeInstant: {
|
|
2485
|
+
type: 'DateTime',
|
|
2486
|
+
value: '2015-12-14T08:06:01.468Z'
|
|
2487
|
+
}
|
|
2488
|
+
}
|
|
2489
|
+
},
|
|
2490
|
+
TimeInstant: {
|
|
2491
|
+
value: '2015-12-14T08:06:01.468Z',
|
|
2492
|
+
type: 'DateTime'
|
|
2493
|
+
}
|
|
2494
|
+
}
|
|
2495
|
+
}
|
|
2496
|
+
]
|
|
2497
|
+
},
|
|
2498
|
+
{
|
|
2499
|
+
describeName: '0420 - Simple group with active attribute + timestamp not defined',
|
|
2500
|
+
provision: {
|
|
2501
|
+
url: 'http://localhost:' + config.iota.server.port + '/iot/services',
|
|
2502
|
+
method: 'POST',
|
|
2503
|
+
json: {
|
|
2504
|
+
services: [
|
|
2505
|
+
{
|
|
2506
|
+
resource: '/iot/json',
|
|
2507
|
+
apikey: globalEnv.apikey,
|
|
2508
|
+
entity_type: globalEnv.entity_type,
|
|
2509
|
+
commands: [],
|
|
2510
|
+
lazy: [],
|
|
2511
|
+
attributes: [
|
|
2512
|
+
{
|
|
2513
|
+
object_id: 'a',
|
|
2514
|
+
name: 'attr_a',
|
|
2515
|
+
type: 'Number'
|
|
2516
|
+
}
|
|
2517
|
+
]
|
|
2518
|
+
}
|
|
2519
|
+
]
|
|
2520
|
+
},
|
|
2521
|
+
headers: {
|
|
2522
|
+
'fiware-service': globalEnv.service,
|
|
2523
|
+
'fiware-servicepath': globalEnv.servicePath
|
|
2524
|
+
}
|
|
2525
|
+
},
|
|
2526
|
+
should: [
|
|
2527
|
+
{
|
|
2528
|
+
shouldName:
|
|
2529
|
+
'A - WHEN sending a measure not named TimeInstant through http IT should not add the timestamp to the attributes or metadata sent to Context Broker',
|
|
2530
|
+
type: 'single',
|
|
2531
|
+
measure: {
|
|
2532
|
+
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
2533
|
+
method: 'POST',
|
|
2534
|
+
qs: {
|
|
2535
|
+
i: globalEnv.deviceId,
|
|
2536
|
+
k: globalEnv.apikey
|
|
2537
|
+
},
|
|
2538
|
+
json: {
|
|
2539
|
+
a: 21
|
|
2540
|
+
}
|
|
2541
|
+
},
|
|
2542
|
+
expectation: {
|
|
2543
|
+
id: globalEnv.entity_name,
|
|
2544
|
+
type: globalEnv.entity_type,
|
|
2545
|
+
attr_a: {
|
|
2546
|
+
value: 21,
|
|
2547
|
+
type: 'Number'
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
},
|
|
2551
|
+
{
|
|
2552
|
+
shouldName:
|
|
2553
|
+
'B - WHEN sending a measure named TimeInstant through http IT should not add the timestamp to the other attributes sent to Context Broker',
|
|
2554
|
+
type: 'single',
|
|
2555
|
+
measure: {
|
|
2556
|
+
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
2557
|
+
method: 'POST',
|
|
2558
|
+
qs: {
|
|
2559
|
+
i: globalEnv.deviceId,
|
|
2560
|
+
k: globalEnv.apikey
|
|
2561
|
+
},
|
|
2562
|
+
json: {
|
|
2563
|
+
TimeInstant: '2015-12-14T08:06:01.468Z',
|
|
2564
|
+
a: 23
|
|
2565
|
+
}
|
|
2566
|
+
},
|
|
2567
|
+
expectation: {
|
|
2568
|
+
id: globalEnv.entity_name,
|
|
2569
|
+
type: globalEnv.entity_type,
|
|
2570
|
+
attr_a: {
|
|
2571
|
+
value: 23,
|
|
2572
|
+
type: 'Number'
|
|
2096
2573
|
},
|
|
2097
2574
|
TimeInstant: {
|
|
2098
2575
|
value: '2015-12-14T08:06:01.468Z',
|
|
@@ -2103,7 +2580,7 @@ const testCases = [
|
|
|
2103
2580
|
]
|
|
2104
2581
|
},
|
|
2105
2582
|
{
|
|
2106
|
-
describeName: '
|
|
2583
|
+
describeName: '0430 - Simple group with active attribute + timestamp mapping defined',
|
|
2107
2584
|
provision: {
|
|
2108
2585
|
url: 'http://localhost:' + config.iota.server.port + '/iot/services',
|
|
2109
2586
|
method: 'POST',
|
|
@@ -2112,14 +2589,15 @@ const testCases = [
|
|
|
2112
2589
|
{
|
|
2113
2590
|
resource: '/iot/json',
|
|
2114
2591
|
apikey: globalEnv.apikey,
|
|
2592
|
+
timestamp: true,
|
|
2115
2593
|
entity_type: globalEnv.entity_type,
|
|
2116
2594
|
commands: [],
|
|
2117
2595
|
lazy: [],
|
|
2118
2596
|
attributes: [
|
|
2119
2597
|
{
|
|
2120
|
-
object_id: '
|
|
2121
|
-
name: '
|
|
2122
|
-
type: '
|
|
2598
|
+
object_id: 'mydatetime',
|
|
2599
|
+
name: 'TimeInstant',
|
|
2600
|
+
type: 'DateTime'
|
|
2123
2601
|
}
|
|
2124
2602
|
]
|
|
2125
2603
|
}
|
|
@@ -2133,7 +2611,7 @@ const testCases = [
|
|
|
2133
2611
|
should: [
|
|
2134
2612
|
{
|
|
2135
2613
|
shouldName:
|
|
2136
|
-
'A - WHEN sending a measure
|
|
2614
|
+
'A - WHEN sending a measure through http IT should map the measure to timestamp attribute and use it for timestmap and other metadata attributes sent to Context Broker',
|
|
2137
2615
|
type: 'single',
|
|
2138
2616
|
measure: {
|
|
2139
2617
|
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
@@ -2143,22 +2621,34 @@ const testCases = [
|
|
|
2143
2621
|
k: globalEnv.apikey
|
|
2144
2622
|
},
|
|
2145
2623
|
json: {
|
|
2146
|
-
|
|
2624
|
+
mydatetime: '2022-02-02T02:22:22.222Z',
|
|
2625
|
+
a: 23
|
|
2147
2626
|
}
|
|
2148
2627
|
},
|
|
2149
2628
|
expectation: {
|
|
2150
2629
|
id: globalEnv.entity_name,
|
|
2151
2630
|
type: globalEnv.entity_type,
|
|
2152
|
-
|
|
2153
|
-
value:
|
|
2154
|
-
type: '
|
|
2631
|
+
a: {
|
|
2632
|
+
value: 23,
|
|
2633
|
+
type: 'Text',
|
|
2634
|
+
metadata: {
|
|
2635
|
+
TimeInstant: {
|
|
2636
|
+
value: '2022-02-02T02:22:22.222Z',
|
|
2637
|
+
type: 'DateTime'
|
|
2638
|
+
}
|
|
2639
|
+
}
|
|
2640
|
+
},
|
|
2641
|
+
TimeInstant: {
|
|
2642
|
+
value: '2022-02-02T02:22:22.222Z',
|
|
2643
|
+
type: 'DateTime'
|
|
2155
2644
|
}
|
|
2156
2645
|
}
|
|
2157
2646
|
},
|
|
2158
2647
|
{
|
|
2159
2648
|
shouldName:
|
|
2160
|
-
'
|
|
2649
|
+
'A - WHEN sending a measure without timestamp through http IT should use system timestamp for mapped attribute and use it for timestmap and other metadata attributes sent to Context Broker',
|
|
2161
2650
|
type: 'single',
|
|
2651
|
+
isRegex: true,
|
|
2162
2652
|
measure: {
|
|
2163
2653
|
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
2164
2654
|
method: 'POST',
|
|
@@ -2167,19 +2657,60 @@ const testCases = [
|
|
|
2167
2657
|
k: globalEnv.apikey
|
|
2168
2658
|
},
|
|
2169
2659
|
json: {
|
|
2170
|
-
TimeInstant: '2015-12-14T08:06:01.468Z',
|
|
2171
2660
|
a: 23
|
|
2172
2661
|
}
|
|
2173
2662
|
},
|
|
2174
2663
|
expectation: {
|
|
2175
2664
|
id: globalEnv.entity_name,
|
|
2176
2665
|
type: globalEnv.entity_type,
|
|
2177
|
-
|
|
2666
|
+
a: {
|
|
2178
2667
|
value: 23,
|
|
2179
|
-
type: '
|
|
2668
|
+
type: 'Text',
|
|
2669
|
+
metadata: {
|
|
2670
|
+
TimeInstant: {
|
|
2671
|
+
value: _.isDateString,
|
|
2672
|
+
type: 'DateTime'
|
|
2673
|
+
}
|
|
2674
|
+
}
|
|
2180
2675
|
},
|
|
2181
2676
|
TimeInstant: {
|
|
2182
|
-
value:
|
|
2677
|
+
value: _.isDateString,
|
|
2678
|
+
type: 'DateTime'
|
|
2679
|
+
}
|
|
2680
|
+
}
|
|
2681
|
+
},
|
|
2682
|
+
{
|
|
2683
|
+
shouldName:
|
|
2684
|
+
'A - WHEN sending a measure with timestamp through http IT should map the measure to timestamp attribute and use it for timestmap and other metadata attributes sent to Context Broker',
|
|
2685
|
+
type: 'single',
|
|
2686
|
+
measure: {
|
|
2687
|
+
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
2688
|
+
method: 'POST',
|
|
2689
|
+
qs: {
|
|
2690
|
+
i: globalEnv.deviceId,
|
|
2691
|
+
k: globalEnv.apikey
|
|
2692
|
+
},
|
|
2693
|
+
json: {
|
|
2694
|
+
mydatetime: '2022-02-02T02:22:22.222Z',
|
|
2695
|
+
TimeInstant: '2033-03-03T03:33:33.333Z',
|
|
2696
|
+
a: 23
|
|
2697
|
+
}
|
|
2698
|
+
},
|
|
2699
|
+
expectation: {
|
|
2700
|
+
id: globalEnv.entity_name,
|
|
2701
|
+
type: globalEnv.entity_type,
|
|
2702
|
+
a: {
|
|
2703
|
+
value: 23,
|
|
2704
|
+
type: 'Text',
|
|
2705
|
+
metadata: {
|
|
2706
|
+
TimeInstant: {
|
|
2707
|
+
value: '2022-02-02T02:22:22.222Z',
|
|
2708
|
+
type: 'DateTime'
|
|
2709
|
+
}
|
|
2710
|
+
}
|
|
2711
|
+
},
|
|
2712
|
+
TimeInstant: {
|
|
2713
|
+
value: '2022-02-02T02:22:22.222Z',
|
|
2183
2714
|
type: 'DateTime'
|
|
2184
2715
|
}
|
|
2185
2716
|
}
|
|
@@ -2187,7 +2718,7 @@ const testCases = [
|
|
|
2187
2718
|
]
|
|
2188
2719
|
},
|
|
2189
2720
|
{
|
|
2190
|
-
describeName: '
|
|
2721
|
+
describeName: '0431 - Simple group with active attribute + timestamp mapping defined + explicitAttrs',
|
|
2191
2722
|
provision: {
|
|
2192
2723
|
url: 'http://localhost:' + config.iota.server.port + '/iot/services',
|
|
2193
2724
|
method: 'POST',
|
|
@@ -2197,6 +2728,7 @@ const testCases = [
|
|
|
2197
2728
|
resource: '/iot/json',
|
|
2198
2729
|
apikey: globalEnv.apikey,
|
|
2199
2730
|
timestamp: true,
|
|
2731
|
+
explicitAttrs: true,
|
|
2200
2732
|
entity_type: globalEnv.entity_type,
|
|
2201
2733
|
commands: [],
|
|
2202
2734
|
lazy: [],
|
|
@@ -2205,6 +2737,11 @@ const testCases = [
|
|
|
2205
2737
|
object_id: 'mydatetime',
|
|
2206
2738
|
name: 'TimeInstant',
|
|
2207
2739
|
type: 'DateTime'
|
|
2740
|
+
},
|
|
2741
|
+
{
|
|
2742
|
+
object_id: 'a',
|
|
2743
|
+
name: 'a',
|
|
2744
|
+
type: 'Text'
|
|
2208
2745
|
}
|
|
2209
2746
|
]
|
|
2210
2747
|
}
|
|
@@ -2325,7 +2862,7 @@ const testCases = [
|
|
|
2325
2862
|
]
|
|
2326
2863
|
},
|
|
2327
2864
|
{
|
|
2328
|
-
describeName: '
|
|
2865
|
+
describeName: '0432 - Simple group with active attribute + bad timestamp mapping defined',
|
|
2329
2866
|
provision: {
|
|
2330
2867
|
url: 'http://localhost:' + config.iota.server.port + '/iot/services',
|
|
2331
2868
|
method: 'POST',
|
|
@@ -2335,7 +2872,6 @@ const testCases = [
|
|
|
2335
2872
|
resource: '/iot/json',
|
|
2336
2873
|
apikey: globalEnv.apikey,
|
|
2337
2874
|
timestamp: true,
|
|
2338
|
-
explicitAttrs: true,
|
|
2339
2875
|
entity_type: globalEnv.entity_type,
|
|
2340
2876
|
commands: [],
|
|
2341
2877
|
lazy: [],
|
|
@@ -2343,12 +2879,8 @@ const testCases = [
|
|
|
2343
2879
|
{
|
|
2344
2880
|
object_id: 'mydatetime',
|
|
2345
2881
|
name: 'TimeInstant',
|
|
2346
|
-
type: 'DateTime'
|
|
2347
|
-
|
|
2348
|
-
{
|
|
2349
|
-
object_id: 'a',
|
|
2350
|
-
name: 'a',
|
|
2351
|
-
type: 'Text'
|
|
2882
|
+
type: 'DateTime',
|
|
2883
|
+
expression: '"2033-03-03T" + "03:33:33.333Z"'
|
|
2352
2884
|
}
|
|
2353
2885
|
]
|
|
2354
2886
|
}
|
|
@@ -2362,7 +2894,7 @@ const testCases = [
|
|
|
2362
2894
|
should: [
|
|
2363
2895
|
{
|
|
2364
2896
|
shouldName:
|
|
2365
|
-
'A - WHEN sending a measure through http IT should map the measure to timestamp attribute and use it for timestmap
|
|
2897
|
+
'A - WHEN sending a measure through http IT should map the measure to fixed timestamp attribute and use it for timestmap sent to Context Broker',
|
|
2366
2898
|
type: 'single',
|
|
2367
2899
|
measure: {
|
|
2368
2900
|
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
@@ -2383,22 +2915,162 @@ const testCases = [
|
|
|
2383
2915
|
value: 23,
|
|
2384
2916
|
type: 'Text',
|
|
2385
2917
|
metadata: {
|
|
2918
|
+
TimeInstant: {
|
|
2919
|
+
value: '2033-03-03T03:33:33.333Z',
|
|
2920
|
+
type: 'DateTime'
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
},
|
|
2924
|
+
TimeInstant: {
|
|
2925
|
+
value: '2033-03-03T03:33:33.333Z',
|
|
2926
|
+
type: 'DateTime'
|
|
2927
|
+
}
|
|
2928
|
+
}
|
|
2929
|
+
}
|
|
2930
|
+
]
|
|
2931
|
+
},
|
|
2932
|
+
{
|
|
2933
|
+
describeName: '0433 - Simple group with active attribute + several timestamp mappings defined in multientity',
|
|
2934
|
+
provision: {
|
|
2935
|
+
url: 'http://localhost:' + config.iota.server.port + '/iot/services',
|
|
2936
|
+
method: 'POST',
|
|
2937
|
+
json: {
|
|
2938
|
+
services: [
|
|
2939
|
+
{
|
|
2940
|
+
resource: '/iot/json',
|
|
2941
|
+
apikey: globalEnv.apikey,
|
|
2942
|
+
timestamp: true,
|
|
2943
|
+
entity_type: globalEnv.entity_type,
|
|
2944
|
+
commands: [],
|
|
2945
|
+
lazy: [],
|
|
2946
|
+
attributes: [
|
|
2947
|
+
{
|
|
2948
|
+
object_id: 'a',
|
|
2949
|
+
name: 'a',
|
|
2950
|
+
type: 'Text'
|
|
2951
|
+
},
|
|
2952
|
+
{
|
|
2953
|
+
object_id: 'mydatetime1',
|
|
2954
|
+
name: 'TimeInstant',
|
|
2955
|
+
type: 'DateTime',
|
|
2956
|
+
entity_name: 'TestType:TestDevice1',
|
|
2957
|
+
entity_type: 'TestType'
|
|
2958
|
+
},
|
|
2959
|
+
{
|
|
2960
|
+
object_id: 'mydatetime2',
|
|
2961
|
+
name: 'TimeInstant',
|
|
2962
|
+
type: 'DateTime',
|
|
2963
|
+
entity_name: 'TestType:TestDevice2',
|
|
2964
|
+
entity_type: 'TestType'
|
|
2965
|
+
},
|
|
2966
|
+
{
|
|
2967
|
+
object_id: 'a1',
|
|
2968
|
+
name: 'a1',
|
|
2969
|
+
type: 'Text',
|
|
2970
|
+
expression: 'a',
|
|
2971
|
+
entity_name: 'TestType:TestDevice1',
|
|
2972
|
+
entity_type: 'TestType'
|
|
2973
|
+
},
|
|
2974
|
+
{
|
|
2975
|
+
object_id: 'a2',
|
|
2976
|
+
name: 'a2',
|
|
2977
|
+
type: 'Text',
|
|
2978
|
+
expression: 'a',
|
|
2979
|
+
entity_name: 'TestType:TestDevice2',
|
|
2980
|
+
entity_type: 'TestType'
|
|
2981
|
+
}
|
|
2982
|
+
]
|
|
2983
|
+
}
|
|
2984
|
+
]
|
|
2985
|
+
},
|
|
2986
|
+
headers: {
|
|
2987
|
+
'fiware-service': globalEnv.service,
|
|
2988
|
+
'fiware-servicepath': globalEnv.servicePath
|
|
2989
|
+
}
|
|
2990
|
+
},
|
|
2991
|
+
should: [
|
|
2992
|
+
{
|
|
2993
|
+
shouldName:
|
|
2994
|
+
'A - WHEN sending a measure through http IT should map the measure to timestamp attributes and use it for timestmap and other metadata attributes sent to Context Broker',
|
|
2995
|
+
type: 'multientity',
|
|
2996
|
+
isRegex: true,
|
|
2997
|
+
measure: {
|
|
2998
|
+
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
2999
|
+
method: 'POST',
|
|
3000
|
+
qs: {
|
|
3001
|
+
i: globalEnv.deviceId,
|
|
3002
|
+
k: globalEnv.apikey
|
|
3003
|
+
},
|
|
3004
|
+
json: {
|
|
3005
|
+
a: 23,
|
|
3006
|
+
mydatetime1: '2011-01-01T01:11:11.111Z',
|
|
3007
|
+
mydatetime2: '2022-02-02T02:22:22.222Z'
|
|
3008
|
+
}
|
|
3009
|
+
},
|
|
3010
|
+
expectation: {
|
|
3011
|
+
actionType: 'append',
|
|
3012
|
+
entities: [
|
|
3013
|
+
{
|
|
3014
|
+
id: 'TestType:TestDevice1',
|
|
3015
|
+
type: globalEnv.entity_type,
|
|
3016
|
+
a1: {
|
|
3017
|
+
value: 23,
|
|
3018
|
+
type: 'Text',
|
|
3019
|
+
metadata: {
|
|
3020
|
+
TimeInstant: {
|
|
3021
|
+
value: '2011-01-01T01:11:11.111Z',
|
|
3022
|
+
type: 'DateTime'
|
|
3023
|
+
}
|
|
3024
|
+
}
|
|
3025
|
+
},
|
|
3026
|
+
TimeInstant: {
|
|
3027
|
+
value: '2011-01-01T01:11:11.111Z',
|
|
3028
|
+
type: 'DateTime'
|
|
3029
|
+
}
|
|
3030
|
+
},
|
|
3031
|
+
{
|
|
3032
|
+
id: 'TestType:TestDevice2',
|
|
3033
|
+
type: globalEnv.entity_type,
|
|
3034
|
+
a2: {
|
|
3035
|
+
value: 23,
|
|
3036
|
+
type: 'Text',
|
|
3037
|
+
metadata: {
|
|
3038
|
+
TimeInstant: {
|
|
3039
|
+
value: '2022-02-02T02:22:22.222Z',
|
|
3040
|
+
type: 'DateTime'
|
|
3041
|
+
}
|
|
3042
|
+
}
|
|
3043
|
+
},
|
|
2386
3044
|
TimeInstant: {
|
|
2387
3045
|
value: '2022-02-02T02:22:22.222Z',
|
|
2388
3046
|
type: 'DateTime'
|
|
2389
3047
|
}
|
|
3048
|
+
},
|
|
3049
|
+
{
|
|
3050
|
+
id: globalEnv.entity_name,
|
|
3051
|
+
type: globalEnv.entity_type,
|
|
3052
|
+
a: {
|
|
3053
|
+
value: 23,
|
|
3054
|
+
type: 'Text',
|
|
3055
|
+
metadata: {
|
|
3056
|
+
TimeInstant: {
|
|
3057
|
+
value: _.isDateString,
|
|
3058
|
+
type: 'DateTime'
|
|
3059
|
+
}
|
|
3060
|
+
}
|
|
3061
|
+
},
|
|
3062
|
+
TimeInstant: {
|
|
3063
|
+
value: _.isDateString,
|
|
3064
|
+
type: 'DateTime'
|
|
3065
|
+
}
|
|
2390
3066
|
}
|
|
2391
|
-
|
|
2392
|
-
TimeInstant: {
|
|
2393
|
-
value: '2022-02-02T02:22:22.222Z',
|
|
2394
|
-
type: 'DateTime'
|
|
2395
|
-
}
|
|
3067
|
+
]
|
|
2396
3068
|
}
|
|
2397
3069
|
},
|
|
2398
3070
|
{
|
|
2399
3071
|
shouldName:
|
|
2400
|
-
'A - WHEN sending a measure
|
|
2401
|
-
type: '
|
|
3072
|
+
'A - WHEN sending a measure through http IT should map the measure to timestamp attributes for just mapped entity and sent to Context Broker',
|
|
3073
|
+
type: 'multientity',
|
|
2402
3074
|
isRegex: true,
|
|
2403
3075
|
measure: {
|
|
2404
3076
|
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
@@ -2408,31 +3080,61 @@ const testCases = [
|
|
|
2408
3080
|
k: globalEnv.apikey
|
|
2409
3081
|
},
|
|
2410
3082
|
json: {
|
|
2411
|
-
|
|
3083
|
+
mydatetime1: '2011-01-01T01:11:11.111Z'
|
|
2412
3084
|
}
|
|
2413
3085
|
},
|
|
2414
3086
|
expectation: {
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
metadata: {
|
|
3087
|
+
actionType: 'append',
|
|
3088
|
+
entities: [
|
|
3089
|
+
{
|
|
3090
|
+
id: 'TestType:TestDevice1',
|
|
3091
|
+
type: globalEnv.entity_type,
|
|
2421
3092
|
TimeInstant: {
|
|
2422
|
-
value:
|
|
3093
|
+
value: '2011-01-01T01:11:11.111Z',
|
|
2423
3094
|
type: 'DateTime'
|
|
2424
3095
|
}
|
|
2425
3096
|
}
|
|
2426
|
-
|
|
2427
|
-
TimeInstant: {
|
|
2428
|
-
value: _.isDateString,
|
|
2429
|
-
type: 'DateTime'
|
|
2430
|
-
}
|
|
3097
|
+
]
|
|
2431
3098
|
}
|
|
3099
|
+
}
|
|
3100
|
+
]
|
|
3101
|
+
},
|
|
3102
|
+
|
|
3103
|
+
// 0500 - EXPLICIT ATTRIBUTES TESTS
|
|
3104
|
+
{
|
|
3105
|
+
describeName: '0500 - Group with explicit attrs:false (boolean) + active atributes',
|
|
3106
|
+
provision: {
|
|
3107
|
+
url: 'http://localhost:' + config.iota.server.port + '/iot/services',
|
|
3108
|
+
method: 'POST',
|
|
3109
|
+
json: {
|
|
3110
|
+
services: [
|
|
3111
|
+
{
|
|
3112
|
+
resource: '/iot/json',
|
|
3113
|
+
apikey: globalEnv.apikey,
|
|
3114
|
+
entity_type: globalEnv.entity_type,
|
|
3115
|
+
explicitAttrs: false,
|
|
3116
|
+
commands: [],
|
|
3117
|
+
lazy: [],
|
|
3118
|
+
attributes: [
|
|
3119
|
+
{
|
|
3120
|
+
object_id: 'a',
|
|
3121
|
+
name: 'attr_a',
|
|
3122
|
+
type: 'Number'
|
|
3123
|
+
}
|
|
3124
|
+
],
|
|
3125
|
+
static_attributes: []
|
|
3126
|
+
}
|
|
3127
|
+
]
|
|
2432
3128
|
},
|
|
3129
|
+
headers: {
|
|
3130
|
+
'fiware-service': globalEnv.service,
|
|
3131
|
+
'fiware-servicepath': globalEnv.servicePath
|
|
3132
|
+
}
|
|
3133
|
+
},
|
|
3134
|
+
should: [
|
|
2433
3135
|
{
|
|
2434
3136
|
shouldName:
|
|
2435
|
-
'A - WHEN sending
|
|
3137
|
+
'A - WHEN sending both provisioned and not object_ids (measures) through http IT should store all attributes into Context Broker',
|
|
2436
3138
|
type: 'single',
|
|
2437
3139
|
measure: {
|
|
2438
3140
|
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
@@ -2442,34 +3144,27 @@ const testCases = [
|
|
|
2442
3144
|
k: globalEnv.apikey
|
|
2443
3145
|
},
|
|
2444
3146
|
json: {
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
a: 23
|
|
3147
|
+
a: 3,
|
|
3148
|
+
b: 10
|
|
2448
3149
|
}
|
|
2449
3150
|
},
|
|
2450
3151
|
expectation: {
|
|
2451
3152
|
id: globalEnv.entity_name,
|
|
2452
3153
|
type: globalEnv.entity_type,
|
|
2453
|
-
|
|
2454
|
-
value:
|
|
2455
|
-
type: 'Text'
|
|
2456
|
-
metadata: {
|
|
2457
|
-
TimeInstant: {
|
|
2458
|
-
value: '2022-02-02T02:22:22.222Z',
|
|
2459
|
-
type: 'DateTime'
|
|
2460
|
-
}
|
|
2461
|
-
}
|
|
3154
|
+
b: {
|
|
3155
|
+
value: 10,
|
|
3156
|
+
type: 'Text'
|
|
2462
3157
|
},
|
|
2463
|
-
|
|
2464
|
-
value:
|
|
2465
|
-
type: '
|
|
3158
|
+
attr_a: {
|
|
3159
|
+
value: 3,
|
|
3160
|
+
type: 'Number'
|
|
2466
3161
|
}
|
|
2467
3162
|
}
|
|
2468
3163
|
}
|
|
2469
3164
|
]
|
|
2470
3165
|
},
|
|
2471
3166
|
{
|
|
2472
|
-
describeName: '
|
|
3167
|
+
describeName: '0510 - Group without explicit (not defined) + active atributes',
|
|
2473
3168
|
provision: {
|
|
2474
3169
|
url: 'http://localhost:' + config.iota.server.port + '/iot/services',
|
|
2475
3170
|
method: 'POST',
|
|
@@ -2478,18 +3173,17 @@ const testCases = [
|
|
|
2478
3173
|
{
|
|
2479
3174
|
resource: '/iot/json',
|
|
2480
3175
|
apikey: globalEnv.apikey,
|
|
2481
|
-
timestamp: true,
|
|
2482
3176
|
entity_type: globalEnv.entity_type,
|
|
2483
3177
|
commands: [],
|
|
2484
3178
|
lazy: [],
|
|
2485
3179
|
attributes: [
|
|
2486
3180
|
{
|
|
2487
|
-
object_id: '
|
|
2488
|
-
name: '
|
|
2489
|
-
type: '
|
|
2490
|
-
expression: '"2033-03-03T" + "03:33:33.333Z"'
|
|
3181
|
+
object_id: 'a',
|
|
3182
|
+
name: 'attr_a',
|
|
3183
|
+
type: 'Number'
|
|
2491
3184
|
}
|
|
2492
|
-
]
|
|
3185
|
+
],
|
|
3186
|
+
static_attributes: []
|
|
2493
3187
|
}
|
|
2494
3188
|
]
|
|
2495
3189
|
},
|
|
@@ -2501,7 +3195,7 @@ const testCases = [
|
|
|
2501
3195
|
should: [
|
|
2502
3196
|
{
|
|
2503
3197
|
shouldName:
|
|
2504
|
-
'A - WHEN sending
|
|
3198
|
+
'A - WHEN sending both provisioned and not object_ids (measures) through http IT should store all attributes into Context Broker',
|
|
2505
3199
|
type: 'single',
|
|
2506
3200
|
measure: {
|
|
2507
3201
|
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
@@ -2511,33 +3205,27 @@ const testCases = [
|
|
|
2511
3205
|
k: globalEnv.apikey
|
|
2512
3206
|
},
|
|
2513
3207
|
json: {
|
|
2514
|
-
|
|
2515
|
-
|
|
3208
|
+
a: 3,
|
|
3209
|
+
b: 10
|
|
2516
3210
|
}
|
|
2517
3211
|
},
|
|
2518
3212
|
expectation: {
|
|
2519
3213
|
id: globalEnv.entity_name,
|
|
2520
3214
|
type: globalEnv.entity_type,
|
|
2521
|
-
|
|
2522
|
-
value:
|
|
2523
|
-
type: 'Text'
|
|
2524
|
-
metadata: {
|
|
2525
|
-
TimeInstant: {
|
|
2526
|
-
value: '2033-03-03T03:33:33.333Z',
|
|
2527
|
-
type: 'DateTime'
|
|
2528
|
-
}
|
|
2529
|
-
}
|
|
3215
|
+
b: {
|
|
3216
|
+
value: 10,
|
|
3217
|
+
type: 'Text'
|
|
2530
3218
|
},
|
|
2531
|
-
|
|
2532
|
-
value:
|
|
2533
|
-
type: '
|
|
3219
|
+
attr_a: {
|
|
3220
|
+
value: 3,
|
|
3221
|
+
type: 'Number'
|
|
2534
3222
|
}
|
|
2535
3223
|
}
|
|
2536
3224
|
}
|
|
2537
3225
|
]
|
|
2538
3226
|
},
|
|
2539
3227
|
{
|
|
2540
|
-
describeName: '
|
|
3228
|
+
describeName: '0520 - Group with explicit attrs:true (boolean) + active atributes',
|
|
2541
3229
|
provision: {
|
|
2542
3230
|
url: 'http://localhost:' + config.iota.server.port + '/iot/services',
|
|
2543
3231
|
method: 'POST',
|
|
@@ -2546,47 +3234,18 @@ const testCases = [
|
|
|
2546
3234
|
{
|
|
2547
3235
|
resource: '/iot/json',
|
|
2548
3236
|
apikey: globalEnv.apikey,
|
|
2549
|
-
timestamp: true,
|
|
2550
3237
|
entity_type: globalEnv.entity_type,
|
|
3238
|
+
explicitAttrs: true,
|
|
2551
3239
|
commands: [],
|
|
2552
3240
|
lazy: [],
|
|
2553
3241
|
attributes: [
|
|
2554
3242
|
{
|
|
2555
3243
|
object_id: 'a',
|
|
2556
|
-
name: '
|
|
2557
|
-
type: '
|
|
2558
|
-
},
|
|
2559
|
-
{
|
|
2560
|
-
object_id: 'mydatetime1',
|
|
2561
|
-
name: 'TimeInstant',
|
|
2562
|
-
type: 'DateTime',
|
|
2563
|
-
entity_name: 'TestType:TestDevice1',
|
|
2564
|
-
entity_type: 'TestType'
|
|
2565
|
-
},
|
|
2566
|
-
{
|
|
2567
|
-
object_id: 'mydatetime2',
|
|
2568
|
-
name: 'TimeInstant',
|
|
2569
|
-
type: 'DateTime',
|
|
2570
|
-
entity_name: 'TestType:TestDevice2',
|
|
2571
|
-
entity_type: 'TestType'
|
|
2572
|
-
},
|
|
2573
|
-
{
|
|
2574
|
-
object_id: 'a1',
|
|
2575
|
-
name: 'a1',
|
|
2576
|
-
type: 'Text',
|
|
2577
|
-
expression: 'a',
|
|
2578
|
-
entity_name: 'TestType:TestDevice1',
|
|
2579
|
-
entity_type: 'TestType'
|
|
2580
|
-
},
|
|
2581
|
-
{
|
|
2582
|
-
object_id: 'a2',
|
|
2583
|
-
name: 'a2',
|
|
2584
|
-
type: 'Text',
|
|
2585
|
-
expression: 'a',
|
|
2586
|
-
entity_name: 'TestType:TestDevice2',
|
|
2587
|
-
entity_type: 'TestType'
|
|
3244
|
+
name: 'attr_a',
|
|
3245
|
+
type: 'Number'
|
|
2588
3246
|
}
|
|
2589
|
-
]
|
|
3247
|
+
],
|
|
3248
|
+
static_attributes: []
|
|
2590
3249
|
}
|
|
2591
3250
|
]
|
|
2592
3251
|
},
|
|
@@ -2598,9 +3257,8 @@ const testCases = [
|
|
|
2598
3257
|
should: [
|
|
2599
3258
|
{
|
|
2600
3259
|
shouldName:
|
|
2601
|
-
'A - WHEN sending
|
|
2602
|
-
type: '
|
|
2603
|
-
isRegex: true,
|
|
3260
|
+
'A - WHEN sending both provisioned and not object_ids (measures) through http IT should store all attributes into Context Broker',
|
|
3261
|
+
type: 'single',
|
|
2604
3262
|
measure: {
|
|
2605
3263
|
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
2606
3264
|
method: 'POST',
|
|
@@ -2609,76 +3267,72 @@ const testCases = [
|
|
|
2609
3267
|
k: globalEnv.apikey
|
|
2610
3268
|
},
|
|
2611
3269
|
json: {
|
|
2612
|
-
a:
|
|
2613
|
-
|
|
2614
|
-
mydatetime2: '2022-02-02T02:22:22.222Z'
|
|
3270
|
+
a: 3,
|
|
3271
|
+
b: 10
|
|
2615
3272
|
}
|
|
2616
3273
|
},
|
|
2617
3274
|
expectation: {
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
type: 'DateTime'
|
|
2648
|
-
}
|
|
2649
|
-
}
|
|
2650
|
-
},
|
|
2651
|
-
TimeInstant: {
|
|
2652
|
-
value: '2011-01-01T01:11:11.111Z',
|
|
2653
|
-
type: 'DateTime'
|
|
2654
|
-
}
|
|
2655
|
-
},
|
|
2656
|
-
{
|
|
2657
|
-
id: 'TestType:TestDevice2',
|
|
2658
|
-
type: globalEnv.entity_type,
|
|
2659
|
-
a2: {
|
|
2660
|
-
value: 23,
|
|
2661
|
-
type: 'Text',
|
|
2662
|
-
metadata: {
|
|
2663
|
-
TimeInstant: {
|
|
2664
|
-
value: '2022-02-02T02:22:22.222Z',
|
|
2665
|
-
type: 'DateTime'
|
|
2666
|
-
}
|
|
2667
|
-
}
|
|
3275
|
+
id: globalEnv.entity_name,
|
|
3276
|
+
type: globalEnv.entity_type,
|
|
3277
|
+
attr_a: {
|
|
3278
|
+
value: 3,
|
|
3279
|
+
type: 'Number'
|
|
3280
|
+
}
|
|
3281
|
+
}
|
|
3282
|
+
}
|
|
3283
|
+
]
|
|
3284
|
+
},
|
|
3285
|
+
{
|
|
3286
|
+
describeName: '0530 - Group with explicit attrs:[array] + active attributes + static attributes',
|
|
3287
|
+
provision: {
|
|
3288
|
+
url: 'http://localhost:' + config.iota.server.port + '/iot/services',
|
|
3289
|
+
method: 'POST',
|
|
3290
|
+
json: {
|
|
3291
|
+
services: [
|
|
3292
|
+
{
|
|
3293
|
+
resource: '/iot/json',
|
|
3294
|
+
apikey: globalEnv.apikey,
|
|
3295
|
+
entity_type: globalEnv.entity_type,
|
|
3296
|
+
explicitAttrs: "['attr_a','static_a']",
|
|
3297
|
+
commands: [],
|
|
3298
|
+
lazy: [],
|
|
3299
|
+
attributes: [
|
|
3300
|
+
{
|
|
3301
|
+
name: 'attr_a',
|
|
3302
|
+
object_id: 'a',
|
|
3303
|
+
type: 'Number'
|
|
2668
3304
|
},
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
3305
|
+
{
|
|
3306
|
+
name: 'attr_b',
|
|
3307
|
+
object_id: 'b',
|
|
3308
|
+
type: 'Number'
|
|
2672
3309
|
}
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
3310
|
+
],
|
|
3311
|
+
static_attributes: [
|
|
3312
|
+
{
|
|
3313
|
+
name: 'static_a',
|
|
3314
|
+
type: 'Number',
|
|
3315
|
+
value: 3
|
|
3316
|
+
},
|
|
3317
|
+
{
|
|
3318
|
+
name: 'static_b',
|
|
3319
|
+
type: 'Number',
|
|
3320
|
+
value: 4
|
|
3321
|
+
}
|
|
3322
|
+
]
|
|
3323
|
+
}
|
|
3324
|
+
]
|
|
2676
3325
|
},
|
|
3326
|
+
headers: {
|
|
3327
|
+
'fiware-service': globalEnv.service,
|
|
3328
|
+
'fiware-servicepath': globalEnv.servicePath
|
|
3329
|
+
}
|
|
3330
|
+
},
|
|
3331
|
+
should: [
|
|
2677
3332
|
{
|
|
2678
3333
|
shouldName:
|
|
2679
|
-
'A - WHEN sending
|
|
2680
|
-
type: '
|
|
2681
|
-
isRegex: true,
|
|
3334
|
+
'A - WHEN sending both provisioned and not object_ids (measures) through http IT should store only defined in explicitAttrs array into Context Broker',
|
|
3335
|
+
type: 'single',
|
|
2682
3336
|
measure: {
|
|
2683
3337
|
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
2684
3338
|
method: 'POST',
|
|
@@ -2687,29 +3341,28 @@ const testCases = [
|
|
|
2687
3341
|
k: globalEnv.apikey
|
|
2688
3342
|
},
|
|
2689
3343
|
json: {
|
|
2690
|
-
|
|
3344
|
+
a: 3,
|
|
3345
|
+
b: 10,
|
|
3346
|
+
c: 11
|
|
2691
3347
|
}
|
|
2692
3348
|
},
|
|
2693
3349
|
expectation: {
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
]
|
|
3350
|
+
id: globalEnv.entity_name,
|
|
3351
|
+
type: globalEnv.entity_type,
|
|
3352
|
+
attr_a: {
|
|
3353
|
+
value: 3,
|
|
3354
|
+
type: 'Number'
|
|
3355
|
+
},
|
|
3356
|
+
static_a: {
|
|
3357
|
+
value: 3,
|
|
3358
|
+
type: 'Number'
|
|
3359
|
+
}
|
|
2705
3360
|
}
|
|
2706
3361
|
}
|
|
2707
3362
|
]
|
|
2708
3363
|
},
|
|
2709
|
-
|
|
2710
|
-
// 0500 - EXPLICIT ATTRIBUTES TESTS
|
|
2711
3364
|
{
|
|
2712
|
-
describeName: '
|
|
3365
|
+
describeName: '0531 - Group with explicit attrs:[ ] (empty array) + active attributes + static attributes',
|
|
2713
3366
|
provision: {
|
|
2714
3367
|
url: 'http://localhost:' + config.iota.server.port + '/iot/services',
|
|
2715
3368
|
method: 'POST',
|
|
@@ -2719,17 +3372,33 @@ const testCases = [
|
|
|
2719
3372
|
resource: '/iot/json',
|
|
2720
3373
|
apikey: globalEnv.apikey,
|
|
2721
3374
|
entity_type: globalEnv.entity_type,
|
|
2722
|
-
explicitAttrs:
|
|
3375
|
+
explicitAttrs: '[ ]',
|
|
2723
3376
|
commands: [],
|
|
2724
3377
|
lazy: [],
|
|
2725
3378
|
attributes: [
|
|
2726
3379
|
{
|
|
2727
|
-
object_id: 'a',
|
|
2728
3380
|
name: 'attr_a',
|
|
3381
|
+
object_id: 'a',
|
|
3382
|
+
type: 'Number'
|
|
3383
|
+
},
|
|
3384
|
+
{
|
|
3385
|
+
name: 'attr_b',
|
|
3386
|
+
object_id: 'b',
|
|
2729
3387
|
type: 'Number'
|
|
2730
3388
|
}
|
|
2731
3389
|
],
|
|
2732
|
-
static_attributes: [
|
|
3390
|
+
static_attributes: [
|
|
3391
|
+
{
|
|
3392
|
+
name: 'static_a',
|
|
3393
|
+
type: 'Number',
|
|
3394
|
+
value: 3
|
|
3395
|
+
},
|
|
3396
|
+
{
|
|
3397
|
+
name: 'static_b',
|
|
3398
|
+
type: 'Number',
|
|
3399
|
+
value: 4
|
|
3400
|
+
}
|
|
3401
|
+
]
|
|
2733
3402
|
}
|
|
2734
3403
|
]
|
|
2735
3404
|
},
|
|
@@ -2741,7 +3410,7 @@ const testCases = [
|
|
|
2741
3410
|
should: [
|
|
2742
3411
|
{
|
|
2743
3412
|
shouldName:
|
|
2744
|
-
'A - WHEN sending both provisioned and not object_ids (measures) through http IT should store
|
|
3413
|
+
'A - WHEN sending both provisioned and not object_ids (measures) through http IT should NOT store anything into the Context Broker (No request to CB)',
|
|
2745
3414
|
type: 'single',
|
|
2746
3415
|
measure: {
|
|
2747
3416
|
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
@@ -2752,26 +3421,17 @@ const testCases = [
|
|
|
2752
3421
|
},
|
|
2753
3422
|
json: {
|
|
2754
3423
|
a: 3,
|
|
2755
|
-
b: 10
|
|
3424
|
+
b: 10,
|
|
3425
|
+
c: 11
|
|
2756
3426
|
}
|
|
2757
3427
|
},
|
|
2758
|
-
expectation:
|
|
2759
|
-
id: globalEnv.entity_name,
|
|
2760
|
-
type: globalEnv.entity_type,
|
|
2761
|
-
b: {
|
|
2762
|
-
value: 10,
|
|
2763
|
-
type: 'Text'
|
|
2764
|
-
},
|
|
2765
|
-
attr_a: {
|
|
2766
|
-
value: 3,
|
|
2767
|
-
type: 'Number'
|
|
2768
|
-
}
|
|
2769
|
-
}
|
|
3428
|
+
expectation: [] // No payload expected
|
|
2770
3429
|
}
|
|
2771
3430
|
]
|
|
2772
3431
|
},
|
|
2773
3432
|
{
|
|
2774
|
-
describeName:
|
|
3433
|
+
describeName:
|
|
3434
|
+
'0532 - Group with explicit attrs:[ ] (empty array) + active attributes + static attributes + timestamp:true',
|
|
2775
3435
|
provision: {
|
|
2776
3436
|
url: 'http://localhost:' + config.iota.server.port + '/iot/services',
|
|
2777
3437
|
method: 'POST',
|
|
@@ -2781,16 +3441,34 @@ const testCases = [
|
|
|
2781
3441
|
resource: '/iot/json',
|
|
2782
3442
|
apikey: globalEnv.apikey,
|
|
2783
3443
|
entity_type: globalEnv.entity_type,
|
|
3444
|
+
explicitAttrs: '[ ]',
|
|
3445
|
+
timestamp: true,
|
|
2784
3446
|
commands: [],
|
|
2785
3447
|
lazy: [],
|
|
2786
3448
|
attributes: [
|
|
2787
3449
|
{
|
|
2788
|
-
object_id: 'a',
|
|
2789
3450
|
name: 'attr_a',
|
|
3451
|
+
object_id: 'a',
|
|
3452
|
+
type: 'Number'
|
|
3453
|
+
},
|
|
3454
|
+
{
|
|
3455
|
+
name: 'attr_b',
|
|
3456
|
+
object_id: 'b',
|
|
2790
3457
|
type: 'Number'
|
|
2791
3458
|
}
|
|
2792
3459
|
],
|
|
2793
|
-
static_attributes: [
|
|
3460
|
+
static_attributes: [
|
|
3461
|
+
{
|
|
3462
|
+
name: 'static_a',
|
|
3463
|
+
type: 'Number',
|
|
3464
|
+
value: 3
|
|
3465
|
+
},
|
|
3466
|
+
{
|
|
3467
|
+
name: 'static_b',
|
|
3468
|
+
type: 'Number',
|
|
3469
|
+
value: 4
|
|
3470
|
+
}
|
|
3471
|
+
]
|
|
2794
3472
|
}
|
|
2795
3473
|
]
|
|
2796
3474
|
},
|
|
@@ -2802,7 +3480,7 @@ const testCases = [
|
|
|
2802
3480
|
should: [
|
|
2803
3481
|
{
|
|
2804
3482
|
shouldName:
|
|
2805
|
-
'A - WHEN sending both provisioned and not object_ids (measures) through http IT should store
|
|
3483
|
+
'A - WHEN sending both provisioned and not object_ids (measures) through http IT should NOT store anything into the Context Broker (No request to CB)',
|
|
2806
3484
|
type: 'single',
|
|
2807
3485
|
measure: {
|
|
2808
3486
|
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
@@ -2813,26 +3491,37 @@ const testCases = [
|
|
|
2813
3491
|
},
|
|
2814
3492
|
json: {
|
|
2815
3493
|
a: 3,
|
|
2816
|
-
b: 10
|
|
3494
|
+
b: 10,
|
|
3495
|
+
c: 11
|
|
2817
3496
|
}
|
|
2818
3497
|
},
|
|
2819
|
-
expectation:
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
3498
|
+
expectation: [] // No payload expected
|
|
3499
|
+
},
|
|
3500
|
+
{
|
|
3501
|
+
shouldName:
|
|
3502
|
+
'B - WHEN sending data and a measure called TimeInstant through http IT should NOT store anything into the Context Broker (No request to CB)',
|
|
3503
|
+
type: 'single',
|
|
3504
|
+
measure: {
|
|
3505
|
+
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
3506
|
+
method: 'POST',
|
|
3507
|
+
qs: {
|
|
3508
|
+
i: globalEnv.deviceId,
|
|
3509
|
+
k: globalEnv.apikey
|
|
2825
3510
|
},
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
3511
|
+
json: {
|
|
3512
|
+
a: 3,
|
|
3513
|
+
b: 10,
|
|
3514
|
+
c: 11,
|
|
3515
|
+
TimeInstant: '2015-12-14T08:06:01.468Z'
|
|
2829
3516
|
}
|
|
2830
|
-
}
|
|
3517
|
+
},
|
|
3518
|
+
expectation: [] // No payload expected
|
|
2831
3519
|
}
|
|
2832
3520
|
]
|
|
2833
3521
|
},
|
|
2834
3522
|
{
|
|
2835
|
-
describeName:
|
|
3523
|
+
describeName:
|
|
3524
|
+
'0533 - Group with explicit attrs:[ ] (empty array) + active attributes + TimeInstant attribute + static attributes + timestamp:true',
|
|
2836
3525
|
provision: {
|
|
2837
3526
|
url: 'http://localhost:' + config.iota.server.port + '/iot/services',
|
|
2838
3527
|
method: 'POST',
|
|
@@ -2842,17 +3531,44 @@ const testCases = [
|
|
|
2842
3531
|
resource: '/iot/json',
|
|
2843
3532
|
apikey: globalEnv.apikey,
|
|
2844
3533
|
entity_type: globalEnv.entity_type,
|
|
2845
|
-
explicitAttrs:
|
|
3534
|
+
explicitAttrs: '[ ]',
|
|
3535
|
+
timestamp: true,
|
|
2846
3536
|
commands: [],
|
|
2847
3537
|
lazy: [],
|
|
2848
3538
|
attributes: [
|
|
2849
3539
|
{
|
|
2850
|
-
object_id: 'a',
|
|
2851
3540
|
name: 'attr_a',
|
|
3541
|
+
object_id: 'a',
|
|
3542
|
+
type: 'Number'
|
|
3543
|
+
},
|
|
3544
|
+
{
|
|
3545
|
+
name: 'attr_b',
|
|
3546
|
+
object_id: 'b',
|
|
2852
3547
|
type: 'Number'
|
|
3548
|
+
},
|
|
3549
|
+
{
|
|
3550
|
+
name: 'DateIssued',
|
|
3551
|
+
object_id: 'TimeInstant',
|
|
3552
|
+
type: 'DateTime'
|
|
3553
|
+
},
|
|
3554
|
+
{
|
|
3555
|
+
name: 'TimeInstant',
|
|
3556
|
+
object_id: 't',
|
|
3557
|
+
type: 'DateTime'
|
|
2853
3558
|
}
|
|
2854
3559
|
],
|
|
2855
|
-
static_attributes: [
|
|
3560
|
+
static_attributes: [
|
|
3561
|
+
{
|
|
3562
|
+
name: 'static_a',
|
|
3563
|
+
type: 'Number',
|
|
3564
|
+
value: 3
|
|
3565
|
+
},
|
|
3566
|
+
{
|
|
3567
|
+
name: 'static_b',
|
|
3568
|
+
type: 'Number',
|
|
3569
|
+
value: 4
|
|
3570
|
+
}
|
|
3571
|
+
]
|
|
2856
3572
|
}
|
|
2857
3573
|
]
|
|
2858
3574
|
},
|
|
@@ -2864,7 +3580,7 @@ const testCases = [
|
|
|
2864
3580
|
should: [
|
|
2865
3581
|
{
|
|
2866
3582
|
shouldName:
|
|
2867
|
-
'A - WHEN sending
|
|
3583
|
+
'A - WHEN sending data and a measure called "t" (defined as TimeInstant attribte) through http IT should NOT store anything into the Context Broker (No request to CB)',
|
|
2868
3584
|
type: 'single',
|
|
2869
3585
|
measure: {
|
|
2870
3586
|
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
@@ -2875,22 +3591,38 @@ const testCases = [
|
|
|
2875
3591
|
},
|
|
2876
3592
|
json: {
|
|
2877
3593
|
a: 3,
|
|
2878
|
-
b: 10
|
|
3594
|
+
b: 10,
|
|
3595
|
+
c: 11,
|
|
3596
|
+
t: '2015-12-14T08:06:01.468Z'
|
|
2879
3597
|
}
|
|
2880
3598
|
},
|
|
2881
|
-
expectation:
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
3599
|
+
expectation: []
|
|
3600
|
+
},
|
|
3601
|
+
{
|
|
3602
|
+
shouldName:
|
|
3603
|
+
'B - WHEN sending data and a measure called TimeInstant through http IT should NOT store anything into the Context Broker (No request to CB)',
|
|
3604
|
+
type: 'single',
|
|
3605
|
+
measure: {
|
|
3606
|
+
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
3607
|
+
method: 'POST',
|
|
3608
|
+
qs: {
|
|
3609
|
+
i: globalEnv.deviceId,
|
|
3610
|
+
k: globalEnv.apikey
|
|
3611
|
+
},
|
|
3612
|
+
json: {
|
|
3613
|
+
a: 3,
|
|
3614
|
+
b: 10,
|
|
3615
|
+
c: 11,
|
|
3616
|
+
TimeInstant: '2015-12-14T08:06:01.468Z'
|
|
2887
3617
|
}
|
|
2888
|
-
}
|
|
3618
|
+
},
|
|
3619
|
+
expectation: [] // No payload expected
|
|
2889
3620
|
}
|
|
2890
3621
|
]
|
|
2891
3622
|
},
|
|
2892
3623
|
{
|
|
2893
|
-
describeName:
|
|
3624
|
+
describeName:
|
|
3625
|
+
'0534 - Group with explicit attrs:[ ] (empty array) + active attributes + TimeInstant attribute + static attributes + timestamp:false',
|
|
2894
3626
|
provision: {
|
|
2895
3627
|
url: 'http://localhost:' + config.iota.server.port + '/iot/services',
|
|
2896
3628
|
method: 'POST',
|
|
@@ -2900,7 +3632,8 @@ const testCases = [
|
|
|
2900
3632
|
resource: '/iot/json',
|
|
2901
3633
|
apikey: globalEnv.apikey,
|
|
2902
3634
|
entity_type: globalEnv.entity_type,
|
|
2903
|
-
explicitAttrs:
|
|
3635
|
+
explicitAttrs: '[ ]',
|
|
3636
|
+
timestamp: false,
|
|
2904
3637
|
commands: [],
|
|
2905
3638
|
lazy: [],
|
|
2906
3639
|
attributes: [
|
|
@@ -2913,6 +3646,16 @@ const testCases = [
|
|
|
2913
3646
|
name: 'attr_b',
|
|
2914
3647
|
object_id: 'b',
|
|
2915
3648
|
type: 'Number'
|
|
3649
|
+
},
|
|
3650
|
+
{
|
|
3651
|
+
name: 'DateIssued',
|
|
3652
|
+
object_id: 'TimeInstant',
|
|
3653
|
+
type: 'DateTime'
|
|
3654
|
+
},
|
|
3655
|
+
{
|
|
3656
|
+
name: 'TimeInstant',
|
|
3657
|
+
object_id: 't',
|
|
3658
|
+
type: 'DateTime'
|
|
2916
3659
|
}
|
|
2917
3660
|
],
|
|
2918
3661
|
static_attributes: [
|
|
@@ -2938,7 +3681,7 @@ const testCases = [
|
|
|
2938
3681
|
should: [
|
|
2939
3682
|
{
|
|
2940
3683
|
shouldName:
|
|
2941
|
-
'A - WHEN sending
|
|
3684
|
+
'A - WHEN sending data and a measure called "t" (defined as TimeInstant attribte) through http IT should NOT store anything into the Context Broker (No request to CB)',
|
|
2942
3685
|
type: 'single',
|
|
2943
3686
|
measure: {
|
|
2944
3687
|
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
@@ -2950,21 +3693,31 @@ const testCases = [
|
|
|
2950
3693
|
json: {
|
|
2951
3694
|
a: 3,
|
|
2952
3695
|
b: 10,
|
|
2953
|
-
c: 11
|
|
3696
|
+
c: 11,
|
|
3697
|
+
t: '2015-12-14T08:06:01.468Z'
|
|
2954
3698
|
}
|
|
2955
3699
|
},
|
|
2956
|
-
expectation:
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
3700
|
+
expectation: []
|
|
3701
|
+
},
|
|
3702
|
+
{
|
|
3703
|
+
shouldName:
|
|
3704
|
+
'B - WHEN sending data and a measure called TimeInstant through http IT should NOT store anything into the Context Broker (No request to CB)',
|
|
3705
|
+
type: 'single',
|
|
3706
|
+
measure: {
|
|
3707
|
+
url: 'http://localhost:' + config.http.port + '/iot/json',
|
|
3708
|
+
method: 'POST',
|
|
3709
|
+
qs: {
|
|
3710
|
+
i: globalEnv.deviceId,
|
|
3711
|
+
k: globalEnv.apikey
|
|
2962
3712
|
},
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
3713
|
+
json: {
|
|
3714
|
+
a: 3,
|
|
3715
|
+
b: 10,
|
|
3716
|
+
c: 11,
|
|
3717
|
+
TimeInstant: '2015-12-14T08:06:01.468Z'
|
|
2966
3718
|
}
|
|
2967
|
-
}
|
|
3719
|
+
},
|
|
3720
|
+
expectation: [] // No payload expected
|
|
2968
3721
|
}
|
|
2969
3722
|
]
|
|
2970
3723
|
},
|