Skip to content

machzqcq/service_virtualization

Repository files navigation

Service Virtualization

Why - here and here .
Stubs are test doubles (aka. mock services), imposter is an abstract for virtualized service, stubs include predicates and responses. predicates specify how an incoming request should match the stub (in the absence of predicate, stub always matches and hence no reason to have more than one stub), responses - proxies, injection and behaviors.

Features

How

  • git pull
  • Install docker
  • docker build -t mymountebank -f mountebank.dockerfile .
  • docker run --name mymountebank-1 -d -p 2525:2525 -p 4545-4555:4545-4555 mymountebank:latest - starts mb with defaults
  • starts mb by injecting the imposter templates. The templates themselves are javascript files, so lots of logic can be injected
docker run -v $(pwd)/templates/sample:/templates -p 4546:4546 -p 5555:5555 -p 2525:2525 -d mymountebank:latest 
--configfile templates/imposters.ejs --allowInjection
  • From here you can start defining imposters as per the documentation

More options

  • mb server has many command-line config options. Options are appended to e.g. docker run....--mock

Releases

No releases published

Packages

No packages published

Languages