@Test public void testGetDropDownData() throws Exception { final AsyncPackageDataModelOracle oracle = mock(AsyncPackageDataModelOracle.class); final String factType = "Car"; final String factField = "color"; final ActionFieldValue value = new ActionFieldValue() {{ setField(factField); }}; final ActionFieldValue[] values = new ActionFieldValue[0]; final RuleModeller modeller = mock(RuleModeller.class); doReturn(oracle).when(modeller).getDataModelOracle(); final EventBus eventBus = mock(EventBus.class); final String variableType = DataType.TYPE_STRING; final boolean readOnly = false; actionValueEditor = new ActionValueEditor(factType, value, values, modeller, eventBus, variableType, readOnly); reset(oracle); actionValueEditor.getDropDownData(); final Map<String, String> fieldValues = new HashMap<>(); verify(oracle).getEnums(eq(factType), eq(factField), eq(fieldValues)); }
DropDownData getDropDownData() { if (DataType.TYPE_BOOLEAN.equals(value.getType())) { this.dropDownData = DropDownData.create(new String[]{"true", "false"}); } else { final Map<String, String> currentValueMap = FieldNatureUtil.toMap(this.values); this.dropDownData = oracle.getEnums(factType, value.getField(), currentValueMap); } return dropDownData; }
ActionValueEditor extends Composite { DropDownData getDropDownData() { if (DataType.TYPE_BOOLEAN.equals(value.getType())) { this.dropDownData = DropDownData.create(new String[]{"true", "false"}); } else { final Map<String, String> currentValueMap = FieldNatureUtil.toMap(this.values); this.dropDownData = oracle.getEnums(factType, value.getField(), currentValueMap); } return dropDownData; } }
ActionValueEditor extends Composite { DropDownData getDropDownData() { if (DataType.TYPE_BOOLEAN.equals(value.getType())) { this.dropDownData = DropDownData.create(new String[]{"true", "false"}); } else { final Map<String, String> currentValueMap = FieldNatureUtil.toMap(this.values); this.dropDownData = oracle.getEnums(factType, value.getField(), currentValueMap); } return dropDownData; } ActionValueEditor(final String factType,
                             final ActionFieldValue value,
                             final ActionFieldValue[] values,
                             final RuleModeller modeller,
                             final EventBus eventBus,
                             final String variableType,
                             final boolean readOnly); }
ActionValueEditor extends Composite { DropDownData getDropDownData() { if (DataType.TYPE_BOOLEAN.equals(value.getType())) { this.dropDownData = DropDownData.create(new String[]{"true", "false"}); } else { final Map<String, String> currentValueMap = FieldNatureUtil.toMap(this.values); this.dropDownData = oracle.getEnums(factType, value.getField(), currentValueMap); } return dropDownData; } ActionValueEditor(final String factType,
                             final ActionFieldValue value,
                             final ActionFieldValue[] values,
                             final RuleModeller modeller,
                             final EventBus eventBus,
                             final String variableType,
                             final boolean readOnly); void refresh(); Command getOnChangeCommand(); void setOnChangeCommand(Command onChangeCommand); }
ActionValueEditor extends Composite { DropDownData getDropDownData() { if (DataType.TYPE_BOOLEAN.equals(value.getType())) { this.dropDownData = DropDownData.create(new String[]{"true", "false"}); } else { final Map<String, String> currentValueMap = FieldNatureUtil.toMap(this.values); this.dropDownData = oracle.getEnums(factType, value.getField(), currentValueMap); } return dropDownData; } ActionValueEditor(final String factType,
                             final ActionFieldValue value,
                             final ActionFieldValue[] values,
                             final RuleModeller modeller,
                             final EventBus eventBus,
                             final String variableType,
                             final boolean readOnly); void refresh(); Command getOnChangeCommand(); void setOnChangeCommand(Command onChangeCommand);  }