public class Hoverfly
extends java.lang.Object
implements java.lang.AutoCloseable
Constructor and Description |
---|
Hoverfly(HoverflyConfig hoverflyConfigBuilder,
HoverflyMode hoverflyMode)
Instantiates
Hoverfly |
Hoverfly(HoverflyMode hoverflyMode)
Instantiates
Hoverfly |
Modifier and Type | Method and Description |
---|---|
void |
assertThatNoDiffIsReported(boolean shouldResetDiff) |
void |
close()
Stops the running
Hoverfly process and clean up resources |
void |
exportSimulation(java.nio.file.Path path)
Exports a simulation and stores it on the filesystem at the given path
|
HoverflyConfiguration |
getHoverflyConfig()
Gets the validated
HoverflyConfig object used by the current Hoverfly instance |
HoverflyInfoView |
getHoverflyInfo()
Gets configuration information from the running instance of Hoverfly.
|
HoverflyMode |
getMode()
Gets the currently activated Hoverfly mode
|
Simulation |
getSimulation()
Gets the simulation currently used by the running
Hoverfly instance |
SslConfigurer |
getSslConfigurer() |
java.util.Map<java.lang.String,java.lang.String> |
getState()
Get all state from Hoverfly
|
void |
importSimulation(SimulationSource simulationSource)
Deprecated.
|
boolean |
isHealthy() |
void |
reset()
Delete existing simulations and journals
|
void |
resetDiffs()
Deletes all diffs from Hoverfly
|
void |
resetJournal()
Delete journal logs
|
void |
resetMode(HoverflyMode mode)
Reset mode with the initial mode arguments.
|
void |
resetState()
Deletes all state from Hoverfly
|
void |
setDestination(java.lang.String destination)
Sets a new destination for the running instance of Hoverfly, overwriting the existing destination setting.
|
void |
setMode(HoverflyMode mode)
Changes the mode of the running instance of Hoverfly.
|
void |
setState(java.util.Map<java.lang.String,java.lang.String> state)
Deletes all state from Hoverfly and then sets the state.
|
void |
simulate(SimulationSource simulationSource,
SimulationSource... sources) |
void |
start()
Adds Hoverfly SSL certificate to the trust store
Sets the proxy system properties to route through Hoverfly
Starts Hoverfly
|
void |
updateState(java.util.Map<java.lang.String,java.lang.String> state)
Updates state in Hoverfly.
|
void |
verify(RequestMatcherBuilder requestMatcher) |
void |
verify(RequestMatcherBuilder requestMatcher,
VerificationCriteria criteria) |
void |
verifyAll() |
void |
verifyZeroRequestTo(StubServiceBuilder requestedServiceBuilder) |
public Hoverfly(HoverflyConfig hoverflyConfigBuilder, HoverflyMode hoverflyMode)
Hoverfly
hoverflyConfigBuilder
- the confighoverflyMode
- the modepublic Hoverfly(HoverflyMode hoverflyMode)
Hoverfly
hoverflyMode
- the modepublic void start()
public void close()
Hoverfly
process and clean up resourcesclose
in interface java.lang.AutoCloseable
@Deprecated public void importSimulation(SimulationSource simulationSource)
Hoverfly
from a SimulationSource
simulationSource
- the simulation to importpublic void simulate(SimulationSource simulationSource, SimulationSource... sources)
public void reset()
public void resetJournal()
public void resetState()
public java.util.Map<java.lang.String,java.lang.String> getState()
public void setState(java.util.Map<java.lang.String,java.lang.String> state)
state
- the state to setpublic void updateState(java.util.Map<java.lang.String,java.lang.String> state)
state
- the state to update withpublic void resetDiffs()
public void exportSimulation(java.nio.file.Path path)
path
- the path on the filesystem to where the simulation should be storedpublic Simulation getSimulation()
Hoverfly
instancepublic HoverflyInfoView getHoverflyInfo()
public void setDestination(java.lang.String destination)
destination
- the destination setting to overridepublic void setMode(HoverflyMode mode)
mode
- hoverfly mode to changepublic void resetMode(HoverflyMode mode)
mode
- Hoverfly mode to resetpublic HoverflyConfiguration getHoverflyConfig()
HoverflyConfig
object used by the current Hoverfly instancepublic HoverflyMode getMode()
public boolean isHealthy()
public SslConfigurer getSslConfigurer()
public void verify(RequestMatcherBuilder requestMatcher, VerificationCriteria criteria)
public void assertThatNoDiffIsReported(boolean shouldResetDiff)
public void verify(RequestMatcherBuilder requestMatcher)
public void verifyZeroRequestTo(StubServiceBuilder requestedServiceBuilder)
public void verifyAll()