diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot index 171fb2a4befbb2bbdf219738dd0e406a16365d82..8bcfc2712125b5c27917320901fec215a3066fdf 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot @@ -14,23 +14,25 @@ Test Template Delete Attributes *** Variables *** ${status_code}= 204 -${filename}= vehicle-two-datasetid-attributes.jsonld +${filename}= vehicle-speed-only-multi-instances.jsonld ${attribute_id}= speed *** Test Cases *** DATASETID DELETEALL EXPECTATION_FILENAME 013_01_01 Delete An Attribute With The Default Instance + [Tags] ea-delete 5_6_5 ${EMPTY} false vehicle-delete-default-speed.jsonld -013_01_02 Delete An Attribute With The datasetId - urn:ngsi-ld:Property:gpsBxyz123-speed false vehicle-delete-datasetid-speed.jsonld -013_01_03 Delete All Target Attribute Instances +013_01_02 Delete An Attribute With A Specific datasetId + [Tags] ea-delete 5_6_5 + urn:ngsi-ld:Dataset:gps false vehicle-delete-datasetid-speed.jsonld +013_01_03 Delete All Attribute Instances + [Tags] ea-delete 5_6_5 ${EMPTY} true vehicle-delete-deleteall-speed.jsonld *** Keywords *** Delete Attributes [Documentation] Check that one can delete an attribute from an entity - [Tags] ea-delete 5_6_5 [Arguments] ${datasetId} ${deleteAll} ${expectation_filename} ${response}= Delete Entity Attributes ... entityId=${entity_id} diff --git a/data/entities/expectations/vehicle-delete-datasetid-speed.jsonld b/data/entities/expectations/vehicle-delete-datasetid-speed.jsonld index a7238cbb9bd3e336116a5c8fb3ace170f2d08896..f3efc2de0d9ec44471c6b035371dd602d6489f26 100644 --- a/data/entities/expectations/vehicle-delete-datasetid-speed.jsonld +++ b/data/entities/expectations/vehicle-delete-datasetid-speed.jsonld @@ -1,29 +1,24 @@ { - "id": "urn:ngsi-ld:Vehicle:randomUUID", - "type": "Vehicle", - "brandName": { + "id": "urn:ngsi-ld:Vehicle:4215907728743778", + "type": "Vehicle", + "speed": [ + { + "type": "Property", + "value": 55, + "source": { "type": "Property", - "value": "Mercedes" + "value": "Feeling" + } }, - "isParked": { - "type": "Relationship", - "object": "urn:ngsi-ld:OffStreetParking:Downtown1", - "observedAt": "2017-07-29T12:00:04Z", - "providedBy": { - "type": "Relationship", - "object": "urn:ngsi-ld:Person:Bob" - }, - "datasetId": "urn:ngsi-ld:Relationship:parked12345" - }, - "speed": { + { + "type": "Property", + "value": 57, + "datasetId": "urn:ngsi-ld:Dataset:speedometer", + "source": { "type": "Property", - "value": 55, - "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" - ] + "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 diff --git a/data/entities/expectations/vehicle-delete-default-speed.jsonld b/data/entities/expectations/vehicle-delete-default-speed.jsonld index 4df3a8c4ea5d7c083eddb8b4dad1f340880c5fca..beff49f76c7269df25bb1de74e67a536f1ac6403 100644 --- a/data/entities/expectations/vehicle-delete-default-speed.jsonld +++ b/data/entities/expectations/vehicle-delete-default-speed.jsonld @@ -1,31 +1,25 @@ { - "id": "urn:ngsi-ld:Vehicle:randomUUID", - "type": "Vehicle", - "brandName": { + "id": "urn:ngsi-ld:Vehicle:2264127260420623", + "type": "Vehicle", + "speed": [ + { + "type": "Property", + "value": 57, + "datasetId": "urn:ngsi-ld:Dataset:speedometer", + "source": { "type": "Property", - "value": "Mercedes" - }, - "isParked": { - "type": "Relationship", - "object": "urn:ngsi-ld:OffStreetParking:Downtown1", - "observedAt": "2017-07-29T12:00:04Z", - "providedBy": { - "type": "Relationship", - "object": "urn:ngsi-ld:Person:Bob" - }, - "datasetId": "urn:ngsi-ld:Relationship:parked12345" + "value": "Speedometer" + } }, - "speed": { + "type": "Property", + "value": 54.5, + "datasetId": "urn:ngsi-ld:Dataset:gps", + "source": { "type": "Property", - "value": 54.5, - "source": { - "type": "Property", - "value": "GPS" - }, - "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" - }, - "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "value": "GPS" + } + } + ], + "@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 diff --git a/data/entities/expectations/vehicle-delete-deleteall-speed.jsonld b/data/entities/expectations/vehicle-delete-deleteall-speed.jsonld index 29744061422af097b19af53ced2c0eacd36ad94f..1f0035741e6d6641e63d77fceea6660e27d05968 100644 --- a/data/entities/expectations/vehicle-delete-deleteall-speed.jsonld +++ b/data/entities/expectations/vehicle-delete-deleteall-speed.jsonld @@ -1,21 +1,5 @@ { - "id": "urn:ngsi-ld:Vehicle:randomUUID", - "type": "Vehicle", - "brandName": { - "type": "Property", - "value": "Mercedes" - }, - "isParked": { - "type": "Relationship", - "object": "urn:ngsi-ld:OffStreetParking:Downtown1", - "observedAt": "2017-07-29T12:00:04Z", - "providedBy": { - "type": "Relationship", - "object": "urn:ngsi-ld:Person:Bob" - }, - "datasetId": "urn:ngsi-ld:Relationship:parked12345" - }, - "@context": [ - "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:Vehicle:0384085170704932", + "type": "Vehicle", + "@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 diff --git a/data/entities/vehicle-speed-only-multi-instances.jsonld b/data/entities/vehicle-speed-only-multi-instances.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..d35ab706fb791f282e6f336896ba2f42b9ce61eb --- /dev/null +++ b/data/entities/vehicle-speed-only-multi-instances.jsonld @@ -0,0 +1,35 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "speed": [ + { + "type": "Property", + "value": 55, + "source": { + "type": "Property", + "value": "Feeling" + } + }, + { + "type": "Property", + "value": 57, + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Dataset:speedometer" + }, + { + "type": "Property", + "value": 54.5, + "source": { + "type": "Property", + "value": "GPS" + }, + "datasetId": "urn:ngsi-ld:Dataset:gps" + } + ], + "@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 diff --git a/doc/files/ContextInformation/Provision/013_01.json b/doc/files/ContextInformation/Provision/013_01.json index 8567f7a512af6a5c77b40eab97ee38095d41b189..27eed43f6f3d2b22287e824d1916e7d9ed9bba98 100644 --- a/doc/files/ContextInformation/Provision/013_01.json +++ b/doc/files/ContextInformation/Provision/013_01.json @@ -1,6 +1,6 @@ { "tp_id": "TP/NGSI-LD/CI/Prov/EA/013_01", - "test_objective": "Check that you can delete an attribute from an entity", + "test_objective": "Check that one can delete an attribute from an entity", "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.5", "config_id": "", "parent_release": "v1.3.1", @@ -10,56 +10,57 @@ "pics_selection": "", "keywords": [ "Delete Attributes", + "Setup Initial Entity", "Delete Initial Entities" ], "teardown": "None", - "initial_condition": "with {\n the SUT containing an initial state\n}", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", "test_cases": [ { "name": "013_01_01 Delete an attribute with the default instance", "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/013_01_01", - "doc": "Check that you can delete an attribute from an entity", + "doc": "Check that one can delete an attribute from an entity", "tags": [ "ea-delete", "5_6_5" ], - "setup": null, + "setup": "Setup Initial Entity", "teardown": "Delete Initial Entities", "template": "Delete Attributes", - "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Delete Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response2.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Entity Attributes: and\n Query Parameter: entityId set to '${entity_id}' and\n Query Parameter: attributeId set to 'speed' and\n Query Parameter: datasetId set to '${datasetId}' and\n Query Parameter: deleteAll set to '${deleteAll}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response2.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Entity Attributes: and\n Query Parameter: entityId set to '${entity_id}' and\n Query Parameter: attributeId set to 'speed' and\n Query Parameter: datasetId set to '${datasetId}' and\n Query Parameter: deleteAll set to '${deleteAll}' and\n Query Parameter: context set to 'https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld'\n}", "http_verb": "DELETE", "endpoint": "entities/{entityId}/attrs/{attributeId}?${params_as_string}" }, { - "name": "013_01_02 Delete an attribute with the datasetId", + "name": "013_01_02 Delete an attribute with a specific datasetId", "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/013_01_02", - "doc": "Check that you can delete an attribute from an entity", + "doc": "Check that one can delete an attribute from an entity", "tags": [ "ea-delete", "5_6_5" ], - "setup": null, + "setup": "Setup Initial Entity", "teardown": "Delete Initial Entities", "template": "Delete Attributes", - "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Delete Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response2.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Entity Attributes: and\n Query Parameter: entityId set to '${entity_id}' and\n Query Parameter: attributeId set to 'speed' and\n Query Parameter: datasetId set to '${datasetId}' and\n Query Parameter: deleteAll set to '${deleteAll}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response2.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Entity Attributes: and\n Query Parameter: entityId set to '${entity_id}' and\n Query Parameter: attributeId set to 'speed' and\n Query Parameter: datasetId set to '${datasetId}' and\n Query Parameter: deleteAll set to '${deleteAll}' and\n Query Parameter: context set to 'https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld'\n}", "http_verb": "DELETE", "endpoint": "entities/{entityId}/attrs/{attributeId}?${params_as_string}" }, { - "name": "013_01_03 Delete all target attribute instances", + "name": "013_01_03 Delete all attribute instances", "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/013_01_03", - "doc": "Check that you can delete an attribute from an entity", + "doc": "Check that one can delete an attribute from an entity", "tags": [ "ea-delete", "5_6_5" ], - "setup": null, + "setup": "Setup Initial Entity", "teardown": "Delete Initial Entities", "template": "Delete Attributes", - "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Delete Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response2.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Entity Attributes: and\n Query Parameter: entityId set to '${entity_id}' and\n Query Parameter: attributeId set to 'speed' and\n Query Parameter: datasetId set to '${datasetId}' and\n Query Parameter: deleteAll set to '${deleteAll}' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' and\n Query Parameter: 'response_body' set to 'response2.json()' and\n Query Parameter: 'ignored_keys' set to 'ignored_attributes'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}?${params_as_string}'\n method set to 'DELETE'\n Delete Entity Attributes: and\n Query Parameter: entityId set to '${entity_id}' and\n Query Parameter: attributeId set to 'speed' and\n Query Parameter: datasetId set to '${datasetId}' and\n Query Parameter: deleteAll set to '${deleteAll}' and\n Query Parameter: context set to 'https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld'\n}", "http_verb": "DELETE", "endpoint": "entities/{entityId}/attrs/{attributeId}?${params_as_string}" }