-
Notifications
You must be signed in to change notification settings - Fork 136
[Hack Week] ApiFaker: match endpoints using query parameters #13083
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
Conversation
Generated by 🚫 Danger |
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
JorgeMucientes
left a comment
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.
Nicely done @hichamboushaba. Code looks good and everything works as expected.
I just left a really minor nitpick. But nothing concerning. Approving!
libs/apifaker/src/main/java/com/woocommerce/android/apifaker/EndpointProcessor.kt
Show resolved
Hide resolved
This makes sure the log is not printed when the matched endpoints use different query parameters.
Description
As part of my Hack Week, I'm bringing back the ApiFaker project paqN3M-SI-p2, and I'm splitting the feature into multiple PRs.
This PR adds support for matching endpoints using query parameters too, in the endpoint definition, we can add a list of query parameters that will filter which endpoints to mock, the logic adapts for the syntax of Jetpack tunneled requests and regular endpoints.
Steps to reproduce
Testing information
/wc/v3/orderswith query parametersearch={some term}and use the search feature of the order list to see if the logic works as expected.The tests that have been performed
^
Images/gif
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: