use of com.vaadin.flow.data.binder.ValueContext in project linkki by linkki-framework.
the class NullHandlingConverterWrapperTest method testConvertToModel_Error.
@Test
public void testConvertToModel_Error() {
FormattedIntegerToStringConverter converter = new FormattedIntegerToStringConverter("#,##0");
NullHandlingConverterWrapper<String, Integer> wrapper = new NullHandlingConverterWrapper<>(converter);
ValueContext context = new ValueContext(Locale.GERMAN);
Result<Integer> converterResult = converter.convertToModel("xyz", context);
Result<Integer> wrapperResult = wrapper.convertToModel("xyz", context);
// converter returns error -> wrapper returns error
assertThat(converterResult.isError(), is(true));
assertThat(wrapperResult.isError(), is(true));
}
Aggregations