jackrabbit icon indicating copy to clipboard operation
jackrabbit copied to clipboard

Replace DummyInternalVersion with mocking object to make test conditi…

Open wx930910 opened this issue 3 years ago • 0 comments

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 interface InternalVersion.
  • 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.

wx930910 avatar Aug 02 '21 04:08 wx930910