Commit 5d955f65 authored by thomas Bousselin's avatar thomas Bousselin
Browse files

fix: update csr tests

parent 69e2bde6
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -39,7 +39,10 @@ Update A Context Source
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    ${expected_status_code}    ${response.status_code}
    Check Response Reason set to    ${response.reason}    ${reason_400}
    Check Response Body Containing ProblemDetails Element    ${response.json()}    ${problem_type}

    Check Response Body Containing ProblemDetails Element Containing Type Element set to
    ...    ${response.json()}
    ...    ${problem_type}

Create Initial Context Source Registration
    ${valid_registration_id}=    Generate Random CSR Id
+3 −1
Original line number Diff line number Diff line
@@ -26,4 +26,6 @@ ${reason_404}= Not Found
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    404    ${response.status_code}
    Check Response Reason set to    ${response.reason}    ${reason_404}
    Check Response Body Containing ProblemDetails Element    ${response.json()}    ${ERROR_TYPE_RESOURCE_NOT_FOUND}
    Check Response Body Containing ProblemDetails Element Containing Type Element set to
    ...    ${response.json()}
    ...    ${ERROR_TYPE_RESOURCE_NOT_FOUND}
+4 −1
Original line number Diff line number Diff line
@@ -22,10 +22,13 @@ ${registration_payload_file_path}= context-source-registration-invalid-json
    ${response}=    Update Context Source Registration From File
    ...    ${registration_id}
    ...    ${registration_payload_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}
    ...    ${ERROR_TYPE_INVALID_REQUEST}

    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()}


+7 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ ${CONTENT_TYPE_JSON} application/json
${CONTENT_TYPE_LD_JSON}                         application/ld+json

${ERROR_TYPE_BAD_REQUEST_DATA}                  https://uri.etsi.org/ngsi-ld/errors/BadRequestData
${ERROR_TYPE_INVALID_REQUEST}                   https://uri.etsi.org/ngsi-ld/errors/InvalidRequest
${ERROR_TYPE_RESOURCE_NOT_FOUND}                https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound

${response}                                     ${EMPTY}
@@ -121,13 +122,18 @@ Update Context Source Registration
    RETURN    ${response}

Update Context Source Registration From File
    [Arguments]    ${context_source_registration_id}    ${filename}
    [Arguments]    ${context_source_registration_id}    ${filename}    ${content_type}    ${accept}=${EMPTY}

    &{headers}=    Create Dictionary    Content-Type=${content_type}
    IF    '${accept}'!=''    Set To Dictionary    ${headers}    Accept=${accept}

    ${file_content}=    Get File    ${EXECDIR}/data/csourceRegistrations/${filename}
    ${response}=    PATCH
    ...    url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id}
    ...    data=${file_content}
    ...    headers=${headers}
    ...    expected_status=any

    Output    ${response}    Update Context Source Registration From File
    RETURN    ${response}