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;
}
Aggregations