Add unit test for item_udpater

To test item_updater easier, mocking utils is necessary.
So add a UtilsInterface to make the mocking eaiser.

Due to the fact that there is templated member functions that could not
be virtual, adding an extra "Impl" virtual function makes it possible to
simulates the mock of templated functions.
See
https://stackoverflow.com/questions/7968023/c-virtual-template-method
for details.

However, using std::any in with googlemock has an issue on GCC9, see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90415
for details.

So this commit uses std::experimental::any as a workaround.

With the mocked utils, it's easy to test item_updater in different
cases.

This commit adds the test cases for creating PSU objects, when:
* There is no PSU present
* There is one PSU present
* There are two PSUs present with the same version;
* There are two PSUs present with different versions.

Tested: Verify the unit tests passes.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I5d74ab26b344c5c40bc141f97b8aca42e74ee88e
diff --git a/src/item_updater.cpp b/src/item_updater.cpp
index 1f1af9d..6c55062 100644
--- a/src/item_updater.cpp
+++ b/src/item_updater.cpp
@@ -55,7 +55,7 @@
                         purpose = value;
                     }
                 }
-                else if (propertyName == "Version")
+                else if (propertyName == VERSION)
                 {
                     version = variant_ns::get<std::string>(propertyValue);
                 }
@@ -304,13 +304,13 @@
     // The code was expecting to get callback on mutliple properties changed.
     // But in practice, the callback is received one-by-one for each property.
     // So it has to handle Present and Version property separately.
-    auto p = properties.find("Present");
+    auto p = properties.find(PRESENT);
     if (p != properties.end())
     {
         present = sdbusplus::message::variant_ns::get<bool>(p->second);
         psuStatusMap[psuPath].present = *present;
     }
-    p = properties.find("Version");
+    p = properties.find(VERSION);
     if (p != properties.end())
     {
         version = sdbusplus::message::variant_ns::get<std::string>(p->second);
@@ -341,7 +341,7 @@
         {
             // If a PSU is plugged out, version property is update to empty as
             // well, and we get callback here, but ignore that because it is
-            // handled by "Present" callback.
+            // handled by PRESENT callback.
             return;
         }
         // Remove object or association
@@ -357,9 +357,9 @@
         // Assume the same service implement both Version and Item interface
         auto service = utils::getService(bus, p.c_str(), VERSION_IFACE);
         auto version = utils::getProperty<std::string>(
-            bus, service.c_str(), p.c_str(), VERSION_IFACE, "Version");
+            bus, service.c_str(), p.c_str(), VERSION_IFACE, VERSION);
         auto present = utils::getProperty<bool>(bus, service.c_str(), p.c_str(),
-                                                ITEM_IFACE, "Present");
+                                                ITEM_IFACE, PRESENT);
         if (present && !version.empty())
         {
             createPsuObject(p, version);