RestrictedMousePanMediator extends AbstractMediator { protected Viewport getLayerViewport() { return getGridLayer().getViewport(); } RestrictedMousePanMediator(final GridLayer gridLayer); protected  RestrictedMousePanMediator(); boolean isDragging(); TransformMediator getTransformMediator(); void setTransformMediator(final TransformMediator transformMediator); @Override void cancel(); @Override boolean handleEvent(final GwtEvent<?> event);  }
@Test public void testGetLayerViewport() { final GridLayer layer = mock(GridLayer.class); final Viewport expectedViewport = mock(Viewport.class); doReturn(expectedViewport).when(layer).getViewport(); doReturn(layer).when(mediator).getGridLayer(); final Viewport actualViewport = mediator.getLayerViewport(); assertEquals(expectedViewport, actualViewport); }