diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_02.robot index f33c756a625186894260127e240d39ea01110998..6ee800390f0e1cc22374caa4f84052f0688771d2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableAttributeInformation/027_02.robot @@ -8,6 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entity Suite Teardown Delete Initial Entity +Test Template Retrieve Detailed Representation Of Available Attribute *** Variables *** @@ -16,16 +17,23 @@ ${filename}= building-simple-attributes.json ${expectation_file}= types/expectations/attribute-027-01.json -*** Test Cases *** -027_02_01 Retrieve Detailed Representation Of Available Attribute - [Documentation] Check that one can retrieve a list with a detailed representation of NGSI-LD attributes +*** Test Cases *** ATTR_NAME +027_02_01 WithCompactedAttributeName [Tags] ed-attr 5_7_10 - ${response}= Retrieve Attribute attribute_name=airQualityLevel context=${ngsild_test_suite_context} - Check Response Status Code 200 ${response.status_code} - Check Response Body Containing Attribute element ${expectation_file} ${response.json()} + airQualityLevel +027_02_02 WithExpandedAttributeName + [Tags] ed-attr 5_7_10 + https%3A%2F%2Fngsi-ld-test-suite%2Fcontext%23airQualityLevel *** Keywords *** +Retrieve Detailed Representation Of Available Attribute + [Documentation] Check that one can retrieve a list with a detailed representation of NGSI-LD attributes + [Arguments] ${attributeName} + ${response}= Retrieve Attribute attribute_name=${attributeName} context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing Attribute element ${expectation_file} ${response.json()} + Setup Initial Entity ${entity_id}= Generate Random Entity Id ${building_id_prefix} ${create_response}= Create Entity Selecting Content Type diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_02.robot index 928c52277a26470569799644b8ad682d74267053..1a6ba8fb90efbd58a419a6131a62ecb223d56cd6 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation/024_02.robot @@ -8,6 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities Suite Teardown Delete Initial Entities +Test Template Retrieve Detailed Representation Of Available Entity Type *** Variables *** @@ -16,16 +17,23 @@ ${filename}= building-simple-attributes.json ${expectation_file}= types/expectations/entity-type-info-024-01.json -*** Test Cases *** -024_02_01 Retrieve Detailed Representation Of Available Entity Type - [Documentation] Check that one can retrieve a detailed representation of a specified NGSI-LD entity type +*** Test Cases *** TYPE +024_02_01 WithCompactedType [Tags] ed-type 5_7_7 - ${response}= Retrieve Entity Type type=Building context=${ngsild_test_suite_context} - Check Response Status Code 200 ${response.status_code} - Check Response Body Containing EntityTypeInfo element ${expectation_file} ${response.json()} + Building +024_02_02 WithExpandedType + [Tags] ed-type 5_7_7 + https%3A%2F%2Fngsi-ld-test-suite%2Fcontext%23Building *** Keywords *** +Retrieve Detailed Representation Of Available Entity Type + [Documentation] Check that one can retrieve a detailed representation of a specified NGSI-LD entity type + [Arguments] ${type} + ${response}= Retrieve Entity Type type=${type} context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing EntityTypeInfo element ${expectation_file} ${response.json()} + Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} diff --git a/doc/files/ContextInformation/Consumption/024_02.json b/doc/files/ContextInformation/Consumption/024_02.json index bf7f7032b07663b23d916bafa32737bdf1cc4b2a..2b195c49adc9d2840be350d9d08b55babaf2440c 100644 --- a/doc/files/ContextInformation/Consumption/024_02.json +++ b/doc/files/ContextInformation/Consumption/024_02.json @@ -1,6 +1,6 @@ { "tp_id": "TP/NGSI-LD/CI/Cons/DISC/024_02", - "test_objective": "Check that you can retrieve a detailed representation of a specified NGSI-LD entity type", + "test_objective": "Check that one can retrieve a detailed representation of a specified NGSI-LD entity type", "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.7", "config_id": "", "parent_release": "v1.3.1", @@ -9,6 +9,7 @@ ], "pics_selection": "", "keywords": [ + "Retrieve Detailed Representation Of Available Entity Type", "Setup Initial Entities", "Delete Initial Entities" ], @@ -16,23 +17,41 @@ "initial_condition": "with {\n the SUT containing an initial state\n}", "test_cases": [ { - "name": "024_02_01 Retrieve Detailed Representation Of Available Entity Type", + "name": "024_02_01 WithCompactedType", "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/024_02_01", - "doc": "Check that you can retrieve a detailed representation of a specified NGSI-LD entity type", + "doc": "Check that one can retrieve a detailed representation of a specified NGSI-LD entity type", "tags": [ "5_7_7", "ed-type" ], "setup": null, "teardown": null, - "template": null, + "template": "Retrieve Detailed Representation Of Available Entity Type", "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Entity Type with Response Status Code set to 200 and\n Retrieve Entity Type with Response body containing an Entity Type Info with expectation body set to file 'types/expectations/entity-type-info-024-01.json' and response body to be checked set to '${response.json()}'\n}", "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/types/{type}'\n method set to 'GET'\n Retrieve Entity Type, with type set to 'Building', with Header['Link'] containing 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", "http_verb": "GET", "endpoint": "types/{type}" + }, + { + "name": "024_02_02 WithExpandedType", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/024_02_02", + "doc": "Check that one can retrieve a detailed representation of a specified NGSI-LD entity type", + "tags": [ + "5_7_7", + "ed-type" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Detailed Representation Of Available Entity Type", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Entity Type with Response Status Code set to 200 and\n Retrieve Entity Type with Response body containing an Entity Type Info with expectation body set to file 'types/expectations/entity-type-info-024-01.json' and response body to be checked set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/types/{type}'\n method set to 'GET'\n Retrieve Entity Type, with type set to 'https%3A%2F%2Fngsi-ld-test-suite%2Fcontext%23Building', with Header['Link'] containing 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "types/{type}" } ], - "permutations": [], + "permutations": [ + "when" + ], "robotpath": "ContextInformation/Consumption/Discovery/RetrieveAvailableEntityTypeInformation", "robotfile": "024_02" } \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/027_02.json b/doc/files/ContextInformation/Consumption/027_02.json index e322d548fbbc1b00b9ab41ec3a2f413eebbcbacc..c46fa8947ddab783b728f31f27d5b00964f80605 100644 --- a/doc/files/ContextInformation/Consumption/027_02.json +++ b/doc/files/ContextInformation/Consumption/027_02.json @@ -1,6 +1,6 @@ { "tp_id": "TP/NGSI-LD/CI/Cons/DISC/027_02", - "test_objective": "Check that you can retrieve a list with a detailed representation of NGSI-LD attributes", + "test_objective": "Check that one can retrieve a list with a detailed representation of NGSI-LD attributes", "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.10", "config_id": "", "parent_release": "v1.3.1", @@ -9,6 +9,7 @@ ], "pics_selection": "", "keywords": [ + "Retrieve Detailed Representation Of Available Attribute", "Setup Initial Entity", "Delete Initial Entity" ], @@ -16,18 +17,34 @@ "initial_condition": "with {\n the SUT containing an initial state\n}", "test_cases": [ { - "name": "027_02_01 Retrieve Detailed Representation Of Available Attribute", + "name": "027_02_01 WithCompactedAttributeName", "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/027_02_01", - "doc": "Check that you can retrieve a list with a detailed representation of NGSI-LD attributes", + "doc": "Check that one can retrieve a list with a detailed representation of NGSI-LD attributes", "tags": [ "5_7_10", "ed-attr" ], "setup": null, "teardown": null, - "template": null, + "template": "Retrieve Detailed Representation Of Available Attribute", "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Attribute with Response Status Code set to 200 and\n Retrieve Attribute with Response body containing an array of attributes\n * with the expected payload defined in the file 'types/expectations/attribute-027-01.json'\n * and response body set to '${response.json()}'\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/attributes/{attribute_name}'\n method set to 'GET'\n Retrieve Attribute with attributeName set to 'airQualityLevel'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/attributes/{attribute_name}'\n method set to 'GET'\n Retrieve Attribute with attributeName set to '${attributeName}'\n}", + "http_verb": "GET", + "endpoint": "attributes/{attribute_name}" + }, + { + "name": "027_02_02 WithExpandedAttributeName", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/DISC/027_02_02", + "doc": "Check that one can retrieve a list with a detailed representation of NGSI-LD attributes", + "tags": [ + "5_7_10", + "ed-attr" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Detailed Representation Of Available Attribute", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Attribute with Response Status Code set to 200 and\n Retrieve Attribute with Response body containing an array of attributes\n * with the expected payload defined in the file 'types/expectations/attribute-027-01.json'\n * and response body set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/attributes/{attribute_name}'\n method set to 'GET'\n Retrieve Attribute with attributeName set to '${attributeName}'\n}", "http_verb": "GET", "endpoint": "attributes/{attribute_name}" }