async changes to support 40749

https://gerrit.openbmc-project.xyz/c/openbmc/sdbusplus/+/40749

Is currently proposing changing these APIs to use C++ asio style
callbacks instead of the javascript callbacks.  This was the only usage
of these callbacks that I found, so this patchset is to move to the new
type.

Requires 40749 to be merged before this will build.

Signed-off-by: Ed Tanous <edtanous@google.com>
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Change-Id: I1e950c096e36d2150a94c459e794bbac7303100d
diff --git a/tests/src/test_report_manager.cpp b/tests/src/test_report_manager.cpp
index 19760fe..d9ea4af 100644
--- a/tests/src/test_report_manager.cpp
+++ b/tests/src/test_report_manager.cpp
@@ -6,6 +6,7 @@
 #include "report.hpp"
 #include "report_manager.hpp"
 #include "utils/conversion.hpp"
+#include "utils/set_exception.hpp"
 #include "utils/transform.hpp"
 
 using namespace testing;
@@ -67,17 +68,21 @@
     template <class T>
     static T getProperty(std::string property)
     {
-        std::promise<T> propertyPromise;
+        auto propertyPromise = std::promise<T>();
+        auto propertyFuture = propertyPromise.get_future();
         sdbusplus::asio::getProperty<T>(
             *DbusEnvironment::getBus(), DbusEnvironment::serviceName(),
             ReportManager::reportManagerPath,
             ReportManager::reportManagerIfaceName, property,
-            [&propertyPromise](boost::system::error_code ec) {
-                EXPECT_THAT(static_cast<bool>(ec), ::testing::Eq(false));
-                propertyPromise.set_value(T{});
-            },
-            [&propertyPromise](T t) { propertyPromise.set_value(t); });
-        return DbusEnvironment::waitForFuture(propertyPromise.get_future());
+            [&propertyPromise](const boost::system::error_code& ec, T t) {
+                if (ec)
+                {
+                    utils::setException(propertyPromise, "Get property failed");
+                    return;
+                }
+                propertyPromise.set_value(t);
+            });
+        return DbusEnvironment::waitForFuture(std::move(propertyFuture));
     }
 };