Commit 4ae8b5d0 authored by Giuseppe Tropea's avatar Giuseppe Tropea
Browse files

Merge remote-tracking branch 'origin/hardening/038s' into parsespec

parents 8188971f 719d4d46
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -29,7 +29,7 @@ ${content_type}= application/json
*** Test Cases ***
*** Test Cases ***
045_01_01 Endpoint /entities/{entityId}
045_01_01 Endpoint /entities/{entityId}
    [Documentation]    Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/entities/{entityId})
    [Documentation]    Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/entities/{entityId})
    [Tags]    e-query    6_3_4
    [Tags]    e-query    cb-get    6_3_4
    ${id}=    Generate Random Entity Id    ${building_id_prefix}
    ${id}=    Generate Random Entity Id    ${building_id_prefix}
    ${response}=    Create Entity Selecting Content Type
    ${response}=    Create Entity Selecting Content Type
    ...    ${building_filename}
    ...    ${building_filename}
@@ -47,7 +47,7 @@ ${content_type}= application/json


045_01_02 Endpoint /subscriptions/{subscriptionId}
045_01_02 Endpoint /subscriptions/{subscriptionId}
    [Documentation]    Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/subscriptions/{subscriptionId})
    [Documentation]    Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/subscriptions/{subscriptionId})
    [Tags]    sub-retrieve    6_3_4
    [Tags]    sub-retrieve    cb-get    6_3_4
    ${id}=    Generate Random Entity Id    ${subscription_id_prefix}
    ${id}=    Generate Random Entity Id    ${subscription_id_prefix}
    ${response}=    Create Subscription    ${id}    ${subscription_filename}    ${CONTENT_TYPE_LD_JSON}
    ${response}=    Create Subscription    ${id}    ${subscription_filename}    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response.status_code}
    Check Response Status Code    201    ${response.status_code}
@@ -61,7 +61,7 @@ ${content_type}= application/json


045_01_03 Endpoint /csourceRegistrations/
045_01_03 Endpoint /csourceRegistrations/
    [Documentation]    Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/csourceRegistrations/)
    [Documentation]    Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/csourceRegistrations/)
    [Tags]    csr-query    6_3_4
    [Tags]    csr-query    cb-get    6_3_4
    ${registration_id}=    Generate Random Entity Id    ${registration_id_prefix}
    ${registration_id}=    Generate Random Entity Id    ${registration_id_prefix}
    ${payload}=    Load JSON From File    ${EXECDIR}/data/${registration_filename}
    ${payload}=    Load JSON From File    ${EXECDIR}/data/${registration_filename}
    ${updated_payload}=    Update Value To JSON    ${payload}    $..id    ${registration_id}
    ${updated_payload}=    Update Value To JSON    ${payload}    $..id    ${registration_id}
@@ -79,7 +79,7 @@ ${content_type}= application/json


045_01_04 Endpoint /temporal/entities
045_01_04 Endpoint /temporal/entities
    [Documentation]    Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/temporal/entities)
    [Documentation]    Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/temporal/entities)
    [Tags]    te-query    6_3_4
    [Tags]    te-query    cb-get    6_3_4
    ${temporal_entity_representation_id}=    Generate Random Entity Id    ${tea_id_prefix}
    ${temporal_entity_representation_id}=    Generate Random Entity Id    ${tea_id_prefix}
    ${response}=    Create Or Update Temporal Representation Of Entity Selecting Content Type
    ${response}=    Create Or Update Temporal Representation Of Entity Selecting Content Type
    ...    temporal_entity_representation_id=${temporal_entity_representation_id}
    ...    temporal_entity_representation_id=${temporal_entity_representation_id}
+5 −5
Original line number Original line Diff line number Diff line
@@ -24,7 +24,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration
*** Test Cases ***
*** Test Cases ***
043_01_01 Create entity
043_01_01 Create entity
    [Documentation]    Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create entity)
    [Documentation]    Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create entity)
    [Tags]    e-create    5_2_2
    [Tags]    e-create    cb-ldcontext    5_2_2
    ${entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${response}=    Create Entity Selecting Content Type
    ${response}=    Create Entity Selecting Content Type
    ...    ${building_filename}
    ...    ${building_filename}
@@ -39,7 +39,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration


043_01_02 Create subscription
043_01_02 Create subscription
    [Documentation]    Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create subscription)
    [Documentation]    Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create subscription)
    [Tags]    sub-create    5_2_2
    [Tags]    sub-create    cb-ldcontext    5_2_2
    ${subscription_id}=    Generate Random Entity Id    ${subscription_id_prefix}
    ${subscription_id}=    Generate Random Entity Id    ${subscription_id_prefix}
    ${response}=    Create Subscription    ${subscription_id}    ${subscription_filename}    ${CONTENT_TYPE_LD_JSON}
    ${response}=    Create Subscription    ${subscription_id}    ${subscription_filename}    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    ${expected_status_code}    ${response.status_code}
    Check Response Status Code    ${expected_status_code}    ${response.status_code}
@@ -51,7 +51,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration


043_01_03 Create Temporal Representation of Entities
043_01_03 Create Temporal Representation of Entities
    [Documentation]    Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create Temporal Representation of Entities)
    [Documentation]    Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create Temporal Representation of Entities)
    [Tags]    te-create    5_2_2
    [Tags]    te-create    cb-ldcontext    5_2_2
    ${temporal_entity_representation_id}=    Generate Random Entity Id    ${tea_id_prefix}
    ${temporal_entity_representation_id}=    Generate Random Entity Id    ${tea_id_prefix}
    ${response}=    Create Or Update Temporal Representation Of Entity Selecting Content Type
    ${response}=    Create Or Update Temporal Representation Of Entity Selecting Content Type
    ...    temporal_entity_representation_id=${temporal_entity_representation_id}
    ...    temporal_entity_representation_id=${temporal_entity_representation_id}
@@ -66,7 +66,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration


043_01_04 Batch entity create
043_01_04 Batch entity create
    [Documentation]    Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Batch entity create)
    [Documentation]    Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Batch entity create)
    [Tags]    be-create    5_2_2
    [Tags]    be-create    cb-ldcontext    5_2_2
    ${first_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${first_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${second_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${second_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${first_entity}=    Load Entity    ${building_filename}    ${first_entity_id}
    ${first_entity}=    Load Entity    ${building_filename}    ${first_entity_id}
@@ -83,7 +83,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration


043_01_05 Create context source registration
043_01_05 Create context source registration
    [Documentation]    Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create context source registration)
    [Documentation]    Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create context source registration)
    [Tags]    csr-create    5_2_2
    [Tags]    csr-create    cb-ldcontext    5_2_2
    ${registration_id}=    Generate Random Entity Id    ${registration_id_prefix}
    ${registration_id}=    Generate Random Entity Id    ${registration_id_prefix}
    ${payload}=    Load JSON From File    ${EXECDIR}/data/${registration_filename}
    ${payload}=    Load JSON From File    ${EXECDIR}/data/${registration_filename}
    ${updated_payload}=    Update Value To JSON    ${payload}    $..id    ${registration_id}
    ${updated_payload}=    Update Value To JSON    ${payload}    $..id    ${registration_id}
+1 −1
Original line number Original line Diff line number Diff line
@@ -19,7 +19,7 @@ ${attribute_id}= brandName
*** Test Cases ***
*** Test Cases ***
044_01_01 endpoint /entities/{entityId}/attrs/{attrId}
044_01_01 endpoint /entities/{entityId}/attrs/{attrId}
    [Documentation]    Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type
    [Documentation]    Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type
    [Tags]    ea-partial-update    6_3_4
    [Tags]    ea-partial-update    cb-mergepatch    6_3_4
    ${response}=    Partial Update Entity Attributes
    ${response}=    Partial Update Entity Attributes
    ...    entityId=${entity_id}
    ...    entityId=${entity_id}
    ...    attributeId=${attribute_id}
    ...    attributeId=${attribute_id}
+1 −1
Original line number Original line Diff line number Diff line
@@ -19,7 +19,7 @@ ${subscription_fragment}= subscriptions/fragments/subscription-update-samp
*** Test Cases ***
*** Test Cases ***
044_02_01 Endpoint /subscriptions/{subscriptionId}
044_02_01 Endpoint /subscriptions/{subscriptionId}
    [Documentation]    Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type
    [Documentation]    Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type
    [Tags]    sub-update    6_3_4
    [Tags]    sub-update    cb-mergepatch    6_3_4
    ${response}=    Update Subscription
    ${response}=    Update Subscription
    ...    ${subscription_id}
    ...    ${subscription_id}
    ...    ${subscription_fragment}
    ...    ${subscription_fragment}
+5 −5
Original line number Original line Diff line number Diff line
@@ -21,7 +21,7 @@ ${subscription_id_prefix}= urn:ngsi-ld:Subscription:
*** Test Cases ***
*** Test Cases ***
049_01_01 Endpoint get /entities/{entityId}
049_01_01 Endpoint get /entities/{entityId}
    [Documentation]    Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /entities/{entityId})
    [Documentation]    Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /entities/{entityId})
    [Tags]    e-query    6_3_4
    [Tags]    e-query    cb-noacceptable-medtype    6_3_4
    ${entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${response}=    Query Entity
    ${response}=    Query Entity
    ...    id=${entity_id}
    ...    id=${entity_id}
@@ -31,7 +31,7 @@ ${subscription_id_prefix}= urn:ngsi-ld:Subscription:


049_01_02 Endpoint get /subscriptions/{subscriptionId}
049_01_02 Endpoint get /subscriptions/{subscriptionId}
    [Documentation]    Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /subscriptions/{subscriptionId})
    [Documentation]    Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /subscriptions/{subscriptionId})
    [Tags]    sub-retrieve    6_3_4
    [Tags]    sub-retrieve    cb-noacceptable-medtype    6_3_4
    ${id}=    Generate Random Entity Id    ${subscription_id_prefix}
    ${id}=    Generate Random Entity Id    ${subscription_id_prefix}
    ${response}=    Retrieve Subscription
    ${response}=    Retrieve Subscription
    ...    id=${id}
    ...    id=${id}
@@ -41,19 +41,19 @@ ${subscription_id_prefix}= urn:ngsi-ld:Subscription:


049_01_03 Endpoint get /csourceRegistrations/
049_01_03 Endpoint get /csourceRegistrations/
    [Documentation]    Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceRegistrations/)
    [Documentation]    Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceRegistrations/)
    [Tags]    csr-query    6_3_4
    [Tags]    csr-query    cb-noacceptable-medtype    6_3_4
    ${response}=    Query Context Source Registrations With Return    type=Building    accept=${accept}
    ${response}=    Query Context Source Registrations With Return    type=Building    accept=${accept}
    Check Response Status Code    ${status_code}    ${response.status_code}
    Check Response Status Code    ${status_code}    ${response.status_code}


049_01_04 Endpoint get /csourceSubscriptions/
049_01_04 Endpoint get /csourceSubscriptions/
    [Documentation]    Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceSubscriptions/)
    [Documentation]    Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceSubscriptions/)
    [Tags]    csrsub-query    6_3_4
    [Tags]    csrsub-query    cb-noacceptable-medtype    6_3_4
    ${response}=    Query Context Source Registration Subscriptions    accept=${accept}
    ${response}=    Query Context Source Registration Subscriptions    accept=${accept}
    Check Response Status Code    ${status_code}    ${response.status_code}
    Check Response Status Code    ${status_code}    ${response.status_code}


049_01_05 Endpoint get /temporal/entities
049_01_05 Endpoint get /temporal/entities
    [Documentation]    Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities)
    [Documentation]    Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities)
    [Tags]    te-query    6_3_4
    [Tags]    te-query    cb-noacceptable-medtype    6_3_4
    ${entity_types_to_be_retrieved}=    Catenate    SEPARATOR=,    Vehicle
    ${entity_types_to_be_retrieved}=    Catenate    SEPARATOR=,    Vehicle
    ${response}=    Query Temporal Representation Of Entities
    ${response}=    Query Temporal Representation Of Entities
    ...    entity_types=${entity_types_to_be_retrieved}
    ...    entity_types=${entity_types_to_be_retrieved}
Loading