@Test public void testListSimple() throws ListProviderException { Map<String, String> list = contributorsListProvider.getList(ContributorsListProvider.DEFAULT, null); Assert.assertTrue(list.containsKey(user1.getName())); Assert.assertTrue(list.containsKey(user2.getName())); Assert.assertTrue(list.containsValue(user1.getName())); Assert.assertTrue(list.containsValue(user2.getName())); Assert.assertTrue(list.containsKey("User 5")); Assert.assertTrue(list.containsValue("User 5")); Assert.assertEquals(3, list.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; }