From 9d4336eb120773d49add70cf34787d5f43cfc8f4 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 4 Dec 2023 12:09:07 +0100 Subject: [PATCH] fix: expect a 204 when updates are ignored in update or append attributes operations --- .../BatchEntities/UpdateBatchOfEntities/005_02.robot | 10 +++++----- .../AppendEntityAttributes/010_04.robot | 6 +++--- .../UpdateEntityAttributes/011_01.robot | 4 ++-- .../expectations/add-attribute-expectation.jsonld | 11 ----------- .../vehicle-speed-datasetid-expectation.jsonld | 6 ------ .../entities/fragmentEntities/location-fragment.json | 12 ++++++++++++ 6 files changed, 22 insertions(+), 27 deletions(-) delete mode 100644 data/entities/expectations/add-attribute-expectation.jsonld delete mode 100644 data/entities/expectations/vehicle-speed-datasetid-expectation.jsonld create mode 100644 data/entities/fragmentEntities/location-fragment.json diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot index 99903ba3..52f642b9 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_02.robot @@ -17,15 +17,15 @@ ${entity_payload_filename}= building-simple-attributes-sample.jsonld *** Test Cases *** FILENAME UPDATE_FRAGMENT_FILENAME EXPECTED_STATUS -005_02_01 EntityWithSimpleProperties +005_02_01 EntityWithExistingAttributes [Tags] be-update 5_6_9 - building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json 207 -005_02_02 EntityWithSimpleRelationships + building-simple-attributes-sample.jsonld fragmentEntities/empty-fragment.json 204 +005_02_02 EntityWithNewAttribute [Tags] be-update 5_6_9 building-relationship-sample.jsonld fragmentEntities/locatedAt-fragment.json 204 -005_02_03 EntityWithRelationshipsProperties +005_02_03 EntityWithNewAndExistingAttribute [Tags] be-update 5_6_9 - building-relationship-of-property-sample.jsonld fragmentEntities/empty-fragment.json 207 + building-location-attribute-sample.jsonld fragmentEntities/location-fragment.json 204 *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_04.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_04.robot index 48f05489..df1b0df4 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_04.robot @@ -17,9 +17,9 @@ ${filename}= vehicle-speed-two-datasetid-sample.jsonld *** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_RESPONSE_BODY EXPECTATION_FILENAME -010_04_01 Append entity attributes - 207 vehicle-attribute-to-add-fragment.jsonld add-attribute-expectation.jsonld vehicle-speed-appended-expectation.jsonld -010_04_02 Append entity attributes +010_04_01 Append entity attributes and ignore existing multi-attribute instance + 204 vehicle-attribute-to-add-fragment.jsonld ${EMPTY} vehicle-speed-appended-expectation.jsonld +010_04_02 Append entity attributes with a new multi-attribute instance 204 vehicle-speed-different-datasetid-fragment.jsonld ${EMPTY} vehicle-speed-different-datasetid-expectation.jsonld 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 7acc04ab..b69c09fc 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot @@ -21,8 +21,8 @@ ${filename}= vehicle-two-datasetid-attributes-sample.jsonld 204 vehicle-speed-two-datasetid-01-fragment.jsonld ${EMPTY} expectations/vehicle-update-attributes-expectation.jsonld 011_01_02 Check that you can update existing attributes with the datasetId 204 vehicle-speed-two-datasetid-02-fragment.jsonld ${EMPTY} expectations/vehicle-update-datasetid-attributes-expectation.jsonld -011_01_03 Check that you can update only some attributes while others failed - 207 vehicle-speed-two-datasetid-03-fragment.jsonld vehicle-speed-datasetid-expectation.jsonld expectations/vehicle-multi-attributes-expectation.jsonld +011_01_03 Check that you can update only some attributes while unknown are ignored + 204 vehicle-speed-two-datasetid-03-fragment.jsonld ${EMPTY} expectations/vehicle-multi-attributes-expectation.jsonld *** Keywords *** diff --git a/data/entities/expectations/add-attribute-expectation.jsonld b/data/entities/expectations/add-attribute-expectation.jsonld deleted file mode 100644 index c6c6eb75..00000000 --- a/data/entities/expectations/add-attribute-expectation.jsonld +++ /dev/null @@ -1,11 +0,0 @@ -{ - "updated":[ - "https://uri.etsi.org/ngsi-ld/default-context/attribute_to_be_added" - ], - "notUpdated":[ - { - "attributeName": "https://ngsi-ld-test-suite/context#speed", - "reason": "a reason ignored during the comparison" - } - ] - } \ No newline at end of file diff --git a/data/entities/expectations/vehicle-speed-datasetid-expectation.jsonld b/data/entities/expectations/vehicle-speed-datasetid-expectation.jsonld deleted file mode 100644 index d1ea2d54..00000000 --- a/data/entities/expectations/vehicle-speed-datasetid-expectation.jsonld +++ /dev/null @@ -1,6 +0,0 @@ -{ - "updated":[ - "https://ngsi-ld-test-suite/context#speed" - ], - "notUpdated":[ ] - } \ No newline at end of file diff --git a/data/entities/fragmentEntities/location-fragment.json b/data/entities/fragmentEntities/location-fragment.json new file mode 100644 index 00000000..00006a2a --- /dev/null +++ b/data/entities/fragmentEntities/location-fragment.json @@ -0,0 +1,12 @@ +{ + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [ + 13.3986, + 52.5547 + ] + } + } +} \ No newline at end of file -- GitLab