stubr
Adaptation of wiremock-rs supporting existing
Wiremock json stubs as input.
Aims at reaching feature parity with Wiremock and be a drop-in replacement of
the latter.
use it
as a crate
use Stubr;
let srv = start.await;
// or just mount a single file
let srv = start.await;
// use '.uri()' method to get server address
get.await;
as a cli
You can use stubr as a cli for serving Wiremock stubs on a local server.
To get a list of all available options run
The simplest usage is for serving Wiremock stubs under a directory. Example for a project exposing contracts using Spring Cloud Contract
> -
> -
> Started
You can also specify the directory as wiremock does with the --root-dir
arg.
You can enforce server port with --port
or -p
arg. By default, stubr starts on a random port.
install it
with precompiled binaries (linux & osx)
linux:
&&
macos (Catalina):
NOTE: Big Sur users are recommended to install with cargo or from source
&&
with cargo
from source (linux & osx)
&& && &&
then generate completion
Completion files generation is currently supported for bash
and zsh
. Stubr cli provides a completion
command to
generate and install them in a standard location.
# or
benchmark
A very simple benchmark is available here