Commit 09cf3d12 authored by Benoit Orihuela's avatar Benoit Orihuela
Browse files

fix: Check Response Body Content was ignoring the whole file when comparing

parent c189012c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle:
${parking_id_prefix}=       urn:ngsi-ld:OffStreetParking:
${vehicle_filename}=        vehicle-simple-attributes.jsonld
${parking_filename}=        parking-simple-attributes.jsonld
${expectation_filename}=    vehicle-parking-simple.geojson
${expectation_filename}=    vehicle-parking-019-02-05.geojson
${vehicle_entity_type}=     https://ngsi-ld-test-suite/context#Vehicle
${parking_entity_type}=     https://ngsi-ld-test-suite/context#OffStreetParking

@@ -39,14 +39,14 @@ ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking

*** Keywords ***
Create Entities
    ${vehicle_entity_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    ${vehicle_entity_id}=    Catenate    ${vehicle_id_prefix}019-02-05
    Set Suite Variable    ${vehicle_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ...    ${vehicle_filename}
    ...    ${vehicle_entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response.status_code}
    ${parking_entity_id}=    Generate Random Entity Id    ${parking_id_prefix}
    ${parking_entity_id}=    Catenate    ${parking_id_prefix}019-02-05
    Set Suite Variable    ${parking_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ...    ${parking_filename}
+3 −3
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ Suite Teardown Delete Entities
*** Variables ***
${building_id_prefix}=      urn:ngsi-ld:Building:
${filename}=                building-location-attribute.jsonld
${expectation_filename}=    two-buildings-location-attribute-normalized.geojson
${expectation_filename}=    two-buildings-location-attribute-normalized-019-05.geojson
${entity_type}=             https://ngsi-ld-test-suite/context#Building


@@ -38,13 +38,13 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building

*** Keywords ***
Create Initial Entities
    ${first_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${first_entity_id}=    Catenate    ${building_id_prefix}019-05-01
    Set Suite Variable    ${first_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ...    ${filename}
    ...    ${first_entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    ${second_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${second_entity_id}=    Catenate    ${building_id_prefix}019-05-02
    Set Suite Variable    ${second_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ...    ${filename}
+5 −11
Original line number Diff line number Diff line
@@ -16,13 +16,13 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle:
${filename}=                vehicle-two-datasetid-attributes.jsonld


*** Test Cases ***    STATUS_CODE    FRAGMENT_FILENAME    EXPECTATION_RESPONSE_FILENAME    EXPECTATION_FILENAME
*** Test Cases ***    STATUS_CODE    FRAGMENT_FILENAME    EXPECTATION_FILENAME
011_01_01 Check that one can update existing attributes with no datasetId
    204    vehicle-speed-two-datasetid-01-fragment.jsonld    ${EMPTY}    expectations/vehicle-update-attributes.jsonld
    204    vehicle-speed-two-datasetid-01-fragment.jsonld    expectations/vehicle-update-attributes.jsonld
011_01_02 Check that one can update existing attributes with the datasetId
    204    vehicle-speed-two-datasetid-02-fragment.jsonld    ${EMPTY}    expectations/vehicle-update-datasetid-attributes.jsonld
011_01_03 Check that one can update only some attributes while unknown are ignored
    204    vehicle-speed-two-datasetid-03-fragment.jsonld    ${EMPTY}    expectations/vehicle-multi-attributes.jsonld
    204    vehicle-speed-two-datasetid-02-fragment.jsonld    expectations/vehicle-update-datasetid-attributes.jsonld
011_01_03 Check that one can update existing attributes and append non-existing attributes
    204    vehicle-speed-two-datasetid-03-fragment.jsonld    expectations/vehicle-multi-attributes.jsonld


*** Keywords ***
@@ -32,18 +32,12 @@ Update Attributes
    [Arguments]
    ...    ${status_code}
    ...    ${fragment_filename}
    ...    ${expectation_resp_filename}
    ...    ${expectation_filename}
    ${response}=    Update Entity Attributes
    ...    ${entity_id}
    ...    ${fragment_filename}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    ${status_code}    ${response.status_code}
    IF    "${expectation_resp_filename}"!="${EMPTY}"
        Check Response Body Content
        ...    expectation_filename=${expectation_resp_filename}
        ...    response_body=${response.json()}
    END
    ${entity_expectation_payload}=    Load Test Sample    entities/${expectation_filename}    ${entity_id}
    ${response1}=    Retrieve Entity by Id
    ...    id=${entity_id}
+4 −8
Original line number Diff line number Diff line
{
    "type": "FeatureCollection",
    "features": [{
        "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9",
        "id": "urn:ngsi-ld:Building:019-05-01",
        "type": "Feature",
        "geometry": {
            "type": "Point",
@@ -24,12 +24,10 @@
                    "coordinates": [13.3986, 52.5547]
                }
            },
            "@context": [
                "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld"
            ]
            "@context": "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld"
        }
    }, {
            "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9",
            "id": "urn:ngsi-ld:Building:019-05-02",
            "type": "Feature",
            "geometry": {
                "type": "Point",
@@ -52,9 +50,7 @@
                        "coordinates": [13.3986, 52.5547]
                    }
                },
                "@context": [
                    "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld"
                ]
                "@context": "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld"
            }
    }]
}
+10 −0
Original line number Diff line number Diff line
@@ -5,6 +5,16 @@
        "type": "Property",
        "value": "Mercedes"
    },
    "isParked2": {
        "type": "Relationship",
        "object": "urn:ngsi-ld:OffStreetParking:Downtown1",
        "observedAt": "2017-07-29T12:00:04Z",
        "providedBy": {
            "type": "Relationship",
            "object": "urn:ngsi-ld:Person:JohnDoe"
        },
        "datasetId": "urn:ngsi-ld:Relationship:parked12345"
    },
    "isParked": {
        "type": "Relationship",
        "object": "urn:ngsi-ld:OffStreetParking:Downtown1",
Loading