-
Notifications
You must be signed in to change notification settings - Fork 60
Closed
Labels
Milestone
Description
Currently Hoverfly-java
only supports to recording modes simulate or capture. The problem is that you use one or other, so for example the first time you run a test to capture the traffic against real service you do HoverflyRule.inCaptureMode
. Then when you don't want to touch the real traffic you need to do HoverflyRule.inSimulateMode
. So as you can see you need to effectively modify the test to adapt the test lifecycle, first run by instantiating Hoverfly in capture and next times for simulate mode.
To avoid this change an aggregation of both modes so you can do something like:
HoverflyRule.inDualMode(SimulationSource, HoverflyConfig, Type)
where Type
can be:
- READ: it always behaves like
inSimulate
- WRITE: it always behaves like
inCapture
- READ_WRITE: if file exists then behave as READ (
simulate
), if not as WRITE (capture
).
I can provide a PR about this.