HistoryViewImpl extends Composite implements HistoryView { @Override public void addRunner(@NotNull RunnerWidget runnerWidget) { runnersPanel.add(runnerWidget); scrollPanel.getElement().setScrollTop(scrollPanel.getElement().getScrollHeight()); } @Inject  HistoryViewImpl(PartStackUIResources resources); @Override void addRunner(@NotNull RunnerWidget runnerWidget); @Override void removeRunner(@NotNull RunnerWidget runnerWidget); @Override void clear(); @Override void setDelegate(@NotNull ActionDelegate delegate);  }
@Test public void runnerWidgetShouldBeAdded() { Element element = mock(Element.class); when(historyView.scrollPanel.getElement()).thenReturn(element); historyView.addRunner(runnerWidget); verify(historyView.runnersPanel).add(runnerWidget); verify(element).getScrollHeight(); verify(element).setScrollTop(element.getScrollHeight()); }