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

Merge branch 'fix/expected-responses-in-invalid-batch-operations' into 'develop'

fix: expected responses in invalid batch operations

See merge request !185
parents 6d4e7ba0 1c38559e
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -74,15 +74,17 @@ ${registration_filename}= csourceRegistrations/context-source-registration
    @{entities_to_be_created}=    Create List    ${first_entity}    ${second_entity}
    @{entities_ids_to_be_created}=    Create List    ${first_entity_id}    ${second_entity_id}
    ${response}=    Batch Create Entities    @{entities_to_be_created}    content_type=${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    ${expected_status_code}    ${response.status_code}
    Check Response Status Code    207    ${response.status_code}
    Check Response Body Containing ProblemDetails Element Containing Type Element set to
    ...    ${response.json()['errors'][0]['error']}
    ...    ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE}
    Check Response Body Containing ProblemDetails Element Containing Type Element set to
    ...    ${response.json()['errors'][1]['error']}
    ...    ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE}
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()['errors'][0]['error']}
	Check Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()['errors'][1]['error']}
    Check Response Body Containing ProblemDetails Element Containing Title Element
    ...    ${response.json()['errors'][0]['error']}
    Check Response Body Containing ProblemDetails Element Containing Title Element
    ...    ${response.json()['errors'][1]['error']}
    [Teardown]    Batch Delete Entities    entities_ids_to_be_deleted=@{entities_ids_to_be_created}

043_01_05 Create context source registration
+2 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ Create Batch Entity With Invalid Request Scenarios
    [Arguments]    ${filename}    ${problem_type}
    ${response}=    Batch Request Entities From File    create    filename=${filename}
    Check Response Status Code    400    ${response.status_code}
    Check RL Response Body Containing ProblemDetails Element Containing Type Element set to
    Check Response Body Containing ProblemDetails Element Containing Type Element set to
    ...    ${response.json()}
    ...    ${problem_type}
    Check RL Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()}
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()}
+3 −2
Original line number Diff line number Diff line
@@ -20,8 +20,9 @@ ${building_id_prefix}= urn:ngsi-ld:Building:

    ${response}=    Batch Create Entities    @{entities_to_be_created}    content_type=${CONTENT_TYPE_JSON}

    Check Response Status Code    400    ${response.status_code}
    Check Response Status Code    207    ${response.status_code}
    Check Response Body Containing ProblemDetails Element Containing Type Element set to
    ...    ${response.json()['errors'][0]['error']}
    ...    ${ERROR_TYPE_BAD_REQUEST_DATA}
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()['errors'][0]['error']}
    Check Response Body Containing ProblemDetails Element Containing Title Element
    ...    ${response.json()['errors'][0]['error']}
+3 −2
Original line number Diff line number Diff line
@@ -20,8 +20,9 @@ ${building_id_prefix}= urn:ngsi-ld:Building:

    ${response}=    Batch Create Entities    @{entities_to_be_created}    content_type=${CONTENT_TYPE_LD_JSON}

    Check Response Status Code    400    ${response.status_code}
    Check Response Status Code    207    ${response.status_code}
    Check Response Body Containing ProblemDetails Element Containing Type Element set to
    ...    ${response.json()['errors'][0]['error']}
    ...    ${ERROR_TYPE_BAD_REQUEST_DATA}
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()['errors'][0]['error']}
    Check Response Body Containing ProblemDetails Element Containing Title Element
    ...    ${response.json()['errors'][0]['error']}
+2 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ Batch Delete Entity With Invalid Request Scenarios
    [Arguments]    ${filename}    ${problem_type}
    ${response}=    Batch Request Entities From File    delete    filename=${filename}
    Check Response Status Code    400    ${response.status_code}
    Check RL Response Body Containing ProblemDetails Element Containing Type Element set to
    Check Response Body Containing ProblemDetails Element Containing Type Element set to
    ...    ${response.json()}
    ...    ${problem_type}
    Check RL Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()}
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()}
Loading