ActionWorkItemSetFieldPlugin extends BaseDecisionTableColumnPlugin implements HasFieldPage,
                                                                                           HasPatternPage,
                                                                                           HasWorkItemPage,
                                                                                           HasAdditionalInfoPage { ActionWorkItemWrapper newActionWorkItemWrapper(final DTColumnConfig52 column) { if (column instanceof ActionWorkItemInsertFactCol52) { return new ActionWorkItemInsertWrapper(this, (ActionWorkItemInsertFactCol52) column); } if (column instanceof ActionWorkItemSetFieldCol52) { return new ActionWorkItemSetWrapper(this, (ActionWorkItemSetFieldCol52) column); } throw new UnsupportedOperationException("Unsupported column type: " + column.getClass().getSimpleName()); } @Inject  ActionWorkItemSetFieldPlugin(final PatternPage patternPage,
                                        final FieldPage fieldPage,
                                        final AdditionalInfoPage additionalInfoPage,
                                        final WorkItemPage workItemPage,
                                        final Event<WizardPageStatusChangeEvent> changeEvent,
                                        final TranslationService translationService); @Override void init(final NewGuidedDecisionTableColumnWizard wizard); @Override String getWorkItem(); @Override void setWorkItem(final String workItemKey); @Override ActionCol52 editingCol(); @Override Boolean isWorkItemSet(); @Override PortableWorkDefinition getWorkItemDefinition(); @Override void forEachWorkItem(BiConsumer<String, String> biConsumer); @Override void setWorkItemPageAsCompleted(); @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 isInsertLogical); @Override void setUpdate(final Boolean isUpdate); @Override String getTitle(); @Override List<WizardPage> getPages(); @Override Boolean generateColumn(); @Override PatternWrapper patternWrapper(); @Override void setEditingPattern(final PatternWrapper patternWrapper); @Override String getEntryPointName(); @Override void setEntryPointName(final String entryPointName); @Override String getPatternPageDescription(); @Override Set<PatternWrapper> getPatterns(); @Override int constraintValue(); @Override FieldAccessorsAndMutators getAccessor(); @Override boolean filterEnumFields(); @Override boolean isFieldBindingValid(); @Override String getBinding(); @Override void setBinding(final String binding); @Override boolean isBindable(); @Override String getFactField(); @Override void setFactField(final String selectedValue); @Override boolean showUpdateEngineWithChanges(); @Override boolean showLogicallyInsert(); @Override boolean isLogicallyInsert(); @Override boolean isUpdateEngine(); @Override Type getType();  }
@Test public void testNewActionWrapperWhenColumnIsAnActionWorkItemInsertFactCol52() throws Exception { when(model.getTableFormat()).thenReturn(GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY); when(presenter.getModel()).thenReturn(model); final ActionWorkItemWrapper wrapper = plugin.newActionWorkItemWrapper(mock(ActionWorkItemInsertFactCol52.class)); assertTrue(wrapper instanceof ActionWorkItemInsertWrapper); }
@Test public void testNewActionWrapperWhenColumnIsAnActionSetFactWrapper() throws Exception { when(model.getTableFormat()).thenReturn(GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY); when(presenter.getModel()).thenReturn(model); final ActionWorkItemWrapper wrapper = plugin.newActionWorkItemWrapper(mock(ActionWorkItemSetFieldCol52.class)); assertTrue(wrapper instanceof ActionWorkItemSetWrapper); }
@Test(expected = UnsupportedOperationException.class) public void testNewActionWrapperWhenColumnIsInvalid() throws Exception { when(model.getTableFormat()).thenReturn(GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY); when(presenter.getModel()).thenReturn(model); plugin.newActionWorkItemWrapper(mock(ConditionCol52.class)); }