Add ReportManager and Report unit tests

Introduced ReportFactory to seperate Report and ReportManager
unit tests. Implemented mocks for Report, ReportManager and
ReportFactory classes. Added tests for DBus Properties and Methods
provided by telemetry service.

Tested:
 - Ran unit-tests with success

Change-Id: I1860e280d26ee4becc52de98dd65e5697d26b376
Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>
diff --git a/src/report_manager.cpp b/src/report_manager.cpp
index f2cbe94..5944fa9 100644
--- a/src/report_manager.cpp
+++ b/src/report_manager.cpp
@@ -4,21 +4,16 @@
 
 #include <system_error>
 
-constexpr const char* reportManagerIfaceName =
-    "xyz.openbmc_project.Telemetry.ReportManager";
-constexpr const char* reportManagerPath =
-    "/xyz/openbmc_project/Telemetry/Reports";
-
 ReportManager::ReportManager(
-    const std::shared_ptr<sdbusplus::asio::connection>& bus,
+    std::unique_ptr<interfaces::ReportFactory> reportFactoryIn,
     const std::shared_ptr<sdbusplus::asio::object_server>& objServerIn) :
+    reportFactory(std::move(reportFactoryIn)),
     objServer(objServerIn)
 {
     reports.reserve(maxReports);
 
     reportManagerIface = objServer->add_unique_interface(
-        reportManagerPath, reportManagerIfaceName,
-        [this, &ioc = bus->get_io_context()](auto& dbusIface) {
+        reportManagerPath, reportManagerIfaceName, [this](auto& dbusIface) {
             dbusIface.register_property_r(
                 "MaxReports", uint32_t{}, sdbusplus::vtable::property_::const_,
                 [](const auto&) { return maxReports; });
@@ -27,13 +22,12 @@
                 [](const auto&) -> uint64_t { return minInterval.count(); });
 
             dbusIface.register_method(
-                "AddReport",
-                [this, &ioc](const std::string& reportName,
-                             const std::string& reportingType,
-                             const bool emitsReadingsUpdate,
-                             const bool logToMetricReportsCollection,
-                             const uint64_t interval,
-                             const ReadingParameters& metricParams) {
+                "AddReport", [this](const std::string& reportName,
+                                    const std::string& reportingType,
+                                    const bool emitsReadingsUpdate,
+                                    const bool logToMetricReportsCollection,
+                                    const uint64_t interval,
+                                    const ReadingParameters& metricParams) {
                     if (reports.size() >= maxReports)
                     {
                         throw sdbusplus::exception::SdBusError(
@@ -43,7 +37,7 @@
 
                     for (const auto& report : reports)
                     {
-                        if (report->name == reportName)
+                        if (report->getName() == reportName)
                         {
                             throw sdbusplus::exception::SdBusError(
                                 static_cast<int>(std::errc::file_exists),
@@ -59,16 +53,16 @@
                             "Invalid interval");
                     }
 
-                    reports.emplace_back(std::make_unique<Report>(
-                        ioc, objServer, reportName, reportingType,
-                        emitsReadingsUpdate, logToMetricReportsCollection,
-                        std::move(reportInterval), metricParams, *this));
-                    return reports.back()->path;
+                    reports.emplace_back(reportFactory->make(
+                        reportName, reportingType, emitsReadingsUpdate,
+                        logToMetricReportsCollection, std::move(reportInterval),
+                        metricParams, *this));
+                    return reports.back()->getPath();
                 });
         });
 }
 
-void ReportManager::removeReport(const Report* report)
+void ReportManager::removeReport(const interfaces::Report* report)
 {
     reports.erase(
         std::remove_if(reports.begin(), reports.end(),