Refactor the platform event message handler code

This commit makes slight code change to use some functions both
in BMC requester and responder flow.

Tested : Using pldmtool platformEventMessage is sent and D-Bus
property is verified.

Change-Id: Id433f136ad4c7be0d94817deed1d6b60df36b3e4
Signed-off-by: Pavithra Barithaya <pavithra.b@ibm.com>
diff --git a/test/libpldmresponder_pdr_sensor_test.cpp b/test/libpldmresponder_pdr_sensor_test.cpp
index 946720a..6429fc6 100644
--- a/test/libpldmresponder_pdr_sensor_test.cpp
+++ b/test/libpldmresponder_pdr_sensor_test.cpp
@@ -32,8 +32,8 @@
     auto inPDRRepo = pldm_pdr_init();
     auto outPDRRepo = pldm_pdr_init();
     Repo outRepo(outPDRRepo);
-    Handler handler(&mockedUtils, "./pdr_jsons/state_sensor/good", "",
-                    inPDRRepo, nullptr, nullptr, nullptr);
+    Handler handler(&mockedUtils, "./pdr_jsons/state_sensor/good", inPDRRepo,
+                    nullptr, nullptr, nullptr);
     handler.getPDR(req, requestPayloadLength);
     Repo inRepo(inPDRRepo);
     getRepoByType(inRepo, outRepo, PLDM_STATE_SENSOR_PDR);
@@ -82,8 +82,8 @@
     auto inPDRRepo = pldm_pdr_init();
     auto outPDRRepo = pldm_pdr_init();
     Repo outRepo(outPDRRepo);
-    Handler handler(&mockedUtils, "./pdr_jsons/state_sensor/good", "",
-                    inPDRRepo, nullptr, nullptr, nullptr);
+    Handler handler(&mockedUtils, "./pdr_jsons/state_sensor/good", inPDRRepo,
+                    nullptr, nullptr, nullptr);
     handler.getPDR(req, requestPayloadLength);
     Repo inRepo(inPDRRepo);
     getRepoByType(inRepo, outRepo, PLDM_STATE_SENSOR_PDR);