httpmockserver
Classes | Functions
httpmock Namespace Reference

Classes

class  IMockServer
 
struct  KeyValueIteratorTrait
 
struct  KeyValueIteratorTrait< MockServer::Header >
 Specialization for MockServer::Header, we want to iterate headers only. More...
 
struct  KeyValueIteratorTrait< MockServer::UrlArg >
 Specialization for MockServer::UrlArg, we want to iterate GET_ARGUMENTS only. More...
 
class  MockServer
 
class  MockServerHolder
 
class  TestEnvironment
 

Functions

template<typename HTTPMock >
std::unique_ptr< MockServergetFirstRunningMockServer (unsigned port=8080, unsigned tryCount=1000)
 
template<typename HTTPMock >
::testing::Environment * createMockServerEnvironment (unsigned startPort=8080, unsigned tryCount=1000)
 

Function Documentation

◆ createMockServerEnvironment()

template<typename HTTPMock >
::testing::Environment* httpmock::createMockServerEnvironment ( unsigned  startPort = 8080,
unsigned  tryCount = 1000 
)

Return new environment with running MockServer heir. Searches for first free port in range <startPort, startPort + tryCount>. Caller is responsible for destruction of returned resources.

◆ getFirstRunningMockServer()

template<typename HTTPMock >
std::unique_ptr<MockServer> httpmock::getFirstRunningMockServer ( unsigned  port = 8080,
unsigned  tryCount = 1000 
)

Return mock server instance or throw the std::runtime_error if server did not start. First bindable port in range <port, port + tryCount> is used. Class HTTPMock is required to have single parameter constructor, passing the port number as an argument.