blob: 8c83d52e15be55f6a752d3f8882c95293d959621 [file] [log] [blame]
Patrick Venture1d66fe62019-06-03 14:57:27 -07001#pragma once
2
Patrick Venturefa06a5f2019-07-01 09:22:38 -07003#include "firmware_handler.hpp"
Patrick Venture1d66fe62019-06-03 14:57:27 -07004#include "status.hpp"
5
Patrick Venturefa06a5f2019-07-01 09:22:38 -07006#include <memory>
7#include <string>
8
Patrick Venture1d66fe62019-06-03 14:57:27 -07009#include <gtest/gtest.h>
10
11namespace ipmi_flash
12{
13// TriggerableActionInterface
14
15class TriggerMock : public TriggerableActionInterface
16{
17 public:
18 MOCK_METHOD0(trigger, bool());
19 MOCK_METHOD0(abort, void());
20 MOCK_METHOD0(status, ActionStatus());
21};
22
23std::unique_ptr<TriggerableActionInterface> CreateTriggerMock()
24{
25 return std::make_unique<TriggerMock>();
26}
27
Patrick Venturefa06a5f2019-07-01 09:22:38 -070028ActionMap CreateActionMap(const std::string& blobPath)
29{
30 std::unique_ptr<ActionPack> actionPack = std::make_unique<ActionPack>();
31 actionPack->preparation = std::move(CreateTriggerMock());
32 actionPack->verification = std::move(CreateTriggerMock());
33 actionPack->update = std::move(CreateTriggerMock());
34
35 ActionMap map;
36 map[blobPath] = std::move(actionPack);
37 return map;
38}
39
Patrick Venture1d66fe62019-06-03 14:57:27 -070040} // namespace ipmi_flash