@Test public void testGenerateColumnVeto() throws Exception { doReturn(false).when(plugin).isNewColumn(); doThrow(new ModelSynchronizer.VetoException()).when(presenter).updateColumn(any(BRLActionColumn.class), any(BRLActionColumn.class)); final Boolean success = plugin.generateColumn(); assertFalse(success); verify(wizard).showGenericVetoError(); }
@Override public Boolean generateColumn() { setupDefinedVariables(getRuleModel()); editingCol().setDefinition(Arrays.asList(getRuleModel().rhs)); if (isNewColumn()) { presenter.appendColumn(editingCol()); } else { try { presenter.updateColumn(originalCol(), editingCol()); } catch (ModelSynchronizer.VetoException veto) { wizard.showGenericVetoError(); return false; } } return true; }
BRLActionColumnPlugin extends BaseDecisionTableColumnPlugin implements HasDefaultValuesPage,
                                                                                    HasRuleModellerPage,
                                                                                    HasAdditionalInfoPage,
                                                                                    TemplateVariablesChangedEvent.Handler { @Override public Boolean generateColumn() { setupDefinedVariables(getRuleModel()); editingCol().setDefinition(Arrays.asList(getRuleModel().rhs)); if (isNewColumn()) { presenter.appendColumn(editingCol()); } else { try { presenter.updateColumn(originalCol(), editingCol()); } catch (ModelSynchronizer.VetoException veto) { wizard.showGenericVetoError(); return false; } } return true; } }
BRLActionColumnPlugin extends BaseDecisionTableColumnPlugin implements HasDefaultValuesPage,
                                                                                    HasRuleModellerPage,
                                                                                    HasAdditionalInfoPage,
                                                                                    TemplateVariablesChangedEvent.Handler { @Override public Boolean generateColumn() { setupDefinedVariables(getRuleModel()); editingCol().setDefinition(Arrays.asList(getRuleModel().rhs)); if (isNewColumn()) { presenter.appendColumn(editingCol()); } else { try { presenter.updateColumn(originalCol(), editingCol()); } catch (ModelSynchronizer.VetoException veto) { wizard.showGenericVetoError(); return false; } } return true; } @Inject  BRLActionColumnPlugin(final RuleModellerPage ruleModellerPage,
                                 final DefaultValuesPage defaultValuesPage,
                                 final Instance<RuleModellerActionPlugin> actionPluginInstance,
                                 final AdditionalInfoPage<BRLActionColumnPlugin> additionalInfoPage,
                                 final Event<WizardPageStatusChangeEvent> changeEvent,
                                 final TranslationService translationService); }
BRLActionColumnPlugin extends BaseDecisionTableColumnPlugin implements HasDefaultValuesPage,
                                                                                    HasRuleModellerPage,
                                                                                    HasAdditionalInfoPage,
                                                                                    TemplateVariablesChangedEvent.Handler { @Override public Boolean generateColumn() { setupDefinedVariables(getRuleModel()); editingCol().setDefinition(Arrays.asList(getRuleModel().rhs)); if (isNewColumn()) { presenter.appendColumn(editingCol()); } else { try { presenter.updateColumn(originalCol(), editingCol()); } catch (ModelSynchronizer.VetoException veto) { wizard.showGenericVetoError(); return false; } } return true; } @Inject  BRLActionColumnPlugin(final RuleModellerPage ruleModellerPage,
                                 final DefaultValuesPage defaultValuesPage,
                                 final Instance<RuleModellerActionPlugin> actionPluginInstance,
                                 final AdditionalInfoPage<BRLActionColumnPlugin> additionalInfoPage,
                                 final Event<WizardPageStatusChangeEvent> changeEvent,
                                 final TranslationService translationService); @Override String getTitle(); @Override List<WizardPage> getPages(); @Override void init(final NewGuidedDecisionTableColumnWizard wizard); @Override void onClose(); @Override Boolean generateColumn(); @Override boolean setupDefinedVariables(RuleModel ruleModel); @Override BRLActionColumn editingCol(); @Override String getHeader(); @Override void setHeader(final String header); @Override Set<String> getAlreadyUsedColumnHeaders(); @Override boolean isHideColumn(); @Override void setHideColumn(boolean hideColumn); @Override void setInsertLogical(final Boolean value); @Override void setUpdate(final Boolean value); @Override boolean showUpdateEngineWithChanges(); @Override boolean showLogicallyInsert(); @Override boolean isLogicallyInsert(); @Override boolean isUpdateEngine(); @Override RuleModel getRuleModel(); @Override Collection<RuleModellerActionPlugin> getRuleModellerActionPlugins(); @Override RuleModellerConfiguration getRuleModellerConfiguration(); @Override String getRuleModellerDescription(); @Override void setRuleModellerPageAsCompleted(); @Override Boolean isRuleModellerPageCompleted(); @Override GuidedDecisionTable52.TableFormat tableFormat(); @Override void onTemplateVariablesChanged(TemplateVariablesChangedEvent event); @Override Type getType(); }
BRLActionColumnPlugin extends BaseDecisionTableColumnPlugin implements HasDefaultValuesPage,
                                                                                    HasRuleModellerPage,
                                                                                    HasAdditionalInfoPage,
                                                                                    TemplateVariablesChangedEvent.Handler { @Override public Boolean generateColumn() { setupDefinedVariables(getRuleModel()); editingCol().setDefinition(Arrays.asList(getRuleModel().rhs)); if (isNewColumn()) { presenter.appendColumn(editingCol()); } else { try { presenter.updateColumn(originalCol(), editingCol()); } catch (ModelSynchronizer.VetoException veto) { wizard.showGenericVetoError(); return false; } } return true; } @Inject  BRLActionColumnPlugin(final RuleModellerPage ruleModellerPage,
                                 final DefaultValuesPage defaultValuesPage,
                                 final Instance<RuleModellerActionPlugin> actionPluginInstance,
                                 final AdditionalInfoPage<BRLActionColumnPlugin> additionalInfoPage,
                                 final Event<WizardPageStatusChangeEvent> changeEvent,
                                 final TranslationService translationService); @Override String getTitle(); @Override List<WizardPage> getPages(); @Override void init(final NewGuidedDecisionTableColumnWizard wizard); @Override void onClose(); @Override Boolean generateColumn(); @Override boolean setupDefinedVariables(RuleModel ruleModel); @Override BRLActionColumn editingCol(); @Override String getHeader(); @Override void setHeader(final String header); @Override Set<String> getAlreadyUsedColumnHeaders(); @Override boolean isHideColumn(); @Override void setHideColumn(boolean hideColumn); @Override void setInsertLogical(final Boolean value); @Override void setUpdate(final Boolean value); @Override boolean showUpdateEngineWithChanges(); @Override boolean showLogicallyInsert(); @Override boolean isLogicallyInsert(); @Override boolean isUpdateEngine(); @Override RuleModel getRuleModel(); @Override Collection<RuleModellerActionPlugin> getRuleModellerActionPlugins(); @Override RuleModellerConfiguration getRuleModellerConfiguration(); @Override String getRuleModellerDescription(); @Override void setRuleModellerPageAsCompleted(); @Override Boolean isRuleModellerPageCompleted(); @Override GuidedDecisionTable52.TableFormat tableFormat(); @Override void onTemplateVariablesChanged(TemplateVariablesChangedEvent event); @Override Type getType();  }