jackrabbit
jackrabbit copied to clipboard
Replace DummyInternalVersion with mocking object to make test conditi…
Fixes #JCR-4710 Refactor DummyInternalVersion in VersionIteratorImplTest.java to improve test logic.
Description
Refactor test class VersionIteratorImplTest.java
Motivation
- Decoupling test class
DummyInternalVersion
from production interfaceInternalVersion
. - Making test condition more clear by removing all redundant overridden methods.
- Making test logic more clear by using method stub instead of method overriding.
Key changed/added classes in this PR
- Created mocking object to replace test subclass
DummyInternalVersion
, decoupled test from production code. - Created a method that return the mocking object for reuse purpose.
- Use method stub to replace method overriding to control mocking object's behavior.
- Remove redundant overridden methods to improve test logic.