BaseEditor { protected Promise<Void> makeMenuBar() { if (menuItems.contains(SAVE)) { menuBuilder.addSave(getOnSave()); } if (menuItems.contains(COPY)) { menuBuilder.addCopy(versionRecordManager.getCurrentPath(), getCopyValidator(), getCopyServiceCaller()); } if (menuItems.contains(RENAME)) { menuBuilder.addRename(getSaveAndRename()); } if (menuItems.contains(DELETE)) { menuBuilder.addDelete(versionRecordManager.getCurrentPath(), getDeleteServiceCaller()); } if (menuItems.contains(VALIDATE)) { menuBuilder.addValidate(getValidateCommand()); } if (menuItems.contains(HISTORY)) { menuBuilder.addNewTopLevelMenu(versionRecordManager.buildMenu()); } if (menuItems.contains(DOWNLOAD)) { addDownloadMenuItem(menuBuilder); } return promises.resolve(); } BaseEditor(VersionRecordManager versionRecordManager,
               BaseEditorView baseView,
               BasicFileMenuBuilder menuBuilder,
               Event<ChangeTitleWidgetEvent> changeTitleNotification); protected  BaseEditor(); protected  BaseEditor(final BaseEditorView baseView); Validator getRenameValidator(); Validator getCopyValidator(); void setOriginalHash(Integer originalHash); String getTitleText(); RemoteCallback<Path> getSaveSuccessCallback(final int newHash); void onRestore(@Observes RestoreEvent restore); void reload(); void disableMenuItem(final MenuItems menuItem); void enableMenuItem(final MenuItems menuItem); void getMenus(final Consumer<Menus> menusConsumer); Command getValidateCommand(); boolean mayClose(Integer currentHash); boolean isDirty(Integer currentHash); VersionRecordManager getVersionRecordManager(); void setMetadataOriginalHash(final Integer metadataOriginalHash);  }
@Test public void testMakeMenuBarWhenItDoesNotContainAllMenuItems() { editor.menuItems = new HashSet<>(); editor.makeMenuBar(); verify(menuBuilder, never()).addSave(any(Command.class)); verify(menuBuilder, never()).addCopy(any(ObservablePath.class), any(Validator.class), any(Caller.class)); verify(menuBuilder, never()).addRename(any()); verify(menuBuilder, never()).addDelete(any(ObservablePath.class), any(Caller.class)); verify(menuBuilder, never()).addValidate(any()); verify(menuBuilder, never()).addNewTopLevelMenu(any()); }