3 Library RequestsLibrary
4 Library HttpLibrary.HTTP
6 Resource ../../../common.robot
7 Resource ./cert-service-properties.robot
12 [Documentation] Create all required sessions
13 Create Session aaf_cert_service_url ${AAFCERT_URL}
14 Set Suite Variable ${http_session} aaf_cert_service_url
17 [Documentation] Run Healthcheck
18 ${resp}= Get Request ${http_session} /actuator/health
19 Should Be Equal As Strings ${resp.status_code} 200
20 Validate Recieved Response ${resp} status UP
22 Send Request And Validate Response
23 [Documentation] Send request to passed url and validate received response
24 [Arguments] ${path} ${csr_file} ${pk_file} ${resp_code}
25 ${csr}= Get Data From File ${csr_file}
26 ${pk}= Get Data From File ${pk_file}
27 ${headers}= Create Dictionary CSR=${csr} PK=${pk}
28 ${resp}= Get Request ${http_session} ${path} headers=${headers}
29 Should Be Equal As Strings ${resp.status_code} ${resp_code}
31 Validate Recieved Response
32 [Documentation] Validare message that has been received
33 [Arguments] ${resp} ${key} ${expected_value}
34 ${json}= Parse Json ${resp.content}
35 ${value}= get from dictionary ${json} ${key}
36 Should Be Equal As Strings ${value} ${expected_value}