@Test public void init() throws Exception { resetMocks(); EmbeddedSubprocess embeddedSubprocess = new EmbeddedSubprocess(); OnEntryAction onEntryAction = embeddedSubprocess.getExecutionSet().getOnEntryAction(); OnExitAction onExitAction = embeddedSubprocess.getExecutionSet().getOnExitAction(); PowerMockito.mockStatic(ClientBindingUtils.class); BDDMockito.given(ClientBindingUtils.getProxiedValue(embeddedSubprocess, "onEntryAction")).willReturn(onEntryAction); BDDMockito.given(ClientBindingUtils.getProxiedValue(embeddedSubprocess, "onExitAction")).willReturn(onExitAction); when(conditionalComboBoxFieldDefinition.getRelatedField()).thenReturn("onEntryAction;onExitAction"); when(renderingContext.getModel()).thenReturn(embeddedSubprocess); when(adapterManager.forProperty()).thenReturn(Mockito.mock(PropertyAdapter.class)); when(adapterManager.forProperty().getValue(onEntryAction)).thenReturn("value"); when(adapterManager.forProperty().getValue(onExitAction)).thenReturn(""); conditionalComboBoxFieldRenderer.init(renderingContext, conditionalComboBoxFieldDefinition); verify(conditionalComboBoxFieldRenderer, never()).setReadOnly(true); when(adapterManager.forProperty().getValue(onEntryAction)).thenReturn(null); when(adapterManager.forProperty().getValue(onExitAction)).thenReturn(""); conditionalComboBoxFieldRenderer.init(renderingContext, conditionalComboBoxFieldDefinition); verify(conditionalComboBoxFieldRenderer, times(1)).setReadOnly(false); }
@Override public void init(final FormRenderingContext renderingContext, ConditionalComboBoxFieldDefinition field) { super.init(renderingContext, field); initializeRelatedFieldCondition(renderingContext, field); }
ConditionalComboBoxFieldRenderer extends AbstractComboBoxFieldRenderer<ConditionalComboBoxFieldDefinition> { @Override public void init(final FormRenderingContext renderingContext, ConditionalComboBoxFieldDefinition field) { super.init(renderingContext, field); initializeRelatedFieldCondition(renderingContext, field); } }
ConditionalComboBoxFieldRenderer extends AbstractComboBoxFieldRenderer<ConditionalComboBoxFieldDefinition> { @Override public void init(final FormRenderingContext renderingContext, ConditionalComboBoxFieldDefinition field) { super.init(renderingContext, field); initializeRelatedFieldCondition(renderingContext, field); } @Inject  ConditionalComboBoxFieldRenderer(@FixedValues final ComboBoxFixedValuesWidgetView comboBoxEditor,
                                            final ClientTranslationService translationService,
                                            final AdapterManager adapterManager); }
ConditionalComboBoxFieldRenderer extends AbstractComboBoxFieldRenderer<ConditionalComboBoxFieldDefinition> { @Override public void init(final FormRenderingContext renderingContext, ConditionalComboBoxFieldDefinition field) { super.init(renderingContext, field); initializeRelatedFieldCondition(renderingContext, field); } @Inject  ConditionalComboBoxFieldRenderer(@FixedValues final ComboBoxFixedValuesWidgetView comboBoxEditor,
                                            final ClientTranslationService translationService,
                                            final AdapterManager adapterManager); @Override void init(final FormRenderingContext renderingContext,
                     ConditionalComboBoxFieldDefinition field); void refreshFieldCondition(Object conditionValue); @Override String getName(); }
ConditionalComboBoxFieldRenderer extends AbstractComboBoxFieldRenderer<ConditionalComboBoxFieldDefinition> { @Override public void init(final FormRenderingContext renderingContext, ConditionalComboBoxFieldDefinition field) { super.init(renderingContext, field); initializeRelatedFieldCondition(renderingContext, field); } @Inject  ConditionalComboBoxFieldRenderer(@FixedValues final ComboBoxFixedValuesWidgetView comboBoxEditor,
                                            final ClientTranslationService translationService,
                                            final AdapterManager adapterManager); @Override void init(final FormRenderingContext renderingContext,
                     ConditionalComboBoxFieldDefinition field); void refreshFieldCondition(Object conditionValue); @Override String getName(); static final String TYPE_NAME; }