GridLienzoScrollHandler { void updateGridLienzoPosition() { final Double percentageX = scrollBars().getHorizontalScrollPosition(); final Double percentageY = scrollBars().getVerticalScrollPosition(); final Double currentXPosition = scrollPosition().currentPositionX(percentageX); final Double currentYPosition = scrollPosition().currentPositionY(percentageY); updateGridLienzoTransform(currentXPosition, currentYPosition); } GridLienzoScrollHandler(final GridLienzoPanel panel); void init(); Integer scrollbarWidth(); Integer scrollbarHeight(); void refreshScrollPosition(); void setBounds(final Bounds bounds);  }
@Test public void testUpdateGridLienzoPosition() { final GridLienzoScrollBars scrollBars = mock(GridLienzoScrollBars.class); final GridLienzoScrollPosition scrollPosition = mock(GridLienzoScrollPosition.class); final Double percentageX = 40d; final Double percentageY = 60d; final Double currentXPosition = 400d; final Double currentYPosition = 600d; doReturn(scrollBars).when(gridLienzoScrollHandler).scrollBars(); doReturn(scrollPosition).when(gridLienzoScrollHandler).scrollPosition(); doReturn(percentageX).when(scrollBars).getHorizontalScrollPosition(); doReturn(percentageY).when(scrollBars).getVerticalScrollPosition(); doReturn(currentXPosition).when(scrollPosition).currentPositionX(percentageX); doReturn(currentYPosition).when(scrollPosition).currentPositionY(percentageY); doNothing().when(gridLienzoScrollHandler).updateGridLienzoTransform(anyDouble(), anyDouble()); gridLienzoScrollHandler.updateGridLienzoPosition(); verify(gridLienzoScrollHandler).updateGridLienzoTransform(currentXPosition, currentYPosition); }