Conditional mocking of dependencies issue#137
Merged
charankamarapu merged 12 commits intoMar 3, 2023
Merged
Conversation
Collaborator
|
Please sign-off your commits , else the checks won't pass |
Collaborator
|
Please self review the PR and fill the PR template and checklist |
3e00047 to
079dd56
Compare
Signed-off-by: Rema <reem.mohamed00@eng-st.cu.edu.eg>
Signed-off-by: Rema <reem.mohamed00@eng-st.cu.edu.eg>
Signed-off-by: Rema <reem.mohamed00@eng-st.cu.edu.eg>
Signed-off-by: Rema <reem.mohamed00@eng-st.cu.edu.eg>
Signed-off-by: Rema <reem.mohamed00@eng-st.cu.edu.eg>
charankamarapu
requested changes
Mar 2, 2023
Signed-off-by: Rema <reem.mohamed00@eng-st.cu.edu.eg>
49094a5 to
fe6695a
Compare
…ithub.com/reem-atalah/java-sdk into Conditional-mocking-of-dependencies-issue
Signed-off-by: Rema <reem.mohamed00@eng-st.cu.edu.eg>
…ithub.com/reem-atalah/java-sdk into Conditional-mocking-of-dependencies-issue
charankamarapu
approved these changes
Mar 3, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
Conditional mocking of dependencies gave the user the ability to choose which dependency/ service (e.g.: SQL, Redis, http ...etc.) will be mocked.
Closes: #124
Describe the changes you've made
According to the user input in the environment variable, intercept the service or not.
default is all services are mocked.
I also added some initialization for future mock supports e.g.: for mongo DB
Type of change
How did you test your code changes?
First test:

Don't put any service in the environment variable.
It works properly as previous, the record is mocked, mock and test files both are formed normally.
Second test:

Put in the environment variable SKIP_MOCK_SQL=true
I ran samples-java, then sent POST and GET requests, it didn't form a mock file, and Keploy didn't capture mock record for it, it formed test file and record only.
Third test:

Put in the environment variable SKIP_MOCK_SQL=false
It works properly as previous, the record is mocked, mock and test files both are formed normally.
Describe if there is any unusual behaviour of your code(Write
NAif there isn't)A clear and concise description of it.
NAChecklist:
Screenshots (if any)