GridLienzoScrollHandler { void setupMouseDragSynchronization() { mousePanMediator = makeRestrictedMousePanMediator(); getLienzoPanel().getViewport().getMediators().push(mousePanMediator); } GridLienzoScrollHandler(final GridLienzoPanel panel); void init(); Integer scrollbarWidth(); Integer scrollbarHeight(); void refreshScrollPosition(); void setBounds(final Bounds bounds);  }
@Test public void testSetupMouseDragSynchronization() { final RestrictedMousePanMediator mediator = mock(RestrictedMousePanMediator.class); final LienzoPanel lienzoPanel = mock(LienzoPanel.class); final Viewport viewport = mock(Viewport.class); final Mediators mediators = mock(Mediators.class); doReturn(mediator).when(gridLienzoScrollHandler).makeRestrictedMousePanMediator(); doReturn(lienzoPanel).when(gridLienzoScrollHandler).getLienzoPanel(); doReturn(viewport).when(lienzoPanel).getViewport(); doReturn(mediators).when(viewport).getMediators(); gridLienzoScrollHandler.setupMouseDragSynchronization(); verify(mediators).push(mediator); }