blob: 9ffd3a2d2f504620d9c741b9fb05980915155a42 [file] [log] [blame]
Patrick Ventureef3aead2018-09-12 08:53:29 -07001#pragma once
2
Patrick Venturecd8dab42019-01-15 19:57:38 -08003#include "manager.hpp"
4
Patrick Ventureaceb4ba2018-09-27 14:50:37 -07005#include <blobs-ipmid/blobs.hpp>
Patrick Ventureef3aead2018-09-12 08:53:29 -07006#include <memory>
7#include <string>
8
9#include <gmock/gmock.h>
10
11namespace blobs
12{
13
14class ManagerMock : public ManagerInterface
15{
16 public:
17 virtual ~ManagerMock() = default;
18
Willy Tu52b75fb2021-04-24 11:18:36 -070019 MOCK_METHOD(bool, registerHandler, (std::unique_ptr<GenericBlobInterface>),
20 (override));
21 MOCK_METHOD(uint32_t, buildBlobList, (), (override));
22 MOCK_METHOD(std::string, getBlobId, (uint32_t), (override));
23 MOCK_METHOD(bool, open, (uint16_t, const std::string&, uint16_t*),
24 (override));
25 MOCK_METHOD(bool, stat, (const std::string&, BlobMeta*), (override));
26 MOCK_METHOD(bool, stat, (uint16_t, BlobMeta*), (override));
27 MOCK_METHOD(bool, commit, (uint16_t, const std::vector<uint8_t>&),
28 (override));
29 MOCK_METHOD(bool, close, (uint16_t), (override));
30 MOCK_METHOD(std::vector<uint8_t>, read, (uint16_t, uint32_t, uint32_t),
31 (override));
32 MOCK_METHOD(bool, write, (uint16_t, uint32_t, const std::vector<uint8_t>&),
33 (override));
34 MOCK_METHOD(bool, deleteBlob, (const std::string&), (override));
35 MOCK_METHOD(bool, writeMeta,
36 (uint16_t, uint32_t, const std::vector<uint8_t>&), (override));
Patrick Ventureef3aead2018-09-12 08:53:29 -070037};
Patrick Venture03f415e2018-10-04 10:10:58 -070038
39/*
40 * Provide a one-off implementation for now.
41 * To test this, set managerReturned as you need.
42 */
43ManagerInterface* managerReturned;
44
45ManagerInterface* getBlobManager()
46{
47 return managerReturned;
48}
49
Patrick Ventureef3aead2018-09-12 08:53:29 -070050} // namespace blobs