Skip to content

Commit

Permalink
Merge pull request #813 from Keshav-NEC/Fix_for_810
Browse files Browse the repository at this point in the history
constants.DEFAULT_ATTRIBUTE_TYPE is changed to Text
  • Loading branch information
fgalan authored Feb 1, 2024
2 parents 87686a3 + 5f6fc33 commit e2cd004
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 30 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix: default attribute type changed from 'string' to 'Text' (#810)
2 changes: 1 addition & 1 deletion lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = {
TIMESTAMP_ATTRIBUTE: 'TimeInstant',
TIMESTAMP_TYPE_NGSI2: 'DateTime',

DEFAULT_ATTRIBUTE_TYPE: 'string',
DEFAULT_ATTRIBUTE_TYPE: 'Text',

COMMAND_STATUS_PENDING: 'PENDING',
COMMAND_STATUS_ERROR: 'ERROR',
Expand Down
5 changes: 2 additions & 3 deletions test/unit/ngsiv2/contextRequests/ngsildMeasure.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "AnMQTTDevice",
"actionType": {
"value": "APPEND",
"type": "string"
"type": "Text"
},
"entities": {
"value": [
Expand Down Expand Up @@ -45,7 +45,6 @@
]
}
],
"type": "string"
"type": "Text"
}
}

4 changes: 2 additions & 2 deletions test/unit/ngsiv2/contextRequests/ngsildPayloadMeasure.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"id": "Second MQTT Device",
"type": "AnMQTTDevice",
"measure_id": {
"type": "string",
"type": "Text",
"value": "urn:ngsi-ld:ParkingSpot:santander:daoiz_velarde_1_5:3"
},
"measure_type": {
"type": "string",
"type": "Text",
"value": "ParkingSpot"
},
"status": {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/ngsiv2/contextRequests/ngsildPayloadMeasure2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"id": "Second MQTT Device",
"type": "AnMQTTDevice",
"measure_id": {
"type": "string",
"type": "Text",
"value": "urn:ngsi-ld:ParkingSpot:santander:reyes_magos_1_1:1"
},
"measure_type": {
"type": "string",
"type": "Text",
"value": "ParkingSpot"
},
"status": {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/ngsiv2/contextRequests/ngsiv2Measure.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type":"AnMQTTDevice",
"actionType": {
"value": "APPEND",
"type": "string"
"type": "Text"
},
"entities": {
"value": [
Expand Down Expand Up @@ -56,6 +56,6 @@
}
}
],
"type": "string"
"type": "Text"
}
}
4 changes: 2 additions & 2 deletions test/unit/ngsiv2/contextRequests/ngsiv2PayloadMeasure.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"id":"Second MQTT Device",
"type":"AnMQTTDevice",
"measure_id": {
"type": "string",
"type": "Text",
"value": "urn:ngsiv2:Streetlight:Streetlight-Mylightpoint-2"
},
"measure_type": {
"type": "string",
"type": "Text",
"value": "Streetlight"
},
"name": {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/ngsiv2/contextRequests/ngsiv2PayloadMeasure2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"id": "Second MQTT Device",
"type": "AnMQTTDevice",
"measure_id": {
"type": "string",
"type": "Text",
"value": "urn:ngsiv2:Streetlight:Streetlight-Mylightpoint-3"
},
"measure_type": {
"type": "string",
"type": "Text",
"value": "Streetlight"
},
"name": {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/ngsiv2/contextRequests/pollingMeasure.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id":"Second MQTT Device",
"type":"AnMQTTDevice",
"a": {
"type": "string",
"type": "Text",
"value": 23
}
}
2 changes: 1 addition & 1 deletion test/unit/ngsiv2/contextRequests/timeInstantMeasures3.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"value": "111222"
},
"pressure":{
"type": "string",
"type": "Text",
"value": "20"
},
"TimeInstant":{
Expand Down
2 changes: 1 addition & 1 deletion test/unit/ngsiv2/contextRequests/unknownMeasures.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"value": "32"
},
"weight":{
"type": "string",
"type": "Text",
"value": "87"
}
}
2 changes: 1 addition & 1 deletion test/unit/ngsiv2/contextRequests/unknownMeasures2.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"value": "33"
},
"weight":{
"type": "string",
"type": "Text",
"value": "89"
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/unit/ngsiv2/contextRequests/unprovisionedDevice.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"id":"TheLightType:JSON_UNPROVISIONED",
"type":"TheLightType",
"humidity":{
"type": "string",
"type": "Text",
"value": "32"
},
"temperature":{
"type": "string",
"type": "Text",
"value": "87"
}
}
4 changes: 2 additions & 2 deletions test/unit/ngsiv2/contextRequests/unprovisionedDevice2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"id":"TheLightType:JSON_UNPROVISIONED",
"type":"TheLightType",
"humidity":{
"type": "string",
"type": "Text",
"value": "33"
},
"temperature":{
"type": "string",
"type": "Text",
"value": "89"
}
}
2 changes: 1 addition & 1 deletion test/unit/ngsiv2/contextRequests/unprovisionedDevice3.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "TheLightType:JSON_UNPROVISIONED",
"type": "TheLightType",
"h":{
"type": "string",
"type": "Text",
"value": "33"
}
}
14 changes: 7 additions & 7 deletions test/unit/ngsiv2/explicit_attributes-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ describe('explicitAttrs tests', function () {
.post('/v2/entities?options=upsert', {
id: 'Sensor:Temperature:JSON_UNPROVISIONED',
type: 'Sensor:Temperature',
h: { type: 'string', value: '33' },
h: { type: 'Text', value: '33' },
temperature: { type: 'Number', value: '89' }
})
.reply(204);
Expand Down Expand Up @@ -434,7 +434,7 @@ describe('explicitAttrs tests', function () {
.post('/v2/entities?options=upsert', {
id: 'Sensor:Temperature:JSON_UNPROVISIONED',
type: 'Sensor:Temperature',
h: { type: 'string', value: '33' },
h: { type: 'Text', value: '33' },
temperature: { type: 'Number', value: '89' }
})
.reply(204);
Expand Down Expand Up @@ -506,7 +506,7 @@ describe('explicitAttrs tests', function () {
.post('/v2/entities?options=upsert', {
id: 'Sensor:Temperature:JSON_UNPROVISIONED',
type: 'Sensor:Temperature',
h: { type: 'string', value: '33' },
h: { type: 'Text', value: '33' },
temperature: { type: 'Number', value: '89' }
})
.reply(204);
Expand Down Expand Up @@ -652,7 +652,7 @@ describe('explicitAttrs tests', function () {
.post('/v2/entities?options=upsert', {
id: 'Sensor:Temperature:JSON_UNPROVISIONED',
type: 'Sensor:Temperature',
h: { type: 'string', value: '33' },
h: { type: 'Text', value: '33' },
temperature: { type: 'Number', value: '89' }
})
.reply(204);
Expand Down Expand Up @@ -699,7 +699,7 @@ describe('explicitAttrs tests', function () {
.post('/v2/entities?options=upsert', {
id: 'Sensor:Temperature:JSON_UNPROVISIONED',
type: 'Sensor:Temperature',
h: { type: 'string', value: '33' },
h: { type: 'Text', value: '33' },
temperature: { type: 'Number', value: '89' }
})
.reply(204);
Expand Down Expand Up @@ -771,7 +771,7 @@ describe('explicitAttrs tests', function () {
.post('/v2/entities?options=upsert', {
id: 'Sensor:Temperature:JSON_UNPROVISIONED',
type: 'Sensor:Temperature',
h: { type: 'string', value: '33' },
h: { type: 'Text', value: '33' },
temperature: { type: 'Number', value: '89' }
})
.reply(204);
Expand Down Expand Up @@ -917,7 +917,7 @@ describe('explicitAttrs tests', function () {
.post('/v2/entities?options=upsert', {
id: 'Sensor:Temperature:JSON_UNPROVISIONED',
type: 'Sensor:Temperature',
h: { type: 'string', value: '33' },
h: { type: 'Text', value: '33' },
temperature: { type: 'Number', value: '89' }
})
.reply(204);
Expand Down

0 comments on commit e2cd004

Please sign in to comment.