regulators: Add Services to ActionEnvironment
Add Services& services to the ActionEnvironment constructor.
Add Services& getServices() to the ActionEnvironment class.
Add Services& services to the ActionEnvironment class.
Update the ActionEnvironment test for the new getServices() method.
Update classes that create an ActionEnvironment.
Update all affected testcases that create an ActionEnvironment.
Signed-off-by: Bob King <Bob_King@wistron.com>
Change-Id: I12ac9f301746965aa282b69432a71ad525739c9e
diff --git a/phosphor-regulators/test/actions/action_utils_tests.cpp b/phosphor-regulators/test/actions/action_utils_tests.cpp
index ede5fa8..640c085 100644
--- a/phosphor-regulators/test/actions/action_utils_tests.cpp
+++ b/phosphor-regulators/test/actions/action_utils_tests.cpp
@@ -18,6 +18,7 @@
#include "action_utils.hpp"
#include "id_map.hpp"
#include "mock_action.hpp"
+#include "mock_services.hpp"
#include <exception>
#include <memory>
@@ -37,7 +38,9 @@
{
// Create ActionEnvironment
IDMap idMap{};
- ActionEnvironment env{idMap, ""};
+ // Create mock services.
+ MockServices services{};
+ ActionEnvironment env{idMap, "", services};
// Test where vector is empty
try