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

fix(035_02): only check response body if 400 error

parent d1ab6a71
Loading
Loading
Loading
Loading
+10 −5
Original line number Original line Diff line number Diff line
@@ -15,22 +15,27 @@ ${registration_id_prefix}= urn:ngsi-ld:Registration:
${filename}=                    context-source-registration-sample.jsonld
${filename}=                    context-source-registration-sample.jsonld




*** Test Cases ***    INVALID_REGISTRATION_ID    EXPECTED_STATUS_CODE
*** Test Cases ***    INVALID_REGISTRATION_ID    EXPECTED_STATUS_CODE    PROBLEM_TYPE
035_02_01 Delete a Context Source Registration if the Id is not present
035_02_01 Delete a Context Source Registration if the Id is not present
    [Tags]    csr-delete    5_9_4
    [Tags]    csr-delete    5_9_4
    ${EMPTY}    405
    ${EMPTY}    405    ${EMPTY}
035_02_02 Delete a Context Source Registration if the Id is not a valid URI
035_02_02 Delete a Context Source Registration if the Id is not a valid URI
    [Tags]    csr-delete    5_9_4
    [Tags]    csr-delete    5_9_4
    invalidURI    400
    invalidURI    400    ${ERROR_TYPE_BAD_REQUEST_DATA}




*** Keywords ***
*** Keywords ***
Delete A Context Source
Delete A Context Source
    [Documentation]    Check that you cannot delete a context source registration under some conditions
    [Documentation]    Check that you cannot delete a context source registration under some conditions
    [Arguments]    ${invalid_registration_id}    ${expected_status_code}
    [Arguments]    ${invalid_registration_id}    ${expected_status_code}    ${problem_type}
    ${response}=    Delete Context Source Registration With Return    ${invalid_registration_id}
    ${response}=    Delete Context Source Registration With Return    ${invalid_registration_id}
    Check Response Status Code    ${expected_status_code}    ${response.status_code}
    Check Response Status Code    ${expected_status_code}    ${response.status_code}
    IF    "${problem_type}"!="${EMPTY}"
        Check Response Body Containing ProblemDetails Element Containing Type Element set to
        ...    ${response.json()}
        ...    ${problem_type}
        Check Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()}
        Check Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()}
    END


Delete Created Context Source Registrations
Delete Created Context Source Registrations
    Delete Context Source Registration    ${registration_id}
    Delete Context Source Registration    ${registration_id}