Loading TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot +3 −3 Original line number Diff line number Diff line Loading @@ -26,8 +26,8 @@ Create Entity Scenarios ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} Check Response Status Code Set To 201 Check Response Headers Containing URI set to ${request['path']} ${entity_id} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} Check Response Status Code 201 ${response['status']} Check Response Headers Containing URI set to ${request['path']} ${entity_id} ${response} [Teardown] Delete Entity by Id ${entity_id} No newline at end of file TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot +6 −5 Original line number Diff line number Diff line Loading @@ -16,13 +16,14 @@ Create one valid entity and one invalid entity [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} Check Response Status Code Set To 201 ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} Check Response Status Code 201 ${response['status']} #creating entity with the same id Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} Check Response Status Code Set To 409 Check Response Body Details Containing Information Error ${expected_error_message} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} Check Response Status Code 409 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_ALREADY_EXISTS} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entity by Id ${entity_id} TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/004.robot +4 −11 Original line number Diff line number Diff line Loading @@ -4,24 +4,17 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource #Suite Setup Setup Initial Entity *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Delete an entity 004_Delete an entity [Documentation] Check that you can delete an entity by id [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity Selecting Content Type building-simple-attributes-sample.jsonld ${entity_id} application/ld+json ${request} ${response}= Create Entity Selecting Content Type building-simple-attributes-sample.jsonld ${entity_id} application/ld+json Check Response Status Code 201 ${response['status']} ${response}= Delete Entity by Id Returning Response ${entity_id} Should Be Equal 204 ${response['status']} #*** Keywords *** #Setup Initial Entity # ${entity_id}= Generate Random Entity Id ${building_id_prefix} # Create Entity building-simple-attributes-sample.jsonld ${entity_id} # Set Suite Variable ${entity_id} Check Response Status Code 204 ${response['status']} TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/005.robot 0 → 100644 +28 −0 Original line number Diff line number Diff line *** Settings *** Documentation Check that you cannot delete an entity with invalid/missing id Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Test Template Delete Entity Scenarios *** Variable *** ${entity_id_empty}= ${entity_id_not_valid}= thisisaninvaliduri *** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE 005_01_Delete an entity if the Entity Id is not present ${entity_id_empty} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} 005_02_Delete an entity if the Entity Id is not a valid URI ${entity_id_not_valid} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Delete Entity Scenarios [Arguments] ${entity_id} ${expected_status_code} ${problem_type} [Documentation] Check that you cannot delete an entity with invalid/missing id [Tags] mandatory failing ${response}= Delete Entity by Id Returning Response ${entity_id} Check Response Status Code ${expected_status_code} ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} No newline at end of file TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/006.robot 0 → 100644 +21 −0 Original line number Diff line number Diff line *** Settings *** Documentation Check that you cannot delete an entity if the entity id is not known to the system Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${expected_status_code}= 404 *** Test Case *** 006_Delete an entity with an id not known to the system [Documentation] Check that you cannot delete an entity if the entity id is not known to the system [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${response}= Delete Entity by Id Returning Response ${entity_id} Check Response Status Code ${expected_status_code} ${response['status']} 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} No newline at end of file Loading
TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001.robot +3 −3 Original line number Diff line number Diff line Loading @@ -26,8 +26,8 @@ Create Entity Scenarios ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} Check Response Status Code Set To 201 Check Response Headers Containing URI set to ${request['path']} ${entity_id} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} Check Response Status Code 201 ${response['status']} Check Response Headers Containing URI set to ${request['path']} ${entity_id} ${response} [Teardown] Delete Entity by Id ${entity_id} No newline at end of file
TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/003.robot +6 −5 Original line number Diff line number Diff line Loading @@ -16,13 +16,14 @@ Create one valid entity and one invalid entity [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} Check Response Status Code Set To 201 ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} Check Response Status Code 201 ${response['status']} #creating entity with the same id Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} Check Response Status Code Set To 409 Check Response Body Details Containing Information Error ${expected_error_message} ${request} ${response}= Create Entity Selecting Content Type ${filename} ${entity_id} ${content_type} Check Response Status Code 409 ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_ALREADY_EXISTS} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} [Teardown] Delete Entity by Id ${entity_id}
TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/004.robot +4 −11 Original line number Diff line number Diff line Loading @@ -4,24 +4,17 @@ Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource #Suite Setup Setup Initial Entity *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Delete an entity 004_Delete an entity [Documentation] Check that you can delete an entity by id [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity Selecting Content Type building-simple-attributes-sample.jsonld ${entity_id} application/ld+json ${request} ${response}= Create Entity Selecting Content Type building-simple-attributes-sample.jsonld ${entity_id} application/ld+json Check Response Status Code 201 ${response['status']} ${response}= Delete Entity by Id Returning Response ${entity_id} Should Be Equal 204 ${response['status']} #*** Keywords *** #Setup Initial Entity # ${entity_id}= Generate Random Entity Id ${building_id_prefix} # Create Entity building-simple-attributes-sample.jsonld ${entity_id} # Set Suite Variable ${entity_id} Check Response Status Code 204 ${response['status']}
TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/005.robot 0 → 100644 +28 −0 Original line number Diff line number Diff line *** Settings *** Documentation Check that you cannot delete an entity with invalid/missing id Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Test Template Delete Entity Scenarios *** Variable *** ${entity_id_empty}= ${entity_id_not_valid}= thisisaninvaliduri *** Test Cases *** ENTITY_ID EXPECTED_STATUS_CODE PROBLEM_TYPE 005_01_Delete an entity if the Entity Id is not present ${entity_id_empty} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} 005_02_Delete an entity if the Entity Id is not a valid URI ${entity_id_not_valid} 400 ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Delete Entity Scenarios [Arguments] ${entity_id} ${expected_status_code} ${problem_type} [Documentation] Check that you cannot delete an entity with invalid/missing id [Tags] mandatory failing ${response}= Delete Entity by Id Returning Response ${entity_id} Check Response Status Code ${expected_status_code} ${response['status']} Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} Check Response Body Containing ProblemDetails Element Containing Title Element ${response} No newline at end of file
TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/006.robot 0 → 100644 +21 −0 Original line number Diff line number Diff line *** Settings *** Documentation Check that you cannot delete an entity if the entity id is not known to the system Resource ${EXECDIR}/resources/ApiUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource *** Variable *** ${building_id_prefix}= urn:ngsi-ld:Building: ${expected_status_code}= 404 *** Test Case *** 006_Delete an entity with an id not known to the system [Documentation] Check that you cannot delete an entity if the entity id is not known to the system [Tags] mandatory ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${response}= Delete Entity by Id Returning Response ${entity_id} Check Response Status Code ${expected_status_code} ${response['status']} 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} No newline at end of file