#include <mock_server_rest_client.h>
◆ MockServerRestClient()
MockServerRestClient::MockServerRestClient |
( |
const uint16_t |
http_port, |
|
|
const std::string & |
http_hostname = "127.0.0.1" |
|
) |
| |
Constructor.
- Parameters
-
http_port | port on which http server handles the http requests |
http_hostname | hostname of the http server that handles the http requests |
◆ get_bool_global()
bool MockServerRestClient::get_bool_global |
( |
const std::string & |
global_name | ) |
|
Gets a selected mock server bool global value.
- Parameters
-
global_name | name of the global |
◆ get_globals_as_json_string()
std::string MockServerRestClient::get_globals_as_json_string |
( |
| ) |
|
Gets all the mock server globals as a json string.
◆ get_int_global()
int MockServerRestClient::get_int_global |
( |
const std::string & |
global_name | ) |
|
Gets a selected mock server int global value.
- Parameters
-
global_name | name of the global |
◆ send_delete()
void MockServerRestClient::send_delete |
( |
const std::string & |
uri | ) |
|
Sends Delete request to the mock server on the selected URI.
- Parameters
-
uri | uri for the Delete request |
◆ set_globals()
void MockServerRestClient::set_globals |
( |
const std::string & |
globals_json | ) |
|
Sets values of the all globals in the server mock via http interface.
Example: set_globals("{\"secondary_removed": true}");
- Parameters
-
globals_json | json string with the globals names and values to set |
◆ wait_for_rest_endpoint_ready()
Wait until a REST endpoint returns !404.
at mock startup the socket starts to listen before the REST endpoint gets registered. As long as it returns 404 Not Found we should wait and retry.
- Parameters
-
max_wait_time | max time to wait for endpoint being ready |
- Returns
- true once endpoint doesn't return 404 anymore, fails otherwise
◆ http_hostname_
const std::string MockServerRestClient::http_hostname_ |
|
private |
◆ http_port_
const uint16_t MockServerRestClient::http_port_ |
|
private |
◆ kMockServerDefaultRestEndpointTimeout
constexpr std::chrono::milliseconds MockServerRestClient::kMockServerDefaultRestEndpointTimeout {1000} |
|
staticconstexprprivate |
◆ kMockServerMaxRestEndpointStepTime
constexpr std::chrono::milliseconds MockServerRestClient::kMockServerMaxRestEndpointStepTime |
|
staticconstexprprivate |
The documentation for this class was generated from the following files: