Function pact_mock_server::start_mock_server_with_config
source · pub fn start_mock_server_with_config(
id: String,
pact: Box<dyn Pact + Send + Sync>,
addr: SocketAddr,
config: MockServerConfig
) -> Result<i32, String>
Expand description
Starts a mock server with the given ID, pact and port number. The ID needs to be unique. A port
number of 0 will result in an auto-allocated port by the operating system. Returns the port
that the mock server is running on wrapped in a Result
.
id
- Unique ID for the mock server.pact
- Pact model to use for the mock server.addr
- Socket address that the server should listen on.config
- Configuration for the mock server
§Errors
An error with a message will be returned in the following conditions:
- If a mock server is not able to be started