cayenne
cayenne copied to clipboard
Refactor MockChannelListener with mocking object and improve testing logic
Fix CAY-2717
Description
Refactor test class DataContextDataChannelEventsIT.java by using Mockito.
Motivation
- Decoupling test class
MockChannelListener
from production interfaceDataChannelListener
- Making test condition more clear by removing redundant overridden methods and new fields.
- Use
Mockito.verify()
to directly verify the behavior of the mocking object and make test condition more explict.
Key changed/added classes in this PR
- Creating mocking object to replace test subclass
MockChannelListener
, decoupled test from production code. - Replacing assertation statement by using
Mockito.verify()
to verify the invocation status ofgraphChanged(GraphEvent)
,graphFlushed(GraphEvent)
andgraphRolledback(GraphEvent)
.