diff --git a/test/webfuse/mocks/mock_invokation_handler.hpp b/test/webfuse/mocks/mock_invokation_handler.hpp index ba63130..9a70482 100644 --- a/test/webfuse/mocks/mock_invokation_handler.hpp +++ b/test/webfuse/mocks/mock_invokation_handler.hpp @@ -1,13 +1,13 @@ #ifndef WF_MOCK_INVOKATION_HANDLER_HPP #define WF_MOCK_INVOKATION_HANDLER_HPP -#include "webfuse/test_util/ws_server.hpp" +#include "webfuse/test_util/invokation_handler.hpp" #include namespace webfuse_test { -class MockInvokationHander: public IIvokationHandler +class MockInvokationHander: public InvokationHandler { public: MOCK_METHOD2(Invoke, std::string(char const * method, json_t * params)); diff --git a/test/webfuse/test_util/invokation_handler.hpp b/test/webfuse/test_util/invokation_handler.hpp new file mode 100644 index 0000000..ac8b7fe --- /dev/null +++ b/test/webfuse/test_util/invokation_handler.hpp @@ -0,0 +1,19 @@ +#ifndef WF_TEST_UTIL_INVOKATION_HANDLER_HPP +#define WF_TEST_UTIL_INVOKATION_HANDLER_HPP + +#include +#include + +namespace webfuse_test +{ + +class InvokationHandler +{ +public: + virtual ~InvokationHandler() = default; + virtual std::string Invoke(char const * method, json_t * params) = 0; +}; + +} + +#endif diff --git a/test/webfuse/test_util/ws_server.cc b/test/webfuse/test_util/ws_server.cc index e76264d..e2161d5 100644 --- a/test/webfuse/test_util/ws_server.cc +++ b/test/webfuse/test_util/ws_server.cc @@ -1,4 +1,5 @@ #include "webfuse/test_util/ws_server.hpp" +#include "webfuse/test_util/invokation_handler.hpp" #include "webfuse/impl/util/lws_log.h" #include @@ -75,7 +76,7 @@ class WsServer::Private : public IServer Private(Private const &) = delete; Private & operator=(Private const &) = delete; public: - Private(IIvokationHandler & handler, std::string const & protocol, int port, bool enable_tls); + Private(InvokationHandler & handler, std::string const & protocol, int port, bool enable_tls); ~Private(); std::string const & GetUrl() const; void OnConnected(lws * wsi) override; @@ -88,7 +89,7 @@ public: private: static void Run(Private * self); - IIvokationHandler & handler_; + InvokationHandler & handler_; std::string protocol_; bool is_shutdown_requested; lws * wsi_; @@ -102,7 +103,7 @@ private: }; WsServer::WsServer( - IIvokationHandler& handler, + InvokationHandler& handler, std::string const & protocol, int port, bool enable_tls) @@ -133,7 +134,7 @@ void WsServer::SendMessage(json_t * message) WsServer::Private::Private( - IIvokationHandler & handler, + InvokationHandler & handler, std::string const & protocol, int port, bool enable_tls) diff --git a/test/webfuse/test_util/ws_server.hpp b/test/webfuse/test_util/ws_server.hpp index cced6ef..e8b0dfe 100644 --- a/test/webfuse/test_util/ws_server.hpp +++ b/test/webfuse/test_util/ws_server.hpp @@ -7,12 +7,7 @@ namespace webfuse_test { -class IIvokationHandler -{ -public: - virtual ~IIvokationHandler() = default; - virtual std::string Invoke(char const * method, json_t * params) = 0; -}; +class InvokationHandler; class WsServer { @@ -20,7 +15,7 @@ class WsServer WsServer & operator=(WsServer const & ) = delete; public: WsServer( - IIvokationHandler& handler, + InvokationHandler& handler, std::string const & protocol, int port = 0, bool enable_tls = false);