Commit 86f42432 authored by thomas Bousselin's avatar thomas Bousselin
Browse files

Merge branch 'feature/etsi-aggregation-for-temporal-retrieve-entities' into 'develop'

feat: add TCs for aggregation for temporal retrieve entities

See merge request !161
parents dda7a266 31410179
Loading
Loading
Loading
Loading
+67 −0
Original line number Diff line number Diff line
*** Settings ***
Documentation       Check that one can retrieve the temporal evolution of entities with the aggregated temporal representation

Resource            ${EXECDIR}/resources/ApiUtils/TemporalContextInformationConsumption.resource
Resource            ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProvision.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 entities with the aggregated temporal representation


*** Variables ***
${vehicle_id_prefix}=               urn:ngsi-ld:Vehicle:
${first_vehicle_payload_file}=      2020-08-vehicle-temporal-representation.jsonld
${second_vehicle_payload_file}=     2020-08-vehicle-temporal-representation.jsonld


*** Test Cases ***    AGGRMETHODS    AGGRPERIODDURATION    ATTRS    VEHICLE_EXPECTATION_FILE
021_17_01 One aggregate method aggregated by one hour duration
    [Tags]    te-retrieve    5_7_3    4_5_19    since_v1.4.1
    avg    PT1H    ${EMPTY}    vehicle-temporal-representation-aggregated-avg-PT1H.json
021_17_02 One aggregate method aggregated by one hour duration asking for one attribute
    [Tags]    te-retrieve    5_7_3    4_5_19    since_v1.4.1
    avg    PT1H    fuelLevel    vehicle-temporal-representation-aggregated-avg-PT1H-fuelLevel.json
021_17_03 Multiple aggregate methods aggregated by one hour duration
    [Tags]    te-retrieve    5_7_3    4_5_19    since_v1.4.1
    avg,max    PT1H    ${EMPTY}    vehicle-temporal-representation-aggregated-avg-max-PT1H.json
021_17_04 Multiple aggregate methods aggregated by one day duration
    [Tags]    te-retrieve    5_7_3    4_5_19    since_v1.4.1
    min,max    P1D    ${EMPTY}    vehicle-temporal-representation-aggregated-min-max-P1D.json


*** Keywords ***
Retrieve the temporal evolution of entities with the aggregated temporal representation
    [Documentation]    Check that one can retrieve the temporal evolution of entities with the aggregated temporal representation
    [Arguments]    ${aggr_methods}    ${aggr_period_duration}    ${attrs}    ${vehicle_expectation_file}
    @{options}=    Create List    aggregatedValues
    @{types}=    Create List    Vehicle

    ${response}=    Query Temporal Representation Of Entities
    ...    entity_types=${types}
    ...    attrs=${attrs}
    ...    options=${options}
    ...    aggrMethods=${aggr_methods}
    ...    aggrPeriodDuration=${aggr_period_duration}
    ...    context=${ngsild_test_suite_context}
    ...    timerel=after
    ...    timeAt=2020-01-01T12:03:00Z
    Check Response Status Code    200    ${response.status_code}

    Check Response Body Containing EntityTemporal element
    ...    ${vehicle_expectation_file}
    ...    ${first_temporal_entity_representation_id}
    ...    ${response.json()[0]}

Setup Initial Entities
    ${first_temporal_entity_representation_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    ${response}=    Create Temporal Representation Of Entity
    ...    ${first_vehicle_payload_file}
    ...    ${first_temporal_entity_representation_id}
    Check Response Status Code    201    ${response.status_code}
    Set Suite Variable    ${first_temporal_entity_representation_id}

Delete Initial Entities
    Delete Temporal Representation Of Entity    ${first_temporal_entity_representation_id}
+7 −7
Original line number Diff line number Diff line
@@ -19,29 +19,29 @@ ${vehicle_payload_file}= 2020-08-vehicle-temporal-representation.jsonld
*** Test Cases ***    AGGRMETHODS    AGGRPERIODDURATION    ATTRS    VEHICLE_EXPECTATION_FILE
020_11_01 One aggregate method aggregated by one hour duration
    [Tags]    te-retrieve    5_7_3    4_5_19    since_v1.4.1
    avg    PT1H    ${EMPTY}    vehicle-temporal-representation-020-11-01.json
    avg    PT1H    ${EMPTY}    vehicle-temporal-representation-aggregated-avg-PT1H.json
020_11_02 One aggregate method aggregated by one hour duration asking for one attribute
    [Tags]    te-retrieve    5_7_3    4_5_19    since_v1.4.1
    avg    PT1H    fuelLevel    vehicle-temporal-representation-020-11-02.json
    avg    PT1H    fuelLevel    vehicle-temporal-representation-aggregated-avg-PT1H-fuelLevel.json
020_11_03 Multiple aggregate methods aggregated by one hour duration
    [Tags]    te-retrieve    5_7_3    4_5_19    since_v1.4.1
    avg,max    PT1H    ${EMPTY}    vehicle-temporal-representation-020-11-03.json
    avg,max    PT1H    ${EMPTY}    vehicle-temporal-representation-aggregated-avg-max-PT1H.json
020_11_04 Multiple aggregate methods aggregated by one day duration
    [Tags]    te-retrieve    5_7_3    4_5_19    since_v1.4.1
    min,max    P1D    ${EMPTY}    vehicle-temporal-representation-020-11-04.json
    min,max    P1D    ${EMPTY}    vehicle-temporal-representation-aggregated-min-max-P1D.json


*** Keywords ***
Retrieve the temporal evolution of an entity with the aggregated temporal representation
    [Documentation]    Check that one can retrieve the temporal evolution of an entity with the aggregated temporal representation
    [Arguments]    ${aggrmethods}    ${aggrperiodduration}    ${attrs}    ${vehicle_expectation_file}
    [Arguments]    ${aggr_methods}    ${aggr_period_duration}    ${attrs}    ${vehicle_expectation_file}
    @{options}=    Create List    aggregatedValues
    ${response}=    Retrieve Temporal Representation Of Entity
    ...    temporal_entity_representation_id=${temporal_entity_representation_id}
    ...    attrs=${attrs}
    ...    options=${options}
    ...    aggrMethods=${aggrmethods}
    ...    aggrPeriodDuration=${aggrperiodduration}
    ...    aggrMethods=${aggr_methods}
    ...    aggrPeriodDuration=${aggr_period_duration}
    ...    context=${ngsild_test_suite_context}
    Check Response Status Code    200    ${response.status_code}
    Check Response Body Containing EntityTemporal element
+0 −0

File moved.

+0 −0

File moved.

+0 −0

File moved.

Loading