add log level change test

Change-Id: Ie4fb5192a86e4433df865c8913ea212d25acc00b
Issue-ID: INT-1107
Signed-off-by: micdzied <michal.1.dziedzic@nokia.com>
diff --git a/tests/dcaegen2/prh-testcases/resources/prh_library.robot b/tests/dcaegen2/prh-testcases/resources/prh_library.robot
index 007caf3..ce5b65b 100644
--- a/tests/dcaegen2/prh-testcases/resources/prh_library.robot
+++ b/tests/dcaegen2/prh-testcases/resources/prh_library.robot
@@ -2,6 +2,7 @@
 Library           RequestsLibrary
 Library           Collections
 Library           PrhLibrary.py
+Library           OperatingSystem
 Resource          ../../../common.robot
 
 *** Keywords ***
@@ -143,6 +144,8 @@
     Set Suite Variable    ${aai_setup_session}    aai_setup_session
     Create Session    consul_setup_session    ${CONSUL_SETUP_URL}
     Set Suite Variable    ${consul_setup_session}    consul_setup_session
+    Create Session    prh_setup_session    ${PRH_SETUP_URL}
+    Set Suite Variable    ${prh_setup_session}    prh_setup_session
 
 Reset Simulators
     Reset AAI simulator
@@ -158,4 +161,23 @@
 
 Create headers
     ${headers}=    Create Dictionary    Accept=application/json    Content-Type=application/json
-    Set Suite Variable    ${suite_headers}    ${headers}
\ No newline at end of file
+    Set Suite Variable    ${suite_headers}    ${headers}
+
+Verify change logging level
+    Change logging level  TRACE
+    Verify logs with heartbeat
+    Change logging level  INFO
+
+Change logging level
+    [Arguments]    ${expected_log_level}
+    Run   curl -i -X POST -H 'Content-Type: application/json' -d '{"configuredLevel": "${expected_log_level}"}' http://localhost:8100/actuator/loggers/org.onap.dcaegen2.services.prh
+
+Verify logging level
+    [Arguments]    ${expected_log_level}
+    ${resp}=    Get Request    prh_setup_session  /actuator/loggers/org.onap.dcaegen2.services.prh
+    Should Be Equal As JSON    ${resp.content}    ${expected_log_level}
+
+Verify logs with heartbeat
+    Verify logging level  ${TRACE_LOG_LEVEL_CONF}
+    Get Request    prh_setup_session    /heartbeat
+    Check PRH log   Heartbeat request received
\ No newline at end of file