Skip to content

Implement Record Types #53

@lordofthejars

Description

@lordofthejars

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions