use of com.vaadin.flow.data.provider.HasListDataView in project linkki by linkki-framework.
the class AvailableValuesAspectDefinitionTest method testHandleNullItems.
@Test
void testHandleNullItems() {
AvailableValuesAspectDefinition<HasListDataView<Object, ?>> availableValuesAspectDefinition = new AvailableValuesAspectDefinition<>(AvailableValuesType.DYNAMIC, NOP);
@SuppressWarnings("unchecked") List<Object> items = mock(List.class);
@SuppressWarnings("unchecked") ComboBox<Object> component = mock(ComboBox.class);
availableValuesAspectDefinition.handleNullItems(new NoLabelComponentWrapper(component, WrapperType.FIELD), items);
verifyNoMoreInteractions(component, items);
}
use of com.vaadin.flow.data.provider.HasListDataView in project linkki by linkki-framework.
the class AvailableValuesAspectDefinitionTest method testSetDataProvider.
@Test
void testSetDataProvider() {
@SuppressWarnings("unchecked") BiConsumer<HasListDataView<Object, ?>, List<Object>> dataProviderSetter = mock(BiConsumer.class);
AvailableValuesAspectDefinition<HasListDataView<Object, ?>> availableValuesAspectDefinition = new AvailableValuesAspectDefinition<>(AvailableValuesType.DYNAMIC, dataProviderSetter);
List<Object> data = new ArrayList<>();
ComboBox<Object> component = new ComboBox<>();
availableValuesAspectDefinition.setDataProvider(new NoLabelComponentWrapper(component), data);
verify(dataProviderSetter).accept(component, data);
}
use of com.vaadin.flow.data.provider.HasListDataView in project linkki by linkki-framework.
the class GenericAvailableValuesAspectDefinitionTest method testSetDataProvider_HasDataProvider.
@SuppressWarnings("unchecked")
@Test
public void testSetDataProvider_HasDataProvider() {
GenericAvailableValuesAspectDefinition hasItemsAvailableValuesAspectDefinition = new GenericAvailableValuesAspectDefinition(AvailableValuesType.DYNAMIC);
List<Object> list = new ArrayList<>();
Component component = spy(new TestHasListDataView());
ComponentWrapper componentWrapper = new NoLabelComponentWrapper(component, WrapperType.FIELD);
hasItemsAvailableValuesAspectDefinition.setDataProvider(componentWrapper, list);
verify((HasListDataView<Object, ?>) component).setItems(list);
}
Aggregations