Extend PnF registrate test cases for GR API
[testsuite.git] / robot / resources / aai / add-relationship-list.robot
index 056b896..dbf3c61 100644 (file)
@@ -3,17 +3,15 @@ Documentation     Operations on relationship-list sub-object in AAI,
 ...    using specified base URL path including API version where it is implemented,
 ...    relies on system to choose default EdgeRule for the pair of object classes
 
-Resource    ../json_templater.robot
 Resource    aai_interface.robot
-Resource    api_version_properties.robot
-Library    OperatingSystem
 Library    Collections
-
+Library    ONAPLibrary.Templating    WITH NAME    Templating
+Library    ONAPLibrary.AAI    WITH NAME    AAI
 
 *** Variables ***
-${AAI_RELATIONSHIPLIST_PATH}=      relationship-list
+${AAI_RELATIONSHIPLIST_PATH}      relationship-list
 ${AAI_RELATIONSHIP_PATH}=      ${AAI_RELATIONSHIPLIST_PATH}/relationship
-${AAI_ADD_RELATIONSHIP_BODY}=    robot/assets/templates/aai/add-relationship.template
+${AAI_ADD_RELATIONSHIP_BODY}    aai/add-relationship.jinja
 ${AAI_RELATIONSHIP_DEPTH}=    ?depth=1
 
 *** Keywords ***
@@ -21,8 +19,9 @@ Add Relationship
     [Documentation]    Adds Relationship sub-object to existing object in AAI
     [Arguments]    ${api_version_base_object_url}  ${related_class_name}  ${related_object_url}
     ${arguments}=    Create Dictionary     related_class_name=${related_class_name}  related_object_url=${related_object_url}
-    ${data}=    Fill JSON Template File    ${AAI_ADD_RELATIONSHIP_BODY}    ${arguments}
-    ${put_resp}=    Run A&AI Put Request     ${api_version_base_object_url}/${AAI_RELATIONSHIP_PATH}     ${data}
+    Templating.Create Environment    aai    ${GLOBAL_TEMPLATE_FOLDER}
+    ${data}=   Templating.Apply Template    aai   ${AAI_ADD_RELATIONSHIP_BODY}    ${arguments}
+    ${put_resp}=    AAI.Run Put Request     ${AAI_FRONTEND_ENDPOINT}    ${api_version_base_object_url}/${AAI_RELATIONSHIP_PATH}     ${data}    auth=${GLOBAL_AAI_AUTHENTICATION}
     ${status_string}=    Convert To String    ${put_resp.status_code}
     Should Match Regexp    ${status_string}     ^(201|200)$
 
@@ -36,8 +35,7 @@ Get RelationshipList
 Get Object With Depth
     [Documentation]   Return Object with Depth parameter to show RelationshipList
     [Arguments]    ${api_version_base_object_url}
-    ${resp}=    Run A&AI Get Request     ${api_version_base_object_url}${AAI_RELATIONSHIP_DEPTH}
+    ${resp}=    AAI.Run Get Request     ${AAI_FRONTEND_ENDPOINT}    ${api_version_base_object_url}${AAI_RELATIONSHIP_DEPTH}    auth=${GLOBAL_AAI_AUTHENTICATION}
     Should Be Equal As Strings  ${resp.status_code}     200
     Log    Returning response ${resp.json()}
-    [Return]  ${resp.json()}
-
+    [Return]  ${resp.json()}
\ No newline at end of file