Loading TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot +32 Changes for TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot: 32 added lines, 0 removed lines. Original line number Diff line number Diff line *** Settings *** Documentation Check that you cannot delete a batch of entities with an invalid request Variables ../../../../../../resources/variables.py Resource ../../../../../../resources/ApiUtils.resource Resource ../../../../../../resources/AssertionUtils.resource Library RequestsLibrary Library JSONLibrary Library OperatingSystem *** Variable *** ${batch_endpoint}= entityOperations/delete ${endpoint}= entities *** Test Case *** With invalid json document [Documentation] Check that you cannot delete a batch of entities with an invalid json document [Tags] critical Batch Request Entities From File batch/invalid-json-sample.jsonld Check Response Status Code Set To 400 Check Response Body Containing Problem Details Element Containing Detail Element ${response} With empty json document [Documentation] Check that you cannot delete a batch of entities with an empty json document [Tags] critical Batch Request Entities From File batch/empty-sample.jsonld Check Response Status Code Set To 400 Check Response Body Containing Problem Details Element Containing Detail Element ${response} TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot +38 Changes for TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot: 38 added lines, 0 removed lines. Original line number Diff line number Diff line *** Settings *** Documentation Check that you can delete a batch of entities Variables ../../../../../../resources/variables.py Resource ../../../../../../resources/ApiUtils.resource Resource ../../../../../../resources/AssertionUtils.resource Resource ../../../../../../resources/JsonUtils.resource Library REST ${url} Library JSONLibrary Library String Library Collections Suite Setup Setup Initial Entities *** Variable *** ${batch_endpoint}= entityOperations/delete ${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Delete a batch of entities [Documentation] Check that you can delete a batch of entities [Tags] critical @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} Check Response Status Code Set To 204 *** Keywords *** Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity building-simple-attributes-sample.jsonld ${first_entity_id} Create Entity building-simple-attributes-sample.jsonld ${second_entity_id} Set Suite Variable ${first_entity_id} Set Suite Variable ${second_entity_id} TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot +41 Changes for TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot: 41 added lines, 0 removed lines. Original line number Diff line number Diff line *** Settings *** Documentation Check that you can delete a batch of entities where some will succeed and others will fail Variables ../../../../../../resources/variables.py Resource ../../../../../../resources/ApiUtils.resource Resource ../../../../../../resources/AssertionUtils.resource Resource ../../../../../../resources/JsonUtils.resource Library REST ${url} Library JSONLibrary Library String Library Collections Suite Setup Setup Initial Entities *** Variable *** ${batch_endpoint}= entityOperations/delete ${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Delete a batch of non existing and existing entities [Documentation] Check that you can delete a batch of non existing and existing entities [Tags] critical ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} @{entities_ids_to_be_deleted}= Create List ${existing_entity_id} ${new_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} @{expected_successful_entities_ids}= Create List ${existing_entity_id} @{expected_failed_entities_ids}= Create List ${new_entity_id} &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} Check Response Status Code Set To 207 Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} *** Keywords *** Setup Initial Entities ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity building-simple-attributes-sample.jsonld ${existing_entity_id} Set Suite Variable ${existing_entity_id} resources/ApiUtils.resource +8 Changes for resources/ApiUtils.resource: 8 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -71,6 +71,14 @@ Batch Update Entities Output response Set Test Variable ${response} Batch Delete Entities [Arguments] @{entities_ids_to_be_deleted} &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST ${batch_endpoint} body=@{entities_ids_to_be_deleted} headers=${headers} Output request Output response Set Test Variable ${response} Batch Request Entities From File [Arguments] ${filename} ${file_content}= Get File ${EXECDIR}/data/entities/${filename} Loading Loading
TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot +32 Changes for TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot: 32 added lines, 0 removed lines. Original line number Diff line number Diff line *** Settings *** Documentation Check that you cannot delete a batch of entities with an invalid request Variables ../../../../../../resources/variables.py Resource ../../../../../../resources/ApiUtils.resource Resource ../../../../../../resources/AssertionUtils.resource Library RequestsLibrary Library JSONLibrary Library OperatingSystem *** Variable *** ${batch_endpoint}= entityOperations/delete ${endpoint}= entities *** Test Case *** With invalid json document [Documentation] Check that you cannot delete a batch of entities with an invalid json document [Tags] critical Batch Request Entities From File batch/invalid-json-sample.jsonld Check Response Status Code Set To 400 Check Response Body Containing Problem Details Element Containing Detail Element ${response} With empty json document [Documentation] Check that you cannot delete a batch of entities with an empty json document [Tags] critical Batch Request Entities From File batch/empty-sample.jsonld Check Response Status Code Set To 400 Check Response Body Containing Problem Details Element Containing Detail Element ${response}
TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot +38 Changes for TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot: 38 added lines, 0 removed lines. Original line number Diff line number Diff line *** Settings *** Documentation Check that you can delete a batch of entities Variables ../../../../../../resources/variables.py Resource ../../../../../../resources/ApiUtils.resource Resource ../../../../../../resources/AssertionUtils.resource Resource ../../../../../../resources/JsonUtils.resource Library REST ${url} Library JSONLibrary Library String Library Collections Suite Setup Setup Initial Entities *** Variable *** ${batch_endpoint}= entityOperations/delete ${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Delete a batch of entities [Documentation] Check that you can delete a batch of entities [Tags] critical @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} Check Response Status Code Set To 204 *** Keywords *** Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity building-simple-attributes-sample.jsonld ${first_entity_id} Create Entity building-simple-attributes-sample.jsonld ${second_entity_id} Set Suite Variable ${first_entity_id} Set Suite Variable ${second_entity_id}
TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot +41 Changes for TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot: 41 added lines, 0 removed lines. Original line number Diff line number Diff line *** Settings *** Documentation Check that you can delete a batch of entities where some will succeed and others will fail Variables ../../../../../../resources/variables.py Resource ../../../../../../resources/ApiUtils.resource Resource ../../../../../../resources/AssertionUtils.resource Resource ../../../../../../resources/JsonUtils.resource Library REST ${url} Library JSONLibrary Library String Library Collections Suite Setup Setup Initial Entities *** Variable *** ${batch_endpoint}= entityOperations/delete ${endpoint}= entities ${building_id_prefix}= urn:ngsi-ld:Building: *** Test Case *** Delete a batch of non existing and existing entities [Documentation] Check that you can delete a batch of non existing and existing entities [Tags] critical ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} @{entities_ids_to_be_deleted}= Create List ${existing_entity_id} ${new_entity_id} Batch Delete Entities @{entities_ids_to_be_deleted} @{expected_successful_entities_ids}= Create List ${existing_entity_id} @{expected_failed_entities_ids}= Create List ${new_entity_id} &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} Check Response Status Code Set To 207 Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} *** Keywords *** Setup Initial Entities ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} Create Entity building-simple-attributes-sample.jsonld ${existing_entity_id} Set Suite Variable ${existing_entity_id}
resources/ApiUtils.resource +8 Changes for resources/ApiUtils.resource: 8 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -71,6 +71,14 @@ Batch Update Entities Output response Set Test Variable ${response} Batch Delete Entities [Arguments] @{entities_ids_to_be_deleted} &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST ${batch_endpoint} body=@{entities_ids_to_be_deleted} headers=${headers} Output request Output response Set Test Variable ${response} Batch Request Entities From File [Arguments] ${filename} ${file_content}= Get File ${EXECDIR}/data/entities/${filename} Loading