diff --git a/test/functional/testCases.js b/test/functional/testCases.js index b2f850aa5..6b9d4a45e 100644 --- a/test/functional/testCases.js +++ b/test/functional/testCases.js @@ -542,6 +542,20 @@ const testCases = [ object_id: '.1.0.0.1', name: 'psBatteryVoltage', type: 'Number' + }, + { + object_id: 't', + name: 'value', + type: 'Number' + }, + { + name: 'fireDetectionThreshold', + type: 'Number' + }, + { + object_id: 'fireDetectionThreshold3', + name: 'fireDetectionThreshold3', + type: 'Number' } ], static_attributes: [] @@ -588,6 +602,56 @@ const testCases = [ value: 23.5 } } + }, + { + shouldName: + 'B - WHEN sending defined object_ids with special format names in attributes 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, + t: 10, + fireDetectionThreshold: 10, + fireDetectionThreshold2: 20, + fireDetectionThreshold3: 30 + } + }, + expectation: { + id: globalEnv.entity_name, + type: globalEnv.entity_type, + attr_a: { + value: false, + type: 'Boolean', + metadata: { + accuracy: { + value: 0.8, + type: 'Float' + } + } + }, + value: { + type: 'Number', + value: 10 + }, + fireDetectionThreshold: { + type: 'Number', + value: 10 + }, + fireDetectionThreshold2: { + type: 'Text', + value: 20 + }, + fireDetectionThreshold3: { + type: 'Number', + value: 30 + } + } } ] },