Commit d970d01b authored by root's avatar root
Browse files

added Consumption/Entity/001_03.robot

parent c251b3cd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ ${expectation_filename}= building-simple-attributes-sample-expectation.jsonld
    ${request}    ${response}=    Create Entity Selecting Content Type  ${filename}     ${entity_id}    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code  201    ${response['status']}

    ${response}=    Retrieve Entity by Id Returning Response    ${entity_id}    ${CONTENT_TYPE_LD_JSON}
    ${response}=    Query Entity    ${entity_id}    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code  200    ${response['status']}
    Check Response Body Containing Entity element    ${expectation_filename}    ${entity_id}    ${response}

+2 −2
Original line number Diff line number Diff line
*** Settings ***
Documentation   Check that you can query some attributes from entity
Documentation   Check that you can query some attributes from an entity
Resource    ${EXECDIR}/resources/ApiUtils.resource
Resource    ${EXECDIR}/resources/AssertionUtils.resource
Resource    ${EXECDIR}/resources/JsonUtils.resource
@@ -13,7 +13,7 @@ ${attribute_subcategory}= https://uri.fiware.org/ns/data-models#subCategory

*** Test Cases ***                               
001_02_Query some attributes from an entity
    [Documentation]  Check that you can query some attributes from entity
    [Documentation]  Check that you can query some attributes from an entity
    [Tags]  mandatory

    ${entity_id}=     Generate Random Entity Id    ${building_id_prefix}
+26 −0
Original line number Diff line number Diff line
*** Settings ***
Documentation   Check that you can query the geometry property from an entity
Resource    ${EXECDIR}/resources/ApiUtils.resource
Resource    ${EXECDIR}/resources/AssertionUtils.resource
Resource    ${EXECDIR}/resources/JsonUtils.resource

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

*** Test Cases ***                               
001_03_Query the geometry property from an entity
    [Documentation]  Check that you can query the geometry property from an entity
    [Tags]  mandatory

    ${entity_id}=     Generate Random Entity Id    ${building_id_prefix}
    ${request}    ${response}=    Create Entity Selecting Content Type  ${filename}     ${entity_id}    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code  201    ${response['status']}

    ${response}=    Query Entity    ${entity_id}    ${CONTENT_TYPE_LD_JSON}    geoproperty=${geometry_property}
    Check Response Status Code  200    ${response['status']}
    Check Response Body Containing Entity element    ${expectation_filename}    ${entity_id}    ${response}

    [Teardown]  Delete Entity by Id Returning Response   ${entity_id}
 No newline at end of file
+23 −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]
        }
    },
    "@context": [
        "https://fiware.github.io/data-models/context.jsonld",
        "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld"
    ]
}
 No newline at end of file
+25 −0
Original line number Diff line number Diff line
{
    "id": "urn:ngsi-ld:Building:9630352980062352",
    "type": "https://uri.fiware.org/ns/data-models#Building",
    "location": {
        "type": "GeoProperty",
        "value": {
            "type": "Point",
            "coordinates": [
                13.3986,
                52.5547
            ]
        }
    },
    "name": {
        "type": "Property",
        "value": "Eiffel Tower"
    },
    "https://uri.fiware.org/ns/data-models#subCategory": {
        "type": "Property",
        "value": "tourism"
    },
    "@context": [
        "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld"
    ]
}
 No newline at end of file
Loading