@Test public void onSafeDeleteWithoutOriginalClassName() { loadFileSuccessfulTest(false); presenter.context.getEditorModelContent().setOriginalClassName(null); presenter.onSafeDelete(); verify(showAssetUsages, never()).showAssetUsages(anyString(), any(), anyString(), any(), any(), any()); verify(validationService).validateForDelete(any(), any()); verify(deletePopUpPresenter).show(any(JavaAssetUpdateValidator.class), any()); }
public void onSafeDelete() { if (context.getEditorModelContent().getOriginalClassName() != null) { final String className = context.getEditorModelContent().getOriginalClassName(); showAssetUsagesDisplayer.showAssetUsages(Constants.INSTANCE.modelEditor_confirm_deletion_of_used_class(className), versionRecordManager.getCurrentPath(), className, ResourceType.JAVA, () -> onDelete(versionRecordManager.getPathToLatest()), () -> { }); } else { onDelete(versionRecordManager.getPathToLatest()); } }
DataModelerScreenPresenter extends KieEditor<String> { public void onSafeDelete() { if (context.getEditorModelContent().getOriginalClassName() != null) { final String className = context.getEditorModelContent().getOriginalClassName(); showAssetUsagesDisplayer.showAssetUsages(Constants.INSTANCE.modelEditor_confirm_deletion_of_used_class(className), versionRecordManager.getCurrentPath(), className, ResourceType.JAVA, () -> onDelete(versionRecordManager.getPathToLatest()), () -> { }); } else { onDelete(versionRecordManager.getPathToLatest()); } } }
DataModelerScreenPresenter extends KieEditor<String> { public void onSafeDelete() { if (context.getEditorModelContent().getOriginalClassName() != null) { final String className = context.getEditorModelContent().getOriginalClassName(); showAssetUsagesDisplayer.showAssetUsages(Constants.INSTANCE.modelEditor_confirm_deletion_of_used_class(className), versionRecordManager.getCurrentPath(), className, ResourceType.JAVA, () -> onDelete(versionRecordManager.getPathToLatest()), () -> { }); } else { onDelete(versionRecordManager.getPathToLatest()); } } @Inject  DataModelerScreenPresenter(DataModelerScreenView baseView,
                                      SessionInfo sessionInfo); }
DataModelerScreenPresenter extends KieEditor<String> { public void onSafeDelete() { if (context.getEditorModelContent().getOriginalClassName() != null) { final String className = context.getEditorModelContent().getOriginalClassName(); showAssetUsagesDisplayer.showAssetUsages(Constants.INSTANCE.modelEditor_confirm_deletion_of_used_class(className), versionRecordManager.getCurrentPath(), className, ResourceType.JAVA, () -> onDelete(versionRecordManager.getPathToLatest()), () -> { }); } else { onDelete(versionRecordManager.getPathToLatest()); } } @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> { public void onSafeDelete() { if (context.getEditorModelContent().getOriginalClassName() != null) { final String className = context.getEditorModelContent().getOriginalClassName(); showAssetUsagesDisplayer.showAssetUsages(Constants.INSTANCE.modelEditor_confirm_deletion_of_used_class(className), versionRecordManager.getCurrentPath(), className, ResourceType.JAVA, () -> onDelete(versionRecordManager.getPathToLatest()), () -> { }); } else { onDelete(versionRecordManager.getPathToLatest()); } } @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; }