Skip to content

CaptureMode should not override the whole simlucation.json file #213

@howareyouo

Description

@howareyouo

For example i have a class :

public class ControllerTest  {
  @ClassRule
  public static HoverflyRule hoverflyRule = HoverflyRule.inCaptureMode("simulation.json");

  @Test
  public void reqeustOne() {
      httpClient.get('/url_one')
  }

  @Test
  public void reqeustTwo() {
      httpClient.get('/url_two')
  }
}

If I run test in class level, the result was fine.
And if I run requestOne first then requestTwo after,
only requestTwo will be export to simulation.json file,
hoverfly-java just simply override the existing file, this is not I was expecting.
It should be override/append the content by request mathing described in the docs.

This will be the issue for inCaptureOrSimulateMode as well:
It should be not just detecting the file extists or not, but looking into the content, to see was there a
matched request exists, is it does, simulate it, if not , capturing then append to the json file.

And by the way, great tools, keeping up guys !!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions