-Publish Event To VES Collector With Wrong Auth
- [Documentation] Send an event to VES Collector by session with wrong auth
- [Arguments] ${evtpath} ${evtdata}
- ${resp}= Post Request ${suite_dcae_vesc_url_https_wrong_auth_session} ${evtpath} data=${evtdata} headers=${suite_headers}
- [Return] ${resp}
-
-Publish Event To VES Collector With Cert
- [Documentation] Send an event to VES Collector by session with certs
- [Arguments] ${evtpath} ${evtdata}
- ${resp}= Post Request ${suite_dcae_vesc_url_https_cert_session} ${evtpath} data=${evtdata} headers=${suite_headers}
- [Return] ${resp}
-
-Publish Event To VES Collector With Wrong Cert
- [Documentation] Send an event to VES Collector by session with wrong certs
- [Arguments] ${evtpath} ${evtdata}
- ${resp}= Post Request ${suite_dcae_vesc_url_https_wrong_cert_session} ${evtpath} data=${evtdata} headers=${suite_headers}
- [Return] ${resp}
-
-Publish Event To VES Collector Without Auth And Cert
- [Documentation] Send an event to VES Collector by session without Auth and Cert
- [Arguments] ${evtpath} ${evtdata}
- ${resp}= Post Request ${suite_dcae_vesc_url_https_wo_auth_session} ${evtpath} data=${evtdata} headers=${suite_headers}
- [Return] ${resp}
+Send Request And Validate Response And Error Message
+ [Documentation] Post singel event to passed url and validate received response code and content
+ [Arguments] ${keyword} ${session} ${evtpath} ${evtjson} ${resp_code} ${msg_content}
+ ${resp}= Send Request And Validate Response ${keyword} ${session} ${evtpath} ${evtjson} ${resp_code}
+ ${error_message}= Set Variable ${resp.json()['requestError']['ServiceException']['text']}
+ Should Be Equal As Strings ${msg_content} ${error_message}
+
+Send Request And Validate Response
+ [Documentation] Post singel event to passed url with passed data and validate received response
+ [Arguments] ${keyword} ${session} ${evtpath} ${evtjson} ${resp_code} ${msg_code}=None ${topic}=None
+ ${evtdata}= Get Data From File ${evtjson}
+ ${resp}= Run Keyword ${keyword} ${session} ${evtpath} ${evtdata}
+ Log Receive HTTPS Status code ${resp.status_code}
+ Should Be Equal As Strings ${resp.status_code} ${resp_code}
+ ${isEmpty}= Is Json Empty ${resp}
+ Run Keyword If '${isEmpty}' == False Log ${resp.json()}
+ Run Keyword If '${msg_code}' != 'None' Check Whether Message Received ${msg_code} ${topic}
+ [Return] ${resp}
+
+Check Whether Message Received
+ [Documentation] Validare if message has been received
+ [Arguments] ${msg_code} ${topic}
+ ${ret}= Run Keyword If '${topic}' != 'None' DMaaP Message Receive On Topic ${msg_code} ${topic}
+ ... ELSE DMaaP Message Receive ${msg_code}
+ Should Be Equal As Strings ${ret} true
+
+Send Request And Expect Error
+ [Documentation] Post singel event to passed url with passed data and expect error
+ [Arguments] ${keyword} ${session} ${evtpath} ${evtjson} ${error_type} @{error_content}
+ ${evtdata}= Get Data From File ${evtjson}
+ ${err_msg}= Run Keyword And Expect Error ${error_type} ${keyword} ${session} ${evtpath} ${evtdata}
+ :FOR ${content} IN @{error_content}
+ \ Should Contain ${err_msg} ${content}
+ Log Recieved error message ${err_msg}
+
+Run Healthcheck
+ [Documentation] Run Healthcheck
+ [Arguments] ${session}
+ ${uuid}= Generate UUID
+ ${headers}= Create Dictionary Accept=*/* X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
+ ${resp}= Get Request ${session} /healthcheck headers=${headers}
+ Should Be Equal As Strings ${resp.status_code} 200