@Test public void testFilterOptionsForConstraintTypeLiteralWhenConstraintValueIsFormula() { when(plugin.constraintValue()).thenReturn(BaseSingleFieldConstraint.TYPE_RET_VALUE); final String[] result = page.filterOptionsForConstraintTypeLiteral(OperatorsOracle.EXPLICIT_LIST_OPERATORS); final List<String> operators = Arrays.asList(result); assertEquals(0, operators.size()); }
String[] filterOptionsForConstraintTypeLiteral(final String[] options) { final List<String> operatorOptions = new ArrayList<>(); Collections.addAll(operatorOptions, options); if (getConstraintValueType() != BaseSingleFieldConstraint.TYPE_LITERAL) { operatorOptions.remove("in"); operatorOptions.remove("not in"); } return operatorOptions.toArray(new String[operatorOptions.size()]); }
OperatorPage extends BaseDecisionTableColumnPage<ConditionColumnPlugin> { String[] filterOptionsForConstraintTypeLiteral(final String[] options) { final List<String> operatorOptions = new ArrayList<>(); Collections.addAll(operatorOptions, options); if (getConstraintValueType() != BaseSingleFieldConstraint.TYPE_LITERAL) { operatorOptions.remove("in"); operatorOptions.remove("not in"); } return operatorOptions.toArray(new String[operatorOptions.size()]); } }
OperatorPage extends BaseDecisionTableColumnPage<ConditionColumnPlugin> { String[] filterOptionsForConstraintTypeLiteral(final String[] options) { final List<String> operatorOptions = new ArrayList<>(); Collections.addAll(operatorOptions, options); if (getConstraintValueType() != BaseSingleFieldConstraint.TYPE_LITERAL) { operatorOptions.remove("in"); operatorOptions.remove("not in"); } return operatorOptions.toArray(new String[operatorOptions.size()]); } @Inject  OperatorPage(final View view,
                        final Event<WizardPageStatusChangeEvent> changeEvent,
                        final TranslationService translationService); }
OperatorPage extends BaseDecisionTableColumnPage<ConditionColumnPlugin> { String[] filterOptionsForConstraintTypeLiteral(final String[] options) { final List<String> operatorOptions = new ArrayList<>(); Collections.addAll(operatorOptions, options); if (getConstraintValueType() != BaseSingleFieldConstraint.TYPE_LITERAL) { operatorOptions.remove("in"); operatorOptions.remove("not in"); } return operatorOptions.toArray(new String[operatorOptions.size()]); } @Inject  OperatorPage(final View view,
                        final Event<WizardPageStatusChangeEvent> changeEvent,
                        final TranslationService translationService); @Override String getTitle(); @Override void prepareView(); @Override void isComplete(final Callback<Boolean> callback); String getOperator(); }
OperatorPage extends BaseDecisionTableColumnPage<ConditionColumnPlugin> { String[] filterOptionsForConstraintTypeLiteral(final String[] options) { final List<String> operatorOptions = new ArrayList<>(); Collections.addAll(operatorOptions, options); if (getConstraintValueType() != BaseSingleFieldConstraint.TYPE_LITERAL) { operatorOptions.remove("in"); operatorOptions.remove("not in"); } return operatorOptions.toArray(new String[operatorOptions.size()]); } @Inject  OperatorPage(final View view,
                        final Event<WizardPageStatusChangeEvent> changeEvent,
                        final TranslationService translationService); @Override String getTitle(); @Override void prepareView(); @Override void isComplete(final Callback<Boolean> callback); String getOperator();  }