From 2f7adc706657f635ec40787f11105bf94f880360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Fri, 1 Aug 2025 09:19:21 +0200 Subject: [PATCH 1/2] FIX add PR #1721 test to test effect on master --- test/functional/testCases.js | 71 ++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/test/functional/testCases.js b/test/functional/testCases.js index b2f850aa5..d5ccaac63 100644 --- a/test/functional/testCases.js +++ b/test/functional/testCases.js @@ -591,6 +591,77 @@ const testCases = [ } ] }, + { + describeName: '0021c - 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: 'fdt', + name: 'fireDetectionThreshold', + type: 'Number' + }, + { + object_id: 'fireDetectionThreshold3', + name: 'fireDetectionThreshold3', + 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 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: { + fdt: 10, + fireDetectionThreshold2: 20, + fireDetectionThreshold3: 30 + } + }, + expectation: { + id: globalEnv.entity_name, + type: globalEnv.entity_type, + fireDetectionThreshold: { + type: 'Number', + value: 10 + }, + fireDetectionThreshold2: { + type: 'Text', + value: 20 + }, + fireDetectionThreshold3: { + type: 'Number', + value: 30 + } + } + } + ] + }, { describeName: '0022 - Simple group with active attributes and multimeasures', provision: { From 158e1d63458f034425beac4f549e44abccaa1b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Wed, 29 Oct 2025 13:50:54 +0100 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Edwin Vautier --- test/functional/testCases.js | 38 ++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/test/functional/testCases.js b/test/functional/testCases.js index d5ccaac63..7dec4b0a4 100644 --- a/test/functional/testCases.js +++ b/test/functional/testCases.js @@ -606,14 +606,18 @@ const testCases = [ lazy: [], attributes: [ { - object_id: 'fdt', - name: 'fireDetectionThreshold', - type: 'Number' + name: 'mainDoorEvent', + type: 'Boolean' }, { - object_id: 'fireDetectionThreshold3', - name: 'fireDetectionThreshold3', - type: 'Number' + name: 'psSMDUHPower14', + type: 'Text', + object_id: '.1.3.6.1.4.1.6302.2.1.2.17.1.1.15.1702' + }, + { + name: 'psSMDUHPower17', + type: 'Number', + object_id: '.1.3.6.1.4.1.6302.2.1.2.17.1.1.18.1702' } ], static_attributes: [] @@ -638,25 +642,25 @@ const testCases = [ k: globalEnv.apikey }, json: { - fdt: 10, - fireDetectionThreshold2: 20, - fireDetectionThreshold3: 30 + '.1.3.6.1.4.1.6302.2.1.2.17.1.1.18.1702': 3, + mainDoorEvent: 1, + psSMDUHPower14: 2 } }, expectation: { id: globalEnv.entity_name, type: globalEnv.entity_type, - fireDetectionThreshold: { + mainDoorEvent: { + type: 'Boolean', + value: 1 + }, + psSMDUHPower17: { type: 'Number', - value: 10 + value: 3 }, - fireDetectionThreshold2: { + psSMDUHPower14: { type: 'Text', - value: 20 - }, - fireDetectionThreshold3: { - type: 'Number', - value: 30 + value: 2 } } }