Skip to content
*** Settings ***
Documentation If a subscription defines an entity type selection query, a notification shall be sent whenever an entity matches the query.
Resource ${EXECDIR}/resources/ApiUtils/ContextInformationSubscription.resource
Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource
Resource ${EXECDIR}/resources/AssertionUtils.resource
Resource ${EXECDIR}/resources/JsonUtils.resource
Resource ${EXECDIR}/resources/NotificationUtils.resource
Suite Setup Before Test
Suite Teardown After Test
*** Variables ***
${subscription_id_prefix}= urn:ngsi-ld:Subscription:
${subscription_payload_file_path}= subscriptions/subscription-building-entities-type-selection.jsonld
${vehicle_id_prefix}= urn:ngsi-ld:Vehicle:
${notification_server_send_url}= http://${notification_server_host}:${notification_server_port}/notify
${entity_vehicle_filepath}= vehicle-simple-attributes-sample.jsonld
${content_type}= application/ld+json
*** Test Cases ***
046_16_02 Check that a notification is not sent if the entity type does not match the entity type selection
[Documentation] If a subscription defines an entity type selection query, a notification shall not be sent if the entity type does not match the query
[Tags] sub-notification 5_8_6 since_v1.5.1
${vehicle_id}= Generate Random Entity Id ${vehicle_id_prefix}
${response}= Create Entity Selecting Content Type
... ${entity_vehicle_filepath}
... ${vehicle_id}
... ${content_type}
Set Suite Variable ${vehicle_id}
Wait for no notification
*** Keywords ***
Setup Initial Subscription
${subscription_id}= Generate Random Entity Id ${subscription_id_prefix}
${subscription_payload}= Load Subscription Sample With Reachable Endpoint
... ${subscription_payload_file_path}
... ${subscription_id}
... ${notification_server_send_url}
Create Subscription From Subscription Payload ${subscription_payload} ${CONTENT_TYPE_LD_JSON}
Set Suite Variable ${subscription_id}
Before Test
Start Local Server ${notification_server_host} ${notification_server_port}
Sleep 1s
Setup Initial Subscription
After Test
Delete Subscription ${subscription_id}
Delete Entity by Id ${vehicle_id}
Stop Local Server
......@@ -37,7 +37,9 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-sample
Check Created Resource Set To ${subscription_payload} ${response1.json()} ${ignored_attributes}
Check Dictionary Might Contain Additional Members of the NotificationParams ${response1.json()} lastNotification
Check Dictionary Might Contain Additional Members of the NotificationParams
... ${response1.json()}
... lastNotification
Check Dictionary Might Contain Additional Members of the NotificationParams ${response1.json()} lastFailure
Check Dictionary Might Contain Additional Members of the NotificationParams ${response1.json()} lastSuccess
Check Dictionary Might Contain Additional Members of the NotificationParams ${response1.json()} timesSent
......
......@@ -40,6 +40,7 @@ ${subscription_payload_file_path}= csourceSubscriptions/subscription-expire
... response_body=${response1.json()}
... expected_attribute_value=expired
*** Keywords ***
Generate Random Ids For Context Source Registration Subscriptions
${subscription_id}= Generate Random Entity Id ${subscription_id_prefix}
......
......@@ -51,7 +51,9 @@ ${expectation_file_path}= csourceSubscriptions/expectations/subscr
... response_body=${response.json()}
... ignored_keys=${ignored_attributes}
Check Dictionary Might Contain Additional Members of the NotificationParams ${response.json()} lastNotification
Check Dictionary Might Contain Additional Members of the NotificationParams
... ${response.json()}
... lastNotification
Check Dictionary Might Contain Additional Members of the NotificationParams ${response.json()} lastFailure
Check Dictionary Might Contain Additional Members of the NotificationParams ${response.json()} lastSuccess
Check Dictionary Might Contain Additional Members of the NotificationParams ${response.json()} timesSent
......
{
"id": "urn:ngsi-ld:Building:randomUUID",
"type": "Building",
"street": {
"type": "LanguageProperty",
"languageMap": {
"fr": "Grand Place",
"nl": "Grote Markt"
}
},
"@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
{
"id": "urn:ngsi-ld:Building:randomUUID",
"type": "Building",
"street": {
"type": "LanguageProperty",
"languageMap": {
"fr": "Grand Place",
"nl": "Grote Markt"
},
"source": {
"type": "Property",
"value": "Speedometer"
}
},
"@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
{
"id": "urn:ngsi-ld:Building:randomUUID",
"type": "Building",
"scope": ["/Madrid/Gardens/ParqueNorte", "/CompanyA/OrganizationB/UnitC"]
}
{
"id": "urn:ngsi-ld:Building:randomUUID",
"type": "Building",
"scope": "/Madrid/Gardens/ParqueNorte"
}
\ No newline at end of file
{
"id": "urn:ngsi-ld:MultiTypes:randomUUID",
"type": ["Parking" ],
"@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
{
"id": "urn:ngsi-ld:MultiTypes:randomUUID",
"type": ["Building", "TouristDestination" ],
"@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
{
"id": "urn:ngsi-ld:Building:randomUUID",
"type": "Building",
"street": {
"languageMap": {
"fr": "Grand Place",
"nl": "Grote Markt"
}
},
"@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
{
"id": "urn:ngsi-ld:Building:randomUUID",
"type": "Building",
"street": {
"type": "LanguageProperty",
"languageMap": {
"fr": "Grand Place",
"nl": "Grote Markt"
}
},
"@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
{
"id": "urn:ngsi-ld:Building:randomUUID",
"type": "Building",
"street": "Grand Place",
"@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
{
"id": "urn:ngsi-ld:Building:randomUUID",
"type": "Building",
"street": {
"type": "Property",
"value": "Grand Place",
"lang": "fr"
},
"@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
{
"id": "urn:ngsi-ld:Building:randomUUID",
"type": "Building",
"street": {
"type": "LanguageProperty",
"languageMap": {
"fr": "Grand Place",
"es": "Gran Lugar"
},
"providedBy": {
"type": "Relationship",
"object": "urn:ngsi-ld:Person:JohnDoe"
},
"source": {
"type": "Property",
"value": "Speedometer"
}
},
"@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
{
"id": "urn:ngsi-ld:Building:randomUUID",
"type": "Building"
}
\ No newline at end of file
{
"id": "urn:ngsi-ld:Building:randomUUID",
"type": "Building",
"scope": "/CompanyA/OrganizationB/UnitC"
}
\ No newline at end of file
{
"id": "urn:ngsi-ld:Building:randomUUID",
"type": "Building",
"scope": ["/Madrid/Gardens/ParqueNorte", "/CompanyA/OrganizationB/UnitC"]
}
\ No newline at end of file
{
"id": "urn:ngsi-ld:Vehicle:randomUUID",
"type": "Vehicle",
"brandName": {
"type": "Property",
"value": "Mercedes"
},
"speed": [
{
"type": "Property",
"source": {
"type": "Property",
"value": "Speedometer"
},
"datasetId": "urn:ngsi-ld:Property:speedometer",
"value": 55
},
{
"type": "Property",
"source": {
"type": "Property",
"value": "GPS"
},
"datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed",
"value": 54.5
}
],
"street": {
"type": "LanguageProperty",
"languageMap": {
"fr": "Grand Place",
"nl": "Grote Markt"
}
},
"isParked": {
"type": "Relationship",
"providedBy": {
"type": "Relationship",
"object": "urn:ngsi-ld:Person:Bob"
},
"object": "urn:ngsi-ld:OffStreetParking:Downtown1",
"observedAt": "2017-07-29T12:00:04Z"
},
"@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