GoYamlUserDataProvider extends SimpleUserDataProvider { @SuppressWarnings({"rawtypes", "unchecked"}) static List<Md5UserData> loadUserData(File yamlFile) { List<Map> userEntries = (List<Map>) YamlTool.load(yamlFile); if (userEntries != null && userEntries.isEmpty() == false) { List<Md5UserData> userDataList = new ArrayList<Md5UserData>(userEntries.size()); for (Map userEntry : userEntries) { Md5UserData userData = new Md5UserData(); userData.setScreenname(getStringValue("nickname", userEntry)); userData.setOrcid(getStringValue("uri", userEntry)); userData.setXref(getStringValue("xref", userEntry)); userData.setMd5s(getStringList("email-md5", userEntry)); userDataList.add(userData); } return userDataList; } return Collections.emptyList(); } @Inject  GoYamlUserDataProvider(GitYaml gitYamlFile); @Override UserData getUserDataPerGithubLogin(final String login); @Override UserData getUserDataPerEMail(final String email); @Override List<XrefUserData> getXrefUserData(); @Override Set<String> getAdditionalXrefs(); @Override List<OrcidUserData> getOrcIdUserData();  }
@Test public void test2() throws Exception { List<Md5UserData> userData = GoYamlUserDataProvider.loadUserData(new File("src/test/resources/user.yaml")); assertEquals(2, userData.size()); }