Go to the documentation of this file.
27 virtual void start() = 0;
30 virtual void stop() = 0;
40 std::unique_ptr<Server>
server;
55 virtual void start()
override;
57 virtual void stop()
override;
118 const std::string &url,
119 const std::string &method,
120 const std::string &data,
121 const std::vector<UrlArg> &urlArguments = {},
122 const std::vector<Header> &headers = {}) = 0;
Definition: mock_server.h:22
virtual ~MockServer()
Definition: mock_server.cc:109
KeyValue(const std::string &key, const std::string &value="")
Definition: mock_server.h:70
std::vector< Header > headers
Response headers.
Definition: mock_server.h:96
std::unique_ptr< Server > server
Server implementation.
Definition: mock_server.h:38
virtual bool isRunning() const override
Return true if server is running.
Definition: mock_server.cc:124
UrlArg(const std::string &key, const std::string &value)
Definition: mock_server.h:87
Definition: mock_server.h:37
Response object.
Definition: mock_server.h:93
Definition: mock_server.cc:20
std::string body
Body sent to the client.
Definition: mock_server.h:95
Response(int status=200, const std::string &body="OK")
Definition: mock_server.h:98
virtual void stop() override
Stops the server.
Definition: mock_server.cc:119
virtual bool isRunning() const =0
Return true if server is running.
Definition: mock_server.cc:26
Response & addHeader(const Header &h)
Add header to the response.
Definition: mock_server.h:103
Url argument (with optional value)
Definition: mock_server.h:80
int port
Port to run server on.
Definition: mock_server.h:42
MockServer(const MockServer &)
UrlArg(const std::string &key)
Definition: mock_server.h:84
virtual void start()=0
Allow to start the server.
virtual void start() override
Starts the server.
Definition: mock_server.cc:114
int getPort() const
Return port number server is running on.
Definition: mock_server.cc:129
int status
Status code returned to the client.
Definition: mock_server.h:94
bool hasValue
Whether the value field has been set.
Definition: mock_server.h:82
virtual void stop()=0
Allow to stop the server.
Key-Value storage.
Definition: mock_server.h:66
virtual Response responseHandler(const std::string &url, const std::string &method, const std::string &data, const std::vector< UrlArg > &urlArguments={}, const std::vector< Header > &headers={})=0
std::string key
Definition: mock_server.h:67
std::string value
Definition: mock_server.h:68
MockServer & operator=(const MockServer &)