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

Merge branch 'feature/add-tc-geojson-with-null-geometry' into 'develop'

feat: add TC on GeoJSON representation with a nonexistent geoproperty

See merge request !169
parents 38857502 89fe32e2
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -26,6 +26,9 @@ ${filename}= building-location-attribute-sample.jsonld
018_05_03 with geometryProperty
    [Tags]    e-retrieve    6_3_7
    ${EMPTY}    observationSpace    building-two-geometry-property-on-observation-space.geojson
018_05_04 with nonexistent geometryProperty
    [Tags]    e-retrieve    6_3_7
    ${EMPTY}    operationSpace    building-two-geometry-property-on-nonexistent-operation-space.geojson


*** Keywords ***
@@ -39,7 +42,10 @@ Retrieve Entity In GeoJSON Representation
    ...    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()}
    Check Response Body Containing Entity element
    ...    expectation_filename=${expectation_filename}
    ...    entity_id=${entity_id}
    ...    response_body=${response.json()}

Create Initial Entity
    ${entity_id}=    Generate Random Entity Id    ${building_id_prefix}
+37 −0
Original line number Diff line number Diff line
{
  "id": "urn:ngsi-ld:Building:3405226884283357",
  "type": "Feature",
  "geometry": null,
  "properties": {
    "type": "Building",
    "location": {
      "type": "GeoProperty",
      "value": {
        "type": "Point",
        "coordinates": [
          13.3986,
          52.5547
        ]
      }
    },
    "name": {
      "type": "Property",
      "value": "Eiffel Tower"
    },
    "observationSpace": {
      "type": "GeoProperty",
      "value": {
        "type": "Point",
        "coordinates": [
          11.1111,
          11.1111
        ]
      }
    },
    "subCategory": {
      "type": "Property",
      "value": "tourism"
    },
    "@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
+19 −3
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@
      "setup": null,
      "teardown": null,
      "template": "Retrieve Entity In GeoJSON Representation",
      "then": "then {\n    the SUT sends a valid Response for the operations:\n        Query Entity with Response Status Code set to 200     and\n        Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-location-attribute-simplified.geojson'\n}",
      "then": "then {\n    the SUT sends a valid Response for the operations:\n        Query Entity with Response Status Code set to 200     and\n        Query Entity with Response Body containing en entity element with id set to 'entity_id=${entity_id}' and body content set to '${EMPTY}'\n}",
      "when": "when {\n    the SUT receives a Request from the client containing:\n        URL set to '/ngsi-ld/v1/entities/{id}'\n        method set to 'GET'\n        Get Entity Request: and\n    Query Parameter: id set to '${entity_id}' and\n    Query Parameter: accept set to 'application/geo+json' and\n    Query Parameter: options set to 'keyValues' and\n    Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n    Query Parameter: geometryProperty set to '${geometry_property}'\n}",
      "http_verb": "GET",
      "endpoint": "entities/{id}"
@@ -43,7 +43,7 @@
      "setup": null,
      "teardown": null,
      "template": "Retrieve Entity In GeoJSON Representation",
      "then": "then {\n    the SUT sends a valid Response for the operations:\n        Query Entity with Response Status Code set to 200     and\n        Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-location-attribute-normalized.geojson'\n}",
      "then": "then {\n    the SUT sends a valid Response for the operations:\n        Query Entity with Response Status Code set to 200     and\n        Query Entity with Response Body containing en entity element with id set to 'entity_id=${entity_id}' and body content set to '${EMPTY}'\n}",
      "when": "when {\n    the SUT receives a Request from the client containing:\n        URL set to '/ngsi-ld/v1/entities/{id}'\n        method set to 'GET'\n        Get Entity Request: and\n    Query Parameter: id set to '${entity_id}' and\n    Query Parameter: accept set to 'application/geo+json' and\n    Query Parameter: options set to '${EMPTY}' and\n    Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n    Query Parameter: geometryProperty set to '${geometry_property}'\n}",
      "http_verb": "GET",
      "endpoint": "entities/{id}"
@@ -59,7 +59,23 @@
      "setup": null,
      "teardown": null,
      "template": "Retrieve Entity In GeoJSON Representation",
      "then": "then {\n    the SUT sends a valid Response for the operations:\n        Query Entity with Response Status Code set to 200     and\n        Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'observationSpace'\n}",
      "then": "then {\n    the SUT sends a valid Response for the operations:\n        Query Entity with Response Status Code set to 200     and\n        Query Entity with Response Body containing en entity element with id set to 'entity_id=${entity_id}' and body content set to 'observationSpace'\n}",
      "when": "when {\n    the SUT receives a Request from the client containing:\n        URL set to '/ngsi-ld/v1/entities/{id}'\n        method set to 'GET'\n        Get Entity Request: and\n    Query Parameter: id set to '${entity_id}' and\n    Query Parameter: accept set to 'application/geo+json' and\n    Query Parameter: options set to '${EMPTY}' and\n    Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n    Query Parameter: geometryProperty set to '${geometry_property}'\n}",
      "http_verb": "GET",
      "endpoint": "entities/{id}"
    },
    {
      "name": "018_05_04 with nonexistent geometryProperty",
      "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_05_04",
      "doc": "Check that the queried entity by id can be returned in a GeoJSON format",
      "tags": [
        "6_3_7",
        "e-retrieve"
      ],
      "setup": null,
      "teardown": null,
      "template": "Retrieve Entity In GeoJSON Representation",
      "then": "then {\n    the SUT sends a valid Response for the operations:\n        Query Entity with Response Status Code set to 200     and\n        Query Entity with Response Body containing en entity element with id set to 'entity_id=${entity_id}' and body content set to 'operationSpace'\n}",
      "when": "when {\n    the SUT receives a Request from the client containing:\n        URL set to '/ngsi-ld/v1/entities/{id}'\n        method set to 'GET'\n        Get Entity Request: and\n    Query Parameter: id set to '${entity_id}' and\n    Query Parameter: accept set to 'application/geo+json' and\n    Query Parameter: options set to '${EMPTY}' and\n    Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n    Query Parameter: geometryProperty set to '${geometry_property}'\n}",
      "http_verb": "GET",
      "endpoint": "entities/{id}"