Commit 3a37a037 authored by thomas Bousselin's avatar thomas Bousselin
Browse files

Merge branch 'feature/etsi-fix-geometry-property' into 'develop'

fix: geometryProperty test for retrieve entity

See merge request !166
parents da51cd57 4ff50ff1
Loading
Loading
Loading
Loading
+0 −48
Original line number Diff line number Diff line
*** Settings ***
Documentation       Check that one can query the geometry property from an entity

Resource            ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource
Resource            ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource

Suite Setup         Create Entity
Suite Teardown      Delete Created Entity


*** Variables ***
${building_id_prefix}=      urn:ngsi-ld:Building:
${filename}=                building-location-attribute.jsonld
${expectation_filename}=    building-geoproperty-query.jsonld
${geometry_property}=       location


*** Test Cases ***
018_01_03 Query the geometry property from an entity
    [Documentation]    Check that one can query the geometry property from an entity
    [Tags]    e-retrieve    5_7_1
    ${response}=    Query Entity
    ...    id=${entity_id}
    ...    accept=${CONTENT_TYPE_LD_JSON}
    ...    geoproperty=${geometry_property}

    Check Response Status Code    200    ${response.status_code}
    Check Response Body Containing Entity element
    ...    ${expectation_filename}
    ...    ${entity_id}
    ...    ${response.json()}
    ...    ${True}


*** Keywords ***
Create Entity
    ${entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    Set Suite Variable    ${entity_id}
    ${create_response}=    Create Entity Selecting Content Type
    ...    ${filename}
    ...    ${entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${create_response.status_code}

Delete Created Entity
    Delete Entity by Id    ${entity_id}
+8 −4
Original line number Diff line number Diff line
@@ -13,27 +13,31 @@ Test Template Retrieve Entity In GeoJSON Representation

*** Variables ***
${building_id_prefix}=      urn:ngsi-ld:Building:
${filename}=                building-location-attribute.jsonld
${filename}=                building-two-geometry-attributes.jsonld


*** Test Cases ***    OPTIONS    EXPECTATION_FILENAME
018_05_01 Simplified
    [Tags]    e-retrieve    6_3_7
    keyValues    building-location-attribute-simplified.geojson
    keyValues    ${EMPTY}    building-two-geometry-attribute-simplified.geojson
018_05_02 Normalized
    [Tags]    e-retrieve    6_3_7
    ${EMPTY}    building-location-attribute-normalized.geojson
    ${EMPTY}    ${EMPTY}    building-two-geometry-attribute-normalized.geojson
018_05_03 with geometryProperty
    [Tags]    e-retrieve    6_3_7
    ${EMPTY}    observationSpace    building-two-geometry-property-on-observation-space.geojson


*** Keywords ***
Retrieve Entity In GeoJSON Representation
    [Documentation]    Check that the queried entity by id can be returned in a GeoJSON format
    [Arguments]    ${options}    ${expectation_filename}
    [Arguments]    ${options}    ${geometry_property}    ${expectation_filename}
    ${response}=    Query Entity
    ...    id=${entity_id}
    ...    accept=${CONTENT_TYPE_GEOJSON}
    ...    options=${options}
    ...    context=${ngsild_test_suite_context}
    ...    geometryProperty=${geometry_property}
    Check Response Status Code    200    ${response.status_code}
    Check Response Body Containing Entity element    ${expectation_filename}    ${entity_id}    ${response.json()}

+29 −0
Original line number Diff line number Diff line
{
    "id": "urn:ngsi-ld:Building:randomUUID",
    "type": "Building",
    "name": {
        "type": "Property",
        "value": "Eiffel Tower"
    },
    "subCategory": {
        "type": "Property",
        "value": "tourism"
    },
    "location": {
        "type": "GeoProperty",
        "value": {
            "type": "Point",
            "coordinates": [13.3986, 52.5547]
        }
    },
    "observationSpace": {
        "type": "GeoProperty",
        "value": {
            "type": "Point",
            "coordinates": [11.1111, 11.1111]
        }
    },
    "@context": [
        "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld"
    ]
}
 No newline at end of file
+7 −0
Original line number Diff line number Diff line
@@ -22,6 +22,13 @@
                "coordinates": [13.3986, 52.5547]
            }
        },
        "observationSpace": {
            "type": "GeoProperty",
            "value": {
                "type": "Point",
                "coordinates": [11.1111, 11.1111]
            }
        },
        "@context": [
            "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld"
        ]
+4 −0
Original line number Diff line number Diff line
@@ -13,6 +13,10 @@
            "type": "Point",
            "coordinates": [13.3986, 52.5547]
        },
        "observationSpace": {
             "type": "Point",
             "coordinates": [11.1111, 11.1111]
        },
        "@context": [
            "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld"
        ]
Loading