summaryrefslogtreecommitdiffstats
path: root/test/csit/tests/holmes/testcase/CommonKeywords/HttpRequest.robot
diff options
context:
space:
mode:
Diffstat (limited to 'test/csit/tests/holmes/testcase/CommonKeywords/HttpRequest.robot')
-rw-r--r--test/csit/tests/holmes/testcase/CommonKeywords/HttpRequest.robot37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/csit/tests/holmes/testcase/CommonKeywords/HttpRequest.robot b/test/csit/tests/holmes/testcase/CommonKeywords/HttpRequest.robot
new file mode 100644
index 000000000..5b8417404
--- /dev/null
+++ b/test/csit/tests/holmes/testcase/CommonKeywords/HttpRequest.robot
@@ -0,0 +1,37 @@
+*** Settings ***
+Library Collections
+Library RequestsLibrary
+Resource ../RuleMgt/Rule-Keywords.robot
+
+*** Keywords ***
+httpPut
+ [Arguments] ${restHost} ${restUrl} ${data}
+ ${headers} create dictionary Content-Type=application/json;charset=utf-8 Accept=application/json
+ create session microservices ${restHost} ${headers}
+ log ${data}
+ ${putResponse} put request microservices ${restUrl} ${data} \ ${EMPTY}
+ ... ${headers}
+ log ${putResponse}
+ [Return] ${putResponse}
+
+httpGet
+ [Arguments] ${restHost} ${restUrl}
+ create session microservices ${restHost}
+ ${getResponse} get request microservices ${restUrl}
+ [Return] ${getResponse}
+
+httpPost
+ [Arguments] ${restHost} ${restUrl} ${data}
+ ${headers} create dictionary Content-Type=application/json Accept=application/json
+ create session microservices ${restHost} ${headers}
+ log ${data}
+ ${postResponse} post request microservices ${restUrl} ${data}
+ Comment log ${postResponse.content}
+ [Return] ${postResponse}
+
+httpDelete
+ [Arguments] ${restHost} ${restUrl} ${data}
+ ${headers} create dictionary Content-Type=application/json Accept=application/json
+ create session microservices ${restHost} ${headers}
+ ${deleteResponse} delete request microservices ${restUrl} ${data}
+ [Return] ${deleteResponse}