Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test about usage of object_id attrs with special format name #1622

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading