Skip to content

HoverflyRule doesn't export simulations for multiple tests #123

@tommysitu

Description

@tommysitu

When HoverflyRule is annotated with @Rule, the exportSimulation is called after each test, meaning that, it will keep overwriting old captured data because of the same filename.

The solution could be postfixing the file name with the test class names, so that

@Rule
public HoverflyRule hoverflyRule = HoverflyRule.inCaptureMode("booking_service_test.json")

@Test 
public shouldGetBooking() {
}

@Test
public shouldDeleteBooking() {
}

should create two files under test/resources/hoverfly

  • booking_service_test_shouldGetBooking.json
  • booking_service_test_shouldDeleteBooking.json

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