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

Refactor MockChannelListener with mocking object and improve testing logic #462

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

Conversation

wx930910
Copy link

@wx930910 wx930910 commented Aug 3, 2021

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).

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

Successfully merging this pull request may close these issues.

1 participant