-
Notifications
You must be signed in to change notification settings - Fork 24
Wiremock module #878
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: 2.8.x
Are you sure you want to change the base?
Wiremock module #878
Conversation
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.
Thanks for the pull request. Would you mind explaining how you would use it in a test?
...wiremock/src/main/java/io/micronaut/testresources/wiremock/WiremockTestResourceProvider.java
Outdated
Show resolved
Hide resolved
|
Sure I would use it like: Does this need to be in the docs? |
…es/wiremock/WiremockTestResourceProvider.java Co-authored-by: Cédric Champeau <[email protected]>
|
Not necessarily in the docs, I was thinking that it wouldn't be quite useful without mappings, but since I'm not familiar with Wiremock, I see from your example that this can be configured "externally" somehow. |
|
yeah mappings are like static requests and responses in files. I mainly use Wiremock through the client and configure the requests and responses in the test that needs it. To be honest I'm not sure how the mappings stuff would work with the files and the classpath, especially since test resources is in a separate process. I imagine it would need to be in src/testResources/resources |
Either that, or you would have to add a dependency on the test resources classpath which contains your mappings. But I think it's useful to support this. |
|
we have a tutorial with Wiremock. it would be used to try to re-write that sample app using this test resources integration instead. https://guides.micronaut.io/latest/testing-rest-api-integrations-using-mockserver.html |
Adds support for wiremock via testcontainers.
Provides properties:
No current way to configure mappings or extra files on the container, that can be added in another PR.