OperatorPage extends BaseDecisionTableColumnPage<ConditionColumnPlugin> { boolean canOperatorBeSet() { return hasFactField() && !isConstraintValuePredicate(); } @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();  }
@Test public void testCanOperatorBeSetWhenFactTypeIsNil() { final String factField = ""; doReturn(factField).when(plugin).getFactField(); assertFalse(page.canOperatorBeSet()); }
@Test public void testCanOperatorBeSetWhenFactTypeIsNotNilAndConstraintValueIsPredicate() { final String factField = "factField"; final int constraintValue = BaseSingleFieldConstraint.TYPE_PREDICATE; doReturn(factField).when(plugin).getFactField(); doReturn(constraintValue).when(plugin).constraintValue(); assertFalse(page.canOperatorBeSet()); }
@Test public void testCanOperatorBeSetWhenFactTypeIsNotNilAndConstraintValueIsNotPredicate() { final String factField = "factField"; final int constraintValue = BaseSingleFieldConstraint.TYPE_LITERAL; doReturn(factField).when(plugin).getFactField(); doReturn(constraintValue).when(plugin).constraintValue(); assertTrue(page.canOperatorBeSet()); }