Commits (5)
......@@ -10,17 +10,17 @@ ${filename}= vehicle-speed-two-datasetid-sample.jsonld
*** Test Cases ***
010_01_01_Append entity attributes
Append Attributes Without Params 204 vehicle-new-attribute-fragment.jsonld
Append Attributes Without Params 204 vehicle-new-attribute-fragment.jsonld vehicle-speed-appended-expectation.jsonld
010_01_02_Append entity attributes
Append Attributes With Params 207 vehicle-attribute-to-add-fragment.jsonld add-attribute-expectation.jsonld
Append Attributes With Params 207 vehicle-attribute-to-add-fragment.jsonld add-attribute-expectation.jsonld vehicle-speed-appended-expectation.jsonld
010_01_03_Append entity attributes
Append Attributes Without Params 204 vehicle-speed-different-datasetid-fragment.jsonld
Append Attributes Without Params 204 vehicle-speed-different-datasetid-fragment.jsonld vehicle-speed-different-datasetid-expectation.jsonld
010_01_04_Append entity attributes
Append Attributes With Params 204 vehicle-speed-different-datasetid-fragment.jsonld ${EMPTY}
Append Attributes With Params 204 vehicle-speed-different-datasetid-fragment.jsonld ${EMPTY} vehicle-speed-different-datasetid-expectation.jsonld
*** Keywords ***
Append Attributes Without Params
[Arguments] ${status_code} ${fragment_filename}
[Arguments] ${status_code} ${fragment_filename} ${expectation_filename}
[Documentation] Check that you can append entity attributes
[Tags] /entities/{entityId}/attrs/ 5_6_3
......@@ -31,10 +31,15 @@ Append Attributes Without Params
${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON}
Check Response Status Code ${status_code} ${response['status']}
${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id}
Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON}
${ignored_attributes}= Create List ${status_regex_expr}
Check Updated Resource Set To ${entity_expectation_payload}
[Teardown] Delete Entity by Id Returning Response ${entity_id}
Append Attributes With Params
[Arguments] ${status_code} ${fragment_filename} ${expectation_filename}
[Arguments] ${status_code} ${fragment_filename} ${expectation_response_body} ${expectation_filename}
[Documentation] Check that you can append entity attributes
[Tags] /entities/{entityId}/attrs/ 5_6_3
......@@ -44,6 +49,11 @@ Append Attributes With Params
${response}= Append Entity Attributes With Parameters ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} noOverwrite
Check Response Status Code ${status_code} ${response['status']}
Run Keyword If "${expectation_filename}"!="${EMPTY}" Check Response Body Content ${expectation_filename} ${response['body']}
Run Keyword If "${expectation_response_body}"!="${EMPTY}" Check Response Body Content ${expectation_response_body} ${response['body']}
${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id}
Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON}
${ignored_attributes}= Create List ${status_regex_expr} @context
Check Updated Resource Set To ${entity_expectation_payload}
[Teardown] Delete Entity by Id Returning Response ${entity_id}
\ No newline at end of file
......@@ -10,15 +10,15 @@ Test Template Update Attributes
${vehicle_id_prefix}= urn:ngsi-ld:Vehicle:
${filename}= vehicle-two-datasetid-attributes-sample.jsonld
*** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_FILENAME
011_01_01_Check that you can update existing attributes with no datasetId 204 vehicle-speed-two-datasetid-01-fragment.jsonld ${EMPTY}
011_01_02_Check that you can update existing attributes with the datasetId 204 vehicle-speed-two-datasetid-02-fragment.jsonld ${EMPTY}
011_01_03_Check that you can update only some attributes while others failed 207 vehicle-speed-two-datasetid-03-fragment.jsonld vehicle-speed-datasetid-expectation.jsonld
011_01_04_Check that you cannot change the type of the attribute 204 vehicle-speed-two-datasetid-04-fragment.jsonld ${EMPTY}
*** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_RESPONSE_FILENAME EXPECTATION_FILENAME
011_01_01_Check that you can update existing attributes with no datasetId 204 fragments/vehicle-speed-two-datasetid-01-fragment.jsonld ${EMPTY} expectations/vehicle-update-attributes-expectation.jsonld
011_01_02_Check that you can update existing attributes with the datasetId 204 vehicle-speed-two-datasetid-02-fragment.jsonld ${EMPTY} expectations/vehicle-update-datasetid-attributes-expectation.jsonld
011_01_03_Check that you can update only some attributes while others failed 207 vehicle-speed-two-datasetid-03-fragment.jsonld vehicle-speed-datasetid-expectation.jsonld expectations/vehicle-multi-attributes-expectation.jsonld
011_01_04_Check that you cannot change the type of the attribute 204 vehicle-speed-two-datasetid-04-fragment.jsonld ${EMPTY} vehicle-two-datasetid-attributes-sample.jsonld
*** Keywords ***
Update Attributes
[Arguments] ${status_code} ${fragment_filename} ${expectation_filename}
[Arguments] ${status_code} ${fragment_filename} ${expectation_response_filename} ${expectation_filename}
[Documentation] Check that you can update entity attributes
[Tags] /entities/{entityId}/attrs/ 5_6_2
......@@ -28,6 +28,11 @@ Update Attributes
${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON}
Check Response Status Code ${status_code} ${response['status']}
Run Keyword If "${expectation_filename}"!="${EMPTY}" Check Response Body Content ${expectation_filename} ${response['body']}
Run Keyword If "${expectation_response_filename}"!="${EMPTY}" Check Response Body Content ${expectation_response_filename} ${response['body']}
${entity_expectation_payload}= Load Test Sample entities/${expectation_filename} ${entity_id}
Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON}
${ignored_attributes}= Create List ${status_regex_expr} @context
Check Updated Resource Set To ${entity_expectation_payload}
[Teardown] Delete Entity by Id Returning Response ${entity_id}
\ No newline at end of file
......@@ -11,13 +11,13 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle:
${filename}= vehicle-speed-two-datasetid-sample.jsonld
${status_code}= 204
*** Test Cases *** FRAGMENT_FILENAME ATTRIBUTE_ID
012_01_01_Check that you can partially update an attribute vehicle-isparked-fragment.jsonld isParked
012_01_02_Check that you can partially update an attribute by specifying the datasetId vehicle-speed-equal-datasetid-fragment.jsonld speed
*** Test Cases *** FRAGMENT_FILENAME ATTRIBUTE_ID EXPECTATION_FILENAME
012_01_01_Check that you can partially update an attribute vehicle-isparked-fragment.jsonld isParked vehicle-isparked-update-expectation.jsonld
012_01_02_Check that you can partially update an attribute by specifying the datasetId vehicle-speed-equal-datasetid-fragment.jsonld speed vehicle-update-speed-expectation.jsonld
*** Keywords ***
Update Attributes
[Arguments] ${fragment_filename} ${attribute_id}
[Arguments] ${fragment_filename} ${attribute_id} ${expectation_filename}
[Documentation] Check that you can perform a partial update on an entity attribute
[Tags] /entities/{entityId}/attrs/{attrId} 5_6_4
......@@ -28,4 +28,10 @@ Update Attributes
${response}= Partial Update Entity Attributes ${entity_id} ${attribute_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON}
Check Response Status Code ${status_code} ${response['status']}
${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id}
Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON}
${ignored_attributes}= Create List ${status_regex_expr} @context
Check Updated Resource Set To ${entity_expectation_payload}
[Teardown] Delete Entity by Id Returning Response ${entity_id}
\ No newline at end of file
......@@ -12,14 +12,14 @@ ${status_code}= 204
${filename}= vehicle-two-datasetid-attributes-sample.jsonld
${attribute_id}= speed
*** Test Cases *** DATASETID DELETEALL
013_01_01_delete an attribute with the id ${EMPTY} false
013_01_02_delete an attribute with the datasetId urn:ngsi-ld:Property:gpsBxyz123-speed false
013_01_03_delete all target attribute instances with a datasetId urn:ngsi-ld:Property:gpsBxyz123-speed true
*** Test Cases *** DATASETID DELETEALL EXPECTATION_FILENAME
013_01_01_delete an attribute with the id ${EMPTY} false vehicle-delete-default-speed-expectation.jsonld
013_01_02_delete an attribute with the datasetId urn:ngsi-ld:Property:gpsBxyz123-speed false vehicle-delete-datasetid-speed-expectation.jsonld
013_01_03_delete all target attribute instances with a datasetId urn:ngsi-ld:Property:gpsBxyz123-speed true vehicle-delete-deleteall-speed-expectation.jsonld
*** Keywords ***
Delete Attributes
[Arguments] ${datasetId} ${deleteAll}
[Arguments] ${datasetId} ${deleteAll} ${expectation_filename}
[Documentation] Check that you can delete an attribute from an entity
[Tags] /entities/{entityId}/attrs/{attrId} 5_6_5
......@@ -30,4 +30,9 @@ Delete Attributes
${response}= Delete Entity Attributes ${entity_id} ${attribute_id} ${datasetId} ${deleteAll}
Check Response Status Code ${status_code} ${response['status']}
${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id}
Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON}
${ignored_attributes}= Create List ${status_regex_expr} @context
Check Updated Resource Set To ${entity_expectation_payload}
[Teardown] Delete Entity by Id Returning Response ${entity_id}
\ No newline at end of file
......@@ -23,4 +23,8 @@ Create Temporal Entity
${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${filename} ${content_type}
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}
[Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id}
\ No newline at end of file
......@@ -8,6 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource
${vehicle_id_prefix}= urn:ngsi-ld:Vehicle:
${filename}= vehicle-temporal-representation-sample.jsonld
${update_filename}= vehicle-temporal-representation-update-sample.jsonld
${expectation_filename}= vehicle-temporal-representation-update-expectation.jsonld
*** Test Cases ***
008_01_Update a temporal representation of an entity with simple temporal properties
......@@ -21,5 +22,9 @@ ${update_filename}= vehicle-temporal-representation-update-sample.jsonld
${response}= Create Or Update Temporal Representation Of Entity Selecting Content Type ${temporal_entity_representation_id} ${update_filename} ${CONTENT_TYPE_LD_JSON}
Check Response Status Code 204 ${response['status']}
${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id}
Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON}
${ignored_attributes}= Create List ${status_regex_expr} instanceId @context
Check Updated Resource Set To ${temporal_entity_expectation_payload}
[Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id}
\ No newline at end of file
......@@ -18,4 +18,7 @@ Delete a temporal representation of an entity with simple temporal properties
Check Response Status Code 201 ${response['status']}
${response}= Delete Temporal Representation Of Entity With Returning Response ${temporal_entity_representation_id}
Check Response Status Code 204 ${response['status']}
\ No newline at end of file
Check Response Status Code 204 ${response['status']}
Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context}
Check SUT Not Containing Resource
\ No newline at end of file
......@@ -8,6 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource
${vehicle_id_prefix}= urn:ngsi-ld:Vehicle:
${filename}= vehicle-temporal-representation-sample.jsonld
${fragment_filename}= vehicle-temporal-representation-fragment.jsonld
${expectation_filename}= vehicle-temporal-representation-added-attribute-expectation.jsonld
*** Test Cases ***
014_01_02_Add an attribute to a temporal entity with simple temporal properties
......@@ -21,4 +22,9 @@ ${fragment_filename}= vehicle-temporal-representation-fragment.jsonld
${response}= Append Attribute To Temporal Entity ${temporal_entity_representation_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON}
Check Response Status Code 204 ${response['status']}
${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id}
Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON}
${ignored_attributes}= Create List ${status_regex_expr} instanceId @context
Check Updated Resource Set To ${temporal_entity_expectation_payload}
[Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id}
\ No newline at end of file
......@@ -12,14 +12,14 @@ ${filename}= vehicle-temporal-representation-sample.jsonld
${status_code}= 204
${attribute_id}= fuelLevel
*** Test Cases *** DELETEALL DATASETID
015_01_01_Delete an attribute from a temporal representation of an entity without deleteALL/datasetID false ${EMPTY}
015_01_02_Delete an attribute from a temporal representation of an entity with datasetId false urn:ngsi-ld:Vehicle:12345-fuel
015_01_03_Delete an attribute from a temporal representation of an entity with deleteALL/datasetID true urn:ngsi-ld:Vehicle:12345-fuel
*** Test Cases *** DELETEALL DATASETID EXPECTATION_FILE
015_01_01_Delete an attribute from a temporal representation of an entity without deleteALL/datasetID false ${EMPTY} vehicle-temporal-representation-delete-fuelLevel-expectation.jsonld
015_01_02_Delete an attribute from a temporal representation of an entity with datasetId false urn:ngsi-ld:Vehicle:12345-fuel vehicle-temporal-representation-delete-fuelLevel-datasetid-expectation.jsonld
015_01_03_Delete an attribute from a temporal representation of an entity with deleteALL/datasetID true urn:ngsi-ld:Vehicle:12345-fuel vehicle-temporal-representation-deleteall-fuelLevel-expectation.jsonld
*** Keywords ***
Delete Attribute From A Temporal Entity
[Arguments] ${deleteAll} ${datasetId}
[Arguments] ${deleteAll} ${datasetId} ${expectation_filename}
[Documentation] Check that you can delete an attribute of a temporal representation of an entity with simple temporal properties
[Tags] mandatory
......@@ -30,4 +30,9 @@ Delete Attribute From A Temporal Entity
${response}= Delete Attribute From Temporal Entity ${temporal_entity_representation_id} ${attribute_id} ${CONTENT_TYPE_LD_JSON} ${datasetId} ${deleteAll}
Check Response Status Code ${status_code} ${response['status']}
${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id}
Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON}
${ignored_attributes}= Create List ${status_regex_expr} instanceId @context
Check Updated Resource Set To ${temporal_entity_expectation_payload}
[Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id}
\ No newline at end of file
......@@ -7,7 +7,8 @@ Resource ${EXECDIR}/resources/JsonUtils.resource
*** Variable ***
${vehicle_id_prefix}= urn:ngsi-ld:Vehicle:
${filename}= vehicle-temporal-representation-sample.jsonld
${fragment_filename}= vehicle-temporal-intanceid-update-fragment.jsonld
${fragment_filename}= vehicle-temporal-instanceid-update-fragment.jsonld
${expectation_filename}= vehicle-temporal-representation-update-expectation.jsonld
${attributeId}= speed
*** Test Cases ***
......@@ -37,4 +38,9 @@ ${attributeId}= speed
${modifiedAt_after_update_date}= Convert Date ${modifiedAt_after_update} epoch
Should Be True ${modifiedAt_before_update_date}<${modifiedAt_after_update_date}
${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id}
Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON}
${ignored_attributes}= Create List ${status_regex_expr} instanceId @context
Check Updated Resource Set To ${temporal_entity_expectation_payload}
[Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id}
\ No newline at end of file
......@@ -10,7 +10,7 @@ Test Template Partially Update Temporal Entity
*** Variable ***
${vehicle_id_prefix}= urn:ngsi-ld:Vehicle:
${filename}= vehicle-temporal-representation-sample.jsonld
${fragment_filename}= vehicle-temporal-intanceid-update-fragment.jsonld
${fragment_filename}= vehicle-temporal-instanceid-update-fragment.jsonld
${status_code}= 400
*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID
......
......@@ -10,7 +10,7 @@ Test Template Partially Update Temporal Entity
*** Variable ***
${vehicle_id_prefix}= urn:ngsi-ld:Vehicle:
${filename}= vehicle-temporal-representation-sample.jsonld
${fragment_filename}= vehicle-temporal-intanceid-update-fragment.jsonld
${fragment_filename}= vehicle-temporal-instanceid-update-fragment.jsonld
${status_code}= 404
*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID
......
......@@ -8,6 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource
${vehicle_id_prefix}= urn:ngsi-ld:Vehicle:
${filename}= vehicle-temporal-representation-sample.jsonld
${attributeId}= speed
${expectation_filename}= vehicle-temporal-representation-delete-speed-instanceid-sample.jsonld
*** Test Cases ***
017_01_Delete an attribute instance in temporal representation of an entity
......@@ -25,4 +26,9 @@ ${attributeId}= speed
${response}= Delete Attribute Instance From Temporal Entity ${temporal_entity_representation_id} ${attributeId} ${instanceId} ${CONTENT_TYPE_LD_JSON}
Check Response Status Code 204 ${response['status']}
${temporal_entity_expectation_payload}= Load Test Sample temporalEntities/expectations/${expectation_filename} ${temporal_entity_representation_id}
Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON}
${ignored_attributes}= Create List ${status_regex_expr} instanceId @context
Check Updated Resource Set To ${temporal_entity_expectation_payload}
[Teardown] Delete Temporal Representation Of Entity ${temporal_entity_representation_id}
\ No newline at end of file
......@@ -16,9 +16,13 @@ Create Context Source Registration With Specific Date Expiration Date
${registration_id}= Generate Random Entity Id ${registration_id_prefix}
${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path}
${updated_payload}= Update Value To Json ${payload} $..id ${registration_id}
${request} ${response}= Create Context Source Registration With Return ${updated_payload}
${registration_payload}= Update Value To Json ${payload} $..id ${registration_id}
${request} ${response}= Create Context Source Registration With Return ${registration_payload}
Check Response Status Code 201 ${response['status']}
Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response}
Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON}
${ignored_attributes}= Create List ${status_regex_expr}
Check Created Resource Set To ${registration_payload} ${ignored_attributes}
[Teardown] Delete Context Source Registration ${registration_id}
......@@ -16,9 +16,13 @@ Create Context Source Registration That Never Expires
${registration_id}= Generate Random Entity Id ${registration_id_prefix}
${payload}= Load Json From File ${EXECDIR}/data/${registration_payload_file_path}
${updated_payload}= Update Value To Json ${payload} $..id ${registration_id}
${request} ${response}= Create Context Source Registration With Return ${updated_payload}
${registration_payload}= Update Value To Json ${payload} $..id ${registration_id}
${request} ${response}= Create Context Source Registration With Return ${registration_payload}
Check Response Status Code 201 ${response['status']}
Check Response Headers Containing URI set to ${request['path']}/ ${registration_id} ${response}
Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON}
${ignored_attributes}= Create List ${status_regex_expr}
Check Created Resource Set To ${registration_payload} ${ignored_attributes}
[Teardown] Delete Context Source Registration ${registration_id}
......@@ -4,7 +4,6 @@ Resource ${EXECDIR}/resources/ApiUtils.resource
Resource ${EXECDIR}/resources/AssertionUtils.resource
Resource ${EXECDIR}/resources/JsonUtils.resource
*** Variable ***
${registration_id_prefix}= urn:ngsi-ld:Registration:
${registration_payload_file_path}= csourceRegistrations/context-source-registration-no-id-sample.jsonld
......@@ -18,5 +17,10 @@ Create Context Source Registration Without A Sprecified ID
${request} ${response}= Create Context Source Registration With Return ${payload}
Check Response Status Code 201 ${response['status']}
${registration_id}= Check Response Headers ID Not Empty ${response}
${registration_payload}= Update Value To Json ${payload} $..id ${registration_id}
Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON}
${ignored_attributes}= Create List ${status_regex_expr}
Check Created Resource Set To ${registration_payload} ${ignored_attributes}
[Teardown] Delete Context Source Registration ${registration_id}
\ No newline at end of file
......@@ -13,6 +13,7 @@ ${registration_payload_file_path}= context-source-registration-simple-sample.j
Delete a context source registration by id
[Documentation] Check that you can delete a context source registration by id
[Tags] /csourceRegistrations/{registrationId} 5_9_4
${registration_id}= Generate Random Entity Id ${registration_id_prefix}
${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${registration_payload_file_path}
${updated_payload}= Update Value To Json ${payload} $..id ${registration_id}
......@@ -21,3 +22,6 @@ Delete a context source registration by id
${response}= Delete Context Source Registration With Return ${registration_id}
Check Response Status Code 204 ${response['status']}
Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context}
Check SUT Not Containing Resource
\ No newline at end of file
......@@ -9,24 +9,30 @@ Test Template Update Context Source
*** Variable ***
${registration_id_prefix}= urn:ngsi-ld:Registration:
*** Test Case *** FILENAME UPDATE_FILENAME
034_01_01_Update a context source registration by id context-source-registration-simple-sample.jsonld context-source-registration-with-expiration-sample.jsonld
034_01_02_Update a context source registration to never expire context-source-registration-with-expiration-sample.jsonld context-source-registration-simple-sample.jsonld
*** Test Case *** FILENAME UPDATE_FILENAME
034_01_01_Update a context source registration by id context-source-registration-sample.jsonld context-source-registration-with-expiration-sample.jsonld
034_01_02_Update a context source registration to never expire context-source-registration-with-expiration-sample.jsonld context-source-registration-simple-sample.jsonld
*** Keywords ***
Update Context Source
[Arguments] ${filename} ${update_filename}
[Documentation] Check that you can update a context source registration by id
[Tags] /csourceRegistrations/{registrationId} 5_9_3
${registration_id}= Generate Random Entity Id ${registration_id_prefix}
${payload}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename}
${updated_payload}= Update Value To Json ${payload} $..id ${registration_id}
${request} ${response}= Create Context Source Registration With Return ${updated_payload}
${registration_payload}= Update Value To Json ${payload} $..id ${registration_id}
${request} ${response}= Create Context Source Registration With Return ${registration_payload}
Check Response Status Code 201 ${response['status']}
${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${update_filename}
${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id}
${response}= Update Context Source Registration With Return ${registration_id} ${fragment_with_id} ${CONTENT_TYPE_LD_JSON}
${registration_update_fragment}= Update Value To Json ${fragment} $..id ${registration_id}
${response}= Update Context Source Registration With Return ${registration_id} ${registration_update_fragment} ${CONTENT_TYPE_LD_JSON}
Check Response Status Code 204 ${response['status']}
Retrieve Context Source Registration ${registration_id} context=${ngsild_test_suite_context} accept=${CONTENT_TYPE_LD_JSON}
${ignored_attributes}= Create List ${status_regex_expr} @context
Check Updated Resource Set To ${registration_payload}
[Teardown] Delete Context Source Registration ${registration_id}
{
"id":"urn:ngsi-ld:ContextSourceRegistration:randomUUID",
"type":"ContextSourceRegistration",
"information":[
{
"entities":[
{
"type":"Building"
}
]
}
"id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID",
"type": "ContextSourceRegistration",
"information": [
{
"entities": [
{
"id": "urn:ngsi-ld:Vehicle:A456",
"type": "Vehicle"
}
],
"propertyNames": ["brandName","speed"],
"relationshipNames": ["isParked"]
},
{
"entities": [
{
"idPattern": ".*downtown$",
"type": "OffStreetParking"
},
{
"idPattern": ".*47$",
"type": "OffStreetParking"
}
],
"propertyNames": ["availableSpotNumber","totalSpotNumber"],
"relationshipNames": ["isNextToBuilding"]
}
],
"endpoint":"http://my.csource.org:1026",
"@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"
"endpoint": "http://my.csource.org:1026",
"location": {
"type": "Polygon",
"coordinates": [
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0],
[100.0, 1.0], [100.0, 0.0]] ]
},
"timestamp": {
"startAt": "2017-11-29T14:53:15Z"
},
"@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
......@@ -35,9 +35,9 @@
[100.0, 1.0], [100.0, 0.0]] ]
},
"timestamp": {
"startAt": " 2017-11-29T14:53:15Z"
"startAt": "2017-11-29T14:53:15Z"
},
"expiresAt": " 2025-11-29T14:53:15Z",
"expiresAt": "2025-11-29T14:53:15Z",
"@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"
]
......