Skip to content

Commit

Permalink
Merge pull request #781 from telefonicaid/task/add_metatata_ngsiv2_pa…
Browse files Browse the repository at this point in the history
…yload_example

add metadata to ngsiv2 payload example
  • Loading branch information
fgalan authored Nov 20, 2023
2 parents 488a403 + 9ae7d36 commit e76e635
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 15 deletions.
10 changes: 9 additions & 1 deletion docs/usermanual.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,15 @@ Examples of these `ngsiv2` payloads are the following ones:
{
"id": "MyEntityId1",
"type": "MyEntityType1",
"attr1": { type: "Text", "value": "MyAttr1Value"},
"attr1": { "type": "Text", "value": "MyAttr1Value"},
"attr2": { "type": "Text", "value": "MyAttr1Value"
"metadata": {
"TimeInstant": {
"type": "DateTime",
"value": "2023-11-17T11:59:22.661Z"
}
}
}
...
},
...
Expand Down
48 changes: 42 additions & 6 deletions test/unit/ngsiv2/HTTP_receive_ngsiv2_measures-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@ describe('HTTP: NGSIv2 Measure reception ', function () {
},
status: {
type: 'Text',
value: 'connected'
value: 'connected',
metadata: {
TimeInstant: {
type: 'DateTime',
value: '2023-11-17T11:59:22.661Z'
}
}
},
dateServiceStarted: {
type: 'DateTime',
Expand Down Expand Up @@ -178,7 +184,13 @@ describe('HTTP: NGSIv2 Measure reception ', function () {
},
status: {
type: 'Text',
value: 'connected'
value: 'connected',
metadata: {
TimeInstant: {
type: 'DateTime',
value: '2023-11-17T11:59:22.661Z'
}
}
},
dateServiceStarted: {
type: 'DateTime',
Expand Down Expand Up @@ -223,7 +235,13 @@ describe('HTTP: NGSIv2 Measure reception ', function () {
},
status: {
type: 'Text',
value: 'connected'
value: 'connected',
metadata: {
TimeInstant: {
type: 'DateTime',
value: '2023-11-17T11:59:22.661Z'
}
}
},
dateServiceStarted: {
type: 'DateTime',
Expand Down Expand Up @@ -316,7 +334,13 @@ describe('HTTP: NGSIv2 Measure reception ', function () {
},
status: {
type: 'Text',
value: 'connected'
value: 'connected',
metadata: {
TimeInstant: {
type: 'DateTime',
value: '2023-11-17T11:59:22.661Z'
}
}
},
dateServiceStarted: {
type: 'DateTime',
Expand Down Expand Up @@ -400,7 +424,13 @@ describe('HTTP: NGSIv2 Measure reception ', function () {
},
status: {
type: 'Text',
value: 'connected'
value: 'connected',
metadata: {
TimeInstant: {
type: 'DateTime',
value: '2023-11-17T11:59:22.661Z'
}
}
},
dateServiceStarted: {
type: 'DateTime',
Expand Down Expand Up @@ -445,7 +475,13 @@ describe('HTTP: NGSIv2 Measure reception ', function () {
},
status: {
type: 'Text',
value: 'connected'
value: 'connected',
metadata: {
TimeInstant: {
type: 'DateTime',
value: '2023-11-17T11:59:22.661Z'
}
}
},
dateServiceStarted: {
type: 'DateTime',
Expand Down
48 changes: 42 additions & 6 deletions test/unit/ngsiv2/MQTT_receive_ngsiv2_measures-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,13 @@ describe('MQTT: NGSIv2 Measure reception ', function () {
},
status: {
type: 'Text',
value: 'connected'
value: 'connected',
metadata: {
TimeInstant: {
type: 'DateTime',
value: '2023-11-17T11:59:22.661Z'
}
}
},
dateServiceStarted: {
type: 'DateTime',
Expand Down Expand Up @@ -164,7 +170,13 @@ describe('MQTT: NGSIv2 Measure reception ', function () {
},
status: {
type: 'Text',
value: 'connected'
value: 'connected',
metadata: {
TimeInstant: {
type: 'DateTime',
value: '2023-11-17T11:59:22.661Z'
}
}
},
dateServiceStarted: {
type: 'DateTime',
Expand Down Expand Up @@ -209,7 +221,13 @@ describe('MQTT: NGSIv2 Measure reception ', function () {
},
status: {
type: 'Text',
value: 'connected'
value: 'connected',
metadata: {
TimeInstant: {
type: 'DateTime',
value: '2023-11-17T11:59:22.661Z'
}
}
},
dateServiceStarted: {
type: 'DateTime',
Expand Down Expand Up @@ -285,7 +303,13 @@ describe('MQTT: NGSIv2 Measure reception ', function () {
},
status: {
type: 'Text',
value: 'connected'
value: 'connected',
metadata: {
TimeInstant: {
type: 'DateTime',
value: '2023-11-17T11:59:22.661Z'
}
}
},
dateServiceStarted: {
type: 'DateTime',
Expand Down Expand Up @@ -352,7 +376,13 @@ describe('MQTT: NGSIv2 Measure reception ', function () {
},
status: {
type: 'Text',
value: 'connected'
value: 'connected',
metadata: {
TimeInstant: {
type: 'DateTime',
value: '2023-11-17T11:59:22.661Z'
}
}
},
dateServiceStarted: {
type: 'DateTime',
Expand Down Expand Up @@ -397,7 +427,13 @@ describe('MQTT: NGSIv2 Measure reception ', function () {
},
status: {
type: 'Text',
value: 'connected'
value: 'connected',
metadata: {
TimeInstant: {
type: 'DateTime',
value: '2023-11-17T11:59:22.661Z'
}
}
},
dateServiceStarted: {
type: 'DateTime',
Expand Down
8 changes: 7 additions & 1 deletion test/unit/ngsiv2/contextRequests/ngsiv2PayloadMeasure.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
},
"status": {
"type": "Text",
"value": "connected"
"value": "connected",
"metadata": {
"TimeInstant": {
"type": "DateTime",
"value": "2023-11-17T11:59:22.661Z"
}
}
},
"dateServiceStarted": {
"type": "DateTime",
Expand Down
8 changes: 7 additions & 1 deletion test/unit/ngsiv2/contextRequests/ngsiv2PayloadMeasure2.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
},
"status": {
"type": "Text",
"value": "connected"
"value": "connected",
"metadata": {
"TimeInstant": {
"type": "DateTime",
"value": "2023-11-17T11:59:22.661Z"
}
}
},
"dateServiceStarted": {
"type": "DateTime",
Expand Down

0 comments on commit e76e635

Please sign in to comment.