From 51b921f7e626cc7f697757a9a064ac9c7ea5aacd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Wed, 8 Nov 2023 13:00:40 +0100 Subject: [PATCH] FIX forcedUpdate with JSON changes --- src/lib/mongoBackend/MongoCommonUpdate.cpp | 2 +- ...ta_object_and_array_with_forcedUpdate.test | 705 ++++++++++++++++++ ...ue_object_and_array_with_forcedUpdate.test | 628 ++++++++++++++++ 3 files changed, 1334 insertions(+), 1 deletion(-) create mode 100644 test/functionalTest/cases/4211_right_json_change_evaluation_in_subs/change_evaluation_metadata_object_and_array_with_forcedUpdate.test create mode 100644 test/functionalTest/cases/4211_right_json_change_evaluation_in_subs/change_evaluation_value_object_and_array_with_forcedUpdate.test diff --git a/src/lib/mongoBackend/MongoCommonUpdate.cpp b/src/lib/mongoBackend/MongoCommonUpdate.cpp index bc5e0d036e..faf2315238 100644 --- a/src/lib/mongoBackend/MongoCommonUpdate.cpp +++ b/src/lib/mongoBackend/MongoCommonUpdate.cpp @@ -510,7 +510,7 @@ static ChangeType mergeAttrInfo } else { - valueChanged = !caP->compoundValueP->equal(getFieldF(attr, ENT_ATTRS_VALUE)); + valueChanged = forcedUpdate || !caP->compoundValueP->equal(getFieldF(attr, ENT_ATTRS_VALUE)); } typeChanged = ((!caP->type.empty()) && (!attr.hasField(ENT_ATTRS_TYPE) || getStringFieldF(attr, ENT_ATTRS_TYPE) != caP->type)); mdChanged = (mdNew.nFields() != mdSize || !equalMetadata(md, mdNew)); diff --git a/test/functionalTest/cases/4211_right_json_change_evaluation_in_subs/change_evaluation_metadata_object_and_array_with_forcedUpdate.test b/test/functionalTest/cases/4211_right_json_change_evaluation_in_subs/change_evaluation_metadata_object_and_array_with_forcedUpdate.test new file mode 100644 index 0000000000..a868b6576c --- /dev/null +++ b/test/functionalTest/cases/4211_right_json_change_evaluation_in_subs/change_evaluation_metadata_object_and_array_with_forcedUpdate.test @@ -0,0 +1,705 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +Right JSON change evaluation in subs (objects and arrays in metadata case with forcedUpdate) + +--SHELL-INIT-- +dbInit CB +brokerStart CB +accumulatorStart --pretty-print + +--SHELL-- + +# +# Same as change_evaluation_metadata_object_and_array.test but using forcedUpdate un update operations +# +# +# 01. Create subscription covering E-A +# 02. Create E-A entity with JSON object in metadata (notification) +# 03. Update E-A entity with same JSON object in metadata (notification) +# 04. Update E-A entity with different JSON object in metadata (notification) +# 05. Update E-A entity with JSON array in metadata (notification) +# 06. Update E-A entity with same JSON array in metadata (notification) +# 07. Update E-A entity with different JSON array in metadata (notification) +# 08. Update E-A entity with same string in metadata (notification) +# 09. Dump accumulator, see 5 notifications +# + +echo "01. Create subscription covering E-A" +echo "====================================" +payload='{ + "subject": { + "entities": [ + { + "id" : "E", + "type": "T" + } + ] + }, + "notification": { + "http": { + "url": "http://127.0.0.1:'${LISTENER_PORT}'/notify" + } + } +}' +orionCurl --url /v2/subscriptions --payload "$payload" +echo +echo + + +echo "02. Create E-A entity with JSON object in metadata (notification)" +echo "=================================================================" +payload='{ + "id": "E", + "type": "T", + "A": { + "value": 1, + "type": "Number", + "metadata": { + "M": { + "value": { + "text": "foo", + "number": 10, + "bool": true, + "null": null, + "array": [ + "22", + { + "x" : [ "x1", "x2" ], + "y" : 3 + }, + [ "z1", "z2" ] + ], + "object": { + "x": { + "x1": "a", + "x2": "b" + }, + "y": [ "y1", "y2" ] + } + }, + "type": "Json" + } + } + } +}' +orionCurl --url /v2/entities --payload "$payload" +echo +echo + + +echo "03. Update E-A entity with same JSON object in metadata (notification)" +echo "======================================================================" +payload='{ + "A": { + "value": 1, + "type": "Number", + "metadata": { + "M": { + "value": { + "text": "foo", + "number": 10, + "bool": true, + "null": null, + "array": [ + "22", + { + "x" : [ "x1", "x2" ], + "y" : 3 + }, + [ "z1", "z2" ] + ], + "object": { + "x": { + "x1": "a", + "x2": "b" + }, + "y": [ "y1", "y2" ] + } + }, + "type": "Json" + } + } + } +}' +orionCurl --url /v2/entities/E/attrs?options=forcedUpdate --payload "$payload" +echo +echo + + +echo "04. Update E-A entity with different JSON object in metadata (notification)" +echo "===========================================================================" +payload='{ + "A": { + "value": 1, + "type": "Number", + "metadata": { + "M": { + "value": { + "text": "foo", + "number": 10, + "bool": true, + "null": null, + "array": [ + "22", + { + "x" : [ "x1", "x2" ], + "y" : 3 + }, + [ "z1", "z2" ] + ], + "object": { + "x": { + "x1": "a", + "x2": "b" + }, + "y": [ "y1", "y_new" ] + } + }, + "type": "Json" + } + } + } +}' +orionCurl --url /v2/entities/E/attrs?options=forcedUpdate --payload "$payload" +echo +echo + + +echo "05. Update E-A entity with JSON array in metadata (notification)" +echo "================================================================" +payload='{ + "A": { + "value": 1, + "type": "Number", + "metadata": { + "M": { + "value": [ + "", + { + "x": [ "x1", "x2" ], + "y": "3" + }, + [ "z1", "z2" ] + ], + "type": "Array" + } + } + } +}' +orionCurl --url /v2/entities/E/attrs?options=forcedUpdate --payload "$payload" +echo +echo + + +echo "06. Update E-A entity with same JSON array in metadata (notification)" +echo "=====================================================================" +payload='{ + "A": { + "value": 1, + "type": "Number", + "metadata": { + "M": { + "value": [ + "", + { + "x": [ "x1", "x2" ], + "y": "3" + }, + [ "z1", "z2" ] + ], + "type": "Array" + } + } + } +}' +orionCurl --url /v2/entities/E/attrs?options=forcedUpdate --payload "$payload" +echo +echo + + +echo "07. Update E-A entity with different JSON array in metadata (notification)" +echo "==========================================================================" +payload='{ + "A": { + "value": 1, + "type": "Number", + "metadata": { + "M": { + "value": [ + "", + { + "x": [ "x1", "x_new" ], + "y": "3" + }, + [ "z1", "z2" ] + ], + "type": "Array" + } + } + } +}' +orionCurl --url /v2/entities/E/attrs?options=forcedUpdate --payload "$payload" +echo +echo + + +echo "08. Update E-A entity with same string in metadata (notification)" +echo "=================================================================" +payload='{ + "A": { + "value": 1, + "type": "Number", + "metadata": { + "M": { + "value": "foo", + "type": "Text" + } + } + } +}' +orionCurl --url /v2/entities/E/attrs?options=forcedUpdate --payload "$payload" +echo +echo + + +echo "09. Dump accumulator, see 7 notifications" +echo "=========================================" +accumulatorDump +echo +echo + + +--REGEXPECT-- +01. Create subscription covering E-A +==================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/subscriptions/REGEX([0-9a-f]{24}) +Content-Length: 0 + + + +02. Create E-A entity with JSON object in metadata (notification) +================================================================= +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E?type=T +Content-Length: 0 + + + +03. Update E-A entity with same JSON object in metadata (notification) +====================================================================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +04. Update E-A entity with different JSON object in metadata (notification) +=========================================================================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +05. Update E-A entity with JSON array in metadata (notification) +================================================================ +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +06. Update E-A entity with same JSON array in metadata (notification) +===================================================================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +07. Update E-A entity with different JSON array in metadata (notification) +========================================================================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +08. Update E-A entity with same string in metadata (notification) +================================================================= +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +09. Dump accumulator, see 7 notifications +========================================= +POST http://127.0.0.1:REGEX(\d+)/notify +Fiware-Servicepath: / +Content-Length: 302 +User-Agent: orion/REGEX(\d+\.\d+\.\d+.*) +Ngsiv2-Attrsformat: normalized +Host: 127.0.0.1:REGEX(\d+) +Accept: application/json +Content-Type: application/json; charset=utf-8 +Fiware-Correlator: REGEX([0-9a-f\-]{36}); cbnotif=1 + +{ + "data": [ + { + "A": { + "metadata": { + "M": { + "type": "Json", + "value": { + "array": [ + "22", + { + "x": [ + "x1", + "x2" + ], + "y": 3 + }, + [ + "z1", + "z2" + ] + ], + "bool": true, + "null": null, + "number": 10, + "object": { + "x": { + "x1": "a", + "x2": "b" + }, + "y": [ + "y1", + "y2" + ] + }, + "text": "foo" + } + } + }, + "type": "Number", + "value": 1 + }, + "id": "E", + "type": "T" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= +POST http://127.0.0.1:REGEX(\d+)/notify +Fiware-Servicepath: / +Content-Length: 302 +User-Agent: orion/REGEX(\d+\.\d+\.\d+.*) +Ngsiv2-Attrsformat: normalized +Host: 127.0.0.1:REGEX(\d+) +Accept: application/json +Content-Type: application/json; charset=utf-8 +Fiware-Correlator: REGEX([0-9a-f\-]{36}); cbnotif=1 + +{ + "data": [ + { + "A": { + "metadata": { + "M": { + "type": "Json", + "value": { + "array": [ + "22", + { + "x": [ + "x1", + "x2" + ], + "y": 3 + }, + [ + "z1", + "z2" + ] + ], + "bool": true, + "null": null, + "number": 10, + "object": { + "x": { + "x1": "a", + "x2": "b" + }, + "y": [ + "y1", + "y2" + ] + }, + "text": "foo" + } + } + }, + "type": "Number", + "value": 1 + }, + "id": "E", + "type": "T" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= +POST http://127.0.0.1:REGEX(\d+)/notify +Fiware-Servicepath: / +Content-Length: 305 +User-Agent: orion/REGEX(\d+\.\d+\.\d+.*) +Ngsiv2-Attrsformat: normalized +Host: 127.0.0.1:REGEX(\d+) +Accept: application/json +Content-Type: application/json; charset=utf-8 +Fiware-Correlator: REGEX([0-9a-f\-]{36}); cbnotif=1 + +{ + "data": [ + { + "A": { + "metadata": { + "M": { + "type": "Json", + "value": { + "array": [ + "22", + { + "x": [ + "x1", + "x2" + ], + "y": 3 + }, + [ + "z1", + "z2" + ] + ], + "bool": true, + "null": null, + "number": 10, + "object": { + "x": { + "x1": "a", + "x2": "b" + }, + "y": [ + "y1", + "y_new" + ] + }, + "text": "foo" + } + } + }, + "type": "Number", + "value": 1 + }, + "id": "E", + "type": "T" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= +POST http://127.0.0.1:REGEX(\d+)/notify +Fiware-Servicepath: / +Content-Length: 193 +User-Agent: orion/REGEX(\d+\.\d+\.\d+.*) +Ngsiv2-Attrsformat: normalized +Host: 127.0.0.1:REGEX(\d+) +Accept: application/json +Content-Type: application/json; charset=utf-8 +Fiware-Correlator: REGEX([0-9a-f\-]{36}); cbnotif=1 + +{ + "data": [ + { + "A": { + "metadata": { + "M": { + "type": "Array", + "value": [ + "", + { + "x": [ + "x1", + "x2" + ], + "y": "3" + }, + [ + "z1", + "z2" + ] + ] + } + }, + "type": "Number", + "value": 1 + }, + "id": "E", + "type": "T" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= +POST http://127.0.0.1:REGEX(\d+)/notify +Fiware-Servicepath: / +Content-Length: 193 +User-Agent: orion/REGEX(\d+\.\d+\.\d+.*) +Ngsiv2-Attrsformat: normalized +Host: 127.0.0.1:REGEX(\d+) +Accept: application/json +Content-Type: application/json; charset=utf-8 +Fiware-Correlator: REGEX([0-9a-f\-]{36}); cbnotif=1 + +{ + "data": [ + { + "A": { + "metadata": { + "M": { + "type": "Array", + "value": [ + "", + { + "x": [ + "x1", + "x2" + ], + "y": "3" + }, + [ + "z1", + "z2" + ] + ] + } + }, + "type": "Number", + "value": 1 + }, + "id": "E", + "type": "T" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= +POST http://127.0.0.1:REGEX(\d+)/notify +Fiware-Servicepath: / +Content-Length: 196 +User-Agent: orion/REGEX(\d+\.\d+\.\d+.*) +Ngsiv2-Attrsformat: normalized +Host: 127.0.0.1:REGEX(\d+) +Accept: application/json +Content-Type: application/json; charset=utf-8 +Fiware-Correlator: REGEX([0-9a-f\-]{36}); cbnotif=1 + +{ + "data": [ + { + "A": { + "metadata": { + "M": { + "type": "Array", + "value": [ + "", + { + "x": [ + "x1", + "x_new" + ], + "y": "3" + }, + [ + "z1", + "z2" + ] + ] + } + }, + "type": "Number", + "value": 1 + }, + "id": "E", + "type": "T" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= +POST http://127.0.0.1:REGEX(\d+)/notify +Fiware-Servicepath: / +Content-Length: 155 +User-Agent: orion/REGEX(\d+\.\d+\.\d+.*) +Ngsiv2-Attrsformat: normalized +Host: 127.0.0.1:REGEX(\d+) +Accept: application/json +Content-Type: application/json; charset=utf-8 +Fiware-Correlator: REGEX([0-9a-f\-]{36}); cbnotif=1 + +{ + "data": [ + { + "A": { + "metadata": { + "M": { + "type": "Text", + "value": "foo" + } + }, + "type": "Number", + "value": 1 + }, + "id": "E", + "type": "T" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= + + +--TEARDOWN-- +brokerStop CB +dbDrop CB +accumulatorStop diff --git a/test/functionalTest/cases/4211_right_json_change_evaluation_in_subs/change_evaluation_value_object_and_array_with_forcedUpdate.test b/test/functionalTest/cases/4211_right_json_change_evaluation_in_subs/change_evaluation_value_object_and_array_with_forcedUpdate.test new file mode 100644 index 0000000000..150035d985 --- /dev/null +++ b/test/functionalTest/cases/4211_right_json_change_evaluation_in_subs/change_evaluation_value_object_and_array_with_forcedUpdate.test @@ -0,0 +1,628 @@ +# Copyright 2023 Telefonica Investigacion y Desarrollo, S.A.U +# +# This file is part of Orion Context Broker. +# +# Orion Context Broker is free software: you can redistribute it and/or +# modify it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# Orion Context Broker is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero +# General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. +# +# For those usages not covered by this license please contact with +# iot_support at tid dot es + +# VALGRIND_READY - to mark the test ready for valgrindTestSuite.sh + +--NAME-- +Right JSON change evaluation in subs (objects and arrays in attribute value case with forcedUpdate) + +--SHELL-INIT-- +dbInit CB +brokerStart CB +accumulatorStart --pretty-print + +--SHELL-- + +# +# Same as change_evaluation_value_object_and_array.test but using forcedUpdate un update operations +# +# +# 01. Create subscription covering E-A +# 02. Create E-A entity with JSON object (notification) +# 03. Update E-A entity with same JSON object (notification) +# 04. Update E-A entity with different JSON object (notification) +# 05. Update E-A entity with JSON array (notification) +# 06. Update E-A entity with same JSON array (notification) +# 07. Update E-A entity with different JSON array (notification) +# 08. Update E-A entity with same string (notification) +# 09. Dump accumulator, see 7 notifications +# + +echo "01. Create subscription covering E-A" +echo "====================================" +payload='{ + "subject": { + "entities": [ + { + "id" : "E", + "type": "T" + } + ] + }, + "notification": { + "http": { + "url": "http://127.0.0.1:'${LISTENER_PORT}'/notify" + } + } +}' +orionCurl --url /v2/subscriptions --payload "$payload" +echo +echo + + +echo "02. Create E-A entity with JSON object (notification)" +echo "=====================================================" +payload='{ + "id": "E", + "type": "T", + "A": { + "value": { + "text": "foo", + "number": 10, + "bool": true, + "null": null, + "array": [ + "22", + { + "x" : [ "x1", "x2" ], + "y" : 3 + }, + [ "z1", "z2" ] + ], + "object": { + "x": { + "x1": "a", + "x2": "b" + }, + "y": [ "y1", "y2" ] + } + }, + "type": "Json" + } +}' +orionCurl --url /v2/entities --payload "$payload" +echo +echo + + +echo "03. Update E-A entity with same JSON object (notification)" +echo "==========================================================" +payload='{ + "A": { + "value": { + "text": "foo", + "number": 10, + "bool": true, + "null": null, + "array": [ + "22", + { + "x" : [ "x1", "x2" ], + "y" : 3 + }, + [ "z1", "z2" ] + ], + "object": { + "x": { + "x1": "a", + "x2": "b" + }, + "y": [ "y1", "y2" ] + } + }, + "type": "Json" + } +}' +orionCurl --url /v2/entities/E/attrs?options=forcedUpdate --payload "$payload" +echo +echo + + +echo "04. Update E-A entity with different JSON object (notification)" +echo "===============================================================" +payload='{ + "A": { + "value": { + "text": "foo", + "number": 10, + "bool": true, + "null": null, + "array": [ + "22", + { + "x" : [ "x1", "x2" ], + "y" : 3 + }, + [ "z1", "z2" ] + ], + "object": { + "x": { + "x1": "a", + "x2": "b" + }, + "y": [ "y1", "y_new" ] + } + }, + "type": "Json" + } +}' +orionCurl --url /v2/entities/E/attrs?options=forcedUpdate --payload "$payload" +echo +echo + + +echo "05. Update E-A entity with JSON array (notification)" +echo "====================================================" +payload='{ + "A": { + "value": [ + "", + { + "x": [ "x1", "x2" ], + "y": "3" + }, + [ "z1", "z2" ] + ], + "type": "Array" + } +}' +orionCurl --url /v2/entities/E/attrs?options=forcedUpdate --payload "$payload" +echo +echo + + +echo "06. Update E-A entity with same JSON array (notification)" +echo "=========================================================" +payload='{ + "A": { + "value": [ + "", + { + "x": [ "x1", "x2" ], + "y": "3" + }, + [ "z1", "z2" ] + ], + "type": "Array" + } +}' +orionCurl --url /v2/entities/E/attrs?options=forcedUpdate --payload "$payload" +echo +echo + + +echo "07. Update E-A entity with different JSON array (notification)" +echo "==============================================================" +payload='{ + "A": { + "value": [ + "", + { + "x": [ "x1", "x_new" ], + "y": "3" + }, + [ "z1", "z2" ] + ], + "type": "Array" + } +}' +orionCurl --url /v2/entities/E/attrs?options=forcedUpdate --payload "$payload" +echo +echo + + +echo "08. Update E-A entity with same string (notification)" +echo "=====================================================" +payload='{ + "A": { + "value": "foo", + "type": "Text" + } +}' +orionCurl --url /v2/entities/E/attrs?options=forcedUpdate --payload "$payload" +echo +echo + + +echo "09. Dump accumulator, see 7 notifications" +echo "=========================================" +accumulatorDump +echo +echo + + +--REGEXPECT-- +01. Create subscription covering E-A +==================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/subscriptions/REGEX([0-9a-f]{24}) +Content-Length: 0 + + + +02. Create E-A entity with JSON object (notification) +===================================================== +HTTP/1.1 201 Created +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) +Location: /v2/entities/E?type=T +Content-Length: 0 + + + +03. Update E-A entity with same JSON object (notification) +========================================================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +04. Update E-A entity with different JSON object (notification) +=============================================================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +05. Update E-A entity with JSON array (notification) +==================================================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +06. Update E-A entity with same JSON array (notification) +========================================================= +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +07. Update E-A entity with different JSON array (notification) +============================================================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +08. Update E-A entity with same string (notification) +===================================================== +HTTP/1.1 204 No Content +Date: REGEX(.*) +Fiware-Correlator: REGEX([0-9a-f\-]{36}) + + + +09. Dump accumulator, see 7 notifications +========================================= +POST http://127.0.0.1:REGEX(\d+)/notify +Fiware-Servicepath: / +Content-Length: 271 +User-Agent: orion/REGEX(\d+\.\d+\.\d+.*) +Ngsiv2-Attrsformat: normalized +Host: 127.0.0.1:REGEX(\d+) +Accept: application/json +Content-Type: application/json; charset=utf-8 +Fiware-Correlator: REGEX([0-9a-f\-]{36}); cbnotif=1 + +{ + "data": [ + { + "A": { + "metadata": {}, + "type": "Json", + "value": { + "array": [ + "22", + { + "x": [ + "x1", + "x2" + ], + "y": 3 + }, + [ + "z1", + "z2" + ] + ], + "bool": true, + "null": null, + "number": 10, + "object": { + "x": { + "x1": "a", + "x2": "b" + }, + "y": [ + "y1", + "y2" + ] + }, + "text": "foo" + } + }, + "id": "E", + "type": "T" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= +POST http://127.0.0.1:REGEX(\d+)/notify +Fiware-Servicepath: / +Content-Length: 271 +User-Agent: orion/REGEX(\d+\.\d+\.\d+.*) +Ngsiv2-Attrsformat: normalized +Host: 127.0.0.1:REGEX(\d+) +Accept: application/json +Content-Type: application/json; charset=utf-8 +Fiware-Correlator: REGEX([0-9a-f\-]{36}); cbnotif=1 + +{ + "data": [ + { + "A": { + "metadata": {}, + "type": "Json", + "value": { + "array": [ + "22", + { + "x": [ + "x1", + "x2" + ], + "y": 3 + }, + [ + "z1", + "z2" + ] + ], + "bool": true, + "null": null, + "number": 10, + "object": { + "x": { + "x1": "a", + "x2": "b" + }, + "y": [ + "y1", + "y2" + ] + }, + "text": "foo" + } + }, + "id": "E", + "type": "T" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= +POST http://127.0.0.1:REGEX(\d+)/notify +Fiware-Servicepath: / +Content-Length: 274 +User-Agent: orion/REGEX(\d+\.\d+\.\d+.*) +Ngsiv2-Attrsformat: normalized +Host: 127.0.0.1:REGEX(\d+) +Accept: application/json +Content-Type: application/json; charset=utf-8 +Fiware-Correlator: REGEX([0-9a-f\-]{36}); cbnotif=1 + +{ + "data": [ + { + "A": { + "metadata": {}, + "type": "Json", + "value": { + "array": [ + "22", + { + "x": [ + "x1", + "x2" + ], + "y": 3 + }, + [ + "z1", + "z2" + ] + ], + "bool": true, + "null": null, + "number": 10, + "object": { + "x": { + "x1": "a", + "x2": "b" + }, + "y": [ + "y1", + "y_new" + ] + }, + "text": "foo" + } + }, + "id": "E", + "type": "T" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= +POST http://127.0.0.1:REGEX(\d+)/notify +Fiware-Servicepath: / +Content-Length: 162 +User-Agent: orion/REGEX(\d+\.\d+\.\d+.*) +Ngsiv2-Attrsformat: normalized +Host: 127.0.0.1:REGEX(\d+) +Accept: application/json +Content-Type: application/json; charset=utf-8 +Fiware-Correlator: REGEX([0-9a-f\-]{36}); cbnotif=1 + +{ + "data": [ + { + "A": { + "metadata": {}, + "type": "Array", + "value": [ + "", + { + "x": [ + "x1", + "x2" + ], + "y": "3" + }, + [ + "z1", + "z2" + ] + ] + }, + "id": "E", + "type": "T" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= +POST http://127.0.0.1:REGEX(\d+)/notify +Fiware-Servicepath: / +Content-Length: 162 +User-Agent: orion/REGEX(\d+\.\d+\.\d+.*) +Ngsiv2-Attrsformat: normalized +Host: 127.0.0.1:REGEX(\d+) +Accept: application/json +Content-Type: application/json; charset=utf-8 +Fiware-Correlator: REGEX([0-9a-f\-]{36}); cbnotif=1 + +{ + "data": [ + { + "A": { + "metadata": {}, + "type": "Array", + "value": [ + "", + { + "x": [ + "x1", + "x2" + ], + "y": "3" + }, + [ + "z1", + "z2" + ] + ] + }, + "id": "E", + "type": "T" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= +POST http://127.0.0.1:REGEX(\d+)/notify +Fiware-Servicepath: / +Content-Length: 165 +User-Agent: orion/REGEX(\d+\.\d+\.\d+.*) +Ngsiv2-Attrsformat: normalized +Host: 127.0.0.1:REGEX(\d+) +Accept: application/json +Content-Type: application/json; charset=utf-8 +Fiware-Correlator: REGEX([0-9a-f\-]{36}); cbnotif=1 + +{ + "data": [ + { + "A": { + "metadata": {}, + "type": "Array", + "value": [ + "", + { + "x": [ + "x1", + "x_new" + ], + "y": "3" + }, + [ + "z1", + "z2" + ] + ] + }, + "id": "E", + "type": "T" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= +POST http://127.0.0.1:REGEX(\d+)/notify +Fiware-Servicepath: / +Content-Length: 124 +User-Agent: orion/REGEX(\d+\.\d+\.\d+.*) +Ngsiv2-Attrsformat: normalized +Host: 127.0.0.1:REGEX(\d+) +Accept: application/json +Content-Type: application/json; charset=utf-8 +Fiware-Correlator: REGEX([0-9a-f\-]{36}); cbnotif=1 + +{ + "data": [ + { + "A": { + "metadata": {}, + "type": "Text", + "value": "foo" + }, + "id": "E", + "type": "T" + } + ], + "subscriptionId": "REGEX([0-9a-f]{24})" +} +======================================= + + +--TEARDOWN-- +brokerStop CB +dbDrop CB +accumulatorStop