Commit 0d2393f4 authored by lopezaguilar's avatar lopezaguilar
Browse files

Adding Provision/Entities operations

parent 8be64a33
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -25,10 +25,10 @@ ${building_id_prefix}= urn:ngsi-ld:Building:
    ...    content_type=${CONTENT_TYPE_JSON}
    ...    context=${ngsild_test_suite_context}
    Check Response Status Code    201    ${response.status_code}
    ${response}=    Retrieve Entity by Id    ${entity_id}    context=${ngsild_test_suite_context}
    ${response}=    Retrieve Entity by Id    id=${entity_id}    context=${ngsild_test_suite_context}
    # Attribute should be compacted as we used the same context as provided when creating the entity
    Check Response Body Containing an Attribute set to    almostFull    ${response.json()}
    ${response}=    Retrieve Entity by Id    ${entity_id}
    ${response}=    Retrieve Entity by Id    id=${entity_id}
    # Attribute should not be compacted as we did not provide a context containing this attribute
    Check Response Body Containing an Attribute set to
    ...    https://ngsi-ld-test-suite/context#almostFull
+2 −2
Original line number Diff line number Diff line
@@ -22,10 +22,10 @@ ${building_id_prefix}= urn:ngsi-ld:Building:
    @{entities_to_be_created}=    Create List    ${entity}
    ${response}=    Batch Create Entities    @{entities_to_be_created}    content_type=${CONTENT_TYPE_JSON}
    Check Response Status Code    201    ${response.status_code}
    ${response}=    Retrieve Entity by Id    ${entity_id}
    ${response}=    Retrieve Entity by Id    id=${entity_id}
    # Attribute should be compacted as we used the same default context as provided when creating the entity
    Check Response Body Containing an Attribute set to    almostFull    ${response.json()}
    ${response}=    Retrieve Entity by Id    ${entity_id}    context=${ngsild_test_suite_context}
    ${response}=    Retrieve Entity by Id    id=${entity_id}    context=${ngsild_test_suite_context}
    # Attribute should not be compacted as we did not provide a context containing this term
    Check Response Body Containing an Attribute set to    ngsi-ld:default-context/almostFull    ${response.json()}

+2 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building:
    @{entities_to_be_created}=    Create List    ${entity}
    ${response}=    Batch Create Entities    @{entities_to_be_created}    content_type=${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response.status_code}
    ${response}=    Retrieve Entity by Id    ${entity_id}    context=${ngsild_test_suite_context}
    ${response}=    Retrieve Entity by Id    id=${entity_id}    context=${ngsild_test_suite_context}
    # Attribute should be compacted as we used the same context as provided when creating the entity
    Check Response Body Containing an Attribute set to
    ...    almostFull
@@ -37,7 +37,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building:
    @{entities_to_be_created}=    Create List    ${entity}
    ${response}=    Batch Create Entities    @{entities_to_be_created}    content_type=${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response.status_code}
    ${response}=    Retrieve Entity by Id    ${entity_id}
    ${response}=    Retrieve Entity by Id    id=${entity_id}
    # Attribute should not be compacted as we did not provide a context containing this term
    Check Response Body Containing an Attribute set to
    ...    https://ngsi-ld-test-suite/context#almostFull
+7 −7
Original line number Diff line number Diff line
@@ -15,13 +15,13 @@ ${building_id_prefix}= urn:ngsi-ld:Building:


*** Test Cases ***    FILENAME    CONTENT_TYPE
001_01_01_MinimalEntity
001_01_01 MinimalEntity
    building-minimal-without-context-sample.jsonld    application/json
001_01_02_EntityWithSimpleProperties
001_01_02 EntityWithSimpleProperties
    building-simple-attributes-sample.jsonld    application/ld+json
001_01_03_EntityWithRelationshipsProperties
001_01_03 EntityWithRelationshipsProperties
    building-relationship-of-property-sample.jsonld    application/ld+json
001_01_04_EntityWithLocationAttribute
001_01_04 EntityWithLocationAttribute
    building-location-attribute-sample.jsonld    application/ld+json


@@ -40,12 +40,12 @@ Create Entity Scenarios
    Check Response Headers Containing URI set to    ${entity_id}    ${response.headers}
    ${created_entity}=    Load Test Sample    entities/${filename}    ${entity_id}
    IF    '${content_type}'=='application/json'
        ${response}=    Retrieve Entity by Id    ${entity_id}    ${content_type}
        ${response}=    Retrieve Entity by Id    id=${entity_id}    accept=${content_type}
    END
    IF    '${content_type}'=='application/ld+json'
        ${response}=    Retrieve Entity by Id
        ...    ${entity_id}
        ...    ${content_type}
        ...    id=${entity_id}
        ...    accept=${content_type}
        ...    context=${ngsild_test_suite_context}
    END
    Check Created Resource Set To    ${created_entity}    ${response.json()}
+3 −3
Original line number Diff line number Diff line
@@ -9,11 +9,11 @@ Test Template Create Entity With Invalid Request Scenarios


*** Test Cases ***    FILENAME    ERROR_TYPE
001_02_01_InvalidJson
001_02_01 InvalidJson
    invalid-json-sample.jsonld    ${ERROR_TYPE_INVALID_REQUEST}
001_02_02_EmptyJson
001_02_02 EmptyJson
    empty-sample.jsonld    ${ERROR_TYPE_INVALID_REQUEST}
001_02_03_EntityWithNoContext
001_02_03 EntityWithNoContext
    building-minimal-without-context-sample.jsonld    ${ERROR_TYPE_BAD_REQUEST_DATA}


Loading