test: move shared mocks to common area
Move mocks that can be shared between version and firmware handler tests
to parent directory (bmc/test).
This will eliminate the need to duplicate the definition of testing
mocks.
Signed-off-by: Jason Ling <jasonling@google.com>
Change-Id: Id41c56271d0bfbcb8c18da1f903c7786699508d4
diff --git a/bmc/firmware-handler/test/create_action_map.hpp b/bmc/firmware-handler/test/create_action_map.hpp
new file mode 100644
index 0000000..8238e2f
--- /dev/null
+++ b/bmc/firmware-handler/test/create_action_map.hpp
@@ -0,0 +1,26 @@
+#pragma once
+
+#include "firmware_handler.hpp"
+#include "triggerable_mock.hpp"
+
+#include <memory>
+#include <string>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+namespace ipmi_flash
+{
+ActionMap CreateActionMap(const std::string& blobPath)
+{
+ std::unique_ptr<ActionPack> actionPack = std::make_unique<ActionPack>();
+ actionPack->preparation = CreateTriggerMock();
+ actionPack->verification = CreateTriggerMock();
+ actionPack->update = CreateTriggerMock();
+
+ ActionMap map;
+ map[blobPath] = std::move(actionPack);
+ return map;
+}
+
+} // namespace ipmi_flash