andyfase / imposter

Scriptable, multipurpose mock server.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Imposter: A scriptable, multipurpose mock server CircleCI

Reliable, scriptable and extensible mock server for general REST APIs, OpenAPI (and Swagger) specifications, Salesforce and HBase APIs.

Scripting support for both JavaScript or Groovy/Java.

What's it for?

Use Imposter to:

  • run standalone mocks in place of real systems
  • turn a OpenAPI/Swagger file into a mock API for testing or QA
  • quickly set up a temporary API for your mobile/web client teams whilst the real API is being built
  • decouple your integration tests from the cloud/various back-end systems and take control of your dependencies

Provide mock responses using static files or customise behaviour based on characteristics of the request. Power users can control mock responses with JavaScript or Java/Groovy script engines. Advanced users can write their own plugins in a JVM language of their choice.


Getting started

The quickest way to get up and running is to use the free cloud-hosted service at mocks.cloud

Tutorials

User documentation

Read the user documentation here


Plugins

Imposter uses plugins to control its behaviour and provide specialised mocks:

You can also create your own plugins, using a JVM language of your choice.

Example

Let's assume your configuration is in a folder named config.

Docker example:

docker run -ti -p 8080:8080 \
    -v $PWD/config:/opt/imposter/config \
    outofcoffee/imposter-rest

Standalone Java example:

java -jar distro/rest/build/libs/imposter-rest.jar \
    --configDir ./config

Your mock server is now running!

This example starts a mock server using the simple REST plugin, serving responses based on the configuration files inside the config folder. You can hit the URL http://localhost:8080/example to see the mock response.

Recent changes and Roadmap

For recent changes see the Changelog, or view the Roadmap.

Contributing

  • Pull requests are welcome.
  • PRs should target the develop branch.

Author

Pete Cornish (outofcoffee@gmail.com)

About

Scriptable, multipurpose mock server.


Languages

Language:Java 90.0%Language:Groovy 6.7%Language:Shell 1.3%Language:JavaScript 0.9%Language:HTML 0.8%Language:Dockerfile 0.3%