From 26139aa98b439046460a57c4908076f79a856678 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Wed, 17 Mar 2021 12:03:00 +0100 Subject: [PATCH 1/3] feat: add tcs for delete subscription --- .../DeleteSubscription/032_01.robot | 22 ++++++++++++ .../DeleteSubscription/032_02.robot | 15 ++++++++ .../DeleteSubscription/032_03.robot | 34 +++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_02.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_03.robot 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 00000000..3820ebe7 --- /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 00000000..5600e7a6 --- /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 00000000..2abec456 --- /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} -- GitLab From cbc0876ce8f919da23dca5da9267e2ae1587ce52 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Wed, 17 Mar 2021 12:06:09 +0100 Subject: [PATCH 2/3] fix: fix rebase --- resources/ApiUtils.resource | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 3a024e6e..5d98bf7a 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -681,7 +681,6 @@ Update Subscription ${response}= PATCH ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} body=${subscription_update_fragment} headers=${headers} Output request Output response - Set Test Variable ${response} [return] ${response} Delete Subscription -- GitLab From b1789120f8a9536d8efed61d5e784db34826d729 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Wed, 17 Mar 2021 13:39:30 +0100 Subject: [PATCH 3/3] fix: fix rebase --- resources/ApiUtils.resource | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 5d98bf7a..3a024e6e 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -681,6 +681,7 @@ Update Subscription ${response}= PATCH ${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} body=${subscription_update_fragment} headers=${headers} Output request Output response + Set Test Variable ${response} [return] ${response} Delete Subscription -- GitLab