private Command cancelCommand() { return () -> presenter.cancel(); }
private Command restoreCommand() { return () -> presenter.restore(); }
public void show(final ObservablePath currentPath, final String currentVersionRecordUri) { command = restoreCommand(currentPath, currentVersionRecordUri); view.show(); }
@Test public void testShow() throws Exception { presenter = spy(presenter); presenter.show(path, "uri"); verify(view).show(); verify(presenter).restoreCommand(path, "uri"); }
public void restoreToCurrentVersion() { restorePopUpPresenter.show(getCurrentPath(), getCurrentVersionRecordUri()); }
ParameterizedCommand<String> restoreCommand(final ObservablePath currentPath, final String currentVersionRecordUri) { return comment -> { busyIndicatorView.showBusyIndicator(CommonConstants.INSTANCE.Restoring()); versionService.call(successCallback(currentVersionRecordUri), errorCallback()).restore(currentPath, comment); }; }
@Test public void testSetup() throws Exception { presenter.setup(); verify(view).init(presenter); }
private ToggleCommentPresenter toggleCommentPresenter() { return presenter.getToggleCommentPresenter(); } }
@Test public void testShow() throws Exception { presenter = spy(presenter); presenter.show(path, "uri"); verify(view).show(); verify(presenter).restoreCommand(path, "uri"); }
public void restoreToCurrentVersion() { restorePopUpPresenter.show(getCurrentPath(), getCurrentVersionRecordUri()); }
ParameterizedCommand<String> restoreCommand(final ObservablePath currentPath, final String currentVersionRecordUri) { return comment -> { busyIndicatorView.showBusyIndicator(CommonConstants.INSTANCE.Restoring()); versionService.call(successCallback(currentVersionRecordUri), errorCallback()).restore(currentPath, comment); }; }
@Test public void testSetup() throws Exception { presenter.setup(); verify(view).init(presenter); }
private ToggleCommentPresenter toggleCommentPresenter() { return presenter.getToggleCommentPresenter(); } }
private Command restoreCommand() { return () -> presenter.restore(); }
@Test public void testReset() throws Exception { manager.onVersionSelectedEvent(new VersionSelectedEvent(pathTo333, getVersionRecord("111"))); manager.restoreToCurrentVersion(); verify(restorePopup).show(pathTo111, "hehe//111"); }
private Command cancelCommand() { return () -> presenter.cancel(); }
public void show(final ObservablePath currentPath, final String currentVersionRecordUri) { command = restoreCommand(currentPath, currentVersionRecordUri); view.show(); }
@Test public void testRestore() throws Exception { when(toggleCommentPresenter.getComment()).thenReturn("test"); presenter.command = commandMock; presenter.restore(); verify(commandMock).execute("test"); verify(view).hide(); }
@Test public void testReset() throws Exception { manager.onVersionSelectedEvent(new VersionSelectedEvent(pathTo333, getVersionRecord("111"))); manager.restoreToCurrentVersion(); verify(restorePopup).show(pathTo111, "hehe//111"); }
@Test public void testCancel() throws Exception { presenter.cancel(); verify(view).hide(); } }