PropertiesPanelPresenter implements PropertiesPanelView.ActionDelegate, PropertiesPanel { @Override public void update(@NotNull Runner runner) { view.setName(runner.getTitle()); view.setType(runner.getType()); view.selectMemory(runner.getRAM()); view.selectScope(runner.getScope()); } PropertiesPanelPresenter(@NotNull PropertiesPanelView view, @NotNull AppContext appContext); @Override void onConfigurationChanged(); @Override void go(AcceptsOneWidget container); @Override void update(@NotNull Runner runner); @Override void update(@NotNull Environment environment); @Override void addListener(@NotNull RemovePanelListener listener); @Override void hideButtonsPanel(); @Override void onCopyButtonClicked(); @Override void onSaveButtonClicked(); @Override void onDeleteButtonClicked(); @Override void onCancelButtonClicked(); @Override void onConfigLinkClicked(); void onSwitcherChanged(boolean isOn);  }
@Test public void runnerShouldBeUpdated() { Runner runner1 = mock(Runner.class); when(runner1.getRAM()).thenReturn(MB_500.getValue()); reset(view); presenter.update(runner1); verify(view).setName(runner1.getTitle()); verify(view).setType(runner1.getType()); verify(runner1).getRAM(); verify(view).selectMemory(500); verify(view).selectScope(runner1.getScope()); }
@Test(expected = UnsupportedOperationException.class) public void unsupportedOperationExceptionShouldBeThrownWhenCallUpdateEnvironment() { presenter.update(environment); }