SimulatingΒΆ
The core of this library is the Hoverfly class, which abstracts away and orchestrates a Hoverfly instance. A flow might be as follows:
try (Hoverfly hoverfly = new Hoverfly(configs(), SIMULATE)) {
hoverfly.start();
hoverfly.importSimulation(classpath("simulation.json"));
// do some requests here
}
When running Hoverfly standalone you can clean up the simulation and journal logs by calling reset
method.
try (Hoverfly hoverfly = new Hoverfly(configs(), SIMULATE)) {
hoverfly.start();
// can import or do some requests
hoverfly.reset();
}