Commit 08dba791 authored by Benoit Orihuela's avatar Benoit Orihuela
Browse files

Merge branch 'fix/incorrect-check-response-body-method' into 'develop'

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

See merge request !158
parents c189012c 09cf3d12
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -15,7 +15,7 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle:
${parking_id_prefix}=       urn:ngsi-ld:OffStreetParking:
${parking_id_prefix}=       urn:ngsi-ld:OffStreetParking:
${vehicle_filename}=        vehicle-simple-attributes.jsonld
${vehicle_filename}=        vehicle-simple-attributes.jsonld
${parking_filename}=        parking-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
${vehicle_entity_type}=     https://ngsi-ld-test-suite/context#Vehicle
${parking_entity_type}=     https://ngsi-ld-test-suite/context#OffStreetParking
${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 ***
*** Keywords ***
Create Entities
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}
    Set Suite Variable    ${vehicle_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ${response}=    Create Entity Selecting Content Type
    ...    ${vehicle_filename}
    ...    ${vehicle_filename}
    ...    ${vehicle_entity_id}
    ...    ${vehicle_entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response.status_code}
    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}
    Set Suite Variable    ${parking_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ${response}=    Create Entity Selecting Content Type
    ...    ${parking_filename}
    ...    ${parking_filename}
+3 −3
Original line number Original line Diff line number Diff line
@@ -13,7 +13,7 @@ Suite Teardown Delete Entities
*** Variables ***
*** Variables ***
${building_id_prefix}=      urn:ngsi-ld:Building:
${building_id_prefix}=      urn:ngsi-ld:Building:
${filename}=                building-location-attribute.jsonld
${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
${entity_type}=             https://ngsi-ld-test-suite/context#Building




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


*** Keywords ***
*** Keywords ***
Create Initial Entities
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}
    Set Suite Variable    ${first_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ${response}=    Create Entity Selecting Content Type
    ...    ${filename}
    ...    ${filename}
    ...    ${first_entity_id}
    ...    ${first_entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    ...    ${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}
    Set Suite Variable    ${second_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ${response}=    Create Entity Selecting Content Type
    ...    ${filename}
    ...    ${filename}
+5 −11
Original line number Original line Diff line number Diff line
@@ -16,13 +16,13 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle:
${filename}=                vehicle-two-datasetid-attributes.jsonld
${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
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
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
    204    vehicle-speed-two-datasetid-02-fragment.jsonld    expectations/vehicle-update-datasetid-attributes.jsonld
011_01_03 Check that one can update only some attributes while unknown are ignored
011_01_03 Check that one can update existing attributes and append non-existing attributes
    204    vehicle-speed-two-datasetid-03-fragment.jsonld    ${EMPTY}    expectations/vehicle-multi-attributes.jsonld
    204    vehicle-speed-two-datasetid-03-fragment.jsonld    expectations/vehicle-multi-attributes.jsonld




*** Keywords ***
*** Keywords ***
@@ -32,18 +32,12 @@ Update Attributes
    [Arguments]
    [Arguments]
    ...    ${status_code}
    ...    ${status_code}
    ...    ${fragment_filename}
    ...    ${fragment_filename}
    ...    ${expectation_resp_filename}
    ...    ${expectation_filename}
    ...    ${expectation_filename}
    ${response}=    Update Entity Attributes
    ${response}=    Update Entity Attributes
    ...    ${entity_id}
    ...    ${entity_id}
    ...    ${fragment_filename}
    ...    ${fragment_filename}
    ...    ${CONTENT_TYPE_LD_JSON}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    ${status_code}    ${response.status_code}
    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}
    ${entity_expectation_payload}=    Load Test Sample    entities/${expectation_filename}    ${entity_id}
    ${response1}=    Retrieve Entity by Id
    ${response1}=    Retrieve Entity by Id
    ...    id=${entity_id}
    ...    id=${entity_id}
+4 −8
Original line number Original line Diff line number Diff line
{
{
    "type": "FeatureCollection",
    "type": "FeatureCollection",
    "features": [{
    "features": [{
        "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9",
        "id": "urn:ngsi-ld:Building:019-05-01",
        "type": "Feature",
        "type": "Feature",
        "geometry": {
        "geometry": {
            "type": "Point",
            "type": "Point",
@@ -24,12 +24,10 @@
                    "coordinates": [13.3986, 52.5547]
                    "coordinates": [13.3986, 52.5547]
                }
                }
            },
            },
            "@context": [
            "@context": "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld"
                "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",
            "type": "Feature",
            "geometry": {
            "geometry": {
                "type": "Point",
                "type": "Point",
@@ -52,9 +50,7 @@
                        "coordinates": [13.3986, 52.5547]
                        "coordinates": [13.3986, 52.5547]
                    }
                    }
                },
                },
                "@context": [
                "@context": "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld"
                    "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 Original line Diff line number Diff line
@@ -5,6 +5,16 @@
        "type": "Property",
        "type": "Property",
        "value": "Mercedes"
        "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": {
    "isParked": {
        "type": "Relationship",
        "type": "Relationship",
        "object": "urn:ngsi-ld:OffStreetParking:Downtown1",
        "object": "urn:ngsi-ld:OffStreetParking:Downtown1",
Loading