--- title: MockServer layout: default ---

MockServer

Easy mocking of any system you integrate with via HTTP or HTTPS

Fork us on GitHub  
BuildKite Build Status Gitter

What is MockServer

MockServer can be used for mocking any system you integrate with via HTTP or HTTPS (i.e. services, web sites, etc).

When MockServer receives a requests it matches the request against active expectations that have been configured.

An expectation defines the action that is taken, for example, a response could be returned.

MockServer supports the follow actions:

What is MockServer Proxy

MockServer Proxy can be used for transparently recording all requests sent by a system (i.e. an application or set of applications).

MockServer Proxy can:

The MockServer Proxy provides the following features:

 

Why use MockServer

MockServer allows you to mock any server or service that you connect to over HTTP or HTTPS, such as a REST or RPC service.

This is useful in the following scenarios:

Mocking Dependencies & Verifying Request

A system with service dependencies, as follows:

System In Production

MockServer could be used to mock the service dependencies, as follows:

Mocking service dependencies with MockServer

Isolating Single Service / Application

A single page application may load static resources such as HTML, CSS and JavaScript from a web server and also make AJAX calls to one or more separate services, as follows:

Single Page Application

To isolate a single AJAX service, for development or debugging, the MockServer can selectively forward specific requests to local instance of the service:

Isolating Single Service

Using MockServer as a content routing load balancer is described in more detail in the section called Isolate Single Service.

Why use MockServer Proxy

MockServer proxy allows you to record request from the system-under-test or two analysis an existing system by recording outbound requests.

This is useful in the following scenarios:

Recording Requests & Analysing Behaviour

MockServer Proxy can record all outbound requests, as follows:

Recording service requests with MockServer Proxy

Verifying Request

MockServer Proxy can verify service requests, as follows:

Verifying service requests with MockServer Proxy