HoverflyRule doesn't export simulations for multiple tests
See original GitHub issueWhen 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
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
JUnit — Hoverfly Java 0.4.2 documentation
You can create a Hoverfly Rule that is started in capture mode if the simulation file does not exist and in simulate mode...
Read more >Easy API simulation with Hoverfly JUnit Rule - SpectoLabs
We build tools that simplify testing throughout the software delivery pipeline.
Read more >Hoverfly Java Documentation - Read the Docs
... simulations, and a JUnit integration for using it within JUnit tests. ... public static HoverflyRule hoverflyRule = HoverflyRule.
Read more >Issues · SpectoLabs/hoverfly-java · GitHub
[0.14.0] Working directory doesn't seem to be relative to workspace directory ... HoverflyRule doesn't export simulations for multiple tests enhancement.
Read more >Easy API Simulation with Hoverfly JUnit Rule - OpenCredo
@Rule public HoverflyRule hoverflyRule = HoverflyRule.buildFromClassPathResource("test-service.json").build();. The rule takes a convention over ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@tommysitu I will focus on the multiple requests issue, and then if I still got time propose a PR for this one too 😉
@ia3andy That’s a very nice workaround! Would be good to add your solution to the project.