Create API simulations.
Use them to develop and test faster.
Get Hoverfly

Hoverfly v0.10.2 has been released! Read the release notes here.

Develop faster, test faster

Remove reliance on production APIs, unreliable test environments or dependent microservices during development and testing.

Speed up test runs, slash costs

No need to spin up 20 services for each test run - use light-weight API simulations in your CI pipeline to save time and money.

Build resilient software

Design your applications to respond gracefully when the APIs they depend on misbehave by injecting failure into your simulations.

Light-weight, high-performance

Hoverfly is a single binary file with no external dependencies. It comes with an optional CLI called hoverctl.

Cross-platform

Run on MacOS, Windows, Linux - on your local machine or on a CI server. Use native language bindings to get started quickly.

Extend with any programming language

Simulate API latency and failure, or manipulate response data by writing custom extensions in the language of your choice.

Open source

Hoverfly and all its associated libraries are made available under the Apache 2 license.

Get Hoverfly

Download

  MacOS 64bit

Download the archive and extract it to a directory on your PATH.

Or use Homebrew.

brew install SpectoLabs/tap/hoverfly

Quickstart

Hoverfly comes with a command line tool called hoverctl.

hoverctl start

Capture an HTTP request and response.

hoverctl mode capture
curl --proxy http://localhost:8500 http://time.jsontest.com

You have just created a simulation.

hoverctl export simulation.json

Set Hoverfly to simulate mode and make the same request.

hoverctl mode simulate
curl --proxy http://localhost:8500 http://time.jsontest.com

The response was returned by Hoverfly.

Next steps

Download

  Windows 64bit  |    Windows 32bit

Download an archive and extract it to a directory on your PATH.

Quickstart

Hoverfly comes with a command line tool called hoverctl.

hoverctl start

Configure your application or browser to use the Hoverfly proxy on localhost:8500.

Set Hoverfly to capture mode.

hoverctl mode capture

Make a request from your application or browser. You have just created a simulation.

hoverctl export simulation.json

Set Hoverfly to simulate mode and make the same request.

hoverctl mode simulate

The response was returned by Hoverfly.

Next steps

Download

  Linux 64bit  |    Linux 32bit

Download an archive and extract it to a directory on your PATH.

Quickstart

Hoverfly comes with a command line tool called hoverctl.

hoverctl start

Capture an HTTP request and response.

hoverctl mode capture
curl --proxy http://localhost:8500 http://time.jsontest.com

You have just created a simulation.

hoverctl export simulation.json

Set Hoverfly to simulate mode and make the same request.

hoverctl mode simulate
curl --proxy http://localhost:8500 http://time.jsontest.com

The response was returned by Hoverfly.

Next steps

Hoverfly Java

Hoverfly Java is a native Java language binding for Hoverfly.

If you are using Maven, add the dependency to your pom.xml

<dependency>
    <groupId>io.specto</groupId>
    <artifactId>hoverfly-java</artifactId>
    <version>0.4.3</version>
    <scope>test</scope>
</dependency>

If you are using Gradle, add the dependency to your *.gradle file

testCompile "io.specto:hoverfly-java:0.4.3"

Quickstart

public class HoverflyExample {

    @ClassRule
    public static HoverflyRule hoverflyRule = HoverflyRule.inSimulationMode(dsl(
        service("www.my-test.com")
            .get("/api/bookings/1")
            .willReturn(success("{\"bookingId\":\"1\"}", "application/json"))
    ));

    @Test
    public void shouldBeAbleToGetABookingUsingHoverfly() {
        // When
        final ResponseEntity<String> getBookingResponse = restTemplate.getForEntity("http://www.my-test.com/api/bookings/1", String.class);

        // Then
        assertThat(getBookingResponse.getStatusCode()).isEqualTo(OK);
        assertThatJSON(getBookingResponse.getBody()).isEqualTo("{"\"bookingId\":\"1\"}");
    }

// Continues...

Next steps

HoverPy

HoverPy is a native Python language binding for Hoverfly.

pip install hoverpy

Quickstart

from hoverpy import capture, simulate
import requests

@capture("requests.db")
def captured_get():
    print(requests.get("http://time.jsontest.com").json())

@simulate("requests.db")
def simulated_get():
    print(requests.get("http://time.jsontest.com").json())

captured_get()
simulated_get()

Next Steps

What people say

Hoverfly is rapidly becoming an important player in the world of open source service virtualization solutions.

Bas Dijkstra, OnTestAutomation.com

Hoverfly solves some of the biggest problems with modern microservice development.

Nick Jackson, NotOnTheHighStreet