-
-
Notifications
You must be signed in to change notification settings - Fork 12
Load files and mappings from src/test/resources by default #184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Hey @oleg-nenashev , I decided to give this ticket a try. I believe it would be a good idea to allow the root directory to be customizable as well but I thought about getting some feedback and suggestions to ensure I'm on the right track. Thanks! I see some unintended formatting changes as well, maybe I could add a PR to include spotless to the project same as the main wiremock project? |
@lhcopetti thank you for the pull request, I will take a look Regarding spotless, I do not plan to include the same configuration as in WireMock core as it is overly prescriptive and damaging to contributor experience. I do not mind if there are some reasonable refactorings along with the pull requests, the flow of contributions is not that high to worry about merge conflicts. Some basic rules from spotless could be introduced though |
Path definitely needs to be configurable. The most obvious example being |
ab206b7
to
3eacf3a
Compare
Hey @oleg-nenashev @mplanchant . I updated the PR to add the configurable rootDir option. Please let me know if that makes sense. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and thanks for the update!
If this is merged and released, I'm happy to try it out. |
This PR adds support for loading files and mappings from test resources directory.
By default, It will look into
src/test/resources/mappings
andsrc/test/resources/__files
behaving very similarly to whenWireMockServer
is started programmatically. This path can be configured viawithRootDir(File file)
.This addition simplifies the testing setup by providing an alternative to having to map all stub and file paths individually using
with...()
calls.Before:
After:
Make sure all stubs and files are stored in the proper sub-directories and all the manual inclusions may be removed:
Alternatively, one can choose a different path to load mappings/files from:
References
Submitter checklist
#help-contributing
or a project-specific channel like#wiremock-java