diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot index 9bbe02f2505524f4d5349ffbcedf98598beb343b..1fedda07d54bbb84f9f16b1848f7c8018036a7a2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: @@ -21,10 +22,11 @@ Retrieve the temporal evolution of an entity Check Response Status Code Set To 200 Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} - #TODO Call Delete Temporal Representation Of Entity - *** Keywords *** Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Suite Variable ${temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot index 8031817d1eff275ad6db468fd5a08e627af0d7a9..54f83eb66c26347f1c2b66dad32a65f2e4481c82 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: @@ -21,10 +22,11 @@ Retrieve the temporal evolution of an entity using a context Check Response Status Code Set To 200 Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} - #TODO Call Delete Temporal Representation Of Entity - *** Keywords *** Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Suite Variable ${temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot index 47e1f163ca8eced7c66bfde67e1d35c9950194f5..b2b628551f6d506d23a785685fb449b4d2ee954a 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: @@ -22,10 +23,11 @@ Retrieve the temporal evolution of certain attributes of an entity Check Response Status Code Set To 200 Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} - #TODO Call Delete Temporal Representation Of Entity - *** Keywords *** Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Suite Variable ${temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot index 5640f0720877e77ee16a6277680ab3e2b1cf902a..b56fa2891e0e19539d18e34c179860f1176c4df4 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot @@ -5,32 +5,33 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities Test Template Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: ${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld -*** Test Cases *** TIMEREL TIME ENDTIME VEHICLE_EXPECTATION_FILE +*** Test Cases *** TIMEREL TIMEAT ENDTIMEAT VEHICLE_EXPECTATION_FILE After after 2018-08-01T13:03:00Z ${EMPTY} vehicle-temporal-representation-020-04-01-expectation.jsonld Before before 2018-08-01T12:05:00Z ${EMPTY} vehicle-temporal-representation-020-04-02-expectation.jsonld Between between 2018-08-01T12:00:00Z 2018-08-01T13:00:00Z vehicle-temporal-representation-020-04-03-expectation.jsonld *** Keywords *** Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query - [Arguments] ${timerel} ${time} ${endTime} ${vehicle_expectation_file} + [Arguments] ${timerel} ${timeAt} ${endTimeAt} ${vehicle_expectation_file} [Documentation] Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query [Tags] mandatory - Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} timerel=${timerel} time=${time} endTime=${endTime} context=${ngsild_test_suite_context} + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} timerel=${timerel} timeAt=${timeAt} endTimeAt=${endTimeAt} context=${ngsild_test_suite_context} Check Response Status Code Set To 200 Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} - Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Suite Variable ${temporal_entity_representation_id} -#TODO Call Suite Teardown \ No newline at end of file +Delete Initial Entities + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot new file mode 100644 index 0000000000000000000000000000000000000000..3810a1c2c089e402aaf94e6d6c1a58641f13ca3a --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot @@ -0,0 +1,36 @@ +*** Settings *** +Documentation Check that you can retrieve the temporal evolution of the last N instances of entity attributes +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve the temporal evolution of the last N instances of entity attributes + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= vehicule-temporal-representation-multiple-instances-sample.jsonld + +*** Test Cases *** LASTN VEHICLE_EXPECTATION_FILE +Retrieve Some Instances ${10} vehicle-temporal-representation-020-05-01-expectation.jsonld +Retrieve All Instances ${20} vehicle-temporal-representation-020-05-02-expectation.jsonld + +*** Keywords *** +Retrieve the temporal evolution of the last N instances of entity attributes + [Arguments] ${lastN} ${vehicle_expectation_file} + [Documentation] Check that you can retrieve the temporal evolution of the last N instances of entity attributes + [Tags] mandatory + + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} lastN=${lastN} context=${ngsild_test_suite_context} + + Check Response Status Code Set To 200 + Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} + +Setup Initial Entities + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot new file mode 100644 index 0000000000000000000000000000000000000000..9c59196802b3d33d531889960429c7b7d22d2eaa --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_06.robot @@ -0,0 +1,16 @@ +*** Settings *** +Documentation Check that you cannot retrieve the temporal evolution of an entity with an invalid id (invalid URI) +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Test Case *** +Retrieve the temporal evolution of an entity with an invalid id + [Documentation] Check that you cannot retrieve the temporal evolution of an entity with an invalid id (invalid URI) + [Tags] mandatory + + Retrieve Temporal Representation Of Entity invalidUri + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot new file mode 100644 index 0000000000000000000000000000000000000000..2b5393ff86a1a9f8a3c84ab250d01981a0cdeacf --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_07.robot @@ -0,0 +1,16 @@ +*** Settings *** +Documentation Check that you cannot retrieve the temporal evolution of a non-existing entity +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +*** Test Case *** +Retrieve the temporal evolution of a non-existing entity + [Documentation] Check that you cannot retrieve the temporal evolution of a non-existing entity + [Tags] mandatory + + Retrieve Temporal Representation Of Entity urn:ngsi-ld:Vehicle:unknowEntity + + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot new file mode 100644 index 0000000000000000000000000000000000000000..20892e4a6566e62397c5071b59967b26b8dd1cb7 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot @@ -0,0 +1,33 @@ +*** Settings *** +Documentation Check that you cannot retrieve the temporal evolution of non-existing entity attributes +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld + +*** Test Case *** +Retrieve the temporal evolution of non-existing entity attributes + [Documentation] Check that you cannot retrieve the temporal evolution of non-existing entity attributes + [Tags] mandatory + + @{temporal_attributes_to_be_retrieved}= Create List unknownAttribute + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} attrs=${temporal_attributes_to_be_retrieved} context=${ngsild_test_suite_context} + + Check Response Status Code Set To 404 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_RESOURCE_NOT_FOUND} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + +*** Keywords *** +Setup Initial Entities + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot new file mode 100644 index 0000000000000000000000000000000000000000..c67b3d1cc1cd662963691f654b905d4be9a0c236 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot @@ -0,0 +1,38 @@ +*** Settings *** +Documentation Check that you cannot retrieve the temporal evolution of an entity with an invalid request content +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve the temporal evolution of an entity with an invalid request content + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld + +*** Test Cases *** TIMEREL TIMEAT ENDTIMEAT +After after ${EMPTY} ${EMPTY} +Before before ${EMPTY} ${EMPTY} +Between between 2020-08-01T12:00:00Z ${EMPTY} + +*** Keywords *** +Retrieve the temporal evolution of an entity with an invalid request content + [Arguments] ${timerel} ${timeAt} ${endTimeAt} + [Documentation] Check that you cannot retrieve the temporal evolution of an entity with an invalid request content + [Tags] mandatory + + Retrieve Temporal Representation Of Entity ${temporal_entity_representation_id} timerel=${timerel} timeAt=${timeAt} endTimeAt=${endTimeAt} + + Check Response Status Code Set To 400 + Check Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${ERROR_TYPE_BAD_REQUEST_DATA} + Check Response Body Containing ProblemDetails Element Containing Title Element ${response} + +Setup Initial Entities + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot index 4c8f62bda5ce0e21a3db5f7645c677066f550fa2..0813a45202df8442f24cb4ecb46c93695d3692bb 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot @@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: @@ -22,10 +23,11 @@ Retrieve the temporal evolution of an entity with the simplified temporal repres Check Response Status Code Set To 200 Check Response Body Containing EntityTemporal element ${vehicle_expectation_file} ${temporal_entity_representation_id} - #TODO Call Delete Temporal Representation Of Entity - *** Keywords *** Setup Initial Entities ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} Set Suite Variable ${temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot index 81a0f4ada2cb150f8db0645142a78ca840f12f72..e169e6fa8287186e51a20b8007ea2aaa86f12e77 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/003_03.robot @@ -5,17 +5,18 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Create Batch Entity With Invalid Request Scenarios -*** Test Cases *** FILENAME -InvalidJson batch/invalid-json-sample.jsonld -EmptyJson batch/empty-sample.jsonld +*** Test Cases *** FILENAME PROBLEM_TYPE +InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +EmptyJson batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Create Batch Entity With Invalid Request Scenarios - [Arguments] ${filename} + [Arguments] ${filename} ${problem_type} [Documentation] Check that you cannot create a batch of entities with an invalid request [Tags] mandatory Batch Request Entities From File create filename=${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Detail Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot index d3a32f42161bc0fe36c8123cd1e43ab8708c2bad..1cdbba5b0bf9dda35172567ca175d54157d649d7 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/006_03.robot @@ -5,17 +5,18 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Batch Delete Entity With Invalid Request Scenarios -*** Test Cases *** FILENAME -InvalidJson batch/invalid-json-sample.jsonld -EmptyJson batch/empty-sample.jsonld +*** Test Cases *** FILENAME PROBLEM_TYPE +InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +EmptyJson batch/empty-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Batch Delete Entity With Invalid Request Scenarios - [Arguments] ${filename} + [Arguments] ${filename} ${problem_type} [Documentation] Check that you cannot delete a batch of entities with an invalid request [Tags] mandatory Batch Request Entities From File delete filename=${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Detail Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot index f9a32ae5f4bb8554efc597462c881177682df2b6..a3195d45b8234358cb4ebaf2a2c743bcc80060ff 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot @@ -5,17 +5,18 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Batch Update Entity With Invalid Request Scenarios -*** Test Cases *** FILENAME -InvalidJson batch/invalid-json-sample.jsonld -InvalidJsonLd batch/invalid-json-ld-sample.jsonld +*** Test Cases *** FILENAME PROBLEM_TYPE +InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +InvalidJsonLd batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Batch Update Entity With Invalid Request Scenarios - [Arguments] ${filename} + [Arguments] ${filename} ${problem_type} [Documentation] Check that you cannot update a batch of entities with an invalid request [Tags] mandatory Batch Request Entities From File update filename=${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Detail Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot index d3a02b9c227d826bccc424ffca504739e6f77cbe..8bf80f0f60621843f57d5054f726761fbacaaee7 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot @@ -5,17 +5,18 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Test Template Batch Upsert Entity With Invalid Request Scenarios -*** Test Cases *** FILENAME -InvalidJson batch/invalid-json-sample.jsonld -InvalidJsonLd batch/invalid-json-ld-sample.jsonld +*** Test Cases *** FILENAME PROBLEM_TYPE +InvalidJson batch/invalid-json-sample.jsonld ${ERROR_TYPE_INVALID_REQUEST} +InvalidJsonLd batch/invalid-json-ld-sample.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** Batch Upsert Entity With Invalid Request Scenarios - [Arguments] ${filename} + [Arguments] ${filename} ${problem_type} [Documentation] Check that you cannot upsert a batch of entities with an invalid request [Tags] mandatory Batch Request Entities From File upsert filename=${filename} Check RL Response Status Code Set To 400 - Check RL Response Body Containing ProblemDetails Element Containing Detail Element ${response} + Check RL Response Body Containing ProblemDetails Element Containing Type Element set to ${response} ${problem_type} + Check RL Response Body Containing ProblemDetails Element Containing Title Element ${response} diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..34e35ca1aa402eed5754108b4666b6f7bb257731 --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld @@ -0,0 +1,112 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":76, + "observedAt":"2018-08-01T16:05:00Z" + }, + { + "type":"Property", + "value":70, + "observedAt":"2018-08-01T17:07:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2018-08-01T18:03:00Z" + }, + { + "type":"Property", + "value":48, + "observedAt":"2018-08-01T19:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2018-08-01T19:07:00Z" + }, + { + "type":"Property", + "value":35, + "observedAt":"2018-08-01T20:05:00Z" + }, + { + "type":"Property", + "value":31, + "observedAt":"2018-08-01T20:07:00Z" + }, + { + "type":"Property", + "value":28, + "observedAt":"2018-08-01T21:03:00Z" + }, + { + "type":"Property", + "value":24, + "observedAt":"2018-08-01T21:05:00Z" + }, + { + "type":"Property", + "value":19, + "observedAt":"2018-08-01T22:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":50, + "observedAt":"2018-08-01T12:15:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2018-08-01T12:17:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2018-08-01T12:19:00Z" + }, + { + "type":"Property", + "value":60, + "observedAt":"2018-08-01T12:21:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T12:23:00Z" + }, + { + "type":"Property", + "value":85, + "observedAt":"2018-08-01T12:25:00Z" + }, + { + "type":"Property", + "value":105, + "observedAt":"2018-08-01T12:27:00Z" + }, + { + "type":"Property", + "value":120, + "observedAt":"2018-08-01T12:29:00Z" + }, + { + "type":"Property", + "value":125, + "observedAt":"2018-08-01T12:31:00Z" + }, + { + "type":"Property", + "value":130, + "observedAt":"2018-08-01T12:35:00Z" + } + ] +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..6399ccd09bc64eaec07e21b230fc277d70c3965c --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld @@ -0,0 +1,177 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2018-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2018-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2018-08-01T14:07:00Z" + }, + { + "type":"Property", + "value":35, + "observedAt":"2018-08-01T14:20:00Z" + }, + { + "type":"Property", + "value":30, + "observedAt":"2018-08-01T15:05:00Z" + }, + { + "type":"Property", + "value":85, + "observedAt":"2018-08-01T15:07:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T15:20:00Z" + }, + { + "type":"Property", + "value":76, + "observedAt":"2018-08-01T16:05:00Z" + }, + { + "type":"Property", + "value":70, + "observedAt":"2018-08-01T17:07:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2018-08-01T18:03:00Z" + }, + { + "type":"Property", + "value":48, + "observedAt":"2018-08-01T19:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2018-08-01T19:07:00Z" + }, + { + "type":"Property", + "value":35, + "observedAt":"2018-08-01T20:05:00Z" + }, + { + "type":"Property", + "value":31, + "observedAt":"2018-08-01T20:07:00Z" + }, + { + "type":"Property", + "value":28, + "observedAt":"2018-08-01T21:03:00Z" + }, + { + "type":"Property", + "value":24, + "observedAt":"2018-08-01T21:05:00Z" + }, + { + "type":"Property", + "value":19, + "observedAt":"2018-08-01T22:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2018-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2018-08-01T12:07:00Z" + }, + { + "type":"Property", + "value":110, + "observedAt":"2018-08-01T12:09:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2018-08-01T12:11:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T12:13:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2018-08-01T12:15:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2018-08-01T12:17:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2018-08-01T12:19:00Z" + }, + { + "type":"Property", + "value":60, + "observedAt":"2018-08-01T12:21:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T12:23:00Z" + }, + { + "type":"Property", + "value":85, + "observedAt":"2018-08-01T12:25:00Z" + }, + { + "type":"Property", + "value":105, + "observedAt":"2018-08-01T12:27:00Z" + }, + { + "type":"Property", + "value":120, + "observedAt":"2018-08-01T12:29:00Z" + }, + { + "type":"Property", + "value":125, + "observedAt":"2018-08-01T12:31:00Z" + }, + { + "type":"Property", + "value":130, + "observedAt":"2018-08-01T12:35:00Z" + } + ] +} \ No newline at end of file diff --git a/data/temporalEntities/vehicule-temporal-representation-multiple-instances-sample.jsonld b/data/temporalEntities/vehicule-temporal-representation-multiple-instances-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..605dd0e00592b6e283f7c68408946e2669a4bdd6 --- /dev/null +++ b/data/temporalEntities/vehicule-temporal-representation-multiple-instances-sample.jsonld @@ -0,0 +1,183 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"Volvo" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2018-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2018-08-01T12:07:00Z" + }, + { + "type":"Property", + "value":110, + "observedAt":"2018-08-01T12:09:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2018-08-01T12:11:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T12:13:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2018-08-01T12:15:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2018-08-01T12:17:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2018-08-01T12:19:00Z" + }, + { + "type":"Property", + "value":60, + "observedAt":"2018-08-01T12:21:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T12:23:00Z" + }, + { + "type":"Property", + "value":85, + "observedAt":"2018-08-01T12:25:00Z" + }, + { + "type":"Property", + "value":105, + "observedAt":"2018-08-01T12:27:00Z" + }, + { + "type":"Property", + "value":120, + "observedAt":"2018-08-01T12:29:00Z" + }, + { + "type":"Property", + "value":125, + "observedAt":"2018-08-01T12:31:00Z" + }, + { + "type":"Property", + "value":130, + "observedAt":"2018-08-01T12:35:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2018-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2018-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2018-08-01T14:07:00Z" + }, + { + "type":"Property", + "value":35, + "observedAt":"2018-08-01T14:20:00Z" + }, + { + "type":"Property", + "value":30, + "observedAt":"2018-08-01T15:05:00Z" + }, + { + "type":"Property", + "value":85, + "observedAt":"2018-08-01T15:07:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2018-08-01T15:20:00Z" + }, + { + "type":"Property", + "value":76, + "observedAt":"2018-08-01T16:05:00Z" + }, + { + "type":"Property", + "value":70, + "observedAt":"2018-08-01T17:07:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2018-08-01T18:03:00Z" + }, + { + "type":"Property", + "value":48, + "observedAt":"2018-08-01T19:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2018-08-01T19:07:00Z" + }, + { + "type":"Property", + "value":35, + "observedAt":"2018-08-01T20:05:00Z" + }, + { + "type":"Property", + "value":31, + "observedAt":"2018-08-01T20:07:00Z" + }, + { + "type":"Property", + "value":28, + "observedAt":"2018-08-01T21:03:00Z" + }, + { + "type":"Property", + "value":24, + "observedAt":"2018-08-01T21:05:00Z" + }, + { + "type":"Property", + "value":19, + "observedAt":"2018-08-01T22:07:00Z" + } + ], + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 946c63e44f27dd7d73531cf3f932f06acf86558d..1373360092e8964e358d75f12dac23b398e7b22b 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -19,6 +19,8 @@ ${CONTENT_TYPE_JSON} application/json ${CONTENT_TYPE_LD_JSON} application/ld+json ${ERROR_TYPE_BAD_REQUEST_DATA} https://uri.etsi.org/ngsi-ld/errors/BadRequestData +${ERROR_TYPE_INVALID_REQUEST} https://uri.etsi.org/ngsi-ld/errors/InvalidRequest +${ERROR_TYPE_RESOURCE_NOT_FOUND} https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound ${response} @@ -127,7 +129,7 @@ Create Temporal Representation Of Entity Output response Retrieve Temporal Representation Of Entity - [Arguments] ${temporal_entity_representation_id} ${attrs}=${EMPTY} ${options}=${EMPTY} ${context}=${EMPTY} ${timerel}=${EMPTY} ${time}=${EMPTY} ${endTime}=${EMPTY} + [Arguments] ${temporal_entity_representation_id} ${attrs}=${EMPTY} ${options}=${EMPTY} ${context}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${endTimeAt}=${EMPTY} ${lastN}=${EMPTY} ${attrs_length} = Get Length ${attrs} ${options_length} = Get Length ${options} &{headers}= Create Dictionary @@ -137,10 +139,18 @@ Retrieve Temporal Representation Of Entity Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} Run Keyword If ${options_length}>0 Set To Dictionary ${params} options=${options} Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} - Run Keyword If '${time}'!='' Set To Dictionary ${params} time=${time} - Run Keyword If '${endTime}'!='' Set To Dictionary ${params} endTime=${endTime} + Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} + Run Keyword If '${endTimeAt}'!='' Set To Dictionary ${params} endTimeAt=${endTimeAt} + Run Keyword If '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} headers=${headers} query=${params} Output request Output response Set Test Variable ${response} + +Delete Temporal Representation Of Entity + [Arguments] ${temporal_entity_representation_id} + + ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + Output request + Output response diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 6ed5b6776d0d2f018e65be81a3219f10b0273fbc..0b31186ac60e426afad6d4e6f4342992c620fa76 100644 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -46,17 +46,22 @@ Check Response Body Containing EntityTemporal element Should Be True ${comparaison_result} msg=EntityTemporal Comparaison Failed Check Response Body Containing ProblemDetails Element Containing Type Element set to - [Arguments] ${response_body} ${type} + [Arguments] ${response} ${type} Should Be Equal ${response['body']['type']} ${type} Check Response Body Containing ProblemDetails Element Containing Title Element - [Arguments] ${response_body} + [Arguments] ${response} Should Not Be Empty ${response['body']['title']} -Check RL Response Body Containing ProblemDetails Element Containing Detail Element - [Arguments] ${response_body} - ${json_response_body}= To Json ${response_body.content} - Should Not Be Empty ${json_response_body['detail']} +Check RL Response Body Containing ProblemDetails Element Containing Type Element set to + [Arguments] ${response} ${type} + ${json_response_body}= To Json ${response.content} + Should Be Equal ${json_response_body['type']} ${type} + +Check RL Response Body Containing ProblemDetails Element Containing Title Element + [Arguments] ${response} + ${json_response_body}= To Json ${response.content} + Should Not Be Empty ${json_response_body['title']} Assert response status code [Arguments] ${code}