Commits (12)
......@@ -8,16 +8,16 @@ 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 ***
043_01 Create entity
......@@ -42,7 +42,6 @@ ${registration_filename}= csourceRegistrations/context-source-registration-with
[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)
......
......@@ -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}
......
......@@ -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,11 @@ ${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
*** 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 +33,14 @@ ${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 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 +51,8 @@ ${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 Response Headers Containing Content-Type set to ${response} ${content_type}
Check Response Headers Link Not Empty ${response}
[Teardown] Delete Subscription ${id}
......@@ -62,10 +65,11 @@ ${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 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 +79,11 @@ ${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 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
......@@ -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
......@@ -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/)
......
......@@ -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
......@@ -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}= 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
......
......@@ -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}
......
......@@ -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
......@@ -10,5 +10,8 @@
]
}
],
"endpoint":"http://my.csource.org:1026"
"endpoint":"http://my.csource.org:1026",
"@context":[
"unretrievableContext"
]
}
\ No newline at end of file
{
"id": "urn:ngsi-ld:Building:randomUUID",
"type": "Building",
"@context": [
"unretrievableContext"
]
}
\ No newline at end of file
{
"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
{
"https://ngsi-ld-test-suite/context#brandName": {
"type": "Property",
"value": "BMW"
}
}
\ No newline at end of file
......@@ -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
......@@ -12,5 +12,8 @@
"uri":"http://my.endpoint.org/notify",
"accept":"application/json"
}
}
},
"@context":[
"contextUnretrievable"
]
}
\ No newline at end of file
......@@ -40,5 +40,8 @@
"value":124,
"observedAt":"2020-08-01T14:07:00Z"
}
],
"@context":[
"unretrievableContext"
]
}
\ No newline at end of file
{
"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
[
{
"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
......@@ -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
......@@ -190,9 +193,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
......
......@@ -37,11 +37,13 @@ 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}
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}
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 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
......@@ -53,6 +55,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}
......