mirror of
https://github.com/XRPLF/clio.git
synced 2026-06-04 01:06:45 +00:00
23 lines
646 B
C++
23 lines
646 B
C++
#include "rpc/common/AnyHandler.hpp"
|
|
#include "rpc/common/Types.hpp"
|
|
#include "rpc/handlers/Ping.hpp"
|
|
#include "util/HandlerBaseTestFixture.hpp"
|
|
|
|
#include <boost/json/parse.hpp>
|
|
#include <gtest/gtest.h>
|
|
|
|
using namespace rpc;
|
|
|
|
class RPCPingHandlerTest : public HandlerBaseTest {};
|
|
|
|
// example handler tests
|
|
TEST_F(RPCPingHandlerTest, Default)
|
|
{
|
|
runSpawn([](auto yield) {
|
|
auto const handler = AnyHandler{PingHandler{}};
|
|
auto const output = handler.process(boost::json::parse(R"JSON({})JSON"), Context{yield});
|
|
ASSERT_TRUE(output);
|
|
EXPECT_EQ(output.result.value(), boost::json::parse(R"JSON({})JSON"));
|
|
});
|
|
}
|