@Test public void testGetDN() throws Exception { Map<CNField, String> userFields; userFields = new HashMap<>(); userFields.put(CNField.C, "US"); userFields.put(CNField.O, "Nuxeo"); userFields.put(CNField.OU, "IT"); userFields.put(CNField.CN, "Wojciech Sulejman"); userFields.put(CNField.Email, "wsulejman@nuxeo.com"); userFields.put(CNField.UserID, "wsulejman"); UserInfo ui = new UserInfo(userFields); assertEquals(ui.getDN(userFields), ("C=US, O=Nuxeo, OU=IT, CN=Wojciech Sulejman")); Map<CNField, String> userFields2; userFields2 = new HashMap<>(); userFields2.put(CNField.OU, "IT"); userFields2.put(CNField.Email, "wsulejman@nuxeo.com"); userFields2.put(CNField.O, "Nuxeo"); userFields2.put(CNField.C, "US"); userFields2.put(CNField.CN, "Wojciech Sulejman"); userFields2.put(CNField.UserID, "wsulejman"); UserInfo ui2 = new UserInfo(userFields2); assertEquals(ui2.getDN(userFields2), ("C=US, O=Nuxeo, OU=IT, CN=Wojciech Sulejman")); }
public String getDN(Map<CNField, String> userFields) { String dN = "C=" + userFields.get(CNField.C) + ", O=" + userFields.get(CNField.O) + ", OU=" + userFields.get(CNField.OU) + ", CN=" + userFields.get(CNField.CN); return dN; }
UserInfo { public String getDN(Map<CNField, String> userFields) { String dN = "C=" + userFields.get(CNField.C) + ", O=" + userFields.get(CNField.O) + ", OU=" + userFields.get(CNField.OU) + ", CN=" + userFields.get(CNField.CN); return dN; } }
UserInfo { public String getDN(Map<CNField, String> userFields) { String dN = "C=" + userFields.get(CNField.C) + ", O=" + userFields.get(CNField.O) + ", OU=" + userFields.get(CNField.OU) + ", CN=" + userFields.get(CNField.CN); return dN; } UserInfo(Map<CNField, String> userDNFields); }
UserInfo { public String getDN(Map<CNField, String> userFields) { String dN = "C=" + userFields.get(CNField.C) + ", O=" + userFields.get(CNField.O) + ", OU=" + userFields.get(CNField.OU) + ", CN=" + userFields.get(CNField.CN); return dN; } UserInfo(Map<CNField, String> userDNFields); void verify(Map<CNField, String> userFields); String getDN(Map<CNField, String> userFields); Map<CNField, String> getUserFields(); X500Principal getX500Principal(); @Override String toString(); }
UserInfo { public String getDN(Map<CNField, String> userFields) { String dN = "C=" + userFields.get(CNField.C) + ", O=" + userFields.get(CNField.O) + ", OU=" + userFields.get(CNField.OU) + ", CN=" + userFields.get(CNField.CN); return dN; } UserInfo(Map<CNField, String> userDNFields); void verify(Map<CNField, String> userFields); String getDN(Map<CNField, String> userFields); Map<CNField, String> getUserFields(); X500Principal getX500Principal(); @Override String toString();  }