From b4564ad231ac0fc889d393d75ddde6d4c83aab90 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 18 Nov 2024 09:02:04 +0100 Subject: [PATCH 1/2] fix: Check Response Body Content was ignoring the whole file when comparing - if adding the empty string as a regex to ignore, all paths are ignored in the files, so it always returns true - for expectations files used only once, create fixed ids to ease the final comparison with the response body --- .../Entity/QueryEntities/019_02_05.robot | 6 +++--- .../Entity/QueryEntities/019_05.robot | 6 +++--- .../UpdateEntityAttributes/011_01.robot | 16 +++++---------- ...ation-attribute-normalized-019-05.geojson} | 12 ++++------- .../vehicle-multi-attributes.jsonld | 10 ++++++++++ ...json => vehicle-parking-019-02-05.geojson} | 13 +++++------- .../Consumption/019_02_05.json | 8 ++++---- .../Consumption/019_05.json | 2 +- .../ContextInformation/Provision/011_01.json | 20 +++++++++---------- resources/AssertionUtils.resource | 6 +++++- 10 files changed, 50 insertions(+), 49 deletions(-) rename data/entities/expectations/{two-buildings-location-attribute-normalized.geojson => two-buildings-location-attribute-normalized-019-05.geojson} (73%) rename data/entities/expectations/{vehicle-parking-simple.geojson => vehicle-parking-019-02-05.geojson} (77%) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot index edc5b38d..36cf8532 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot @@ -15,7 +15,7 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${parking_id_prefix}= urn:ngsi-ld:OffStreetParking: ${vehicle_filename}= vehicle-simple-attributes.jsonld ${parking_filename}= parking-simple-attributes.jsonld -${expectation_filename}= vehicle-parking-simple.geojson +${expectation_filename}= vehicle-parking-019-02-05.geojson ${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking @@ -39,14 +39,14 @@ ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking *** Keywords *** Create Entities - ${vehicle_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${vehicle_entity_id}= Catenate ${vehicle_id_prefix}019-02-05 Set Suite Variable ${vehicle_entity_id} ${response}= Create Entity Selecting Content Type ... ${vehicle_filename} ... ${vehicle_entity_id} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response.status_code} - ${parking_entity_id}= Generate Random Entity Id ${parking_id_prefix} + ${parking_entity_id}= Catenate ${parking_id_prefix}019-02-05 Set Suite Variable ${parking_entity_id} ${response}= Create Entity Selecting Content Type ... ${parking_filename} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot index 02673972..4c7be3f1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot @@ -13,7 +13,7 @@ Suite Teardown Delete Entities *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-location-attribute.jsonld -${expectation_filename}= two-buildings-location-attribute-normalized.geojson +${expectation_filename}= two-buildings-location-attribute-normalized-019-05.geojson ${entity_type}= https://ngsi-ld-test-suite/context#Building @@ -38,13 +38,13 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building *** Keywords *** Create Initial Entities - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${first_entity_id}= Catenate ${building_id_prefix}019-05-01 Set Suite Variable ${first_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} ... ${first_entity_id} ... ${CONTENT_TYPE_LD_JSON} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Catenate ${building_id_prefix}019-05-02 Set Suite Variable ${second_entity_id} ${response}= Create Entity Selecting Content Type ... ${filename} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot index cdc9c053..60d07c06 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot @@ -16,13 +16,13 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-two-datasetid-attributes.jsonld -*** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_RESPONSE_FILENAME EXPECTATION_FILENAME +*** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_FILENAME 011_01_01 Check that one can update existing attributes with no datasetId - 204 vehicle-speed-two-datasetid-01-fragment.jsonld ${EMPTY} expectations/vehicle-update-attributes.jsonld + 204 vehicle-speed-two-datasetid-01-fragment.jsonld expectations/vehicle-update-attributes.jsonld 011_01_02 Check that one can update existing attributes with the datasetId - 204 vehicle-speed-two-datasetid-02-fragment.jsonld ${EMPTY} expectations/vehicle-update-datasetid-attributes.jsonld -011_01_03 Check that one can update only some attributes while unknown are ignored - 204 vehicle-speed-two-datasetid-03-fragment.jsonld ${EMPTY} expectations/vehicle-multi-attributes.jsonld + 204 vehicle-speed-two-datasetid-02-fragment.jsonld expectations/vehicle-update-datasetid-attributes.jsonld +011_01_03 Check that one can update existing attributes and append non-existing attributes + 204 vehicle-speed-two-datasetid-03-fragment.jsonld expectations/vehicle-multi-attributes.jsonld *** Keywords *** @@ -32,18 +32,12 @@ Update Attributes [Arguments] ... ${status_code} ... ${fragment_filename} - ... ${expectation_resp_filename} ... ${expectation_filename} ${response}= Update Entity Attributes ... ${entity_id} ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response.status_code} - IF "${expectation_resp_filename}"!="${EMPTY}" - Check Response Body Content - ... expectation_filename=${expectation_resp_filename} - ... response_body=${response.json()} - END ${entity_expectation_payload}= Load Test Sample entities/${expectation_filename} ${entity_id} ${response1}= Retrieve Entity by Id ... id=${entity_id} diff --git a/data/entities/expectations/two-buildings-location-attribute-normalized.geojson b/data/entities/expectations/two-buildings-location-attribute-normalized-019-05.geojson similarity index 73% rename from data/entities/expectations/two-buildings-location-attribute-normalized.geojson rename to data/entities/expectations/two-buildings-location-attribute-normalized-019-05.geojson index 60a81324..7b34511f 100644 --- a/data/entities/expectations/two-buildings-location-attribute-normalized.geojson +++ b/data/entities/expectations/two-buildings-location-attribute-normalized-019-05.geojson @@ -1,7 +1,7 @@ { "type": "FeatureCollection", "features": [{ - "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "id": "urn:ngsi-ld:Building:019-05-01", "type": "Feature", "geometry": { "type": "Point", @@ -24,12 +24,10 @@ "coordinates": [13.3986, 52.5547] } }, - "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "@context": "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" } }, { - "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "id": "urn:ngsi-ld:Building:019-05-02", "type": "Feature", "geometry": { "type": "Point", @@ -52,9 +50,7 @@ "coordinates": [13.3986, 52.5547] } }, - "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "@context": "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" } }] } diff --git a/data/entities/expectations/vehicle-multi-attributes.jsonld b/data/entities/expectations/vehicle-multi-attributes.jsonld index 06decfb2..8d24bf98 100644 --- a/data/entities/expectations/vehicle-multi-attributes.jsonld +++ b/data/entities/expectations/vehicle-multi-attributes.jsonld @@ -5,6 +5,16 @@ "type": "Property", "value": "Mercedes" }, + "isParked2": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:JohnDoe" + }, + "datasetId": "urn:ngsi-ld:Relationship:parked12345" + }, "isParked": { "type": "Relationship", "object": "urn:ngsi-ld:OffStreetParking:Downtown1", diff --git a/data/entities/expectations/vehicle-parking-simple.geojson b/data/entities/expectations/vehicle-parking-019-02-05.geojson similarity index 77% rename from data/entities/expectations/vehicle-parking-simple.geojson rename to data/entities/expectations/vehicle-parking-019-02-05.geojson index a13e5641..3aa10bff 100644 --- a/data/entities/expectations/vehicle-parking-simple.geojson +++ b/data/entities/expectations/vehicle-parking-019-02-05.geojson @@ -2,8 +2,9 @@ "type": "FeatureCollection", "features": [ { - "id": "urn:ngsi-ld:Vehicle:9584898452850406", + "id": "urn:ngsi-ld:Vehicle:019-02-05", "type": "Feature", + "geometry": null, "properties": { "type": "Vehicle", "brandName": { @@ -19,13 +20,11 @@ "object": "urn:ngsi-ld:OffStreetParking:Downtown1", "observedAt": "2017-07-29T12:00:04Z" }, - "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "@context": "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" } }, { - "id": "urn:ngsi-ld:OffStreetParking:8449859096747487", + "id": "urn:ngsi-ld:OffStreetParking:019-02-05", "type": "Feature", "geometry": { "type": "Point", @@ -67,9 +66,7 @@ ] } }, - "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "@context": "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" } } ] diff --git a/doc/files/ContextInformation/Consumption/019_02_05.json b/doc/files/ContextInformation/Consumption/019_02_05.json index a968ef31..62c46b4a 100644 --- a/doc/files/ContextInformation/Consumption/019_02_05.json +++ b/doc/files/ContextInformation/Consumption/019_02_05.json @@ -1,6 +1,6 @@ { "tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_05", - "test_objective": "Check that you can query entitites via POST Interaction asking for a GeoJSON representation", + "test_objective": "Check that one can query entitites via POST Interaction asking for a GeoJSON representation", "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.2", "config_id": "", "parent_release": "v1.3.1", @@ -18,7 +18,7 @@ { "name": "019_02_05 Query several entities via POST Interaction asking for a GeoJSON representation", "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_02_05", - "doc": "Check that you can query entities via POST Interaction asking for a GeoJSON representation", + "doc": "Check that one can query entities via POST Interaction asking for a GeoJSON representation", "tags": [ "5_7_2", "e-query" @@ -26,8 +26,8 @@ "setup": null, "teardown": null, "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities Via POST with Response Status Code set to 200 and\n Query Entities Via POST with Check Response Body Content and\n Query Parameter: expectation_filename set to 'vehicle-parking-simple.geojson' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}'\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/query'\n method set to 'POST'\n Get Entities Via POST Request: and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: accept set to 'application/geo+json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: content_type set to 'application/json'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities Via POST with Response Status Code set to 200 and\n Query Entities Via POST with Check Response Body Content and\n Query Parameter: expectation_filename set to 'vehicle-parking-019-02-05.geojson' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entityOperations/query'\n method set to 'POST'\n Get Entities Via POST Request: and\n Query Parameter: entities set to '${entities}' and\n Query Parameter: accept set to 'application/geo+json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: content_type set to 'application/json'\n}", "http_verb": "POST", "endpoint": "entityOperations/query" } diff --git a/doc/files/ContextInformation/Consumption/019_05.json b/doc/files/ContextInformation/Consumption/019_05.json index 04b800af..27bc2290 100644 --- a/doc/files/ContextInformation/Consumption/019_05.json +++ b/doc/files/ContextInformation/Consumption/019_05.json @@ -26,7 +26,7 @@ "setup": null, "teardown": null, "template": null, - "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to 200 and\n Query Entities with Check Response Body Content and\n Query Parameter: expectation_filename set to 'two-buildings-location-attribute-normalized.geojson' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to 200 and\n Query Entities with Check Response Body Content and\n Query Parameter: expectation_filename set to 'two-buildings-location-attribute-normalized-019-05.geojson' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_ids set to '${entities_ids_to_be_retrieved}' and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: accept set to 'application/geo+json' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"'\n}", "http_verb": "GET", "endpoint": "entities/" diff --git a/doc/files/ContextInformation/Provision/011_01.json b/doc/files/ContextInformation/Provision/011_01.json index 45a01842..b0db534d 100644 --- a/doc/files/ContextInformation/Provision/011_01.json +++ b/doc/files/ContextInformation/Provision/011_01.json @@ -1,6 +1,6 @@ { "tp_id": "TP/NGSI-LD/CI/Prov/EA/011_01", - "test_objective": "Check that you can update entity attributes", + "test_objective": "Check that one can update entity attributes", "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.2", "config_id": "", "parent_release": "v1.3.1", @@ -17,9 +17,9 @@ "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", "test_cases": [ { - "name": "011_01_01 Check that you can update existing attributes with no datasetId", + "name": "011_01_01 Check that one can update existing attributes with no datasetId", "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/011_01_01", - "doc": "Check that you can update entity attributes", + "doc": "Check that one can update entity attributes", "tags": [ "ea-update", "5_6_2" @@ -27,15 +27,15 @@ "setup": "Initialize Test", "teardown": "Delete Initial Entities", "template": "Update Attributes", - "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 204 and\n Update Entity Attributes with Check Response Body Content and\n Query Parameter: expectation_filename set to 'expectation_resp_filename' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}' and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-speed-two-datasetid-01-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", "http_verb": "PATCH", "endpoint": "entities/{entityId}/attrs/{attributeId}" }, { - "name": "011_01_02 Check that you can update existing attributes with the datasetId", + "name": "011_01_02 Check that one can update existing attributes with the datasetId", "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/011_01_02", - "doc": "Check that you can update entity attributes", + "doc": "Check that one can update entity attributes", "tags": [ "ea-update", "5_6_2" @@ -43,15 +43,15 @@ "setup": "Initialize Test", "teardown": "Delete Initial Entities", "template": "Update Attributes", - "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 204 and\n Update Entity Attributes with Check Response Body Content and\n Query Parameter: expectation_filename set to 'expectation_resp_filename' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}' and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-speed-two-datasetid-02-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", "http_verb": "PATCH", "endpoint": "entities/{entityId}/attrs/{attributeId}" }, { - "name": "011_01_03 Check that you can update only some attributes while unknown are ignored", + "name": "011_01_03 Check that one can update existing attributes and append non-existing attributes", "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/011_01_03", - "doc": "Check that you can update entity attributes", + "doc": "Check that one can update entity attributes", "tags": [ "ea-update", "5_6_2" @@ -59,7 +59,7 @@ "setup": "Initialize Test", "teardown": "Delete Initial Entities", "template": "Update Attributes", - "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 204 and\n Update Entity Attributes with Check Response Body Content and\n Query Parameter: expectation_filename set to 'expectation_resp_filename' and\n Query Parameter: response_body set to 'response.json()' and\n Query Parameter: additional_ignored_path set to '${EMPTY}' and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Update Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-speed-two-datasetid-03-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", "http_verb": "PATCH", "endpoint": "entities/{entityId}/attrs/{attributeId}" diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 6bac6741..b6754cdc 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -48,7 +48,11 @@ Check Response Body Containing Entities URIS set to Check Response Body Content [Arguments] ${expectation_filename} ${response_body} ${additional_ignored_path}=${EMPTY} ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/expectations/${expectation_filename} - ${all_ignored_paths}= Create List ${instance_id_regex_expr} ${additional_ignored_path} + IF $additional_ignored_path!='' + ${all_ignored_paths}= Create List ${instance_id_regex_expr} ${additional_ignored_path} + ELSE + ${all_ignored_paths}= Create List ${instance_id_regex_expr} + END ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${entity_payload} ... ${response_body} -- GitLab From defbba59ff48a7fe9f9192037d85e7d1e0cc0017 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 18 Nov 2024 11:10:49 +0100 Subject: [PATCH 2/2] compare with EMPTY --- resources/AssertionUtils.resource | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index b6754cdc..63bb83e4 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -48,7 +48,7 @@ Check Response Body Containing Entities URIS set to Check Response Body Content [Arguments] ${expectation_filename} ${response_body} ${additional_ignored_path}=${EMPTY} ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/expectations/${expectation_filename} - IF $additional_ignored_path!='' + IF $additional_ignored_path!=${EMPTY} ${all_ignored_paths}= Create List ${instance_id_regex_expr} ${additional_ignored_path} ELSE ${all_ignored_paths}= Create List ${instance_id_regex_expr} -- GitLab