OperatorPage extends BaseDecisionTableColumnPage<ConditionColumnPlugin> { String currentField() { final List<String> parts = Arrays.asList(plugin().getBinding(), plugin().getFactField()); return parts .stream() .filter(part -> !nil(part)) .collect(Collectors.joining(" : ")); } @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 testCurrentFieldWhenFactFieldIsNull() throws Exception { final String factField = null; doReturn(factField).when(plugin).getFactField(); final String currentField = page.currentField(); assertEquals("", currentField); }
@Test public void testCurrentFieldWhenFactFieldIsNotNull() throws Exception { final String factField = "factField"; doReturn(factField).when(plugin).getFactField(); final String currentField = page.currentField(); assertEquals("factField", currentField); }
@Test public void testCurrentFieldWhenBindingIsNotNull() throws Exception { final String factField = "factField"; final String binding = "binding"; doReturn(factField).when(plugin).getFactField(); doReturn(binding).when(plugin).getBinding(); final String currentField = page.currentField(); assertEquals("binding : factField", currentField); }