2 Documentation The main interface for interacting with Message router. It handles low level stuff like managing the http request library and message router required fields
3 Library RequestsLibrary
6 Resource global_properties.robot
9 ${MR_HEALTH_CHECK_PATH} /topics
10 ${MR_PUB_HEALTH_CHECK_PATH} /events/TEST_TOPIC
11 ${MR_SUB_HEALTH_CHECK_PATH} /events/TEST_TOPIC/g1/c4?timeout=5000
12 ${MR_ENDPOINT} ${GLOBAL_MR_SERVER_PROTOCOL}://${GLOBAL_INJECTED_MR_IP_ADDR}:${GLOBAL_MR_SERVER_PORT}
13 ${MR_PUBLISH_TEMPLATE} robot/assets/templates/mr_publish.template
18 [Documentation] Runs MR Health check
19 ${resp}= Run MR Get Request ${MR_HEALTH_CHECK_PATH}
20 Should Be Equal As Strings ${resp.status_code} 200
21 Should Contain ${resp.json()} topics
23 Run MR PubSub Health Check
24 [Documentation] Runs MR PubSub Health check
25 ${resp}= Run MR Get Request ${MR_SUB_HEALTH_CHECK_PATH}
26 # topic may not be created which is a 400 error
27 ${resp}= Run MR Post Request ${MR_PUB_HEALTH_CHECK_PATH}
28 Should Be Equal As Strings ${resp.status_code} 200
29 Should Contain ${resp.json()} serverTimeMs Failed to Write Data
30 ${resp}= Run MR Get Request ${MR_SUB_HEALTH_CHECK_PATH}
32 Should Be Equal As Strings ${resp.status_code} 200
33 Should Contain ${resp.json()[0]} timestamp Failed to Read Data
36 [Documentation] Runs MR Get request
37 [Arguments] ${data_path}
38 ${session}= Create Session mr ${MR_ENDPOINT}
39 ${uuid}= Generate UUID
40 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
41 ${resp}= Get Request mr ${data_path} headers=${headers}
42 Log Received response from message router ${resp.text}
46 [Documentation] Runs MR Post request
47 [Arguments] ${data_path}
48 ${session}= Create Session mr ${MR_ENDPOINT}
49 ${timestamp}= Get Current Date
50 ${dict}= Create Dictionary timestamp=${timestamp}
51 ${data}= Fill JSON Template File ${MR_PUBLISH_TEMPLATE} ${dict}
52 ${uuid}= Generate UUID
53 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
54 ${resp}= Post Request mr ${data_path} data=${data} headers=${headers}
55 Log Received response from message router ${resp.text}