Commit d25a1f15 authored by lopesg's avatar lopesg
Browse files

fixed merge conflicts

parents 21afd0e0 e99be438
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -8,16 +8,16 @@ Resource ${EXECDIR}/resources/JsonUtils.resource
${expected_status_code}=  503

${building_id_prefix}=  urn:ngsi-ld:Building:
${building_filename}=  building-minimal-without-context-sample.jsonld 
${building_filename}=  building-unretrievable-context-sample.jsonld 

${subscription_id_prefix}=  urn:ngsi-ld:Subscription:
${subscription_filename}=  csourceSubscriptions/subscription-without-context-sample.jsonld
${subscription_filename}=  subscriptions/subscription-unretrievable-context-sample.jsonld

${tea_id_prefix}=  urn:ngsi-ld:Vehicle:
${tea_filename}=  bus-temporal-representation-without-context-sample.jsonld
${tea_filename}=  bus-temporal-representation-unretrievable-context-sample.jsonld

${registration_id_prefix}=  urn:ngsi-ld:Registration:
${registration_filename}=  csourceRegistrations/context-source-registration-without-context-sample.jsonld   
${registration_filename}=  csourceRegistrations/context-source-registration-unretrievable-context-sample.jsonld   

*** Test Cases *** 
043_01 Create entity
@@ -44,7 +44,6 @@ ${registration_filename}= csourceRegistrations/context-source-registration-with

    [Teardown]  Delete Subscription  ${subscription_id}


043_03 Create Temporal Representation of Entities
    [Documentation]  Verify throwing 503 – LDContextNotAvaliable error if remote JSON-LD @context cannot be retrieved (Create Temporal Representation of Entities)
    [Tags]  cb
+7 −7
Original line number Diff line number Diff line
@@ -7,12 +7,12 @@ Resource ${EXECDIR}/resources/JsonUtils.resource
*** Variable ***
${vehicle_id_prefix}=  urn:ngsi-ld:Vehicle:
${vehicle_filename}=  vehicle-simple-attributes-sample.jsonld
${vehicle_fragment}=  vehicle-brandname-fragment.jsonld
${vehicle_fragment}=  vehicle-brandname-fragment.json
${attribute_id}=  brandName

${subscription_id_prefix}=  urn:ngsi-ld:Subscription:
${subscription_filename}=  csourceSubscriptions/subscription-sample.jsonld
${subscription_fragment}=  csourceSubscriptions/fragments/subscription-update-sample.jsonld
${subscription_filename}=  subscriptions/subscription-sample.jsonld
${subscription_fragment}=  subscriptions/fragments/subscription-update-sample.json

*** Test Cases ***                      
044_01_01_endpoint /entities/{entityId}/attrs/{attrId}
@@ -22,7 +22,7 @@ ${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sa
    ${request}    ${response}=    Create Entity Selecting Content Type    ${vehicle_filename}    ${entity_id}    ${CONTENT_TYPE_LD_JSON}    
    Check Response Status Code  201    ${response['status']}

    ${response}=    Partial Update Entity Attributes    ${entity_id}    ${attribute_id}    ${vehicle_fragment}    ${CONTENT_TYPE_MERGE_PATCH_JSON}
    ${response}=    Partial Update Entity Attributes    ${entity_id}    ${attribute_id}    ${vehicle_fragment}    ${CONTENT_TYPE_MERGE_PATCH_JSON}    context=${ngsild_test_suite_context}
    Check Response Status Code  204    ${response['status']}

    [Teardown]  Delete Entity by Id  ${entity_id}
@@ -34,7 +34,7 @@ ${subscription_fragment}= csourceSubscriptions/fragments/subscription-update-sa
    ${response}=    Create Subscription    ${subscription_id}    ${subscription_filename}    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code  201    ${response['status']}

    ${response}=    Update Subscription    ${subscription_id}     ${subscription_fragment}    ${CONTENT_TYPE_MERGE_PATCH_JSON}
    ${response}=    Update Subscription    ${subscription_id}     ${subscription_fragment}    ${CONTENT_TYPE_MERGE_PATCH_JSON}    context=${ngsild_test_suite_context}
    Check Response Status Code  204    ${response['status']}

    [Teardown]  Delete Subscription  ${subscription_id}
+15 −10
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ ${building_expectation}= building-simple-attributes-sample-expectation.json
${entity_type}=  https://ngsi-ld-test-suite/context#Building

${subscription_id_prefix}=  urn:ngsi-ld:Subscription:
${subscription_filename}=  csourceSubscriptions/subscription-sample.jsonld
${subscription_filename}=  subscriptions/subscription-sample.jsonld
${subscription_expectation}=  subscription-sample-expectation.json

${registration_id_prefix}=  urn:ngsi-ld:Registration:
@@ -21,9 +21,11 @@ ${registration_type}= Vehicle

${tea_id_prefix}=  urn:ngsi-ld:Vehicle:
${tea_filename}=  vehicle-temporal-representation-sample.jsonld
${tea_expectation}=  vehicle-temporal-representation-expectation.json
${tea_expectation}=  vehicles-temporal-representation-044-02-04-expectation.json
${teatype}=  Vehicle

${content_type}=  application/json

*** Test Cases ***
044_02_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})
@@ -32,14 +34,14 @@ ${teatype}= Vehicle
    ${request}    ${response}=    Create Entity Selecting Content Type  ${building_filename}     ${id}    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code  201    ${response['status']}

    ${request}    ${response}=    Query Entity    ${id}
    ${request}    ${response}=    Query Entity    ${id}    context=${ngsild_test_suite_context}
    Check Response Status Code  200    ${response['status']}
    Check Response Body Containing Entity element    ${building_expectation}    ${id}    ${response['body']}
    Check Request Containing Accept Header Set To  ${request}    application/json, */* 
    Check Response Headers Containing Content-Type set to  ${response}    ${content_type}
    Check Response Headers Link Not Empty  ${response}

    [Teardown]  Delete Entity by Id Returning Response   ${id}
  

044_02_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})
    [Tags]  cb
@@ -51,7 +53,8 @@ ${teatype}= Vehicle
    ${request}    ${response}=  Retrieve Subscription  ${id}
    Check Response Status Code  200    ${response['status']}
    Check Response Body Containing One Subscription element    ${subscription_expectation}    ${response['body']}
    Check Request Containing Accept Header Set To  ${request}    application/json, */* 
    Check Response Headers Containing Content-Type set to  ${response}    ${content_type}
    Check Response Headers Link Not Empty  ${response}

    [Teardown]  Delete Subscription  ${id}

@@ -65,10 +68,11 @@ ${teatype}= Vehicle
    ${request}    ${response}=    Create Context Source Registration With Return  ${updated_payload}
    Check Response Status Code  201    ${response['status']}

    ${request}    ${response}=  Query Context Source Registrations With Return      id=${registration_id}    type=${registration_type}
    ${request}    ${response}=  Query Context Source Registrations With Return      id=${registration_id}    type=${registration_type}    context=${ngsild_test_suite_context}
    Check Response Status Code  200    ${response['status']}
    Check Response Body Containing One Registration element  ${registration_expectation}    ${response['body']}
    Check Request Containing Accept Header Set To  ${request}    application/json, */* 
    Check Response Headers Containing Content-Type set to  ${response}    ${content_type}
    Check Response Headers Link Not Empty  ${response}

    [Teardown]  Delete Context Source Registration    ${registration_id}

@@ -79,10 +83,11 @@ ${teatype}= Vehicle
    ${temporal_entity_representation_id}=     Generate Random Entity Id    ${tea_id_prefix}
    Create Temporal Representation Of Entity  ${tea_filename}     ${temporal_entity_representation_id}

    ${request}    ${response}=  Query Temporal Representation Of Entities With Return   entity_types=${teatype}    timerel=after    timeAt=2020-08-01T12:05:00Z
    ${request}    ${response}=  Query Temporal Representation Of Entities With Return   entity_types=${teatype}    timerel=after    timeAt=2020-08-01T12:05:00Z    context=${ngsild_test_suite_context}
    Check Response Status Code  200    ${response['status']}
    Set Test Variable  ${response}
    Check Response Body Containing EntityTemporal element      ${tea_expectation}    ${temporal_entity_representation_id}
    Check Request Containing Accept Header Set To  ${request}    application/json, */* 
    Check Response Headers Containing Content-Type set to  ${response}    ${content_type}
    Check Response Headers Link Not Empty  ${response}

    [Teardown]  Delete Temporal Representation Of Entity    ${temporal_entity_representation_id}
 No newline at end of file
+9 −7
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource

*** Variable ***
${vehicle_id_prefix}=  urn:ngsi-ld:Vehicle:
${vehicle_filename}=  vehicle-simple-attributes-sample.json
${vehicle_filename}=  vehicle-simple-attributes-sample.jsonld
${vehicle_attribute}=  speed
${vehicle_fragment}=  vehicle-brandname-fragment.jsonld

@@ -20,6 +20,8 @@ ${tea_filename}= vehicle-temporal-representation-sample.jsonld
${building_id_prefix}=  urn:ngsi-ld:Building:
${building_filename}=  building-simple-attributes-sample.jsonld

${content_type}=  application/xml

*** Test Cases ***
044_03_01_endpoint patch /entities/{entityId}/attrs/{attrId}
    [Documentation]  Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /entities/{entityId}/attrs/{attrId})
@@ -29,7 +31,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld
    ${request}    ${response}=    Create Entity Selecting Content Type  ${vehicle_filename}     ${entity_id}    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code  201    ${response['status']}

    ${response}=    Partial Update Entity Attributes    ${entity_id}    ${vehicle_attribute}    ${vehicle_fragment}    ${EMPTY}
    ${response}=    Partial Update Entity Attributes    ${entity_id}    ${vehicle_attribute}    ${vehicle_fragment}    ${content_type}
    Check Response Status Code  415    ${response['status']}

    [Teardown]  Delete Entity by Id Returning Response   ${entity_id}
@@ -42,7 +44,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld
    ${response}=  Create Subscription  ${id}    ${subscription_filename}    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code  201    ${response['status']}

    ${response}=  Update Subscription  ${id}     ${subscription_fragment}    ${EMPTY}
    ${response}=  Update Subscription  ${id}     ${subscription_fragment}    ${content_type}
    Check Response Status Code  415    ${response['status']}

    [Teardown]  Delete Subscription  ${id}
@@ -52,7 +54,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld
    [Tags]  cb

    ${entity_id}=     Generate Random Entity Id    ${building_id_prefix}
    ${request}    ${response}=    Create Entity Selecting Content Type   ${building_filename}      ${entity_id}     ${EMPTY}
    ${request}    ${response}=    Create Entity Selecting Content Type   ${building_filename}      ${entity_id}     ${content_type}
    Check Response Status Code  415    ${response['status']}

    [Teardown]    Delete Entity by Id       ${entity_id}
@@ -62,7 +64,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld
    [Tags]  cb

    ${subscriptions_id}=     Generate Random Entity Id    ${subscription_id_prefix}
    ${response}=  Create Subscription  ${subscriptions_id}    ${subscription_filename}    ${EMPTY}
    ${response}=  Create Subscription  ${subscriptions_id}    ${subscription_filename}    ${content_type}
    Check Response Status Code  415    ${response['status']}

    [Teardown]  Delete Subscription  ${subscriptions_id}
@@ -77,7 +79,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld
    ${second_entity}=    Load Entity    ${building_filename}      ${second_entity_id}
    @{entities_to_be_created}=  Create List   ${first_entity}     ${second_entity}

    Batch Create Entities   @{entities_to_be_created}    content_type=${EMPTY}
    Batch Create Entities   @{entities_to_be_created}    content_type=${content_type}

    @{expected_entities_ids}=  Create List   ${first_entity_id}     ${second_entity_id}
    Check Response Status Code Set To  415
@@ -89,7 +91,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld
    [Tags]  cb
    
    ${temporal_entity_representation_id}=     Generate Random Entity Id    ${tea_id_prefix}
    ${response}=  Create Or Update Temporal Representation Of Entity Selecting Content Type  ${temporal_entity_representation_id}    ${tea_filename}     ${EMPTY}
    ${response}=  Create Or Update Temporal Representation Of Entity Selecting Content Type  ${temporal_entity_representation_id}    ${tea_filename}     ${content_type}
    Check Response Status Code  415    ${response['status']}

    [Teardown]    Delete Temporal Representation Of Entity    ${temporal_entity_representation_id}
 No newline at end of file
+3 −3
Original line number Diff line number Diff line
@@ -41,9 +41,9 @@ ${subscription_filename}= csourceSubscriptions/subscription-sample.jsonld

044_04_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/)
    [Tags]  cb
    Query Context Source Registrations  type=Building    accept=${accept}
    Check Response Status Code Set To  ${status_code}

    ${request}    ${response}=  Query Context Source Registrations With Return  type=Building    accept=${accept}
    Check Response Status Code  ${status_code}    ${response['status']}

044_04_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/)
Loading