mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-27 23:25:53 +00:00
@@ -19,6 +19,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "etl/ETLState.hpp"
|
||||
#include "etlng/InitialLoadObserverInterface.hpp"
|
||||
#include "etlng/LoadBalancerInterface.hpp"
|
||||
#include "rpc/Errors.hpp"
|
||||
#include "util/FakeFetchResponse.hpp"
|
||||
|
||||
@@ -28,10 +31,12 @@
|
||||
#include <boost/json/value.hpp>
|
||||
#include <gmock/gmock.h>
|
||||
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
#include <expected>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
struct MockLoadBalancer {
|
||||
using RawLedgerObjectType = FakeLedgerObject;
|
||||
@@ -48,3 +53,36 @@ struct MockLoadBalancer {
|
||||
(const)
|
||||
);
|
||||
};
|
||||
|
||||
struct MockNgLoadBalancer : etlng::LoadBalancerInterface {
|
||||
using RawLedgerObjectType = FakeLedgerObject;
|
||||
|
||||
MOCK_METHOD(
|
||||
std::vector<std::string>,
|
||||
loadInitialLedger,
|
||||
(uint32_t, etlng::InitialLoadObserverInterface&, std::chrono::steady_clock::duration),
|
||||
(override)
|
||||
);
|
||||
MOCK_METHOD(
|
||||
std::vector<std::string>,
|
||||
loadInitialLedger,
|
||||
(uint32_t, std::chrono::steady_clock::duration),
|
||||
(override)
|
||||
);
|
||||
MOCK_METHOD(
|
||||
OptionalGetLedgerResponseType,
|
||||
fetchLedger,
|
||||
(uint32_t, bool, bool, std::chrono::steady_clock::duration),
|
||||
(override)
|
||||
);
|
||||
MOCK_METHOD(boost::json::value, toJson, (), (const, override));
|
||||
MOCK_METHOD(std::optional<etl::ETLState>, getETLState, (), (noexcept, override));
|
||||
|
||||
using ForwardToRippledReturnType = std::expected<boost::json::object, rpc::ClioError>;
|
||||
MOCK_METHOD(
|
||||
ForwardToRippledReturnType,
|
||||
forwardToRippled,
|
||||
(boost::json::object const&, std::optional<std::string> const&, bool, boost::asio::yield_context),
|
||||
(override)
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user