Skip to content

Commit

Permalink
Merge pull request #1622 from telefonicaid/task/add_test_funcional_ob…
Browse files Browse the repository at this point in the history
…ject_id_special_names

add test about usage of object_id attrs with special format name
  • Loading branch information
fgalan authored Jun 26, 2024
2 parents 80e19ab + 7f65f07 commit d4e4ce5
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions test/functional/testCases.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,84 @@ const testCases = [
}
]
},
{
describeName: '0021b - Simple group with active attributes with special names in object_id',
provision: {
url: 'http://localhost:' + config.iota.server.port + '/iot/services',
method: 'POST',
json: {
services: [
{
resource: '/iot/json',
apikey: globalEnv.apikey,
entity_type: globalEnv.entity_type,
commands: [],
lazy: [],
attributes: [
{
object_id: 'a',
name: 'attr_a',
type: 'Boolean',
metadata: {
accuracy: {
value: 0.8,
type: 'Float'
}
}
},
{
object_id: '.1.0.0.1',
name: 'psBatteryVoltage',
type: 'Number'
}
],
static_attributes: []
}
]
},
headers: {
'fiware-service': globalEnv.service,
'fiware-servicepath': globalEnv.servicePath
}
},
should: [
{
shouldName:
'A - WHEN sending defined object_ids with special format names (measures) through http IT should send measures to Context Broker preserving value types, name mappings and metadatas',
type: 'single',
measure: {
url: 'http://localhost:' + config.http.port + '/iot/json',
method: 'POST',
qs: {
i: globalEnv.deviceId,
k: globalEnv.apikey
},
json: {
a: false,
'.1.0.0.1': 23.5
}
},
expectation: {
id: globalEnv.entity_name,
type: globalEnv.entity_type,
attr_a: {
value: false,
type: 'Boolean',
metadata: {
accuracy: {
value: 0.8,
type: 'Float'
}
}
},
psBatteryVoltage: {
type: 'Number',
value: 23.5
}
}
}
]
},
{
describeName: '0022 - Simple group with active attributes and multimeasures',
provision: {
Expand Down

0 comments on commit d4e4ce5

Please sign in to comment.