Hoverfly

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

Sign up for Hoverfly Cloud Get Hoverfly

Introducing Hoverfly Cloud - API simulations as a service. Sign up for the private beta.

Develop fast, test faster

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

Faster tests, lower 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.

Hoverfly

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 32bit   |  Windows 64bit

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 32bit  |  Linux 64bit

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.5.0</version>
    <scope>test</scope>
</dependency>

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

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

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

“The fastest and easiest way to get started with service virtualization”


Alex Soto, RedHat



“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.”


Nic Jackson, NotOnTheHighStreet

Get Hoverfly

© Copyright SpectoLabs 2017