Wiremock stubs not loaded correctly with resetToDefaultMappings() when using a custom stubs location
See original GitHub issueWhen a custom stub location is configured in @AutoConfigureWireMock and during tests the resetToDefaultMappings() is called then the custom stubs location is not taken into account but the default location “mappings” is used.
You can check that in the sample here https://github.com/m-kay/wiremock-reset-test with the test WiremockResetTestApplicationTests
. If stubs on line 18 where configured to be in classpath:/wiremock/mappings
it would work correctly because mappings
is the default location.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Wiremock stubs not loaded correctly with resetToDefaultMappings ...
When a custom stub location is configured in @AutoConfigureWireMock and during tests the resetToDefaultMappings() is called then the custom stubs location ...
Read more >Returning stubbed HTTP responses to specific requests
If you've created some file based stub mappings to be loaded at startup and you don't want these to disappear when you do...
Read more >Best practice how to manage a lot of wiremock stubs?
One way you can avoid repeatedly writing the same stubbings is by defining the stub location while creating the wiremock server in the...
Read more >97. Spring Cloud Contract WireMock
Wiremock runs as a stub server and you can register stub behavior using a ... is not working properly @ClassRule public static WireMockClassRule...
Read more >Wiremock Stubbing, Stub Verification And Proxying With ...
Let's see some examples of stubbing using both Java code as well as JSON requests that could be sent directly to the Wiremock...
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 Free
Top 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
@m-kay I agree that would be a great place to put a hint. I will update the docs accordingly.
Well to fix the issue I just used the default location and moved my stubs. Just opened this issue because I found it confusing and had to debug why my tests didn’t work. Maybe a hint to this behavior in the
@AutoConfigureWireMock#stubs
documentation would be helpful too.