Commit c7d29db7 authored by Benedetta Arena's avatar Benedetta Arena
Browse files

fix: change typos in tests

parent ca2f1fed
Loading
Loading
Loading
Loading
+19 −18
Original line number Diff line number Diff line
@@ -23,29 +23,27 @@ IOP_003_01_01 Query Entities Of Type OffstreetParking Via GET
    ...                Registrations established: Inclusive in A to B. Exclusive in A to C.
    [Tags]    since_v1.6.1    iop    cnf_01    4_3_3    additive-inclusive    proxy-exclusive    4_3_6    5_7_2    6_4_3_1

    #Agent queries all entities with type OffstreetParking in A and checks for a successful response that contains the attributes of both entities in B and C.
    ${response}=    Query Entities    entity_types=OffstreetParking    broker_url=${broker_A_url}
    #Agent queries all entities with type OffStreetParking in A and checks for a successful response that contains the attributes of both entities in B and C.
    ${response}=    Query Entities    entity_types=OffStreetParking    broker_url=${broker_A_url}    context=${ngsild_test_suite_context}
    Check Response Status Code    200    ${response.status_code}
    @{payload}=    Set Variable   ${response.json()}
    Should Contain    ${payload}\[OffstreetParking1]    availableSpotsNumber
    Should Contain    ${payload}\[OffstreetParking1]    totalSpotsNumber
    Should Contain    ${payload}\[OffstreetParking2]    availableSpotsNumber
    Should Contain    ${payload}\[OffstreetParking2]    location

    #Agent queries all entities with type OffstreetParking in B and C
    ${response}=    Query Entities    entity_types=OffstreetParking    broker_url=${broker_B_url}
    Should Contain    ${response.json()}    availableSpotsNumber
    Should Contain    ${response.json()}    totalSpotsNumber
    Should Contain    ${response.json()}    availableSpotsNumber
    Should Contain    ${response.json()}    location

    #Agent queries all entities with type OffStreetParking in B and C
    ${response}=    Query Entities    entity_types=OffStreetParking    broker_url=${broker_B_url}    context=${ngsild_test_suite_context}
    @{first_expected_payload}=    Set Variable    ${response.json()}
    ${entity_ids}=    Create List    ${entity_id}    ${second_entity_id}
    Check Response Body Containing Entities URIS set to    ${entity_ids}    ${response.json()}

    ${response}=    Query Entities    entity_types=OffstreetParking    broker_url=${broker_C_url}
    ${response}=    Query Entities    entity_types=OffStreetParking    broker_url=${broker_C_url}    context=${ngsild_test_suite_context}
    @{second_expected_payload}=    Set Variable    ${response.json()}
    Check Response Body Containing Entities URIS set to    ${entity_id}    ${response.json()}

    #Agent checks that OffstreetParking:1 in A is the same as the one in B and that OffstreetParking:2 in A contains the attributes of both OffstreetParking:2 in B and C.
    Should Be Equal    ${payload}\[OffstreetParking1]    ${first_expected_payload}\[OffstreetParking1]
    Should Contain    ${payload}\[OffstreetParking2]    ${first_expected_payload}\[OffstreetParking2][totalSpotsNumber]
    Should Contain    ${payload}\[OffstreetParking2]    ${second_expected_payload}\[OffstreetParking2][location]
    #Agent checks that OffStreetParking:1 in A is the same as the one in B and that OffStreetParking:2 in A contains the attributes of both OffStreetParking:2 in B and C.
    Should Be Equal    ${response.json()}    ${first_expected_payload}
    Should Contain    ${response.json()}    ${second_expected_payload}

*** Keywords ***
Setup Initial Context Source Registrations
@@ -98,6 +96,9 @@ Setup Initial Context Source Registrations
    Compose IOP Configuration    ${first_configuration}

Delete Entities And Delete Registrations
    @{broker_count}=    Create List    ${broker_A_url}    ${broker_B_url}    ${broker_C_url}
    @{entities_to_delete}=    Create List    ${entity_id}    ${second_entity_id}
    Delete Registrations And Entities    ${broker_count}    ${entities_to_delete}
 No newline at end of file
    Delete Context Source Registration With Return    ${registration_id1}    broker_url=${broker_A_url}
    Delete Context Source Registration With Return    ${registration_id2}    broker_url=${broker_A_url}
    Delete Context Source Registration With Return    ${registration_id3}    broker_url=${broker_A_url}
    Delete Entity    ${entity_id}    broker_url=${broker_B_url}
    Delete Entity    ${second_entity_id}    broker_url=${broker_B_url}
    Delete Entity    ${entity_id}    broker_url=${broker_C_url}
 No newline at end of file
+15 −16
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ Test Teardown Delete Entities and Delete Registrations
*** Variables ***
${first_entity_payload_filename}               interoperability/offstreet-parking1-full.jsonld
${second_entity_payload_filename}              interoperability/offstreet-parking2-full.jsonld
${third_entity_payload_filename}               interoperability/offstreet-parking2-no-location-and-totalspotsnumber.jsonld
${third_entity_payload_filename}               interoperability/offstreet-parking2-no-location.jsonld
${inclusive_registration_payload_file_path}    csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld
${exclusive_registration_payload_file_path}    csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld
${broker_A_url}
@@ -19,33 +19,32 @@ ${broker_C_url}

*** Test Cases ***
IOP_003_01_02 Query Entities Of Type OffstreetParking Via POST
    [Documentation]    Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking:1 and OffStreetParking:2 without location and totalSpotsNumber. C contains OffStreetParking:2.
    [Documentation]    Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking:1 and OffStreetParking:2 without location. C contains OffStreetParking:2.
    ...                Registrations established: Inclusive in A to B. Exclusive in A to C.
    [Tags]    since_v1.6.1    iop    cnf_01    4_3_3    additive-inclusive    proxy-exclusive    4_3_6    5_7_2    6_23_2_1

    #Agent queries all entities with type OffstreetParking in A and checks for a successful response that contains the attributes of both entities in B and C.
    #Agent queries all entities with type OffStreetParking in A and checks for a successful response that contains the attributes of both entities in B and C.
    @{entities}=    Create List    ${entity_id}    ${second_entity_id}
    ${response}=    Query Entities Via POST   entities=${entities}    broker_url=${broker_A_url}
    ${response}=    Query Entities Via POST   entities=${entities}    broker_url=${broker_A_url}    context=${ngsild_test_suite_context}
    Check Response Status Code    200    ${response.status_code}
    @{payload}=    Set Variable   ${response.json()}
    Should Contain    ${payload}\[OffstreetParking1]    availableSpotsNumber
    Should Contain    ${payload}\[OffstreetParking1]    totalSpotsNumber
    Should Contain    ${payload}\[OffstreetParking2]    availableSpotsNumber
    Should Contain    ${payload}\[OffstreetParking2]    location

    #Agent queries all entities with type OffstreetParking in B and C
    ${response}=    Query Entities Via POST   entities=${entities}    broker_url=${broker_B_url}
    Should Contain    ${response.json()}    availableSpotsNumber
    Should Contain    ${response.json()}    totalSpotsNumber
    Should Contain    ${response.json()}    availableSpotsNumber
    Should Contain    ${response.json()}   location

    #Agent queries all entities with type OffStreetParking in B and C
    ${response}=    Query Entities Via POST   entities=${entities}    broker_url=${broker_B_url}    context=${ngsild_test_suite_context}
    @{first_expected_payload}=    Set Variable    ${response.json()}
    Check Response Body Containing Entities URIS set to    ${entities}    ${response.json()}

    ${response}=    Query Entities Via POST   entities=${entity_id}    broker_url=${broker_C_url}
    ${response}=    Query Entities Via POST   entities=${entity_id}    broker_url=${broker_C_url}    context=${ngsild_test_suite_context}
    @{second_expected_payload}=    Set Variable    ${response.json()}
    Check Response Body Containing Entities URIS set to    ${entity_id}    ${response.json()}

    #Agent checks that OffstreetParking:1 in A is the same as the one in B and that OffstreetParking:2 in A contains the attributes of both OffstreetParking:2 in B and C.
    Should Be Equal    ${payload}\[OffstreetParking1]    ${first_expected_payload}\[OffstreetParking1]
    Should Contain    ${payload}\[OffstreetParking2]    ${first_expected_payload}\[OffstreetParking2][totalSpotsNumber]
    Should Contain    ${payload}\[OffstreetParking2]    ${second_expected_payload}\[OffstreetParking2][location]
    Should Be Equal    ${response.json()}    ${first_expected_payload}
    Should Contain    ${response.json()}   ${first_expected_payload}
    Should Contain    ${response.json()}   ${second_expected_payload}

*** Keywords ***
Setup Initial Context Source Registrations
+5 −5
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ IOP_003_02_01 Query Entities Of Type OffstreetParking Via GET
    [Tags]    since_v1.6.1    iop    cnf_02    4_3_3    additive-inclusive    proxy-redirect    4_3_6    5_7_2    6_4_3_1

    #Agent queries all entities with type OffstreetParking in A and checks for a successful response not containing the name attribute.
    ${response}=    Query Entities    entity_types=OffstreetParking    broker_url=${broker_A_url}
    ${response}=    Query Entities    entity_types=OffstreetParking    broker_url=${broker_A_url}    context=${ngsild_test_suite_context}
    Check Response Status Code    200    ${response.status_code}
    @{entities_A}=    Set Variable   ${response.json()}
    ${first_payload}=    Get From List   ${entities_A}    0
@@ -37,20 +37,20 @@ IOP_003_02_01 Query Entities Of Type OffstreetParking Via GET
    Should Not Contain    ${second_payload}    name

    #Agent queries all entities with type OffstreetParking in B, C and D
    ${response}=    Query Entities    entity_types=OffstreetParking    broker_url=${broker_B_url}
    ${response}=    Query Entities    entity_types=OffStreetParking    broker_url=${broker_B_url}    context=${ngsild_test_suite_context}
    @{entities_B}=    Set Variable    ${response.json()}
    ${first_B_payload}=    Get From List   ${entities_B}    0
    ${second_B_payload}=    Get From List   ${entities_B}    1

    ${response}=    Query Entities    entity_types=OffstreetParking    broker_url=${broker_C_url}
    ${response}=    Query Entities    entity_types=OffStreetParking    broker_url=${broker_C_url}    context=${ngsild_test_suite_context}
    @{entities_C}=    Set Variable    ${response.json()}
    ${C_payload}=    Get From List   ${entities_C}    0

    ${response}=    Query Entities    entity_types=OffstreetParking    broker_url=${broker_D_url}
    ${response}=    Query Entities    entity_types=OffStreetParking    broker_url=${broker_D_url}    context=${ngsild_test_suite_context}
    @{entities_D}=    Set Variable    ${response.json()}
    ${D_payload}=    Get From List   ${entities_D}    0
    
    #Agent checks that OffstreetParking:1 in A has the same availableSpotsNumber and totalSpotsNumber as the one in B and the same location attribute found in C. The OffstreetParking:2 entity in A contains the attributes of both OffstreetParking:2 availableSpotsNumber and totalSpotsNumber in C and the same location found in D.
    #Agent checks that OffStreetParking:1 in A has the same availableSpotsNumber and totalSpotsNumber as the one in B and the same location attribute found in C. The OffStreetParking:2 entity in A contains the attributes of both OffStreetParking:2 availableSpotsNumber and totalSpotsNumber in C and the same location found in D.
    Should Be Equal    ${first_payload}[availableSpotsNumber]    ${first_b2_payload}[availableSpotsNumber]
    Should Be Equal    ${first_payload}[totalSpotsNumber]    ${first_b2_payload}[totalSpotsNumber]
    Should Be Equal    ${first_payload}[location]    ${b3_payload}[location]
+4 −4
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ IOP_003_02_02 Query Entities Of Type OffstreetParking And Vehicle with attrs
    [Tags]    since_v1.6.1    iop    cnf_02    4_3_3    additive-inclusive    proxy-redirect    4_3_6    5_7_2    6_4_3_1

    #Client queries all entities with type OffstreetParking and Vehicle in A and checks for a successful response that contains the location attribute for all entities.
    ${response}=    Query Entities    entity_types=OffstreetParking,Vehicle    attrs=location    broker_url=${broker_A_url}
    ${response}=    Query Entities    entity_types=OffStreetParking,Vehicle    attrs=location    broker_url=${broker_A_url}    context=${ngsild_test_suite_context}
    Check Response Status Code    200    ${response.status_code}
    &{payload}=    Evaluate    {i['id']: i for i in ${response.json()}}
    ${parking1_payload}=    Get From Dictionary    ${payload}    ${first_parking_entity_id}
@@ -44,11 +44,11 @@ IOP_003_02_02 Query Entities Of Type OffstreetParking And Vehicle with attrs
    Should Contain    ${vehicle2_payload}    location

    #Client queries all entities with type OffstreetParking and Vehicle in B, C and D. 
    ${response}=    Query Entities    entity_types=OffstreetParking,Vehicle    attrs=location    broker_url=${broker_B_url}
    ${response}=    Query Entities    entity_types=OffStreetParking,Vehicle    attrs=location    broker_url=${broker_B_url}    context=${ngsild_test_suite_context}
    &{first_expected_payload}=    Evaluate    {i['id']: i for i in ${response.json()}}
    ${response}=    Query Entities    entity_types=OffstreetParking,Vehicle    attrs=location    broker_url=${broker_C_url}
    ${response}=    Query Entities    entity_types=OffStreetParking,Vehicle    attrs=location    broker_url=${broker_C_url}    context=${ngsild_test_suite_context}
    &{second_expected_payload}=    Evaluate    {i['id']: i for i in ${response.json()}}
    ${response}=    Query Entities    entity_types=OffstreetParking,Vehicle    attrs=location    broker_url=${broker_D_url}
    ${response}=    Query Entities    entity_types=OffStreetParking,Vehicle    attrs=location    broker_url=${broker_D_url}    context=${ngsild_test_suite_context}
    &{third_expected_payload}=    Evaluate    {i['id']: i for i in ${response.json()}}

    #Client checks that the attributes of the entities in A are the same as the ones in B, C and D.
+9 −9
Original line number Diff line number Diff line
@@ -26,25 +26,25 @@ IOP_003_03_01 Query Entities Of Type OffstreetParking Via GET
    [Tags]    since_v1.6.1    iop    cnf_03    4_3_3    additive-inclusive    additive-auxiliary    4_3_6    5_7_2    6_4_3_1

    #Client queries all entities with type OffstreetParking in A and checks for a successful response. 
    ${response}=    Query Entities    entity_types=OffstreetParking    broker_url=${broker_A_url}
    ${response}=    Query Entities    entity_types=OffStreetParking    broker_url=${broker_A_url}    context=${ngsild_test_suite_context}
    Check Response Status Code    200    ${response.status_code}

    &{payload}=    Evaluate    {i['id']: i for i in ${response.json()}}
    ${first_parking_payload}=    Get From Dictionary    ${payload}    OffstreetParking:1
    ${second_parking_payload}=    Get From Dictionary    ${payload}    OffstreetParking:2
    ${first_parking_payload}=    Get From Dictionary    ${payload}    OffStreetParking:1
    ${second_parking_payload}=    Get From Dictionary    ${payload}    OffStreetParking:2

    #Client queries all entities with type OffstreetParking in B, C and D.
    ${response}=    Query Entities    entity_types=OffstreetParking    broker_url=${broker_B_url}
    ${response}=    Query Entities    entity_types=OffStreetParking    broker_url=${broker_B_url}    context=${ngsild_test_suite_context}
    ${payload}=    Evaluate    {i['id']: i for i in ${response.json()}}
    ${expected_parking1}=    Get From Dictionary    ${payload}    OffstreetParking:2
    ${expected_parking1}=    Get From Dictionary    ${payload}    OffStreetParking:2

    ${response}=    Query Entities    entity_types=OffstreetParking    broker_url=${broker_C_url}
    ${response}=    Query Entities    entity_types=OffStreetParking    broker_url=${broker_C_url}    context=${ngsild_test_suite_context}
    ${payload}=    Evaluate    {i['id']: i for i in ${response.json()}}
    ${expected_parking2}=    Get From Dictionary    ${payload}    OffstreetParking:1
    ${expected_parking2}=    Get From Dictionary    ${payload}    OffStreetParking:1

    ${response}=    Query Entities    entity_types=OffstreetParking    broker_url=${broker_D_url}
    ${response}=    Query Entities    entity_types=OffStreetParking    broker_url=${broker_D_url}    context=${ngsild_test_suite_context}
    ${payload}=    Evaluate    {i['id']: i for i in ${response.json()}}
    ${expected_parking3}=    Get From Dictionary    ${payload}    OffstreetParking:2
    ${expected_parking3}=    Get From Dictionary    ${payload}    OffStreetParking:2

    #Client checks that the attributes of the entities in A are the same as the ones in B, C and D.
    Should Be Equal    ${first_parking_payload}[name]    ${expected_parking2}[name]
Loading