Skip to content
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

Resolve 2 mismatch stubbings in KeyValueTest.java #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ARMS2025
Copy link

@ARMS2025 ARMS2025 commented Mar 10, 2025

We are researchers and analyzed the test doubles (mocks) in the test code of the project. In our analysis of the project, we observed that

  • The getDominValue method, which is previously stubbed, is executed with arguments "dom1" and "dom2", but these specific arguments are not stubbed, resulting in mismatch stubbings. These mismatches occur in the test wildcardsAlsoMatchNullDomainValues.

In this pull request, we propose a solution to resolve the mismatch stubbing.

Mismatched stubbing occurs when a mocked method is stubbed with specific arguments in a test but later invoked with different arguments in the code, potentially causing unexpected behavior. Mockito recommends addressing these issues, (https://www.javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/exceptions/misusing/PotentialStubbingProblem.html)

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.

1 participant