26#ifndef MYSQLROUTER_MOCK_SERVER_REST_CLIENT_INCLUDED
27#define MYSQLROUTER_MOCK_SERVER_REST_CLIENT_INCLUDED
34 "/api/v1/mock_server/globals/";
51 const std::string &http_hostname =
"127.0.0.1");
95 std::chrono::milliseconds max_wait_time =
101 static constexpr std::chrono::milliseconds
Definition: mock_server_rest_client.h:42
bool get_bool_global(const std::string &global_name)
Gets a selected mock server bool global value.
Definition: mock_server_rest_client.cc:130
std::string get_globals_as_json_string()
Gets all the mock server globals as a json string.
Definition: mock_server_rest_client.cc:75
MockServerRestClient(const uint16_t http_port, const std::string &http_hostname="127.0.0.1")
Constructor.
Definition: mock_server_rest_client.cc:39
static constexpr std::chrono::milliseconds kMockServerMaxRestEndpointStepTime
Definition: mock_server_rest_client.h:99
const uint16_t http_port_
Definition: mock_server_rest_client.h:104
void send_delete(const std::string &uri)
Sends Delete request to the mock server on the selected URI.
Definition: mock_server_rest_client.cc:151
int get_int_global(const std::string &global_name)
Gets a selected mock server int global value.
Definition: mock_server_rest_client.cc:109
static constexpr std::chrono::milliseconds kMockServerDefaultRestEndpointTimeout
Definition: mock_server_rest_client.h:102
void set_globals(const std::string &globals_json)
Sets values of the all globals in the server mock via http interface.
Definition: mock_server_rest_client.cc:43
bool wait_for_rest_endpoint_ready(std::chrono::milliseconds max_wait_time=kMockServerDefaultRestEndpointTimeout) const noexcept
Wait until a REST endpoint returns !404.
Definition: mock_server_rest_client.cc:176
const std::string http_hostname_
Definition: mock_server_rest_client.h:103
static constexpr const char kMockServerGlobalsRestUri[]
URI for the mock server globals.
Definition: mock_server_rest_client.h:33