@Test public void testListQuery() { ResourceListQueryImpl query = new ResourceListQueryImpl(); query.setLimit(0); query.setOffset(0); Assert.assertEquals(5, contributorsListProvider.getList(ContributorsListProvider.NAMES_TO_USERNAMES, query).size()); query.setOffset(3); Assert.assertEquals(2, contributorsListProvider.getList(ContributorsListProvider.NAMES_TO_USERNAMES, query).size()); query.setOffset(0); query.setLimit(1); Assert.assertEquals(1, contributorsListProvider.getList(ContributorsListProvider.NAMES_TO_USERNAMES, query).size()); }
@Override public Map<String, String> getList(String listName, ResourceListQuery query) { if (listName.equalsIgnoreCase(USERNAMES)) { return getListWithUserNames(query); } else if (listName.equalsIgnoreCase(NAMES_TO_USERNAMES)) { return getListWithTechnicalPresenters(query); } else { return getList(query); } }
ContributorsListProvider implements ResourceListProvider { @Override public Map<String, String> getList(String listName, ResourceListQuery query) { if (listName.equalsIgnoreCase(USERNAMES)) { return getListWithUserNames(query); } else if (listName.equalsIgnoreCase(NAMES_TO_USERNAMES)) { return getListWithTechnicalPresenters(query); } else { return getList(query); } } }
ContributorsListProvider implements ResourceListProvider { @Override public Map<String, String> getList(String listName, ResourceListQuery query) { if (listName.equalsIgnoreCase(USERNAMES)) { return getListWithUserNames(query); } else if (listName.equalsIgnoreCase(NAMES_TO_USERNAMES)) { return getListWithTechnicalPresenters(query); } else { return getList(query); } }  }
ContributorsListProvider implements ResourceListProvider { @Override public Map<String, String> getList(String listName, ResourceListQuery query) { if (listName.equalsIgnoreCase(USERNAMES)) { return getListWithUserNames(query); } else if (listName.equalsIgnoreCase(NAMES_TO_USERNAMES)) { return getListWithTechnicalPresenters(query); } else { return getList(query); } }  void setUserDirectoryService(UserDirectoryService userDirectoryService); void setIndex(AbstractSearchIndex index); @Override String[] getListNames(); @Override Map<String, String> getList(String listName, ResourceListQuery query); @Override boolean isTranslatable(String listName); @Override String getDefault(); }
ContributorsListProvider implements ResourceListProvider { @Override public Map<String, String> getList(String listName, ResourceListQuery query) { if (listName.equalsIgnoreCase(USERNAMES)) { return getListWithUserNames(query); } else if (listName.equalsIgnoreCase(NAMES_TO_USERNAMES)) { return getListWithTechnicalPresenters(query); } else { return getList(query); } }  void setUserDirectoryService(UserDirectoryService userDirectoryService); void setIndex(AbstractSearchIndex index); @Override String[] getListNames(); @Override Map<String, String> getList(String listName, ResourceListQuery query); @Override boolean isTranslatable(String listName); @Override String getDefault(); static final String DEFAULT; static final String NAMES_TO_USERNAMES; static final String USERNAMES; }