cayenne icon indicating copy to clipboard operation
cayenne copied to clipboard

Refactor MockChannelListener with mocking object and improve testing logic

Open wx930910 opened this issue 3 years ago • 0 comments

Fix CAY-2717

Description

Refactor test class DataContextDataChannelEventsIT.java by using Mockito.


Motivation
  • Decoupling test class MockChannelListener from production interface DataChannelListener
  • 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 of graphChanged(GraphEvent), graphFlushed(GraphEvent) and graphRolledback(GraphEvent).

wx930910 avatar Aug 03 '21 04:08 wx930910