DecisionTableXLSEditorPresenter extends KieEditor<DecisionTableXLSContent> implements DecisionTableXLSEditorView.Presenter { @Override protected void save(String commitMessage) { metadataService.call(getSaveSuccessCallback(metadata.hashCode())) .saveMetadata(versionRecordManager.getCurrentPath(), metadata, commitMessage); } @Inject  DecisionTableXLSEditorPresenter(final DecisionTableXLSEditorView baseView,
                                           final DecisionTableXLSResourceType decisionTableXLSResourceType,
                                           final DecisionTableXLSXResourceType decisionTableXLSXResourceType,
                                           final BusyIndicatorView busyIndicatorView,
                                           final ValidationPopup validationPopup,
                                           final Caller<DecisionTableXLSService> decisionTableXLSService,
                                           final Caller<MetadataService> metadataService); @OnStartup void onStartup(final ObservablePath path,
                          final PlaceRequest place); @Override void onUpload(); @Override void onUploadSuccess(); @Override void onSourceTabSelected(); @OnClose @Override void onClose(); @WorkbenchPartTitleDecoration IsWidget getTitle(); @WorkbenchPartTitle String getTitleText(); @WorkbenchPartView IsWidget getWidget(); @WorkbenchMenu void getMenus(final Consumer<Menus> menusConsumer); static final String EDITOR_ID; }
@Test public void testSave() { final ObservablePath path = mock(ObservablePath.class); doReturn(path).when(versionRecordManager).getCurrentPath(); presenter.onStartup(XLSPath, mock(PlaceRequest.class)); doReturn(Optional.of(mock(WorkspaceProject.class))).when(workbenchContext).getActiveWorkspaceProject(); doReturn(promises.resolve(false)).when(projectController).canUpdateProject(any()); presenter.save("saving"); verify(metadataService).saveMetadata(eq(path), eq(metadata), eq("saving")); }