Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
CURATOR-610: Refactor CountCuratorWatcher in TestWatcherIdentity.java …
Fixes [CURATOR-610](https://issues.apache.org/jira/browse/CURATOR-610) ### Description Refactor test class [CountCuratorWatcher](https://github.com/apache/curator/blob/4a11aaef8b190dc220d35b7a91df294bfa06250e/curator-framework/src/test/java/org/apache/curator/framework/imps/TestWatcherIdentity.java#L42) by using mocking object created by Mockito. <hr> ##### Key changed/added classes in this PR - Create mocking object to replace test subclass `CountCuratorWatcher`, decouple test from production code. - Make test logic more clear by using method stub instead of method overriding. - Extract AtomicInteger variable out of the test subclass. Use the extracted variable in assertation statement to check `process(WatchedEvent)` method invocation status. <hr> Author: wx930910 <wx19930910@gmail.com> Reviewers: Enrico Olivelli <eolivelli@apache.org> Closes #397 from wx930910/CURATOR-610
- Loading branch information
Showing
2 changed files
with
143 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters