@Test public void onSaveWithPackageChangeTest() { when(validationService.validateForSave(any(Path.class), any(DataObject.class))).thenReturn(Collections.emptyList()); presenter.context = mock(DataModelerContext.class); when(presenter.context.getDataObject()).thenReturn(testObject1); when(presenter.context.isEditorChanged()).thenReturn(true); when(presenter.context.getEditorModelContent()).thenReturn(mock(EditorModelContent.class)); when(presenter.context.getEditorModelContent().getOriginalPackageName()).thenReturn("org.test.original"); presenter.save(); verify(view).showYesNoCancelPopup(anyString(), anyString(), any(Command.class), anyString(), eq(ButtonType.PRIMARY), any(Command.class), anyString(), eq(ButtonType.DANGER)); }
protected void save() { validationService.call(checkMessages -> { if (((List<ValidationMessage>) checkMessages).isEmpty()) { checkDirtyAndSaveFile(); } else { validationPopup.showSaveValidationMessages(() -> checkDirtyAndSaveFile(), () -> { }, (List<ValidationMessage>) checkMessages); } }).validateForSave(versionRecordManager.getPathToLatest(), context.getDataObject()); }
DataModelerScreenPresenter extends KieEditor<String> { protected void save() { validationService.call(checkMessages -> { if (((List<ValidationMessage>) checkMessages).isEmpty()) { checkDirtyAndSaveFile(); } else { validationPopup.showSaveValidationMessages(() -> checkDirtyAndSaveFile(), () -> { }, (List<ValidationMessage>) checkMessages); } }).validateForSave(versionRecordManager.getPathToLatest(), context.getDataObject()); } }
DataModelerScreenPresenter extends KieEditor<String> { protected void save() { validationService.call(checkMessages -> { if (((List<ValidationMessage>) checkMessages).isEmpty()) { checkDirtyAndSaveFile(); } else { validationPopup.showSaveValidationMessages(() -> checkDirtyAndSaveFile(), () -> { }, (List<ValidationMessage>) checkMessages); } }).validateForSave(versionRecordManager.getPathToLatest(), context.getDataObject()); } @Inject  DataModelerScreenPresenter(DataModelerScreenView baseView,
                                      SessionInfo sessionInfo); }
DataModelerScreenPresenter extends KieEditor<String> { protected void save() { validationService.call(checkMessages -> { if (((List<ValidationMessage>) checkMessages).isEmpty()) { checkDirtyAndSaveFile(); } else { validationPopup.showSaveValidationMessages(() -> checkDirtyAndSaveFile(), () -> { }, (List<ValidationMessage>) checkMessages); } }).validateForSave(versionRecordManager.getPathToLatest(), context.getDataObject()); } @Inject  DataModelerScreenPresenter(DataModelerScreenView baseView,
                                      SessionInfo sessionInfo); @WorkbenchPartTitle String getTitleText(); @WorkbenchPartTitleDecoration IsWidget getTitle(); @WorkbenchPartView IsWidget getView(); @WorkbenchMenu void getMenus(final Consumer<Menus> menusConsumer); @OnStartup void onStartup(final ObservablePath path,
                          final PlaceRequest place); @OnFocus void onFocus(); @Override void showDocks(); @Override void hideDocks(); @OnMayClose boolean onMayClose(); @OnClose @Override void onClose(); void onSafeDelete(); void onSafeRename(); DataModel getDataModel(); String getSource(); void setSource(String source); @Override void onSourceTabSelected(); @Override void onOverviewSelected(); @Override void onEditTabSelected(); }
DataModelerScreenPresenter extends KieEditor<String> { protected void save() { validationService.call(checkMessages -> { if (((List<ValidationMessage>) checkMessages).isEmpty()) { checkDirtyAndSaveFile(); } else { validationPopup.showSaveValidationMessages(() -> checkDirtyAndSaveFile(), () -> { }, (List<ValidationMessage>) checkMessages); } }).validateForSave(versionRecordManager.getPathToLatest(), context.getDataObject()); } @Inject  DataModelerScreenPresenter(DataModelerScreenView baseView,
                                      SessionInfo sessionInfo); @WorkbenchPartTitle String getTitleText(); @WorkbenchPartTitleDecoration IsWidget getTitle(); @WorkbenchPartView IsWidget getView(); @WorkbenchMenu void getMenus(final Consumer<Menus> menusConsumer); @OnStartup void onStartup(final ObservablePath path,
                          final PlaceRequest place); @OnFocus void onFocus(); @Override void showDocks(); @Override void hideDocks(); @OnMayClose boolean onMayClose(); @OnClose @Override void onClose(); void onSafeDelete(); void onSafeRename(); DataModel getDataModel(); String getSource(); void setSource(String source); @Override void onSourceTabSelected(); @Override void onOverviewSelected(); @Override void onEditTabSelected(); static final String EDITOR_ID; }