BRLConditionColumnPlugin extends BaseDecisionTableColumnPlugin implements HasDefaultValuesPage,
                                                                                       HasRuleModellerPage,
                                                                                       HasAdditionalInfoPage,
                                                                                       TemplateVariablesChangedEvent.Handler { @Override public Boolean generateColumn() { setupDefinedVariables(getRuleModel()); editingCol().setDefinition(Arrays.asList(getRuleModel().lhs)); if (isNewColumn()) { presenter.appendColumn(editingCol()); } else { try { presenter.updateColumn(getOriginalColumn(), editingCol()); } catch (VetoUpdatePatternInUseException veto) { wizard.showPatternInUseError(); return false; } catch (VetoException veto) { wizard.showGenericVetoError(); return false; } } return true; } @Inject  BRLConditionColumnPlugin(final RuleModellerPage ruleModellerPage,
                                    final DefaultValuesPage defaultValuesPage,
                                    final AdditionalInfoPage additionalInfoPage,
                                    final Event<WizardPageStatusChangeEvent> changeEvent,
                                    final TranslationService translationService); @Override void init(final NewGuidedDecisionTableColumnWizard wizard); @Override void onClose(); @Override String getTitle(); @Override List<WizardPage> getPages(); @Override Boolean generateColumn(); @Override Type getType(); @Override boolean setupDefinedVariables(RuleModel ruleModel); @Override BRLConditionColumn editingCol(); @Override String getHeader(); @Override void setHeader(String header); @Override Set<String> getAlreadyUsedColumnHeaders(); @Override boolean isHideColumn(); @Override void setHideColumn(boolean hideColumn); @Override void setInsertLogical(Boolean value); @Override void setUpdate(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 TableFormat tableFormat(); @Override void onTemplateVariablesChanged(TemplateVariablesChangedEvent event);  }
@Test public void testGenerateColumnVeto() throws Exception { doReturn(false).when(plugin).isNewColumn(); doThrow(new ModelSynchronizer.VetoException()).when(presenter).updateColumn(any(ConditionCol52.class), any(BRLConditionColumn.class)); final Boolean success = plugin.generateColumn(); assertFalse(success); verify(wizard).showGenericVetoError(); }
@Test public void testGenerateColumnWhenColumnIsNotNewAndVetoed() throws Exception { doReturn(false).when(plugin).isNewColumn(); doThrow(VetoUpdatePatternInUseException.class).when(presenter).updateColumn(any(BRLConditionColumn.class), any(BRLConditionColumn.class)); assertFalse(plugin.generateColumn()); verify(wizard).showPatternInUseError(); }