Commit b25c5853 authored by Benoit Orihuela's avatar Benoit Orihuela
Browse files

fix(temporal): attributes not matching temporal queries should not be part of the response (#31)

parent 64b17426
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
*** Settings ***
Documentation       Check that one can query the temporal evolution of entities

Resource            ${EXECDIR}/resources/ApiUtils/Common.resource
Resource            ${EXECDIR}/resources/ApiUtils/TemporalContextInformationConsumption.resource
Resource            ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProvision.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
@@ -12,8 +13,6 @@ Test Template Query the temporal evolution of entities


*** Variables ***
${vehicle_id_prefix}=               urn:ngsi-ld:Vehicle:
${bus_id_prefix}=                   urn:ngsi-ld:Bus:
${first_vehicle_payload_file}=      2020-08-vehicle-temporal-representation.jsonld
${second_vehicle_payload_file}=     2020-09-vehicle-temporal-representation.jsonld
${bus_payload_file}=                2020-08-bus-temporal-representation.jsonld
@@ -44,29 +43,25 @@ Query the temporal evolution of entities
    ...    endTimeAt=${endTimeAt}
    ...    context=${ngsild_test_suite_context}

    @{temporal_entities_representation_ids}=    Create List
    ...    ${first_temporal_entity_representation_id}
    ...    ${second_temporal_entity_representation_id}
    Check Response Status Code    200    ${response.status_code}
    Check Response Body Containing List Containing EntityTemporal elements
    ...    ${expectation_file}
    ...    ${temporal_entities_representation_ids}
    ...    ${response.json()}

Setup Initial Entities
    ${first_temporal_entity_representation_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    ${first_temporal_entity_representation_id}=    Catenate    ${VEHICLE_ID_PREFIX}021-01-A
    ${create_response1}=    Create Temporal Representation Of Entity
    ...    ${first_vehicle_payload_file}
    ...    ${first_temporal_entity_representation_id}
    Check Response Status Code    201    ${create_response1.status_code}
    Set Test Variable    ${first_temporal_entity_representation_id}
    ${second_temporal_entity_representation_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    ${second_temporal_entity_representation_id}=    Catenate    ${VEHICLE_ID_PREFIX}021-01-B
    ${create_response2}=    Create Temporal Representation Of Entity
    ...    ${second_vehicle_payload_file}
    ...    ${second_temporal_entity_representation_id}
    Check Response Status Code    201    ${create_response2.status_code}
    Set Test Variable    ${second_temporal_entity_representation_id}
    ${third_temporal_entity_representation_id}=    Generate Random Entity Id    ${bus_id_prefix}
    ${third_temporal_entity_representation_id}=    Catenate    ${BUS_ID_PREFIX}021-13-A
    ${create_response3}=    Create Temporal Representation Of Entity
    ...    ${bus_payload_file}
    ...    ${third_temporal_entity_representation_id}
+3 −7
Original line number Diff line number Diff line
*** Settings ***
Documentation       Check that one can query the temporal evolution of certain attributes of entities

Resource            ${EXECDIR}/resources/ApiUtils/Common.resource
Resource            ${EXECDIR}/resources/ApiUtils/TemporalContextInformationConsumption.resource
Resource            ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProvision.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
@@ -11,7 +12,6 @@ Suite Teardown Delete Initial Temporal Entities


*** Variables ***
${vehicle_id_prefix}=               urn:ngsi-ld:Vehicle:
${first_vehicle_payload_file}=      2020-08-vehicle-temporal-representation.jsonld
${second_vehicle_payload_file}=     2020-09-vehicle-temporal-representation.jsonld
${expectation_file}=                vehicles-temporal-representation-021-02.jsonld
@@ -31,25 +31,21 @@ ${expectation_file}= vehicles-temporal-representation-021-02.json
    ...    attrs=${temporal_attributes_to_be_retrieved}
    ...    context=${ngsild_test_suite_context}

    @{temporal_entities_representation_ids}=    Create List
    ...    ${first_temporal_entity_representation_id}
    ...    ${second_temporal_entity_representation_id}
    Check Response Status Code    200    ${response.status_code}
    Check Response Body Containing List Containing EntityTemporal elements
    ...    ${expectation_file}
    ...    ${temporal_entities_representation_ids}
    ...    ${response.json()}


*** Keywords ***
Setup Initial Temporal Entities
    ${first_temporal_entity_representation_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    ${first_temporal_entity_representation_id}=    Catenate    ${VEHICLE_ID_PREFIX}021-02-A
    ${create_response1}=    Create Temporal Representation Of Entity
    ...    ${first_vehicle_payload_file}
    ...    ${first_temporal_entity_representation_id}
    Check Response Status Code    201    ${create_response1.status_code}
    Set Suite Variable    ${first_temporal_entity_representation_id}
    ${second_temporal_entity_representation_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    ${second_temporal_entity_representation_id}=    Catenate    ${VEHICLE_ID_PREFIX}021-02-B
    ${create_response2}=    Create Temporal Representation Of Entity
    ...    ${second_vehicle_payload_file}
    ...    ${second_temporal_entity_representation_id}
+3 −7
Original line number Diff line number Diff line
*** Settings ***
Documentation       Check that one can query the temporal evolution of the last N instances of entities attributes

Resource            ${EXECDIR}/resources/ApiUtils/Common.resource
Resource            ${EXECDIR}/resources/ApiUtils/TemporalContextInformationConsumption.resource
Resource            ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProvision.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
@@ -11,7 +12,6 @@ Suite Teardown Delete Initial Temporal Entities


*** Variables ***
${vehicle_id_prefix}=               urn:ngsi-ld:Vehicle:
${first_vehicle_payload_file}=      2020-08-vehicle-temporal-representation-multiple-instances.jsonld
${second_vehicle_payload_file}=     2020-09-vehicle-temporal-representation.jsonld
${expectation_file}=                vehicles-temporal-representation-021-03.jsonld
@@ -30,25 +30,21 @@ ${expectation_file}= vehicles-temporal-representation-021-03.json
    ...    lastN=${4}
    ...    context=${ngsild_test_suite_context}

    @{temporal_entities_representation_ids}=    Create List
    ...    ${first_temporal_entity_representation_id}
    ...    ${second_temporal_entity_representation_id}
    Check Response Status Code    200    ${response.status_code}
    Check Response Body Containing List Containing EntityTemporal elements
    ...    ${expectation_file}
    ...    ${temporal_entities_representation_ids}
    ...    ${response.json()}


*** Keywords ***
Setup Initial Temporal Entities
    ${first_temporal_entity_representation_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    ${first_temporal_entity_representation_id}=    Catenate    ${VEHICLE_ID_PREFIX}021-03-A
    ${create_response1}=    Create Temporal Representation Of Entity
    ...    ${first_vehicle_payload_file}
    ...    ${first_temporal_entity_representation_id}
    Check Response Status Code    201    ${create_response1.status_code}
    Set Suite Variable    ${first_temporal_entity_representation_id}
    ${second_temporal_entity_representation_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    ${second_temporal_entity_representation_id}=    Catenate    ${VEHICLE_ID_PREFIX}021-03-B
    ${create_response2}=    Create Temporal Representation Of Entity
    ...    ${second_vehicle_payload_file}
    ...    ${second_temporal_entity_representation_id}
+3 −7
Original line number Diff line number Diff line
*** Settings ***
Documentation       Check that one can query the temporal evolution of entities using a context

Resource            ${EXECDIR}/resources/ApiUtils/Common.resource
Resource            ${EXECDIR}/resources/ApiUtils/TemporalContextInformationConsumption.resource
Resource            ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProvision.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
@@ -11,7 +12,6 @@ Suite Teardown Delete Initial Temporal Entities


*** Variables ***
${vehicle_id_prefix}=               urn:ngsi-ld:Vehicle:
${first_vehicle_payload_file}=      2020-08-vehicle-temporal-representation.jsonld
${second_vehicle_payload_file}=     2020-09-vehicle-temporal-representation.jsonld
${expectation_file}=                vehicles-temporal-representation-021-04.jsonld
@@ -29,25 +29,21 @@ ${expectation_file}= vehicles-temporal-representation-021-04.json
    ...    timeAt=2020-07-01T12:05:00Z
    ...    context=${ngsild_test_suite_context}

    @{temporal_entities_representation_ids}=    Create List
    ...    ${first_temporal_entity_representation_id}
    ...    ${second_temporal_entity_representation_id}
    Check Response Status Code    200    ${response.status_code}
    Check Response Body Containing List Containing EntityTemporal elements
    ...    ${expectation_file}
    ...    ${temporal_entities_representation_ids}
    ...    ${response.json()}


*** Keywords ***
Setup Initial Temporal Entities
    ${first_temporal_entity_representation_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    ${first_temporal_entity_representation_id}=    Catenate    ${VEHICLE_ID_PREFIX}021-04-A
    ${create_response1}=    Create Temporal Representation Of Entity
    ...    ${first_vehicle_payload_file}
    ...    ${first_temporal_entity_representation_id}
    Check Response Status Code    201    ${create_response1.status_code}
    Set Suite Variable    ${first_temporal_entity_representation_id}
    ${second_temporal_entity_representation_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    ${second_temporal_entity_representation_id}=    Catenate    ${VEHICLE_ID_PREFIX}021-04-B
    ${create_response2}=    Create Temporal Representation Of Entity
    ...    ${second_vehicle_payload_file}
    ...    ${second_temporal_entity_representation_id}
+3 −7
Original line number Diff line number Diff line
*** Settings ***
Documentation       Check that one can query the temporal evolution of entities matching the given type(s)

Resource            ${EXECDIR}/resources/ApiUtils/Common.resource
Resource            ${EXECDIR}/resources/ApiUtils/TemporalContextInformationConsumption.resource
Resource            ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProvision.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
@@ -11,8 +12,6 @@ Suite Teardown Delete Initial Temporal Entities


*** Variables ***
${vehicle_id_prefix}=       urn:ngsi-ld:Vehicle:
${bus_id_prefix}=           urn:ngsi-ld:Bus:
${vehicle_payload_file}=    2020-08-vehicle-temporal-representation.jsonld
${bus_payload_file}=        2020-08-bus-temporal-representation.jsonld
${expectation_file}=        vehicles-temporal-representation-021-05.jsonld
@@ -30,24 +29,21 @@ ${expectation_file}= vehicles-temporal-representation-021-05.jsonld
    ...    timeAt=2020-07-01T12:05:00Z
    ...    context=${ngsild_test_suite_context}

    @{temporal_entities_representation_ids}=    Create List    ${second_temporal_entity_representation_id}
    Check Response Status Code    200    ${response.status_code}
    Check Response Body Containing List Containing EntityTemporal elements
    ...    ${expectation_file}
    ...    ${temporal_entities_representation_ids}
    ...    ${response.json()}


*** Keywords ***
Setup Initial Temporal Entities
    ${first_temporal_entity_representation_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    ${second_temporal_entity_representation_id}=    Generate Random Entity Id    ${bus_id_prefix}
    ${first_temporal_entity_representation_id}=    Catenate    ${VEHICLE_ID_PREFIX}021-05-A
    ${create_response1}=    Create Temporal Representation Of Entity
    ...    ${vehicle_payload_file}
    ...    ${first_temporal_entity_representation_id}
    Check Response Status Code    201    ${create_response1.status_code}
    Set Suite Variable    ${first_temporal_entity_representation_id}
    ${second_temporal_entity_representation_id}=    Generate Random Entity Id    ${bus_id_prefix}
    ${second_temporal_entity_representation_id}=    Catenate    ${BUS_ID_PREFIX}021-05-A
    ${create_response2}=    Create Temporal Representation Of Entity
    ...    ${bus_payload_file}
    ...    ${second_temporal_entity_representation_id}
Loading