From: dhanasekaran Date: Tue, 21 Jun 2022 07:19:17 +0000 (+0000) Subject: Fix warnings in sol003 tests related to RequestsLibrary X-Git-Tag: v12.0.0rc1~5 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=d90c14aa761a796cf74563812fb5a01f3b145ee9;p=osm%2Ftests.git Fix warnings in sol003 tests related to RequestsLibrary Instead of the deprecated methods Post Request and Get Request, the new methods Post On Session and Get On Session are used. Change-Id: I64f0f575c752743b0125385f08c1fc5731457881 Signed-off-by: dhanasekaran --- diff --git a/robot-systest/lib/sol003_common_lib.robot b/robot-systest/lib/sol003_common_lib.robot index 795a1a3..c0e7323 100644 --- a/robot-systest/lib/sol003_common_lib.robot +++ b/robot-systest/lib/sol003_common_lib.robot @@ -22,8 +22,6 @@ Library OperatingSystem Resource %{ROBOT_DEVOPS_FOLDER}/lib/vim_lib.robot *** Variables *** -&{HEADERS} Content-Type=application/json Accept=application/json -&{data} username=admin password=admin project-id=admin @{success_status_code_list} 200 201 202 204 ${descriptor_content_type_gzip} application/gzip ${auth_token_uri} /osm/admin/v1/tokens @@ -37,8 +35,9 @@ Get Auth Token [Tags] auth_token Get Hostname Create Session osmhit ${HOST} - Log Many ${auth_token_uri} @{data} ${data} - ${resp}= Post Request osmhit ${auth_token_uri} data=${data} headers=${HEADERS} + &{headers} Create Dictionary Content-Type=application/json Accept=application/json + &{data} Create Dictionary username=admin password=admin project-id=admin + ${resp}= Post On Session osmhit ${auth_token_uri} json=${data} headers=${headers} log ${resp} Pass Execution If ${resp.status_code} in ${success_status_code_list} Get Auth Token completed Set Suite Variable ${token_status_code} ${resp.status_code} @@ -66,7 +65,7 @@ Post Api Request [Documentation] Keword to Post API Request Create Session APISession ${HOST} &{headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Bearer ${access_token} - ${request_response}= Post Request APISession ${PostApi} data=${updated_json_obj} headers=${headers} + ${request_response}= Post On Session APISession ${PostApi} json=${updated_json_obj} headers=${headers} Set Suite Variable ${request_response} ${response_statuscode} Convert To String ${request_response.status_code} Set Suite Variable ${response_statuscode} @@ -97,7 +96,7 @@ Get Api Request [Documentation] Keyword to Get API Request Create Session Session ${HOST} &{headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Bearer ${access_token} - ${request_response}= Get Request Session ${uri} headers=${Headers} + ${request_response}= Get On Session Session ${uri} headers=${Headers} Set Suite Variable ${request_response} ${response_statuscode} Convert To String ${request_response.status_code} Set Suite Variable ${response_statuscode}