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

Replace DummyInternalVersion with mocking object to make test conditi… #95

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

Conversation

wx930910
Copy link

@wx930910 wx930910 commented Aug 2, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant