Commit ea65be46 authored by Benoit Orihuela's avatar Benoit Orihuela
Browse files

Merge branch 'fix/misplaced-create-entity-endpoint' into 'develop'

fix: move create entity from file in the correct API resource file

See merge request !110
parents 0b3d71ea 3b7a3f64
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
*** 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()}
+0 −12
Original line number Diff line number Diff line
@@ -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
+12 −0
Original line number Diff line number Diff line
@@ -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}