Skip to content

In-process mock server for matching HTTP requests and generating responses from a pact file

License

Notifications You must be signed in to change notification settings

pact-foundation/pact-core-mock-server

Repository files navigation

Logo of the project

Build

Pact Core Mock Server

This project contains the in-process mock server for matching HTTP requests and generating responses from a pact file. It implements the Pact specifications up to V4 Pact specification.

There are two modules to this project:

  • pact_mock_server - This is the library that provides the in-process mock server.
  • pact_mock_server_cli - A CLI for starting and controlling seperate process mock servers.

Usage

Building

To build the libraries in this project, you need a working Rust environment. Requires minimum Rust 1.77.0. Refer to the Rust Guide.

The build tool used is cargo.

cargo build

This will compile all the libraries and put the generated files in rust/target/debug.

To run the tests:

cargo test

Releasing

The released libraries for each module are built by a GH action that attaches the libraries to the GH release for each crate. To release a crate, run the release.groovy script in the crate directory. This will guide you through the release process for the crate. Then create a GH release using the tag and changelog created by the script.

Contributing

See CONTRIBUTING (PRs are always welcome!).

Documentation

Rust crate documentation is published to the Rust documentation site.

Additional documentation can be found at the main Pact website.

Contact

Join us in slack: slack

or

Licensing

The code in this project is licensed under a MIT license. See LICENSE.