ARMS2025 opened a new pull request, #56:
URL: https://github.com/apache/sling-org-apache-sling-servlets-resolver/pull/56

   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
   
   + In the `testCreateMethodsDefault` test, 1 stubbing for the `getProperty` 
method is stubbed with the argument "service.id", but in actual execution, it 
is called with the argument "sling.servlet.paths". Additionally, the 
`getProperty` method is called with "sling.servlet.selectors", 
"sling.servlet.extensions", "sling.servlet.methods", "sling.servlet.prefix", 
and "sling.servlet.resourceSuperType", none of which were stubbed, resulting in 
mismatch stubbings.
   
   + In the `testCreateMethodsSingle` test, 1 stubbing for the `getProperty` 
method is stubbed with the argument "service.id", but in actual execution, it 
is called with the argument "sling.servlet.paths". Additionally, the 
`getProperty` method is called with "sling.servlet.selectors", 
"sling.servlet.extensions", "sling.servlet.prefix", and 
"sling.servlet.resourceSuperType", none of which were stubbed, resulting in 
mismatch stubbings.
   
   + In the `testCreateMethodsMultiple` test, 1 stubbing for the `getProperty` 
method is stubbed with the argument "service.id", but in actual execution, it 
is called with the argument "sling.servlet.paths". Additionally, the 
`getProperty` method is called with "sling.servlet.selectors", 
"sling.servlet.extensions", "sling.servlet.prefix", and 
"sling.servlet.resourceSuperType", none of which were stubbed, resulting in 
mismatch stubbings.
   
   +  In the `testCreateMethodsAll` test, 1 stubbing for the `getProperty` 
method is stubbed with the argument "service.id", but in actual execution, it 
is called with the argument "sling.servlet.paths". Additionally, the 
`getProperty` method is called with "sling.servlet.selectors", 
"sling.servlet.extensions", "sling.servlet.prefix", and 
"sling.servlet.resourceSuperType", none of which were stubbed, resulting in 
mismatch stubbings.
   
   + In the `testCreateSelectorsExtensions` test, 1 stubbing for the 
`getProperty` method is stubbed with the argument "service.id", but in actual 
execution, it is called with the argument "sling.servlet.paths". Additionally, 
the `getProperty` method is called with "sling.servlet.prefix" and 
"sling.servlet.resourceSuperType", none of which were stubbed, resulting in 
mismatch stubbings.
   
   + In the `testCreateMethodsExtensions` test, 1 stubbing for the 
`getProperty` method is stubbed with the argument "service.id", but in actual 
execution, it is called with the argument "sling.servlet.paths". Additionally, 
the `getProperty` method is called with "sling.servlet.selectors", 
"sling.servlet.prefix", and "sling.servlet.resourceSuperType", none of which 
were stubbed, resulting in mismatch stubbings.
   
   + In the `testCreateWithResourceSuperType` test, 1 stubbing for the 
`getProperty` method is stubbed with the argument "service.id", but in actual 
execution, it is called with the argument "sling.servlet.paths". Additionally, 
the `getProperty` method is called with "sling.servlet.selectors", 
"sling.servlet.methods", and "sling.servlet.prefix", none of which were 
stubbed, resulting in mismatch stubbings.
   
   + In the `testCreateWithDefaultResourceSuperType` test, 1 stubbing for the 
`getProperty` method is stubbed with the argument "service.id", but in actual 
execution, it is called with the argument "sling.servlet.paths". Additionally, 
the `getProperty` method is called with "sling.servlet.methods" and 
"sling.servlet.prefix", none of which were stubbed, resulting in mismatch 
stubbings.
   
   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).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@sling.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to