Commit 3a71a845 authored by lopesg's avatar lopesg
Browse files

fixed 044_03

parent 976f6d2a
Loading
Loading
Loading
Loading
+9 −8
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})
@@ -28,7 +30,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}
@@ -40,7 +42,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}
@@ -49,7 +51,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld
    [Documentation]  Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entities/)

    ${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}
@@ -58,13 +60,12 @@ ${building_filename}= building-simple-attributes-sample.jsonld
    [Documentation]  Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /subscriptions/)

    ${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}

044_03_05_endpoint post /entityOperations/create

    [Documentation]  Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entityOperations/create)

    ${first_entity_id}=     Generate Random Entity Id    ${building_id_prefix}
@@ -73,7 +74,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
@@ -84,7 +85,7 @@ ${building_filename}= building-simple-attributes-sample.jsonld
    [Documentation]  Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /temporal/entities/)

    ${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