@Test public void testGetValue() { final String expected = "duration(\"P2Y1M\")"; final YearsMonthsValue value = mock(YearsMonthsValue.class); when(value.getYears()).thenReturn("2"); when(value.getMonths()).thenReturn("1"); when(converter.toDMNString("2", "1")).thenReturn(expected); when(view.getValue()).thenReturn(value); final String actual = selector.getValue(); verify(view).getValue(); assertEquals(expected, actual); }
@Override public String getValue() { final YearsMonthsValue value = view.getValue(); return converter.toDMNString(value.getYears(), value.getMonths()); }
YearsMonthsSelector implements TypedValueSelector { @Override public String getValue() { final YearsMonthsValue value = view.getValue(); return converter.toDMNString(value.getYears(), value.getMonths()); } }
YearsMonthsSelector implements TypedValueSelector { @Override public String getValue() { final YearsMonthsValue value = view.getValue(); return converter.toDMNString(value.getYears(), value.getMonths()); } @Inject  YearsMonthsSelector(final YearsMonthsSelector.View view,
                               final YearsMonthsValueConverter converter); }
YearsMonthsSelector implements TypedValueSelector { @Override public String getValue() { final YearsMonthsValue value = view.getValue(); return converter.toDMNString(value.getYears(), value.getMonths()); } @Inject  YearsMonthsSelector(final YearsMonthsSelector.View view,
                               final YearsMonthsValueConverter converter); @Override String getValue(); @Override void setValue(final String value); @Override void setPlaceholder(final String placeholder); @Override Element getElement(); @Override void setOnInputChangeCallback(final Consumer<Event> onValueChanged); @Override void setOnInputBlurCallback(final Consumer<BlurEvent> blurEvent); @Override void select(); @Override String toDisplay(final String rawValue); }
YearsMonthsSelector implements TypedValueSelector { @Override public String getValue() { final YearsMonthsValue value = view.getValue(); return converter.toDMNString(value.getYears(), value.getMonths()); } @Inject  YearsMonthsSelector(final YearsMonthsSelector.View view,
                               final YearsMonthsValueConverter converter); @Override String getValue(); @Override void setValue(final String value); @Override void setPlaceholder(final String placeholder); @Override Element getElement(); @Override void setOnInputChangeCallback(final Consumer<Event> onValueChanged); @Override void setOnInputBlurCallback(final Consumer<BlurEvent> blurEvent); @Override void select(); @Override String toDisplay(final String rawValue);  }