Loading TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot +10 −13 Original line number Diff line number Diff line Loading @@ -18,10 +18,7 @@ ${registration_id_prefix}= urn:ngsi-ld:Registration: *** Test Cases *** FILENAME UPDATE_FILENAME 034_01_01 Update a context source registration by id [Tags] csr-update 5_9_3 context-source-registration-sample.jsonld context-source-registration-with-expiration-sample.jsonld 034_01_02 Update a context source registration to never expire [Tags] csr-update 5_9_3 context-source-registration-with-expiration-sample.jsonld context-source-registration-sample.jsonld context-source-registration-sample.jsonld context-source-registration-update-sample.json *** Keywords *** Loading @@ -29,18 +26,19 @@ Update A Context Source [Documentation] Check that you can update a context source registration by id [Arguments] ${filename} ${update_filename} Set Test Variable ${filename} ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${update_filename} ${registration_update_fragment}= Update Value To JSON ${fragment} $..id ${registration_id} ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/fragments/${update_filename} ${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} ... ${CONTENT_TYPE_JSON} Check Response Status Code 204 ${response.status_code} Check Retrieving Context Source Registration ... registration_id=${registration_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ... registration_payload=${registration_payload} ${response1}= Retrieve Context Source Registration ... context_source_registration_id=${registration_id} Check JSON Value In Response Body ... ['endpoint'] ... http://my.new.csource.org:1026 ... ${response1.json()} Delete Updated Context Source Registration Delete Context Source Registration ${registration_id} Loading @@ -48,7 +46,6 @@ Delete Updated Context Source Registration Initialize the Test Case ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Test Variable ${registration_id} # ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} ${payload}= Load JSON From File ... ${EXECDIR}/data/csourceRegistrations/context-source-registration-sample.jsonld ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} Loading TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_05.robot 0 → 100644 +53 −0 Original line number Diff line number Diff line *** Settings *** Documentation Check that you can update a context source registration by id Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Test Setup Initialize the Test Case Test Teardown Delete Updated Context Source Registration Test Template Update A Context Source *** Variables *** ${registration_id_prefix}= urn:ngsi-ld:Registration: *** Test Cases *** FILENAME UPDATE_FILENAME 034_05_01 Update a context source registration to never expire [Tags] csr-update 5_9_3 context-source-registration-with-expiration-sample.jsonld context-source-registration-null-expiresAt.json *** Keywords *** Update A Context Source [Documentation] Check that you can update a context source registration by id [Arguments] ${filename} ${update_filename} Set Test Variable ${filename} ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/fragments/${update_filename} ${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_JSON} Check Response Status Code 204 ${response.status_code} ${response1}= Retrieve Context Source Registration ... context_source_registration_id=${registration_id} Check JSON Value Not In Response Body ... $.expiresAt ... ${response1.json()} Delete Updated Context Source Registration Delete Context Source Registration ${registration_id} Initialize the Test Case ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Test Variable ${registration_id} ${payload}= Load JSON From File ... ${EXECDIR}/data/csourceRegistrations/context-source-registration-sample.jsonld ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} Set Test Variable ${registration_payload} ${response}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response.status_code} data/csourceRegistrations/fragments/context-source-registration-null-expiresAt.json 0 → 100644 +3 −0 Original line number Diff line number Diff line { "expiresAt": null } No newline at end of file resources/AssertionUtils.resource +4 −0 Original line number Diff line number Diff line Loading @@ -345,6 +345,10 @@ Check JSON Value In Response Body [Arguments] ${json_path_expr} ${value_to_check} ${response_body} Should Be Equal As Strings ${response_body${json_path_expr}} ${value_to_check} Check JSON Value Not In Response Body [Arguments] ${json_path_expr} ${response_body} Should Not Have Value In Json ${response_body} ${json_path_expr} Check NotificationParams [Arguments] ${filename} ${expected_additional_members} ${response_body} Loading Loading
TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_01.robot +10 −13 Original line number Diff line number Diff line Loading @@ -18,10 +18,7 @@ ${registration_id_prefix}= urn:ngsi-ld:Registration: *** Test Cases *** FILENAME UPDATE_FILENAME 034_01_01 Update a context source registration by id [Tags] csr-update 5_9_3 context-source-registration-sample.jsonld context-source-registration-with-expiration-sample.jsonld 034_01_02 Update a context source registration to never expire [Tags] csr-update 5_9_3 context-source-registration-with-expiration-sample.jsonld context-source-registration-sample.jsonld context-source-registration-sample.jsonld context-source-registration-update-sample.json *** Keywords *** Loading @@ -29,18 +26,19 @@ Update A Context Source [Documentation] Check that you can update a context source registration by id [Arguments] ${filename} ${update_filename} Set Test Variable ${filename} ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${update_filename} ${registration_update_fragment}= Update Value To JSON ${fragment} $..id ${registration_id} ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/fragments/${update_filename} ${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} ... ${CONTENT_TYPE_JSON} Check Response Status Code 204 ${response.status_code} Check Retrieving Context Source Registration ... registration_id=${registration_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ... registration_payload=${registration_payload} ${response1}= Retrieve Context Source Registration ... context_source_registration_id=${registration_id} Check JSON Value In Response Body ... ['endpoint'] ... http://my.new.csource.org:1026 ... ${response1.json()} Delete Updated Context Source Registration Delete Context Source Registration ${registration_id} Loading @@ -48,7 +46,6 @@ Delete Updated Context Source Registration Initialize the Test Case ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Test Variable ${registration_id} # ${payload}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/${filename} ${payload}= Load JSON From File ... ${EXECDIR}/data/csourceRegistrations/context-source-registration-sample.jsonld ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} Loading
TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/034_05.robot 0 → 100644 +53 −0 Original line number Diff line number Diff line *** Settings *** Documentation Check that you can update a context source registration by id Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Test Setup Initialize the Test Case Test Teardown Delete Updated Context Source Registration Test Template Update A Context Source *** Variables *** ${registration_id_prefix}= urn:ngsi-ld:Registration: *** Test Cases *** FILENAME UPDATE_FILENAME 034_05_01 Update a context source registration to never expire [Tags] csr-update 5_9_3 context-source-registration-with-expiration-sample.jsonld context-source-registration-null-expiresAt.json *** Keywords *** Update A Context Source [Documentation] Check that you can update a context source registration by id [Arguments] ${filename} ${update_filename} Set Test Variable ${filename} ${fragment}= Load JSON From File ${EXECDIR}/data/csourceRegistrations/fragments/${update_filename} ${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_JSON} Check Response Status Code 204 ${response.status_code} ${response1}= Retrieve Context Source Registration ... context_source_registration_id=${registration_id} Check JSON Value Not In Response Body ... $.expiresAt ... ${response1.json()} Delete Updated Context Source Registration Delete Context Source Registration ${registration_id} Initialize the Test Case ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Test Variable ${registration_id} ${payload}= Load JSON From File ... ${EXECDIR}/data/csourceRegistrations/context-source-registration-sample.jsonld ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} Set Test Variable ${registration_payload} ${response}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response.status_code}
data/csourceRegistrations/fragments/context-source-registration-null-expiresAt.json 0 → 100644 +3 −0 Original line number Diff line number Diff line { "expiresAt": null } No newline at end of file
resources/AssertionUtils.resource +4 −0 Original line number Diff line number Diff line Loading @@ -345,6 +345,10 @@ Check JSON Value In Response Body [Arguments] ${json_path_expr} ${value_to_check} ${response_body} Should Be Equal As Strings ${response_body${json_path_expr}} ${value_to_check} Check JSON Value Not In Response Body [Arguments] ${json_path_expr} ${response_body} Should Not Have Value In Json ${response_body} ${json_path_expr} Check NotificationParams [Arguments] ${filename} ${expected_additional_members} ${response_body} Loading