diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot index a708395226be407d27ccad781ed4b42693504cde..f27030a96ef26e6a91d8e08121205af9f2c5af16 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot @@ -16,7 +16,7 @@ ${building_filename}= building-minimal.jsonld ${vehicle_filename}= vehicle-simple-attributes.jsonld ${expectation_filename}= vehicle-simple-attributes-core-context.json ${attribute_brandname}= https://ngsi-ld-test-suite/context#brandName -${attribute_isparked}= https://uri.etsi.org/ngsi-ld/default-context/isParked +${attribute_isparked}= https://ngsi-ld-test-suite/context#isParked *** Test Cases *** diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_aux.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_aux.robot index d57b7a336e030dce0d81211a476c18781595068e..7e3f77850a36c38a82fdc32f6475e557c12b6637 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_aux.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_aux.robot @@ -19,7 +19,7 @@ ${entity_payload_filename} vehicle-simple-attributes.json ${entity_payload_filename2} vehicle-simple-attributes-second.jsonld ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld ${fragment_filename} vehicle-brandname-fragment.json -${expected_attribute} brandName +${expected_attribute} https://ngsi-ld-test-suite/context#brandName *** Test Cases *** @@ -35,7 +35,7 @@ D010_01_aux Retrieve Entity That Exists On Both The Context Source And The Conte # mock ends up sending headers only). Serialise to a JSON string first. ${entity_body_json}= Evaluate json.dumps($entity_body) json Set Stub Reply GET /ngsi-ld/v1/entities/${entity_id} 200 ${entity_body_json} - ${response}= Retrieve Entity ${entity_id} context=${ngsild_test_suite_context} + ${response}= Retrieve Entity ${entity_id} Check Response Status Code 200 ${response.status_code} Check Response Body Containing an Attribute set to diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/AppendEntityAttributes/D003_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/AppendEntityAttributes/D003_01_inc.robot index 61eb57b19dfde360d9a2af18dd7e74064c011915..34a5a6cbc7c4db51f30f9aafa48cdcae5ca7fb5d 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/AppendEntityAttributes/D003_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/AppendEntityAttributes/D003_01_inc.robot @@ -16,8 +16,10 @@ Test Teardown Delete Registration And Stop Context Source Mock Server *** Variables *** ${entity_payload_filename} vehicle-simple-attributes.jsonld -${fragment_filename} vehicle-speed-isParked-fragment.json +${fragment_filename} vehicle-speed-isParked-fragment.jsonld ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld +${expected_attribute_isParked} https://ngsi-ld-test-suite/context#isParked +${expected_attribute_speed} https://ngsi-ld-test-suite/context#speed *** Test Cases *** D003_01_inc Append Entity Attribute @@ -25,22 +27,22 @@ D003_01_inc Append Entity Attribute [Tags] since_v1.6.1 dist-ops 4_3_3 cf_04 additive-inclusive 4_3_6_2 5_6_3 ${response}= Retrieve Entity ${entity_id} - ${old_body}= Get From Dictionary ${response.json()} isParked + ${old_body}= Get From Dictionary ${response.json()} ${expected_attribute_isParked} Set Stub Reply POST /ngsi-ld/v1/entities/${entity_id}/attrs/ 204 ${response}= Append Entity Attributes ... ${entity_id} ... ${fragment_filename} - ... ${CONTENT_TYPE_JSON} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 204 ${response.status_code} ${stub_count}= Get Stub Count POST /ngsi-ld/v1/entities/${entity_id}/attrs/ Should Be Equal As Integers ${stub_count} 1 ${response}= Retrieve Entity ${entity_id} - ${new_body}= Get From Dictionary ${response.json()} isParked + ${new_body}= Get From Dictionary ${response.json()} ${expected_attribute_isParked} - Should Have Value In Json ${response.json()} $.speed + Should Contain ${response.json()} ${expected_attribute_speed} Should Not Be Equal ${old_body} ${new_body} *** Keywords *** diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/AppendEntityAttributes/D003_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/AppendEntityAttributes/D003_02_inc.robot index 7b762d992da8fd23797429d1d44365fabd2928cd..451f1ea835aa22febf5cb0f9e19da5ee1fed0639 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/AppendEntityAttributes/D003_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/AppendEntityAttributes/D003_02_inc.robot @@ -15,8 +15,10 @@ Test Teardown Delete Registration And Stop Context Source Mock Server *** Variables *** ${entity_payload_filename} vehicle-simple-attributes.jsonld -${fragment_filename} vehicle-speed-isParked-fragment.json +${fragment_filename} vehicle-speed-isParked-fragment.jsonld ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld +${expected_attribute_isParked} https://ngsi-ld-test-suite/context#isParked +${expected_attribute_speed} https://ngsi-ld-test-suite/context#speed *** Test Cases *** D003_02_inc Append Entity Attribute @@ -24,13 +26,13 @@ D003_02_inc Append Entity Attribute [Tags] since_v1.6.1 dist-ops 4_3_3 cf_04 additive-inclusive 4_3_6_2 5_6_3 ${response}= Retrieve Entity ${entity_id} - ${old_body}= Get From Dictionary ${response.json()} isParked + ${old_body}= Get From Dictionary ${response.json()} ${expected_attribute_isParked} Set Stub Reply POST /ngsi-ld/v1/entities/${entity_id}/attrs/ 207 ${response}= Append Entity Attributes With Parameters ... ${entity_id} ... ${fragment_filename} - ... ${CONTENT_TYPE_JSON} + ... ${CONTENT_TYPE_LD_JSON} ... noOverwrite Wait For Request Check Response Status Code 207 ${response.status_code} @@ -39,8 +41,8 @@ D003_02_inc Append Entity Attribute Should Contain ${stub} noOverwrite ${response}= Retrieve Entity ${entity_id} - ${new_body}= Get From Dictionary ${response.json()} isParked - Should Have Value In Json ${response.json()} $.speed + ${new_body}= Get From Dictionary ${response.json()} ${expected_attribute_isParked} + Should Contain ${response.json()} ${expected_attribute_speed} Should Be Equal ${old_body} ${new_body} *** Keywords *** diff --git a/data/csourceRegistrations/expectations/context-source-registration-expanded-format.json b/data/csourceRegistrations/expectations/context-source-registration-expanded-format.json index 03e4a0d1ae5f15f9526c6b5b2c9aaf7f6583d1d0..9cc4dd2d62c0213b5d3ee651af833e5b992232df 100644 --- a/data/csourceRegistrations/expectations/context-source-registration-expanded-format.json +++ b/data/csourceRegistrations/expectations/context-source-registration-expanded-format.json @@ -7,7 +7,7 @@ "entities": [ { "id": "urn:ngsi-ld:Vehicle:A456", - "type": "https://ngsi-ld-test-suite/context#Vehicle" + "type": ["https://ngsi-ld-test-suite/context#Vehicle"] } ], "propertyNames": [ @@ -15,17 +15,17 @@ "https://ngsi-ld-test-suite/context#speed" ], "relationshipNames": [ - "isParked" + "https://ngsi-ld-test-suite/context#isParked" ] }, { "entities": [ { - "type": "https://ngsi-ld-test-suite/context#OffStreetParking", + "type": ["https://ngsi-ld-test-suite/context#OffStreetParking"], "idPattern": ".*downtown$" }, { - "type": "https://ngsi-ld-test-suite/context#OffStreetParking", + "type": ["https://ngsi-ld-test-suite/context#OffStreetParking"], "idPattern": ".*47$" } ], diff --git a/data/entities/expectations/two-types-vehicle-offstreetparking.jsonld b/data/entities/expectations/two-types-vehicle-offstreetparking.jsonld index bb08a6df6be99ce5f3b4eae96ed5e01cf34f68a3..f85ae76a34bd7057acd249a224665d3f1a3f6382 100644 --- a/data/entities/expectations/two-types-vehicle-offstreetparking.jsonld +++ b/data/entities/expectations/two-types-vehicle-offstreetparking.jsonld @@ -6,7 +6,7 @@ "type": "Property", "value": "Mercedes" }, - "isParked": { + "https://ngsi-ld-test-suite/context#isParked": { "type": "Relationship", "providedBy": { "type": "Relationship", @@ -28,7 +28,7 @@ "type": "Relationship", "object": "urn:ngsi-ld:Camera:C1" }, - "reliability": { + "https://ngsi-ld-test-suite/context#reliability": { "type": "Property", "value": 0.7 }, diff --git a/data/entities/expectations/two-vehicles.jsonld b/data/entities/expectations/two-vehicles.jsonld index 6cf1695f02069166beb999f255f1e8ec11094dc0..7af2714d7ae0f84d27e178f4d89209450dd9ed24 100644 --- a/data/entities/expectations/two-vehicles.jsonld +++ b/data/entities/expectations/two-vehicles.jsonld @@ -6,7 +6,7 @@ "type": "Property", "value": "Mercedes" }, - "isParked": { + "https://ngsi-ld-test-suite/context#isParked": { "type": "Relationship", "providedBy": { "type": "Relationship", @@ -26,7 +26,7 @@ "type": "Property", "value": "Mercedes" }, - "isParked": { + "https://ngsi-ld-test-suite/context#isParked": { "type": "Relationship", "providedBy": { "type": "Relationship", diff --git a/data/entities/expectations/vehicle-simple-attributes-core-context.json b/data/entities/expectations/vehicle-simple-attributes-core-context.json index 54eca92534d500d21893510ebaa7c7a8bf8b01da..bd9f3348c6b885fa1aa56f896e15b88620335b65 100644 --- a/data/entities/expectations/vehicle-simple-attributes-core-context.json +++ b/data/entities/expectations/vehicle-simple-attributes-core-context.json @@ -5,7 +5,7 @@ "type": "Property", "value": "Mercedes" }, - "isParked": { + "https://ngsi-ld-test-suite/context#isParked": { "type": "Relationship", "providedBy": { "type": "Relationship", diff --git a/data/entities/fragmentEntities/vehicle-speed-isParked-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-isParked-fragment.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..1b5f3498173532ee2b532d1475d89e13b1878b13 --- /dev/null +++ b/data/entities/fragmentEntities/vehicle-speed-isParked-fragment.jsonld @@ -0,0 +1,22 @@ +{ + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:JohnDoe" + } + }, + "speed": { + "type": "Property", + "value": 99, + "source": { + "type": "Property", + "value": "Speedometer" + } + }, + "@context": [ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] +} \ No newline at end of file diff --git a/data/types/expectations/entity-type-023-01-01.json b/data/types/expectations/entity-type-023-01-01.json index a192383199021914a7552174103630cdbae0d3f8..5a112c410aa79756cf4e27e77ed6415a3ace5d2c 100644 --- a/data/types/expectations/entity-type-023-01-01.json +++ b/data/types/expectations/entity-type-023-01-01.json @@ -16,7 +16,7 @@ "typeName":"https://ngsi-ld-test-suite/context#Vehicle", "attributeNames":[ "https://ngsi-ld-test-suite/context#brandName", - "isParked" + "https://ngsi-ld-test-suite/context#isParked" ] } ] \ No newline at end of file diff --git a/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld b/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld index 512d86a4d95df7778e9944593bf53a4f97ba3c7f..81a01dfac3ceaccef9a64d053221222e939b6341 100644 --- a/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld +++ b/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld @@ -1,6 +1,6 @@ { "@context": [ - "ngsi-ld-test-suite.jsonld", + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.9.jsonld" ] }