diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot index 267d0f1841ff02bae79ed61ebc99baf297189ee5..13067279be170c677086cc4b2aa7277516858ae0 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_02.robot @@ -1,21 +1,19 @@ *** Settings *** -Documentation Check that you cannot get an entity with invalid/missing id +Documentation Check that you cannot get an entity with invalid id Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Template Get Entity With Invalid/Missing Id +Test Template Get Entity With Invalid Id *** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE -018_02_01 Get an entity if the Entity Id is not present - ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} -018_02_02 Get an entity if the Entity Id is not a valid URI +018_02_01 Get an entity if the Entity Id is not a valid URI thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** -Get Entity With Invalid/Missing Id +Get Entity With Invalid Id [Documentation] Check that you cannot get an entity with invalid/missing id [Tags] e-retrieve 5_7_1 [Arguments] ${entity_id} ${expected_status_code} ${problem_type} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot index 646f06953798f256d0d2d7e7f83ec937e87e0116..7822ceae3003f0f9f9cde1f1b4397405ad38001a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_02.robot @@ -11,7 +11,7 @@ Test Template Delete Entity Scenarios *** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE 002_02_01 Delete an entity if the Entity Id is not present [Tags] e-delete 5_6_6 - ${EMPTY} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} + ${EMPTY} 405 ${EMPTY} 002_02_02 Delete an entity if the Entity Id is not a valid URI [Tags] e-delete 5_6_6 thisisaninvaliduri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} @@ -23,7 +23,9 @@ Delete Entity Scenarios [Arguments] ${entity_id} ${expected_status_code} ${problem_type} ${response}= Delete Entity by Id ${entity_id} Check Response Status Code ${expected_status_code} ${response.status_code} - Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} - ... ${problem_type} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + IF "${problem_type}"!="${EMPTY}" + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response.json()} + ... ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + END diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot index f125849896778256b52b5b7244d521edd46a2be0..f9099c24a5a638d964f05116dd53b5152ea10a43 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_02.robot @@ -12,24 +12,23 @@ Test Template Delete Attributes *** Variables *** ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${status_code}= 400 ${filename}= vehicle-two-datasetid-attributes-sample.jsonld -*** Test Cases *** ENTITY_ID ATTRIBUTE_ID +*** Test Cases *** ENTITY_ID ATTRIBUTE_ID EXPECTED_STATUS_CODE 013_02_01 Delete an attribute if the Entity Id is not present - ${EMPTY} speed + ${EMPTY} speed 400 013_02_02 Delete an attribute if the Entity Id is not a valid URI - thisIsAnInvalidURI speed + thisIsAnInvalidURI speed 400 013_02_03 Delete an attribute if the Attribute Name is not present - ${valid_entity_id} ${EMPTY} + ${valid_entity_id} ${EMPTY} 405 *** Keywords *** Delete Attributes [Documentation] Check that you cannot delete an attribute from an entity with invalid/missing ids [Tags] ea-delete 5_6_5 - [Arguments] ${entity_id} ${attribute_id} + [Arguments] ${entity_id} ${attribute_id} ${expected_status_code} ${create_response}= Create Entity Selecting Content Type ... ${filename} ... ${valid_entity_id} @@ -40,7 +39,7 @@ Delete Attributes ... attributeId=${attribute_id} ... datasetId=${EMPTY} ... deleteAll=false - Check Response Status Code ${status_code} ${response.status_code} + Check Response Status Code ${expected_status_code} ${response.status_code} Setup Initial Entities ${valid_entity_id}= Generate Random Entity Id ${vehicle_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot index 36f7564532c55cb2f5611c7585d9a2fdd56de28f..df07ccc9496dfa9073245b2a236511859750fc5a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_02.robot @@ -21,11 +21,9 @@ ${status_code}= 400 ${EMPTY} speed vehicle-speed-equal-datasetid-fragment.jsonld 012_02_02 Make a partial attribute update if the Entity Id is not a valid URI thisisaninvaliduri speed vehicle-speed-equal-datasetid-fragment.jsonld -012_02_03 Make a partial attribute update if the Attribute Id is not present - ${valid_entity_id} ${EMPTY} vehicle-speed-equal-datasetid-fragment.jsonld -012_02_04 Make a partial attribute update if the Attribute type does not match +012_02_03 Make a partial attribute update if the Attribute type does not match ${valid_entity_id} speed vehicle-speed-equal-datasetid-different-type-fragment.jsonld -012_02_05 Make a partial attribute update if the entity fragment is empty +012_02_04 Make a partial attribute update if the entity fragment is empty ${valid_entity_id} speed empty-fragment.json diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot index 02ebd1cd4162cdb5ff7aa34d594db89c8a6f09ed..0a0125b5c12b18b4d6d054c0213ce90cc60c1f75 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_03.robot @@ -25,7 +25,7 @@ ${default_attr_id}= speed 012_03_03 Partial update when no instance with the datasetId specified ${valid_entity_id} ${default_attr_id} vehicle-speed-unknown-datasetid-fragment.jsonld 012_03_04 Partial update when the Attribute Name does not exist in the entity - ${valid_entity_id} speed2 vehicle-speed-no-datasetid-fragment.jsonld + ${valid_entity_id} isParked2 vehicle-isparked-fragment.jsonld *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot index edd9c51ec9337bbea8aecd08a7f716f32ea3fd79..8e3a2cd61c2043b5949f3080130f447b7269ed60 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntity/DeleteTemporalRepresentationOfEntity/009_02.robot @@ -12,21 +12,23 @@ Test Template Delete Temporal Entity ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -*** Test Cases *** STATUS_CODE ID PROBLEM_TYPE +*** Test Cases *** ID EXPECTED_STATUS_CODE PROBLEM_TYPE 009_02_01 Delete a temporal representation of an entity with an empty entity id - 400 ${EMPTY} ${ERROR_TYPE_BAD_REQUEST_DATA} + ${EMPTY} 405 ${EMPTY} 009_02_02 Delete a temporal representation of an entity with an invalid entity id - 400 invalidId ${ERROR_TYPE_BAD_REQUEST_DATA} + invalidId 400 ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Delete Temporal Entity [Documentation] Check that an error is raised if you delete a temporal entity with an empty/invalid EntityId [Tags] te-delete 5_6_16 - [Arguments] ${status_code} ${id} ${problem_type} + [Arguments] ${id} ${expected_status_code} ${problem_type} ${response}= Delete Temporal Representation Of Entity With Returning Response ${id} - Check Response Status Code ${status_code} ${response.status_code} - Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} - ... ${problem_type} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + Check Response Status Code ${expected_status_code} ${response.status_code} + IF "${problem_type}"!="${EMPTY}" + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response.json()} + ... ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + END diff --git a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot index e81cb8c167e7f9ae806e5c9671f3ad22f7e9ba45..26cabf40245e9b406d0a0e869678af69c02cfb16 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/TemporalEntityAttributes/PartialUpdateAttributeInstance/016_02.robot @@ -15,29 +15,28 @@ Test Template Modify Attribute Instance Temporal Entity ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: ${filename}= vehicle-temporal-representation-sample.jsonld ${fragment_filename}= vehicle-temporal-modify-attribute-instance-fragment.jsonld -${status_code}= 400 -*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID +*** Test Cases *** TEMPORAL_ENTITY_ID ATTRIBUTE_ID INSTANCE_ID EXPECTED_STATUS_CODE 016_02_01 Modify attribute instance in temporal representation of an entity if the entity id is not valid - invalidId speed ${valid_instanceId} + invalidId speed ${valid_instanceId} 400 016_02_02 Modify attribute instance in temporal representation of an entity if the entity id is not present - ${EMPTY} speed ${valid_instanceId} + ${EMPTY} speed ${valid_instanceId} 400 016_02_03 Modify attribute instance in temporal representation of an entity if the instance id is not valid - ${temporal_entity_representation_id} speed invalidId + ${temporal_entity_representation_id} speed invalidId 400 016_02_04 Modify attribute instance in temporal representation of an entity if the instance id is not present - ${temporal_entity_representation_id} speed ${EMPTY} + ${temporal_entity_representation_id} speed ${EMPTY} 405 016_02_05 Modify attribute instance in temporal representation of an entity if the attribute name is not a valid name - ${temporal_entity_representation_id} invalid(Id ${valid_instanceId} + ${temporal_entity_representation_id} invalid(Id ${valid_instanceId} 400 016_02_06 Modify attribute instance in temporal representation of an entity if the attribute name is not present - ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} + ${temporal_entity_representation_id} ${EMPTY} ${valid_instanceId} 405 *** Keywords *** Modify Attribute Instance Temporal Entity [Documentation] Check that you cannot partially modify attribute instance in temporal representation of an entity if the EntityId/AttributeId/InstanceId is not right [Tags] tea-partial-update 5_6_14 - [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} + [Arguments] ${temporal_entity_id} ${attributeId} ${instanceId} ${expected_status_code} ${response}= Modify Attribute Instance From Temporal Entity ... ${temporal_entity_id} ... ${attributeId} @@ -45,7 +44,7 @@ Modify Attribute Instance Temporal Entity ... ${fragment_filename} ... ${CONTENT_TYPE_JSON} ... ${ngsild_test_suite_context} - Check Response Status Code ${status_code} ${response.status_code} + Check Response Status Code ${expected_status_code} ${response.status_code} Create Id ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicle_id_prefix} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot index 092224556b7960ec2520b466506c37f729c10bba..d91dc8e1bdcf2efcfe092bbaa8c832aa68c21c61 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/DeleteSubscription/032_01.robot @@ -1,5 +1,5 @@ *** 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 +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 shall be raised Resource ${EXECDIR}/resources/ApiUtils/ContextInformationSubscription.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -7,22 +7,24 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Delete Subscription With Non present Or Invalid Id -*** Test Cases *** id +*** Test Cases *** ID EXPECTED_STATUS_CODE PROBLEM_TYPE 032_01_01 NotPresentId [Tags] sub-delete 5_8_5 - ${EMPTY} + ${EMPTY} 405 ${EMPTY} 032_01_02 InvalidId [Tags] sub-delete 5_8_5 - InvalidUri + InvalidUri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Delete Subscription With Non present Or Invalid 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 - [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 shall be raised + [Arguments] ${id} ${expected_status_code} ${problem_type} ${response}= Delete Subscription ${id} - Check Response Status Code 400 ${response.status_code} - Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} - ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + Check Response Status Code ${expected_status_code} ${response.status_code} + IF "${problem_type}"!="${EMPTY}" + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response.json()} + ... ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + END diff --git a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot index 931c63da34185a8bb2be143d533e716a8d162bfd..13dab30b609843c4d8ba26aabb2e419dd7de1a02 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/UpdateSubscription/029_01.robot @@ -12,22 +12,24 @@ Test Template Update Subscription With Non present Or Invalid Id ${subscription_update_fragment_file_path}= subscriptions/fragments/subscription-update-sample.json -*** Test Cases *** ID +*** Test Cases *** ID EXPECTED_STATUS_CODE PROBLEM_TYPE 029_01_01 NotPresentId [Tags] sub-update 5_8_2 - ${EMPTY} + ${EMPTY} 405 ${EMPTY} 029_01_02 InvalidId [Tags] sub-update 5_8_2 - InvalidUri + InvalidUri 400 ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Update Subscription With Non present Or Invalid Id [Documentation] Check that you cannot update 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 - [Arguments] ${id} + [Arguments] ${id} ${expected_status_code} ${problem_type} ${response}= Update Subscription ${id} ${subscription_update_fragment_file_path} ${CONTENT_TYPE_JSON} - Check Response Status Code 400 ${response.status_code} - Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} - ... ${ERROR_TYPE_BAD_REQUEST_DATA} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + Check Response Status Code ${expected_status_code} ${response.status_code} + IF "${problem_type}"!="${EMPTY}" + Check Response Body Containing ProblemDetails Element Containing Type Element set to + ... ${response.json()} + ... ${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + END