From cc1a3e2a22bf2b87e8c91d297d813512f79b621e Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Wed, 24 Mar 2021 11:06:09 +0000 Subject: [PATCH 01/10] fixed 043_XX tests --- TP/NGSI-LD/CommonBehaviours/043.robot | 12 ++++++------ ...registration-unretrievable-context-sample.jsonld} | 5 ++++- .../building-unretrievable-context-sample.jsonld | 7 +++++++ ...subscription-unretrievable-context-sample.jsonld} | 5 ++++- ...presentation-unretrievable-context-sample.jsonld} | 3 +++ 5 files changed, 24 insertions(+), 8 deletions(-) rename data/csourceRegistrations/{context-source-registration-without-context-sample.jsonld => context-source-registration-unretrievable-context-sample.jsonld} (71%) create mode 100644 data/entities/building-unretrievable-context-sample.jsonld rename data/{csourceSubscriptions/subscription-without-context-sample.jsonld => subscriptions/subscription-unretrievable-context-sample.jsonld} (84%) rename data/temporalEntities/{bus-temporal-representation-without-context-sample.jsonld => bus-temporal-representation-unretrievable-context-sample.jsonld} (94%) diff --git a/TP/NGSI-LD/CommonBehaviours/043.robot b/TP/NGSI-LD/CommonBehaviours/043.robot index b372613b..416fec3b 100644 --- a/TP/NGSI-LD/CommonBehaviours/043.robot +++ b/TP/NGSI-LD/CommonBehaviours/043.robot @@ -8,18 +8,18 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${expected_status_code}= 503 ${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-minimal-without-context-sample.jsonld +${building_filename}= building-unretrievable-context-sample.jsonld ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= csourceSubscriptions/subscription-without-context-sample.jsonld +${subscription_filename}= subscriptions/subscription-unretrievable-context-sample.jsonld ${tea_id_prefix}= urn:ngsi-ld:Vehicle: -${tea_filename}= bus-temporal-representation-without-context-sample.jsonld +${tea_filename}= bus-temporal-representation-unretrievable-context-sample.jsonld ${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_filename}= csourceRegistrations/context-source-registration-without-context-sample.jsonld +${registration_filename}= csourceRegistrations/context-source-registration-unretrievable-context-sample.jsonld -*** Test Cases *** +*** comments *** 043_01 Create entity [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create entity) @@ -69,7 +69,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration-with Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Batch Delete Entities @{entities_to_be_created} - +*** Test Cases *** 043_05 Create context source registration [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create context source registration) diff --git a/data/csourceRegistrations/context-source-registration-without-context-sample.jsonld b/data/csourceRegistrations/context-source-registration-unretrievable-context-sample.jsonld similarity index 71% rename from data/csourceRegistrations/context-source-registration-without-context-sample.jsonld rename to data/csourceRegistrations/context-source-registration-unretrievable-context-sample.jsonld index b4a6b06e..41532009 100644 --- a/data/csourceRegistrations/context-source-registration-without-context-sample.jsonld +++ b/data/csourceRegistrations/context-source-registration-unretrievable-context-sample.jsonld @@ -10,5 +10,8 @@ ] } ], - "endpoint":"http://my.csource.org:1026" + "endpoint":"http://my.csource.org:1026", + "@context":[ + "unretrievableContext" + ] } \ No newline at end of file diff --git a/data/entities/building-unretrievable-context-sample.jsonld b/data/entities/building-unretrievable-context-sample.jsonld new file mode 100644 index 00000000..908a6b09 --- /dev/null +++ b/data/entities/building-unretrievable-context-sample.jsonld @@ -0,0 +1,7 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "@context": [ + "unretrievableContext" + ] +} \ No newline at end of file diff --git a/data/csourceSubscriptions/subscription-without-context-sample.jsonld b/data/subscriptions/subscription-unretrievable-context-sample.jsonld similarity index 84% rename from data/csourceSubscriptions/subscription-without-context-sample.jsonld rename to data/subscriptions/subscription-unretrievable-context-sample.jsonld index 36860f5b..f4a60a81 100644 --- a/data/csourceSubscriptions/subscription-without-context-sample.jsonld +++ b/data/subscriptions/subscription-unretrievable-context-sample.jsonld @@ -12,5 +12,8 @@ "uri":"http://my.endpoint.org/notify", "accept":"application/json" } - } + }, + "@context":[ + "contextUnretrievable" + ] } \ No newline at end of file diff --git a/data/temporalEntities/bus-temporal-representation-without-context-sample.jsonld b/data/temporalEntities/bus-temporal-representation-unretrievable-context-sample.jsonld similarity index 94% rename from data/temporalEntities/bus-temporal-representation-without-context-sample.jsonld rename to data/temporalEntities/bus-temporal-representation-unretrievable-context-sample.jsonld index 9a70e2bd..c6f12825 100644 --- a/data/temporalEntities/bus-temporal-representation-without-context-sample.jsonld +++ b/data/temporalEntities/bus-temporal-representation-unretrievable-context-sample.jsonld @@ -40,5 +40,8 @@ "value":124, "observedAt":"2020-08-01T14:07:00Z" } + ], + "@context":[ + "unretrievableContext" ] } \ No newline at end of file -- GitLab From ec4db086139c5cc3dd0b6707c5a0c289e73c79bb Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Wed, 24 Mar 2021 12:15:40 +0000 Subject: [PATCH 02/10] fixed 044_01 tests --- TP/NGSI-LD/CommonBehaviours/043.robot | 5 ++--- TP/NGSI-LD/CommonBehaviours/044_01.robot | 14 +++++++------- .../vehicle-brandname-fragment.json | 6 ++++++ .../vehicle-brandname-fragment.jsonld | 2 +- resources/ApiUtils.resource | 3 ++- 5 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 data/entities/fragmentEntities/vehicle-brandname-fragment.json diff --git a/TP/NGSI-LD/CommonBehaviours/043.robot b/TP/NGSI-LD/CommonBehaviours/043.robot index 416fec3b..2e7a10d4 100644 --- a/TP/NGSI-LD/CommonBehaviours/043.robot +++ b/TP/NGSI-LD/CommonBehaviours/043.robot @@ -19,7 +19,7 @@ ${tea_filename}= bus-temporal-representation-unretrievable-context-sample.jsonl ${registration_id_prefix}= urn:ngsi-ld:Registration: ${registration_filename}= csourceRegistrations/context-source-registration-unretrievable-context-sample.jsonld -*** comments *** +*** Test Cases *** 043_01 Create entity [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create entity) @@ -42,7 +42,6 @@ ${registration_filename}= csourceRegistrations/context-source-registration-unre [Teardown] Delete Subscription ${subscription_id} - 043_03 Create Temporal Representation of Entities [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create Temporal Representation of Entities) @@ -69,7 +68,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration-unre Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Batch Delete Entities @{entities_to_be_created} -*** Test Cases *** + 043_05 Create context source registration [Documentation] Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create context source registration) diff --git a/TP/NGSI-LD/CommonBehaviours/044_01.robot b/TP/NGSI-LD/CommonBehaviours/044_01.robot index 76c1db84..5aecce32 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_01.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_01.robot @@ -7,14 +7,14 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${vehicle_fragment}= vehicle-brandname-fragment.jsonld +${vehicle_fragment}= vehicle-brandname-fragment.json ${attribute_id}= brandName ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld -${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sample.jsonld +${subscription_filename}= subscriptions/subscription-sample.jsonld +${subscription_fragment}= subscriptions/fragments/subscription-update-sample.json -*** Test Cases *** +*** Test Cases *** 044_01_01_endpoint /entities/{entityId}/attrs/{attrId} [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type [Tags] mandatory @@ -22,11 +22,11 @@ ${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sa ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${vehicle_fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} + ${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${vehicle_fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} context=${ngsild_test_suite_context} Check Response Status Code 204 ${response['status']} [Teardown] Delete Entity by Id ${entity_id} - + 044_01_02_endpoint /subscriptions/{subscriptionId} [Documentation] Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type [Tags] mandatory @@ -34,7 +34,7 @@ ${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sa ${response}= Create Subscription ${subscription_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Update Subscription ${subscription_id} ${subscription_fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} + ${response}= Update Subscription ${subscription_id} ${subscription_fragment} ${CONTENT_TYPE_MERGE_PATCH_JSON} context=${ngsild_test_suite_context} Check Response Status Code 204 ${response['status']} [Teardown] Delete Subscription ${subscription_id} diff --git a/data/entities/fragmentEntities/vehicle-brandname-fragment.json b/data/entities/fragmentEntities/vehicle-brandname-fragment.json new file mode 100644 index 00000000..2675db21 --- /dev/null +++ b/data/entities/fragmentEntities/vehicle-brandname-fragment.json @@ -0,0 +1,6 @@ +{ + "https://ngsi-ld-test-suite/context#brandName": { + "type": "Property", + "value": "BMW" + } +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld b/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld index 14fcc171..8c229718 100644 --- a/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld +++ b/data/entities/fragmentEntities/vehicle-brandname-fragment.jsonld @@ -3,5 +3,5 @@ "type": "Property", "value": "BMW" }, - "@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.3.jsonld" + "@context": "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" } \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index fd1f48db..06b03997 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -190,9 +190,10 @@ Delete Entity Attributes [return] ${response} Partial Update Entity Attributes - [Arguments] ${entityId} ${attributeId} ${fragment_filename} ${content_type} ${accept}=${EMPTY} + [Arguments] ${entityId} ${attributeId} ${fragment_filename} ${content_type} ${accept}=${EMPTY} ${context}=${EMPTY} &{headers}= Create Dictionary Content-Type=${content_type} Run Keyword If '${accept}'!='' Set To Dictionary ${headers} Accept ${accept} + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" ${fragment_payload}= Load Json From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} ${response}= PATCH ${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId} body=${fragment_payload} headers=${headers} Output request -- GitLab From 976f6d2a0fda16d2e08fdba84d53340b4c437563 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Wed, 24 Mar 2021 17:46:16 +0000 Subject: [PATCH 03/10] fixed 044_02 --- TP/NGSI-LD/CommonBehaviours/044_02.robot | 30 +++++--- ...-simple-attributes-sample-expectation.json | 16 ++-- ...e-temporal-representation-expectation.json | 44 ----------- ...-representation-044-02-04-expectation.json | 76 +++++++++++++++++++ resources/AssertionUtils.resource | 9 +++ 5 files changed, 113 insertions(+), 62 deletions(-) delete mode 100644 data/temporalEntities/expectations/vehicle-temporal-representation-expectation.json create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-044-02-04-expectation.json diff --git a/TP/NGSI-LD/CommonBehaviours/044_02.robot b/TP/NGSI-LD/CommonBehaviours/044_02.robot index df734374..2294ca7c 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_02.robot @@ -11,7 +11,7 @@ ${building_expectation}= building-simple-attributes-sample-expectation.json ${entity_type}= https://ngsi-ld-test-suite/context#Building ${subscription_id_prefix}= urn:ngsi-ld:Subscription: -${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld +${subscription_filename}= subscriptions/subscription-sample.jsonld ${subscription_expectation}= subscription-sample-expectation.json ${registration_id_prefix}= urn:ngsi-ld:Registration: @@ -21,9 +21,12 @@ ${registration_type}= Vehicle ${tea_id_prefix}= urn:ngsi-ld:Vehicle: ${tea_filename}= vehicle-temporal-representation-sample.jsonld -${tea_expectation}= vehicle-temporal-representation-expectation.json +${tea_expectation}= vehicles-temporal-representation-044-02-04-expectation.json ${teatype}= Vehicle +${content_type}= application/json +${accept}= application/json, */* + *** Test Cases *** 044_02_01_endpoint /entities/{entityId} [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/entities/{entityId}) @@ -31,14 +34,15 @@ ${teatype}= Vehicle ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Entity ${id} + ${request} ${response}= Query Entity ${id} context=${ngsild_test_suite_context} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${building_expectation} ${id} ${response['body']} - Check Request Containing Accept Header Set To ${request} application/json, */* + Check Request Containing Accept Header Set To ${request} ${accept} + Check Response Headers Containing Content-Type set to ${response} ${content_type} + Check Response Headers Link Not Empty ${response} [Teardown] Delete Entity by Id Returning Response ${id} - 044_02_02_endpoint /subscriptions/{subscriptionId} [Documentation] Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/subscriptions/{subscriptionId}) @@ -49,7 +53,9 @@ ${teatype}= Vehicle ${request} ${response}= Retrieve Subscription ${id} Check Response Status Code 200 ${response['status']} Check Response Body Containing One Subscription element ${subscription_expectation} ${response['body']} - Check Request Containing Accept Header Set To ${request} application/json, */* + Check Request Containing Accept Header Set To ${request} ${accept} + Check Response Headers Containing Content-Type set to ${response} ${content_type} + Check Response Headers Link Not Empty ${response} [Teardown] Delete Subscription ${id} @@ -62,10 +68,12 @@ ${teatype}= Vehicle ${request} ${response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${response['status']} - ${request} ${response}= Query Context Source Registrations With Return id=${registration_id} type=${registration_type} + ${request} ${response}= Query Context Source Registrations With Return id=${registration_id} type=${registration_type} context=${ngsild_test_suite_context} Check Response Status Code 200 ${response['status']} Check Response Body Containing One Registration element ${registration_expectation} ${response['body']} - Check Request Containing Accept Header Set To ${request} application/json, */* + Check Request Containing Accept Header Set To ${request} ${accept} + Check Response Headers Containing Content-Type set to ${response} ${content_type} + Check Response Headers Link Not Empty ${response} [Teardown] Delete Context Source Registration ${registration_id} @@ -75,10 +83,12 @@ ${teatype}= Vehicle ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} Create Temporal Representation Of Entity ${tea_filename} ${temporal_entity_representation_id} - ${request} ${response}= Query Temporal Representation Of Entities With Return entity_types=${teatype} timerel=after timeAt=2020-08-01T12:05:00Z + ${request} ${response}= Query Temporal Representation Of Entities With Return entity_types=${teatype} timerel=after timeAt=2020-08-01T12:05:00Z context=${ngsild_test_suite_context} Check Response Status Code 200 ${response['status']} Set Test Variable ${response} Check Response Body Containing EntityTemporal element ${tea_expectation} ${temporal_entity_representation_id} - Check Request Containing Accept Header Set To ${request} application/json, */* + Check Request Containing Accept Header Set To ${request} ${accept} + Check Response Headers Containing Content-Type set to ${response} ${content_type} + Check Response Headers Link Not Empty ${response} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/data/entities/expectations/building-simple-attributes-sample-expectation.json b/data/entities/expectations/building-simple-attributes-sample-expectation.json index df3301bf..436ba724 100644 --- a/data/entities/expectations/building-simple-attributes-sample-expectation.json +++ b/data/entities/expectations/building-simple-attributes-sample-expectation.json @@ -1,22 +1,22 @@ { "id": "urn:ngsi-ld:Building:randomUUID", - "type": "https://ngsi-ld-test-suite/context#Building", - "https://ngsi-ld-test-suite/context#name": { - "type": "Property", - "value": "Eiffel Tower" - }, - "https://ngsi-ld-test-suite/context#airQualityLevel": { + "type": "Building", + "airQualityLevel": { "type": "Property", "value": 4, "observedAt": "2020-09-09T16:40:00.000Z", "unitCode": "C62" }, - "https://ngsi-ld-test-suite/context#almostFull": { + "almostFull": { "type": "Property", "value": false }, - "https://ngsi-ld-test-suite/context#subCategory": { + "subCategory": { "type": "Property", "value": "tourism" + }, + "name": { + "type": "Property", + "value": "Eiffel Tower" } } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-expectation.json b/data/temporalEntities/expectations/vehicle-temporal-representation-expectation.json deleted file mode 100644 index 7917df3c..00000000 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-expectation.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "id":"urn:ngsi-ld:Vehicle:randomUUID", - "type": "https://ngsi-ld-test-suite/context#Vehicle", - "https://ngsi-ld-test-suite/context#brandName": { - "type": "Property", - "value": "BMW", - "instanceId": "urn:ngsi-ld:76739600-3d5c-4cfd-939d-34742a13b52d" - }, - "https://ngsi-ld-test-suite/context#fuelLevel": [ - { - "type": "Property", - "datasetId": "urn:ngsi-ld:Vehicle:12345-fuel", - "value": 40, - "instanceId": "urn:ngsi-ld:0f6e7514-e3ed-46a6-9e9f-6bb02ff687bf", - "observedAt": "2020-09-01T14:07:00Z" - }, - { - "type": "Property", - "value": 53, - "instanceId": "urn:ngsi-ld:59ebe244-14d6-4428-87e1-cd313748125c", - "observedAt": "2020-09-01T13:05:00Z" - }, - { - "type": "Property", - "value": 67, - "instanceId": "urn:ngsi-ld:8bfeea42-8ed3-4d4e-a942-c389229bd6ff", - "observedAt": "2020-09-01T12:03:00Z" - } - ], - "https://ngsi-ld-test-suite/context#speed": [ - { - "type": "Property", - "value": 120, - "instanceId": "urn:ngsi-ld:ec47b86f-656e-4182-b1c2-fbe5af5b4862", - "observedAt": "2020-09-01T12:03:00Z" - }, - { - "type": "Property", - "value": 80, - "instanceId": "urn:ngsi-ld:f3ffc7ad-e562-4081-bd8a-5dda92ab0ffd", - "observedAt": "2020-09-01T12:05:00Z" - } - ] -} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-044-02-04-expectation.json b/data/temporalEntities/expectations/vehicles-temporal-representation-044-02-04-expectation.json new file mode 100644 index 00000000..6fb2bc95 --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-044-02-04-expectation.json @@ -0,0 +1,76 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":53, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"BMW" + }, + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ] + } +] \ No newline at end of file diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 54eac1a5..5a134a79 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -43,6 +43,14 @@ Check Request Containing Accept Header Set To Run Keyword If 'Accept' in ${request['headers']} Should Be Equal ${expected_accept_content} ${request['headers']['Accept']} ignore_order=True Run Keyword If 'accept' in ${request['headers']} Should Be Equal ${expected_accept_content} ${request['headers']['accept']} ignore_order=True +Check Response Headers Containing Content-Type set to + [Arguments] ${response} ${expected_content_type_content} + Should Be Equal ${response['headers']['Content-Type']} ${expected_content_type_content} + +Check Response Headers Link Not Empty + [Arguments] ${response} + Should Not Be Empty ${response['headers']['Link']} + # Since Http headers names are case-insensitive (from Http specification) # We check both Location and location headers Check Response Headers Containing URI set to @@ -53,6 +61,7 @@ Check Response Headers Containing URI set to # Since Http headers names are case-insensitive (from Http specification) # We check both Location and location headers + Check Response Headers ID Not Empty [Arguments] ${response} -- GitLab From 3a71a84589536d36d13d00a1a3fa75f831107c4d Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Wed, 24 Mar 2021 18:49:59 +0000 Subject: [PATCH 04/10] fixed 044_03 --- TP/NGSI-LD/CommonBehaviours/044_03.robot | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/TP/NGSI-LD/CommonBehaviours/044_03.robot b/TP/NGSI-LD/CommonBehaviours/044_03.robot index bf43562b..814983fc 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_03.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_03.robot @@ -6,7 +6,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_filename}= vehicle-simple-attributes-sample.json +${vehicle_filename}= vehicle-simple-attributes-sample.jsonld ${vehicle_attribute}= speed ${vehicle_fragment}= vehicle-brandname-fragment.jsonld @@ -20,6 +20,8 @@ ${tea_filename}= vehicle-temporal-representation-sample.jsonld ${building_id_prefix}= urn:ngsi-ld:Building: ${building_filename}= building-simple-attributes-sample.jsonld +${content_type}= application/xml + *** Test Cases *** 044_03_01_endpoint patch /entities/{entityId}/attrs/{attrId} [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /entities/{entityId}/attrs/{attrId}) @@ -28,7 +30,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Partial Update Entity Attributes ${entity_id} ${vehicle_attribute} ${vehicle_fragment} ${EMPTY} + ${response}= Partial Update Entity Attributes ${entity_id} ${vehicle_attribute} ${vehicle_fragment} ${content_type} Check Response Status Code 415 ${response['status']} [Teardown] Delete Entity by Id Returning Response ${entity_id} @@ -40,7 +42,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${response['status']} - ${response}= Update Subscription ${id} ${subscription_fragment} ${EMPTY} + ${response}= Update Subscription ${id} ${subscription_fragment} ${content_type} Check Response Status Code 415 ${response['status']} [Teardown] Delete Subscription ${id} @@ -49,7 +51,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entities/) ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${EMPTY} + ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${content_type} Check Response Status Code 415 ${response['status']} [Teardown] Delete Entity by Id ${entity_id} @@ -58,13 +60,12 @@ ${building_filename}= building-simple-attributes-sample.jsonld [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /subscriptions/) ${subscriptions_id}= Generate Random Entity Id ${subscription_id_prefix} - ${response}= Create Subscription ${subscriptions_id} ${subscription_filename} ${EMPTY} + ${response}= Create Subscription ${subscriptions_id} ${subscription_filename} ${content_type} Check Response Status Code 415 ${response['status']} [Teardown] Delete Subscription ${subscriptions_id} 044_03_05_endpoint post /entityOperations/create - [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entityOperations/create) ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} @@ -73,7 +74,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld ${second_entity}= Load Entity ${building_filename} ${second_entity_id} @{entities_to_be_created}= Create List ${first_entity} ${second_entity} - Batch Create Entities @{entities_to_be_created} content_type=${EMPTY} + Batch Create Entities @{entities_to_be_created} content_type=${content_type} @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Status Code Set To 415 @@ -84,7 +85,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld [Documentation] Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /temporal/entities/) ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${EMPTY} + ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${content_type} Check Response Status Code 415 ${response['status']} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file -- GitLab From 486edb7321c61885e30811316bd87bc9548fd178 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Thu, 25 Mar 2021 12:51:16 +0000 Subject: [PATCH 05/10] fixed 044_05 --- TP/NGSI-LD/CommonBehaviours/044_04.robot | 4 +- TP/NGSI-LD/CommonBehaviours/044_05.robot | 96 ++++-------------------- 2 files changed, 15 insertions(+), 85 deletions(-) diff --git a/TP/NGSI-LD/CommonBehaviours/044_04.robot b/TP/NGSI-LD/CommonBehaviours/044_04.robot index 29d07ad6..64e96436 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_04.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_04.robot @@ -42,8 +42,8 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld 044_04_03_endpoint get /csourceRegistrations/ [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceRegistrations/) - Query Context Source Registrations type=Building accept=${accept} - Check Response Status Code Set To ${status_code} + ${request} ${response}= Query Context Source Registrations With Return type=Building accept=${accept} + Check Response Status Code ${status_code} ${response['status']} 044_04_04_endpoint get /csourceSubscriptions/ [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceSubscriptions/) diff --git a/TP/NGSI-LD/CommonBehaviours/044_05.robot b/TP/NGSI-LD/CommonBehaviours/044_05.robot index ff5b8b74..7b7662db 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_05.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_05.robot @@ -8,100 +8,30 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${accept}= application/geo+json ${status_code}= 406 -${building_id_prefix}= urn:ngsi-ld:Building: -${building_filename}= building-simple-attributes-sample.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building - ${subscription_id_prefix}= urn:ngsi-ld:Subscription: ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld -${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sample.json - -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_filename}= context-source-registration-with-expiration-sample.jsonld -${registration_fragment}= context-source-registration-with-expiration-expectation.json - -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_filename}= vehicle-simple-attributes-sample.jsonld -${vehicle_attribute}= brandName -${vehicle_fragment}= vehicle-brandname-fragment.jsonld - -${tea_id_prefix}= urn:ngsi-ld:Vehicle: -${tea_filename}= vehicle-temporal-representation-sample.jsonld *** Test Cases *** -044_05_01_endpoint create /entities/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /entities/) - - ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${building_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Entity by Id ${entity_id} - -044_05_02_endpoint update /entities/{entityId}/attrs/{attrId} - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (update /entities/{entityId}/attrs/{attrId}) - - ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} - ${request} ${response}= Create Entity Selecting Content Type ${vehicle_filename} ${entity_id} ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 201 ${response['status']} - Retrieve Entity by Id ${entity_id} - ${response}= Partial Update Entity Attributes ${entity_id} ${vehicle_attribute} ${vehicle_fragment} ${CONTENT_TYPE_LD_JSON} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Entity by Id Returning Response ${entity_id} - -044_05_03_endpoint create /subscriptions/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /subscriptions/) - - ${subscriptions_id}= Generate Random Entity Id ${subscription_id_prefix} - ${response}= Create Subscription ${subscriptions_id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Subscription ${subscriptions_id} - -044_05_04_endpoint update /subscriptions/{subscriptionId} - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (update /subscriptions/{subscriptionId}) - +044_05_01 Retrieve subscription by id + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /subscriptions/{subscriptionId}) + ${id}= Generate Random Entity Id ${subscription_id_prefix} ${response}= Create Subscription ${id} ${subscription_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response['status']} - ${response}= Update Subscription ${id} ${subscription_fragment} ${CONTENT_TYPE_LD_JSON} accept=${accept} + ${request} ${response}= Retrieve Subscription ${id} accept=${accept} Check Response Status Code ${status_code} ${response['status']} [Teardown] Delete Subscription ${id} -044_05_05_endpoint create /temporal/entities/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /temporal/entities/) - - ${temporal_entity_representation_id}= Generate Random Entity Id ${tea_id_prefix} - ${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${tea_filename} ${CONTENT_TYPE_LD_JSON} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - - [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} - -044_05_06_endpoint create /entityOperations/create - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /entityOperations/create) - - ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} - ${first_entity}= Load Entity ${building_filename} ${first_entity_id} - ${second_entity}= Load Entity ${building_filename} ${second_entity_id} - @{entities_to_be_created}= Create List ${first_entity} ${second_entity} - - Batch Create Entities @{entities_to_be_created} content_type=${CONTENT_TYPE_LD_JSON} accept=${accept} - - @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} +044_05_02 Query temporal entities + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-08-01T12:05:00Z accept=${accept} Check Response Status Code Set To ${status_code} - [Teardown] Batch Delete Entities @{expected_entities_ids} - -044_05_07_endpoint create /csourceRegistrations/ - [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header is "application/geo+json" for operations different than "Retrieve Entity" and "Query Entity" (create /csourceRegistrations/) - - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - ${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_filename} - ${updated_payload}= Update Value To Json ${payload} $..id ${registration_id} - ${request} ${response}= Create Context Source Registration With Return ${updated_payload} accept=${accept} - Check Response Status Code ${status_code} ${response['status']} - [Teardown] Delete Context Source Registration ${registration_id} \ No newline at end of file +044_05_03 Query context source registration + [Documentation] Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities) + ${request} ${response}= Query Context Source Registrations With Return type=Building accept=${accept} + Check Response Status Code ${status_code} ${response['status']} \ No newline at end of file -- GitLab From 537c99706d6d0a7117f2eeec9e8c7fb931d82d8c Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Thu, 25 Mar 2021 13:08:33 +0000 Subject: [PATCH 06/10] fixed 019_03_04 --- .../Consumption/Entity/QueryEntities/019_03_04.robot | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot index 5d0d706a..290bf36d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot @@ -8,9 +8,8 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld ${entity_type}= https://ngsi-ld-test-suite/context#Building -${invalid_attribute_one}= invalid_attribute_one -${invalid_attribute_two}= invalid_attribute_two - +${invalid_attribute_one}= subCategory= +${invalid_attribute_two}= airQualityLevel= *** Test Cases *** Query several entities based on incorrect attribute names [Documentation] Check that you cannot query entities if the requested attribute names are incorrect -- GitLab From 4dd07760c43e9736c28d089ba9b6dc9b3d7bfae3 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Fri, 26 Mar 2021 09:56:35 +0000 Subject: [PATCH 07/10] fixed 019_03_05 and 007_01_XX --- .../Entity/QueryEntities/019_03_05.robot | 12 +++++++---- .../007_01.robot | 5 +++-- ...building-invalid-geoproperty-sample.jsonld | 21 +++++++++++++++++++ resources/ApiUtils.resource | 5 ++++- 4 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 data/entities/building-invalid-geoproperty-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot index 55dd7fd3..8f061207 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_05.robot @@ -6,9 +6,12 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-minimal-sample.jsonld -${entity_type}= https://ngsi-ld-test-suite/context#Building -${invalid_geometry_property}= invalid_geometry_property +${filename}= building-location-attribute-sample.jsonld +${entity_type}= Building +${georel}= invalid +${geometry}= Point +${coordinates}= [-8.503,41.202] +${geoproperty}= location *** Test Cases *** Query entitites when the request has a wrong geometryProperty @@ -23,7 +26,8 @@ Query entitites when the request has a wrong geometryProperty Check Response Status Code 201 ${response['status']} ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, ${entity_type} - ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} geoproperty=${invalid_geometry_property} + ${response}= Query Entities entity_types=${entity_types_to_be_retrieved} geoproperty=${geoproperty} georel=${georel} geometry=${geometry} coordinates=${coordinates} context=${ngsild_test_suite_context} + Check Response Status Code 400 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot index 9f686e75..a44a455f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/CreateTemporalRepresentationOfEntity/007_01.robot @@ -24,7 +24,8 @@ Create Temporal Entity Check Response Status Code 201 ${response['status']} ${created_temporal_entity}= Load Test Sample temporalEntities/${filename} ${temporal_entity_representation_id} - Set Test Variable ${response} - Check Created Resource Set To ${created_temporal_entity} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} + ${ignored_attributes}= Create List instanceId @context + Check Created Resource Set To ${created_temporal_entity} ${ignored_attributes} [Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id} \ No newline at end of file diff --git a/data/entities/building-invalid-geoproperty-sample.jsonld b/data/entities/building-invalid-geoproperty-sample.jsonld new file mode 100644 index 00000000..d3c8987d --- /dev/null +++ b/data/entities/building-invalid-geoproperty-sample.jsonld @@ -0,0 +1,21 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "subCategory": { + "type": "Property", + "value": ["tourism"] + }, + "geoQ":{ + "georel":"near;maxDistance==2000", + "geometry":"Point", + "coordinates":[-8.52,41.2], + "geoproperty": "location" + }, + "@context": [ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 06b03997..26d1fe61 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -68,7 +68,7 @@ Query Entity [return] ${request} ${response} Query Entities - [Arguments] ${entity_ids}=${EMPTY} ${entity_types}=${EMPTY} ${accept}=${EMPTY} ${attrs}=${EMPTY} ${context}=${EMPTY} ${geoproperty}=${EMPTY} ${options}=${EMPTY} ${limit}=${EMPTY} ${entity_id_pattern}=${EMPTY} + [Arguments] ${entity_ids}=${EMPTY} ${entity_types}=${EMPTY} ${accept}=${EMPTY} ${attrs}=${EMPTY} ${context}=${EMPTY} ${geoproperty}=${EMPTY} ${options}=${EMPTY} ${limit}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${georel}=${EMPTY} ${coordinates}=${EMPTY} ${geometry}=${EMPTY} ${attrs_length} = Get Length ${attrs} ${accept_length} = Get Length ${accept} ${options_length} = Get Length ${options} @@ -85,6 +85,9 @@ Query Entities Run Keyword If ${entity_types_length}>0 Set To Dictionary ${params} type=${entity_types} Run Keyword If '${limit}'!='' Set To Dictionary ${params} limit=${limit} Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} + Run Keyword If '${georel}'!='' Set To Dictionary ${params} georel=${georel} + Run Keyword If '${coordinates}'!='' Set To Dictionary ${params} coordinates=${coordinates} + Run Keyword If '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} ${response}= GET ${ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} Output request -- GitLab From 4b8610a22f6e5137b1a4c596bf48aa794e5d4881 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Fri, 26 Mar 2021 09:58:34 +0000 Subject: [PATCH 08/10] removed unused file --- ...building-invalid-geoproperty-sample.jsonld | 21 ------------------- 1 file changed, 21 deletions(-) delete mode 100644 data/entities/building-invalid-geoproperty-sample.jsonld diff --git a/data/entities/building-invalid-geoproperty-sample.jsonld b/data/entities/building-invalid-geoproperty-sample.jsonld deleted file mode 100644 index d3c8987d..00000000 --- a/data/entities/building-invalid-geoproperty-sample.jsonld +++ /dev/null @@ -1,21 +0,0 @@ -{ - "id": "urn:ngsi-ld:Building:randomUUID", - "type": "Building", - "name": { - "type": "Property", - "value": "Eiffel Tower" - }, - "subCategory": { - "type": "Property", - "value": ["tourism"] - }, - "geoQ":{ - "georel":"near;maxDistance==2000", - "geometry":"Point", - "coordinates":[-8.52,41.2], - "geoproperty": "location" - }, - "@context": [ - "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld" - ] -} \ No newline at end of file -- GitLab From c0f0150a79a4616a0bfab63d48ae55089a54022d Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Fri, 26 Mar 2021 10:21:06 +0000 Subject: [PATCH 09/10] fixed 019_03_04 --- .../Consumption/Entity/QueryEntities/019_03_04.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot index 290bf36d..fe88f51a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_03_04.robot @@ -8,8 +8,8 @@ Resource ${EXECDIR}/resources/JsonUtils.resource ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-minimal-sample.jsonld ${entity_type}= https://ngsi-ld-test-suite/context#Building -${invalid_attribute_one}= subCategory= -${invalid_attribute_two}= airQualityLevel= +${invalid_attribute_one}= invalid +${invalid_attribute_two}= invalid *** Test Cases *** Query several entities based on incorrect attribute names [Documentation] Check that you cannot query entities if the requested attribute names are incorrect -- GitLab From 0abdc32eeee5dd94e58f05a11f4a21f754a2bcf8 Mon Sep 17 00:00:00 2001 From: Gustavo Lopes Date: Fri, 26 Mar 2021 12:46:42 +0000 Subject: [PATCH 10/10] removed check accept header request on 044_02 --- TP/NGSI-LD/CommonBehaviours/044_02.robot | 5 ----- resources/AssertionUtils.resource | 6 ------ 2 files changed, 11 deletions(-) diff --git a/TP/NGSI-LD/CommonBehaviours/044_02.robot b/TP/NGSI-LD/CommonBehaviours/044_02.robot index 2294ca7c..8b853cdb 100644 --- a/TP/NGSI-LD/CommonBehaviours/044_02.robot +++ b/TP/NGSI-LD/CommonBehaviours/044_02.robot @@ -25,7 +25,6 @@ ${tea_expectation}= vehicles-temporal-representation-044-02-04-expectation.json ${teatype}= Vehicle ${content_type}= application/json -${accept}= application/json, */* *** Test Cases *** 044_02_01_endpoint /entities/{entityId} @@ -37,7 +36,6 @@ ${accept}= application/json, */* ${request} ${response}= Query Entity ${id} context=${ngsild_test_suite_context} Check Response Status Code 200 ${response['status']} Check Response Body Containing Entity element ${building_expectation} ${id} ${response['body']} - Check Request Containing Accept Header Set To ${request} ${accept} Check Response Headers Containing Content-Type set to ${response} ${content_type} Check Response Headers Link Not Empty ${response} @@ -53,7 +51,6 @@ ${accept}= application/json, */* ${request} ${response}= Retrieve Subscription ${id} Check Response Status Code 200 ${response['status']} Check Response Body Containing One Subscription element ${subscription_expectation} ${response['body']} - Check Request Containing Accept Header Set To ${request} ${accept} Check Response Headers Containing Content-Type set to ${response} ${content_type} Check Response Headers Link Not Empty ${response} @@ -71,7 +68,6 @@ ${accept}= application/json, */* ${request} ${response}= Query Context Source Registrations With Return id=${registration_id} type=${registration_type} context=${ngsild_test_suite_context} Check Response Status Code 200 ${response['status']} Check Response Body Containing One Registration element ${registration_expectation} ${response['body']} - Check Request Containing Accept Header Set To ${request} ${accept} Check Response Headers Containing Content-Type set to ${response} ${content_type} Check Response Headers Link Not Empty ${response} @@ -87,7 +83,6 @@ ${accept}= application/json, */* Check Response Status Code 200 ${response['status']} Set Test Variable ${response} Check Response Body Containing EntityTemporal element ${tea_expectation} ${temporal_entity_representation_id} - Check Request Containing Accept Header Set To ${request} ${accept} Check Response Headers Containing Content-Type set to ${response} ${content_type} Check Response Headers Link Not Empty ${response} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 5a134a79..431c61d0 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -37,12 +37,6 @@ Check Response Body Content ${comparison_result}= Compare Dictionaries Ignoring Keys ${response_body} ${entity_payload} ${all_ignored_paths} Should Be True ${comparison_result} msg=Entity Comparison Failed -Check Request Containing Accept Header Set To - [Arguments] ${request} ${expected_accept_content} - - Run Keyword If 'Accept' in ${request['headers']} Should Be Equal ${expected_accept_content} ${request['headers']['Accept']} ignore_order=True - Run Keyword If 'accept' in ${request['headers']} Should Be Equal ${expected_accept_content} ${request['headers']['accept']} ignore_order=True - Check Response Headers Containing Content-Type set to [Arguments] ${response} ${expected_content_type_content} Should Be Equal ${response['headers']['Content-Type']} ${expected_content_type_content} -- GitLab