Giter Club home page Giter Club logo

imposter's Introduction

Imposter: Scriptable, multipurpose mock server

CI

Mock server for REST APIs, OpenAPI (and Swagger) specifications, SOAP web services (and WSDL files), Salesforce and HBase APIs.

  • Run standalone mock servers in Docker, Kubernetes, AWS Lambda or on the JVM.
  • Embed mocks within your tests (JVM or Node.js) to remove external dependencies.
  • Script dynamic responses using JavaScript, Groovy or Java.
  • Capture data from requests, then store it or return a templated response.
  • Proxy an existing endpoint to replay its responses as a mock.

Imposter logo

Features

  • run standalone mocks in place of real systems
  • turn an OpenAPI/Swagger file or WSDL file into a mock API for dev or QA (use it before the real API is built)
  • decouple your integration tests from the cloud/back-end systems and take control of your dependencies
  • validate your API requests against an OpenAPI specification
  • capture data to retrieve later, or use in templates to for conditional responses
  • proxy an existing endpoint to replay its responses as a mock

Send dynamic responses:

  • 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

User documentation

Read the user documentation here

Tutorials


Mock types

Imposter provides specialised mocks for the following scenarios:

  • OpenAPI - Support for OpenAPI (and Swagger) API specifications.
  • REST - Mocks RESTful or plain HTTP APIs.
  • SOAP - Support for SOAP web services (and WSDL files).
  • HBase - Basic HBase mock implementation.
  • SFDC (Salesforce) - Basic Salesforce mock implementation.

These use a plugin system, so you can also create your own plugins, using any JVM language.

Example

$ imposter up

Starting server on port 8080...
Parsing configuration file: someapi-config.yaml
...
Mock server is up and running

Your mock server is now running! Here Imposter provides HTTP responses to simulate an API that accepts users and returns a dynamic response containing the user ID from the request.

$ curl -v -X PUT http://localhost:8080/users/alice

HTTP/1.1 201 Created
Content-Type: application/json

{ "userName": "alice" }

This is a trivial example, which you can extend with conditional logic, request validation, data capture and much more...

How to run Imposter

There are many ways to run Imposter.

Standalone mock server

Embedded in tests


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 ([email protected])

imposter's People

Contributors

outofcoffee avatar dependabot[bot] avatar snyk-bot avatar benjvoigt avatar yanan-l avatar csokol avatar pcornish avatar kareem-habib avatar pauturner avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.