Skip to content

Conditional mocking of dependencies issue#137

Merged
charankamarapu merged 12 commits into
keploy:mainfrom
reem-atalah:Conditional-mocking-of-dependencies-issue
Mar 3, 2023
Merged

Conditional mocking of dependencies issue#137
charankamarapu merged 12 commits into
keploy:mainfrom
reem-atalah:Conditional-mocking-of-dependencies-issue

Conversation

@reem-atalah
Copy link
Copy Markdown
Contributor

@reem-atalah reem-atalah commented Mar 1, 2023

Related Issue

  • Info about Issue or bug
    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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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.
image

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.
image

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.
image

Describe if there is any unusual behaviour of your code(Write NA if there isn't)

A clear and concise description of it.
NA

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas and used java doc.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

Screenshots (if any)

Original Updated
original screenshot updated screenshot

Comment thread agent/agent.iml Outdated
@charankamarapu
Copy link
Copy Markdown
Collaborator

Please sign-off your commits , else the checks won't pass

@charankamarapu
Copy link
Copy Markdown
Collaborator

Please self review the PR and fill the PR template and checklist

@reem-atalah reem-atalah force-pushed the Conditional-mocking-of-dependencies-issue branch 2 times, most recently from 3e00047 to 079dd56 Compare March 1, 2023 16:35
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>
Signed-off-by: Rema <reem.mohamed00@eng-st.cu.edu.eg>
Comment thread agent/src/main/java/io/keploy/advice/redis/jedis/JedisPoolResource_Advice.java Outdated
Comment thread api/src/main/java/io/keploy/service/GrpcService.java Outdated
Comment thread core/src/main/java/io/keploy/regression/keploy/ServerConfig.java Outdated
Comment thread integration/src/main/java/io/keploy/httpClients/OkHttpInterceptor_Kotlin.java Outdated
Comment thread integration/src/main/java/io/keploy/httpClients/OkHttpInterceptor_Kotlin.java Outdated
Comment thread agent/src/main/java/io/keploy/agent/KAgent.java Outdated
Comment thread agent/src/main/java/io/keploy/agent/KAgent.java Outdated
Comment thread agent/src/main/java/io/keploy/agent/KAgent.java Outdated
Comment thread agent/src/main/java/io/keploy/agent/KAgent.java Outdated
Comment thread agent/src/main/java/io/keploy/agent/KAgent.java Outdated
Signed-off-by: Rema <reem.mohamed00@eng-st.cu.edu.eg>
@reem-atalah reem-atalah closed this Mar 2, 2023
@reem-atalah reem-atalah force-pushed the Conditional-mocking-of-dependencies-issue branch from 49094a5 to fe6695a Compare March 2, 2023 12:43
@reem-atalah reem-atalah reopened this Mar 2, 2023
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 charankamarapu merged commit 006d071 into keploy:main Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature]: Conditional mocking of dependencies

2 participants