GridLienzoScrollHandler { RestrictedMousePanMediator getMousePanMediator() { return mousePanMediator; } GridLienzoScrollHandler(final GridLienzoPanel panel); void init(); Integer scrollbarWidth(); Integer scrollbarHeight(); void refreshScrollPosition(); void setBounds(final Bounds bounds);  }
@Test public void testGetMousePanMediator() { final RestrictedMousePanMediator expectedMediator = mock(RestrictedMousePanMediator.class); final LienzoPanel lienzoPanel = mock(LienzoPanel.class); final Viewport viewport = mock(Viewport.class); final Mediators mediators = mock(Mediators.class); doReturn(lienzoPanel).when(gridLienzoScrollHandler).getLienzoPanel(); doReturn(viewport).when(lienzoPanel).getViewport(); doReturn(mediators).when(viewport).getMediators(); doReturn(expectedMediator).when(gridLienzoScrollHandler).makeRestrictedMousePanMediator(); gridLienzoScrollHandler.setupMouseDragSynchronization(); final RestrictedMousePanMediator actualMediator = gridLienzoScrollHandler.getMousePanMediator(); assertEquals(expectedMediator, actualMediator); }