Skip to content

Resolve 2 mismatch stubbings in KeyValueTest.java#22

Open
ARMS2025 wants to merge 1 commit into
parship:masterfrom
ARMS2025:resolve-mismatch-stubbings-1
Open

Resolve 2 mismatch stubbings in KeyValueTest.java#22
ARMS2025 wants to merge 1 commit into
parship:masterfrom
ARMS2025:resolve-mismatch-stubbings-1

Conversation

@ARMS2025

@ARMS2025 ARMS2025 commented Mar 10, 2025

Copy link
Copy Markdown

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