#include "utils.hpp" #include namespace utils { class MockedUtils : public UtilsInterface { public: MockedUtils() = default; MockedUtils(const MockedUtils&) = delete; MockedUtils& operator=(const MockedUtils&) = delete; MockedUtils(MockedUtils&&) = delete; MockedUtils& operator=(MockedUtils&&) = delete; ~MockedUtils() override = default; MOCK_CONST_METHOD1(getPSUInventoryPath, std::vector(sdbusplus::bus_t& bus)); MOCK_CONST_METHOD3(getService, std::string(sdbusplus::bus_t& bus, const char* path, const char* interface)); MOCK_CONST_METHOD3(getServices, std::vector(sdbusplus::bus_t& bus, const char* path, const char* interface)); MOCK_CONST_METHOD1(getVersionId, std::string(const std::string& version)); MOCK_CONST_METHOD1(getVersion, std::string(const std::string& psuInventoryPath)); MOCK_CONST_METHOD1(getLatestVersion, std::string(const std::set& versions)); MOCK_CONST_METHOD2(isAssociated, bool(const std::string& psuInventoryPath, const AssociationList& assocs)); MOCK_CONST_METHOD5(getPropertyImpl, any(sdbusplus::bus_t& bus, const char* service, const char* path, const char* interface, const char* propertyName)); }; static std::unique_ptr utils; inline const UtilsInterface& getUtils() { if (!utils) { utils = std::make_unique(); } return *utils; } inline void freeUtils() { utils.reset(); } } // namespace utils