diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/007.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/007.robot new file mode 100644 index 0000000000000000000000000000000000000000..210db5b9b8d1ae147e8846f93f5cc988f83b284d --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/007.robot @@ -0,0 +1,23 @@ +*** Settings *** +Documentation Check that you can delete a context source registration by id +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}= registration-sample.jsonld + +*** Test Case *** +Delete a context source registration by id + [Documentation] Check that you can delete a context source registration by id + [Tags] mandatory + ${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} + ${request} ${response}= Create Context Source Registration ${updated_payload} + Check Response Status Code 201 ${response['status']} + + ${response}= Delete Context Source Registration ${registration_id} + Check Response Status Code 204 ${response['status']} diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/008.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/008.robot new file mode 100644 index 0000000000000000000000000000000000000000..b76f552fb789083a03832c3b71a5f8c747d9526a --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/008.robot @@ -0,0 +1,32 @@ +*** Settings *** +Documentation Check that you cannot delete a context source registration under some conditions +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Template Delete Context Source + +*** Variable *** +${registration_id_prefix}= urn:ngsi-ld:Registration: +${filename}= registration-sample.jsonld + +*** Test Case *** INVALID_REGISTRATION_ID +008_01_Delete a Context Source Registration if the Id is not present ${EMPTY} +008_02_Delete a Context Source Registration if the Id is not a valid URI invalidURI + +*** Keywords *** +Delete Context Source + [Arguments] ${invalid_registration_id} + [Documentation] Check that you cannot delete a context source registration under some conditions + [Tags] mandatory + ${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 ${updated_payload} + Check Response Status Code 201 ${response['status']} + + ${response}= Delete Context Source Registration ${invalid_registration_id} + Check Response Status Code 400 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + + [Teardown] Delete Context Source Registration ${registration_id} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/009.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/009.robot new file mode 100644 index 0000000000000000000000000000000000000000..33768c9dc74e758962ab553fa676e8611c006012 --- /dev/null +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/009.robot @@ -0,0 +1,20 @@ +*** Settings *** +Documentation Check that you cannot delete a context source registration by id if the id is not known to the system +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}= registration-sample.jsonld + +*** Test Case *** +Delete a context source registration by id + [Documentation] Check that you cannot delete a context source registration by id if the id is not known to the system + [Tags] mandatory + ${registration_id}= Generate Random Entity Id ${registration_id_prefix} + + ${response}= Delete Context Source Registration ${registration_id} + Check Response Status Code 404 ${response['status']} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} \ No newline at end of file diff --git a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot index 952d8c5a74c7115111780a6af18817c552b0cd98..61b079cfeab628904433c487b7ac41d07f852245 100644 --- a/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot +++ b/TP/NGSI-LD/ContextSource/Registration/UpdateContextSourceRegistration/006.robot @@ -16,7 +16,7 @@ ${filename}= registration-sample.jsonld ${fragment}= Load Json From File ${EXECDIR}/data/csourceRegistrations/${filename} ${fragment_with_id}= Update Value To Json ${fragment} $..id ${registration_id} ${response}= Update Context Source Registration ${registration_id} ${fragment_with_id} - Check Response Status Code 400 ${response['status']} + Check Response Status Code 404 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Context Source Registration ${registration_id}