commons-jxpath
commons-jxpath copied to clipboard
JXPATH-198: Refactor Context to improve test logic
JIRA
Fixes XPATH-198
Description
Refactor test class Context
Motivation
- Decouple test class
Contextfrom production interfaceExpressionContext. - Remove the redundant test child class
Context - Remove the redundant overridden methods that return default values.
- Make testing logic more explict.
Key changed/added classes in this PR
- Created mocking object to replace test subclass
Context, 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.
- Add Mockito dependency.
Exact same comment as https://github.com/apache/commons-codec/pull/94#issuecomment-924597345