@Test public void testAddRenameWhenSaveAndRenameIsEnabled() { final Caller saveAndRenameCaller = mock(Caller.class); final Command command = mock(Command.class); doReturn(saveAndRenameCaller).when(presenter).getSaveAndRenameServiceCaller(); doReturn(command).when(presenter).getSaveAndRename(); presenter.addRename(fileMenuBuilder); verify(fileMenuBuilder).addRename(command); }
protected void addRename(final FileMenuBuilder fileMenuBuilder) { final Optional<? extends Caller<? extends SupportsSaveAndRename<T, Metadata>>> saveAndRenameServiceCaller = Optional.ofNullable(getSaveAndRenameServiceCaller()); if (saveAndRenameServiceCaller.isPresent()) { fileMenuBuilder.addRename(getSaveAndRename()); } else { fileMenuBuilder.addRename(versionRecordManager.getPathToLatest(), assetUpdateValidator); } }
KieEditor extends BaseEditor<T, Metadata> implements KieEditorWrapperView.KieEditorWrapperPresenter { protected void addRename(final FileMenuBuilder fileMenuBuilder) { final Optional<? extends Caller<? extends SupportsSaveAndRename<T, Metadata>>> saveAndRenameServiceCaller = Optional.ofNullable(getSaveAndRenameServiceCaller()); if (saveAndRenameServiceCaller.isPresent()) { fileMenuBuilder.addRename(getSaveAndRename()); } else { fileMenuBuilder.addRename(versionRecordManager.getPathToLatest(), assetUpdateValidator); } } }
KieEditor extends BaseEditor<T, Metadata> implements KieEditorWrapperView.KieEditorWrapperPresenter { protected void addRename(final FileMenuBuilder fileMenuBuilder) { final Optional<? extends Caller<? extends SupportsSaveAndRename<T, Metadata>>> saveAndRenameServiceCaller = Optional.ofNullable(getSaveAndRenameServiceCaller()); if (saveAndRenameServiceCaller.isPresent()) { fileMenuBuilder.addRename(getSaveAndRename()); } else { fileMenuBuilder.addRename(versionRecordManager.getPathToLatest(), assetUpdateValidator); } } protected  KieEditor(); protected  KieEditor(final KieEditorView baseView); }
KieEditor extends BaseEditor<T, Metadata> implements KieEditorWrapperView.KieEditorWrapperPresenter { protected void addRename(final FileMenuBuilder fileMenuBuilder) { final Optional<? extends Caller<? extends SupportsSaveAndRename<T, Metadata>>> saveAndRenameServiceCaller = Optional.ofNullable(getSaveAndRenameServiceCaller()); if (saveAndRenameServiceCaller.isPresent()) { fileMenuBuilder.addRename(getSaveAndRename()); } else { fileMenuBuilder.addRename(versionRecordManager.getPathToLatest(), assetUpdateValidator); } } protected  KieEditor(); protected  KieEditor(final KieEditorView baseView); void onShowDiagramEditorDocks(@Observes PlaceGainFocusEvent event); void onHideDocks(@Observes PlaceHiddenEvent event); void showDocks(); void hideDocks(); boolean verifyEventIdentifier(AbstractPlaceEvent event); @Override void setOriginalHash(Integer originalHash); boolean mayClose(Object object); @OnClose void onClose(); void addDownloadMenuItem(final FileMenuBuilder fileMenuBuilder); @Override Validator getRenameValidator(); void setSelectedTab(int index); IsWidget getWidget(); void onRepositoryRemoved(final @Observes RepositoryRemovedEvent event); @Override boolean mayClose(Integer currentHash); @Override void onOverviewSelected(); @Override void onSourceTabSelected(); @Override void onEditTabSelected(); @Override void onEditTabUnselected(); void addTabBarWidget(final IsWidget customWidget); }
KieEditor extends BaseEditor<T, Metadata> implements KieEditorWrapperView.KieEditorWrapperPresenter { protected void addRename(final FileMenuBuilder fileMenuBuilder) { final Optional<? extends Caller<? extends SupportsSaveAndRename<T, Metadata>>> saveAndRenameServiceCaller = Optional.ofNullable(getSaveAndRenameServiceCaller()); if (saveAndRenameServiceCaller.isPresent()) { fileMenuBuilder.addRename(getSaveAndRename()); } else { fileMenuBuilder.addRename(versionRecordManager.getPathToLatest(), assetUpdateValidator); } } protected  KieEditor(); protected  KieEditor(final KieEditorView baseView); void onShowDiagramEditorDocks(@Observes PlaceGainFocusEvent event); void onHideDocks(@Observes PlaceHiddenEvent event); void showDocks(); void hideDocks(); boolean verifyEventIdentifier(AbstractPlaceEvent event); @Override void setOriginalHash(Integer originalHash); boolean mayClose(Object object); @OnClose void onClose(); void addDownloadMenuItem(final FileMenuBuilder fileMenuBuilder); @Override Validator getRenameValidator(); void setSelectedTab(int index); IsWidget getWidget(); void onRepositoryRemoved(final @Observes RepositoryRemovedEvent event); @Override boolean mayClose(Integer currentHash); @Override void onOverviewSelected(); @Override void onSourceTabSelected(); @Override void onEditTabSelected(); @Override void onEditTabUnselected(); void addTabBarWidget(final IsWidget customWidget);  }