blob: 88fdcf29ff6f3cc676b80096862d86594f270d23 [file] [log] [blame]
Lei YUf77189f2019-08-07 14:26:30 +08001#include "utils.hpp"
2
3#include <gmock/gmock.h>
4
5namespace utils
6{
7
8class MockedUtils : public UtilsInterface
9{
10 public:
11 virtual ~MockedUtils() = default;
12
13 MOCK_CONST_METHOD1(getPSUInventoryPath,
14 std::vector<std::string>(sdbusplus::bus::bus& bus));
15
16 MOCK_CONST_METHOD3(getService,
17 std::string(sdbusplus::bus::bus& bus, const char* path,
18 const char* interface));
19
20 MOCK_CONST_METHOD1(getVersionId, std::string(const std::string& version));
21
Lei YU5f3584d2019-08-27 16:28:53 +080022 MOCK_CONST_METHOD1(getVersion,
23 std::string(const std::string& psuInventoryPath));
24
Lei YUf77189f2019-08-07 14:26:30 +080025 MOCK_CONST_METHOD5(getPropertyImpl,
26 any(sdbusplus::bus::bus& bus, const char* service,
27 const char* path, const char* interface,
28 const char* propertyName));
29};
30
31const UtilsInterface& getUtils()
32{
33 static MockedUtils utils;
34 return utils;
35}
36
37} // namespace utils