diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot index bde69e2105bd6bfae05fbdf9a9aee1dd42c18ee0..dda6b86a1a71d675484dcb7708fa536a80876f87 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot @@ -1,7 +1,7 @@ *** Settings *** Documentation Check that you cannot create an entity with an invalid request -Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Create Entity With Invalid Request Scenarios @@ -23,7 +23,7 @@ Test Template Create Entity With Invalid Request Scenarios Create Entity With Invalid Request Scenarios [Documentation] Check that you cannot create an entity with an invalid request [Arguments] ${filename} ${error_type} - ${response}= Request Entity From File ${filename} + ${response}= Create Entity From File ${filename} Check Response Status Code 400 ${response.status_code} Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ... ${response.json()} diff --git a/resources/ApiUtils/ContextInformationConsumption.resource b/resources/ApiUtils/ContextInformationConsumption.resource index 70e50ef2412f049b502d3287b73d7a0a835c9acf..7782d2f0bfe6098bf13fd2fb8e287e98d6f64a03 100755 --- a/resources/ApiUtils/ContextInformationConsumption.resource +++ b/resources/ApiUtils/ContextInformationConsumption.resource @@ -197,18 +197,6 @@ Retrieve Attributes Output ${response} Retrieve Attributes RETURN ${response} -Request Entity From File - [Arguments] ${filename} - ${file_content}= Get File ${EXECDIR}/data/entities/${filename} - &{headers}= Create Dictionary Content-Type=application/ld+json - ${response}= POST - ... url=${url}/${ENTITIES_ENDPOINT_PATH} - ... data=${file_content} - ... headers=${headers} - ... expected_status=any - Output ${response} Request Entity From File - RETURN ${response} - Retrieve Entity by Id [Arguments] ${id} ${accept}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${headers}= Create Dictionary diff --git a/resources/ApiUtils/ContextInformationProvision.resource b/resources/ApiUtils/ContextInformationProvision.resource index b4ec511c85de140c98b64bc61054102f8911d6cc..7a22bbdd856fe97e1ca585689a3282577fcbf67f 100755 --- a/resources/ApiUtils/ContextInformationProvision.resource +++ b/resources/ApiUtils/ContextInformationProvision.resource @@ -167,6 +167,18 @@ Create Entity Selecting Content Type Output ${response} Create Entity Selecting Content Type RETURN ${response} +Create Entity From File + [Arguments] ${filename} + ${file_content}= Get File ${EXECDIR}/data/entities/${filename} + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST + ... url=${url}/${ENTITIES_ENDPOINT_PATH} + ... data=${file_content} + ... headers=${headers} + ... expected_status=any + Output ${response} Create Entity From File + RETURN ${response} + Delete Entity Attributes [Arguments] ${entityId} ${attributeId} ${datasetId} ${deleteAll} ${context}=${EMPTY} &{headers}= Create Dictionary Content-Type=${CONTENT_TYPE_JSON}