Search in sources :

Example 1 with UsersListProvider

use of org.opencastproject.index.service.resources.list.provider.UsersListProvider in project opencast by opencast.

the class TestSeriesEndpoint method createListProviderService.

private ListProvidersService createListProviderService(List<User> users) {
    UserDirectoryService userDirectoryService = EasyMock.createMock(UserDirectoryService.class);
    EasyMock.expect(userDirectoryService.findUsers("%", 0, 0)).andReturn(users.iterator()).anyTimes();
    EasyMock.replay(userDirectoryService);
    UsersListProvider userListProvider = new UsersListProvider();
    userListProvider.setUserDirectoryService(userDirectoryService);
    ListProvidersServiceImpl listProvidersServiceImpl = new ListProvidersServiceImpl();
    listProvidersServiceImpl.addProvider(userListProvider);
    listProvidersServiceImpl.addProvider(new ResourceListProvider() {

        @Override
        public String[] getListNames() {
            return new String[] { "LANGUAGES" };
        }

        @Override
        public Map<String, String> getList(String listName, ResourceListQuery query, Organization organization) {
            return new HashMap<>();
        }

        @Override
        public boolean isTranslatable(String listName) {
            return false;
        }

        @Override
        public String getDefault() {
            return null;
        }
    });
    return listProvidersServiceImpl;
}
Also used : UsersListProvider(org.opencastproject.index.service.resources.list.provider.UsersListProvider) ResourceListProvider(org.opencastproject.index.service.resources.list.api.ResourceListProvider) Organization(org.opencastproject.security.api.Organization) JaxbOrganization(org.opencastproject.security.api.JaxbOrganization) DefaultOrganization(org.opencastproject.security.api.DefaultOrganization) ListProvidersServiceImpl(org.opencastproject.index.service.resources.list.impl.ListProvidersServiceImpl) ResourceListQuery(org.opencastproject.index.service.resources.list.api.ResourceListQuery) Map(java.util.Map) HashMap(java.util.HashMap) UserDirectoryService(org.opencastproject.security.api.UserDirectoryService)

Aggregations

HashMap (java.util.HashMap)1 Map (java.util.Map)1 ResourceListProvider (org.opencastproject.index.service.resources.list.api.ResourceListProvider)1 ResourceListQuery (org.opencastproject.index.service.resources.list.api.ResourceListQuery)1 ListProvidersServiceImpl (org.opencastproject.index.service.resources.list.impl.ListProvidersServiceImpl)1 UsersListProvider (org.opencastproject.index.service.resources.list.provider.UsersListProvider)1 DefaultOrganization (org.opencastproject.security.api.DefaultOrganization)1 JaxbOrganization (org.opencastproject.security.api.JaxbOrganization)1 Organization (org.opencastproject.security.api.Organization)1 UserDirectoryService (org.opencastproject.security.api.UserDirectoryService)1