BaseServiceImpl implements BaseService<ID, T> { @Override public <S> List<S> findDistinct(Filter filter, String distinctField, Class<S> elementType, SortOrder... orders) { return getDao().findDistinct(filter, distinctField, elementType, orders); }  @Override long count(); @Override long count(Filter filter, boolean distinct); @Override T createNewEntity(); @Override @Transactional void delete(List<T> list); @Override @Transactional void delete(T t); @Override List<T> fetch(Filter filter, FetchJoinInformation... joins); @Override List<T> fetch(Filter filter, int pageNumber, int pageSize, FetchJoinInformation... joins); @Override List<T> fetch(Filter filter, int pageNumber, int pageSize, SortOrders sortOrders, FetchJoinInformation... joins); @Override List<T> fetch(Filter filter, SortOrders orders, FetchJoinInformation... joins); @Override T fetchById(ID id, FetchJoinInformation... joins); @Override List<T> fetchByIds(List<ID> ids, FetchJoinInformation... joins); @Override List<T> fetchByIds(List<ID> ids, SortOrders sortOrders, FetchJoinInformation... joins); @Override T fetchByUniqueProperty(String propertyName, Object value, boolean caseSensitive, FetchJoinInformation... joins); @Override List<T> find(Filter filter); @Override List<T> find(Filter filter, SortOrder... orders); @Override List<T> findAll(); @Override List<T> findAll(SortOrder... orders); @Override T findById(ID id); @Override T findByUniqueProperty(String propertyName, Object value, boolean caseSensitive); @Override List<S> findDistinct(Filter filter, String distinctField, Class<S> elementType, SortOrder... orders); @Override List<S> findDistinctInCollectionTable(String tableName, String distinctField, Class<S> elementType); @Override List<ID> findIds(Filter filter, Integer maxResults, SortOrder... orders); @Override List<ID> findIds(Filter filter, SortOrder... orders); @Override List<?> findSelect(Filter filter, String[] selectProperties, int pageNumber, int pageSize, SortOrders sortOrders); @Override List<?> findSelect(Filter filter, String[] selectProperties, SortOrders sortOrders); @Override Class<T> getEntityClass(); MessageService getMessageService(); @Override @Transactional List<T> save(List<T> list); @Override @Transactional T save(T t); @Override void validate(T t);  }
@Test public void testFindDistinct() { Filter filter = new Compare.Equal("property1", 1); SortOrder so = new SortOrder("property2"); service.findDistinct(filter, "property1", String.class, so); verify(dao).findDistinct(filter, "property1", String.class, so); }