diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot new file mode 100644 index 0000000000000000000000000000000000000000..3820ebe79260c51b4db7ec93f9900f5548208b65 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot @@ -0,0 +1,22 @@ +*** Settings *** +Documentation Check that you cannot delete a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Delete Subscription With Non present Or Invalid Id + +*** Test Cases *** id +NotPresentId ${EMPTY} +InvalidId InvalidUri + +*** Keywords *** +Delete Subscription With Non present Or Invalid Id + [Arguments] ${id} + [Documentation] Check that you cannot delete a subscription: If the subscription Id is not present or it is not a valid URI, then an error of type BadRequestData shall be raised + [Tags] mandatory + + Delete Subscription ${id} + + Check Response Status Code Set To 400 + 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/Subscription/DeleteSubscription/032_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot new file mode 100644 index 0000000000000000000000000000000000000000..5600e7a69d66492626be30464230713c3f999e7a --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot @@ -0,0 +1,15 @@ +*** Settings *** +Documentation Check that you cannot delete a subscription: If the subscription id provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +*** Test Case *** +Delete Unknown Subscription + [Documentation] Check that you cannot delete a subscription: If the subscription id provided does not correspond to any existing subscription in the system then an error of type ResourceNotFound shall be raised + [Tags] mandatory + + Delete Subscription unknownSubscription + + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot new file mode 100644 index 0000000000000000000000000000000000000000..2abec456bb351376e50599cfd12ebb47880c3242 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot @@ -0,0 +1,34 @@ +*** Settings *** +Documentation Check that you can delete a subscription +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Subscriptions +Suite Teardown Delete Initial Subscriptions + +*** Variable *** +${subscription_id_prefix}= urn:ngsi-ld:Subscription: +${subscription_payload_file_path}= subscriptions/subscription-sample.jsonld + +*** Test Case *** +Delete Subscription + [Documentation] Check that you can delete a subscription + [Tags] mandatory + + Delete Subscription ${subscription_id} + Check Response Status Code Set To 204 + + Retrieve Subscription ${subscription_id} + Check SUT Not Containing Resource + +*** Keywords *** +Setup Initial Subscriptions + ${subscription_id}= Generate Random Entity Id ${subscription_id_prefix} + + Create Subscription ${subscription_id} ${subscription_payload_file_path} ${CONTENT_TYPE_LD_JSON} + + Set Suite Variable ${subscription_id} + +Delete Initial Subscriptions + Delete Subscription ${subscription_id}