diff --git a/test/functional/testCases.js b/test/functional/testCases.js index 859f2e54d..da4d42216 100644 --- a/test/functional/testCases.js +++ b/test/functional/testCases.js @@ -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: {