EntityListSingleSelect extends ListBox<T> implements Refreshable, Cascadable<T> { public SelectMode getSelectMode() { return selectMode; } @SafeVarargs  EntityListSingleSelect(EntityModel<T> targetEntityModel, AttributeModel attributeModel, BaseService<ID, T> service,
            SelectMode mode, SerializablePredicate<T> filter, ListDataProvider<T> sharedProvider, List<T> items,
            SortOrder<?>... sortOrders); @SafeVarargs  EntityListSingleSelect(EntityModel<T> targetEntityModel, AttributeModel attributeModel, BaseService<ID, T> service,
            SerializablePredicate<T> filter, ListDataProvider<T> sharedProvider, SortOrder<?>... sortOrder); @SafeVarargs  EntityListSingleSelect(EntityModel<T> targetEntityModel, AttributeModel attributeModel, BaseService<ID, T> service,
            SortOrder<?>... sortOrder);  EntityListSingleSelect(EntityModel<T> targetEntityModel, AttributeModel attributeModel, List<T> items); @Override void clearAdditionalFilter(); @Override SerializablePredicate<T> getAdditionalFilter(); AttributeModel getAttributeModel(); @SuppressWarnings("unchecked") int getDataProviderSize(); SerializablePredicate<T> getFilter(); SelectMode getSelectMode(); SortOrder<?>[] getSortOrders(); @SuppressWarnings("unchecked") @Override void refresh(); void refresh(SerializablePredicate<T> filter); @Override void setAdditionalFilter(SerializablePredicate<T> additionalFilter);  }
@Test public void testAll() { EntityListSingleSelect<Integer, TestEntity> select = new EntityListSingleSelect<>(factory.getModel(TestEntity.class), null, service); assertEquals(EntityListSingleSelect.SelectMode.ALL, select.getSelectMode()); verify(service).findAll((SortOrder[]) null); }
@Test public void testFixed() { EntityListSingleSelect<Integer, TestEntity> select = new EntityListSingleSelect<>(factory.getModel(TestEntity.class), null, List.of(new TestEntity())); assertEquals(EntityListSingleSelect.SelectMode.FIXED, select.getSelectMode()); verifyNoInteractions(service); }
@Test public void testFilter() { EntityListSingleSelect<Integer, TestEntity> select = new EntityListSingleSelect<>(factory.getModel(TestEntity.class), null, service, new EqualsPredicate<TestEntity>("name", "Bob"), null); assertEquals(EntityListSingleSelect.SelectMode.FILTERED, select.getSelectMode()); verify(service).find(any(com.ocs.dynamo.filter.Filter.class), isNull()); }