mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-28 23:02:15 +00:00
SEC-805: Add extra fields to InetOrgPerson
http://jira.springframework.org/browse/SEC-805. Added a substantial number of new fields to the class.
This commit is contained in:
parent
49bec559a9
commit
104716fedb
@ -29,33 +29,120 @@ import org.springframework.ldap.core.DirContextOperations;
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class InetOrgPerson extends Person {
|
public class InetOrgPerson extends Person {
|
||||||
private String mail;
|
private String carLicense;
|
||||||
private String uid;
|
// Person.cn
|
||||||
private String employeeNumber;
|
|
||||||
private String destinationIndicator;
|
private String destinationIndicator;
|
||||||
|
private String departmentNumber;
|
||||||
public String getMail() {
|
// Person.description
|
||||||
return mail;
|
private String displayName;
|
||||||
}
|
private String employeeNumber;
|
||||||
|
private String homePhone;
|
||||||
|
private String homePostalAddress;
|
||||||
|
private String initials;
|
||||||
|
private String mail;
|
||||||
|
private String mobile;
|
||||||
|
private String o;
|
||||||
|
private String ou;
|
||||||
|
private String postalAddress;
|
||||||
|
private String postalCode;
|
||||||
|
private String roomNumber;
|
||||||
|
private String street;
|
||||||
|
// Person.sn
|
||||||
|
// Person.telephoneNumber
|
||||||
|
private String title;
|
||||||
|
private String uid;
|
||||||
|
|
||||||
public String getUid() {
|
public String getUid() {
|
||||||
return uid;
|
return uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getMail() {
|
||||||
|
return mail;
|
||||||
|
}
|
||||||
|
|
||||||
public String getEmployeeNumber() {
|
public String getEmployeeNumber() {
|
||||||
return employeeNumber;
|
return employeeNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getInitials() {
|
||||||
|
return initials;
|
||||||
|
}
|
||||||
|
|
||||||
public String getDestinationIndicator() {
|
public String getDestinationIndicator() {
|
||||||
return destinationIndicator;
|
return destinationIndicator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getO() {
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOu() {
|
||||||
|
return ou;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCarLicense() {
|
||||||
|
return carLicense;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDepartmentNumber() {
|
||||||
|
return departmentNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDisplayName() {
|
||||||
|
return displayName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHomePhone() {
|
||||||
|
return homePhone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRoomNumber() {
|
||||||
|
return roomNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHomePostalAddress() {
|
||||||
|
return homePostalAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMobile() {
|
||||||
|
return mobile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPostalAddress() {
|
||||||
|
return postalAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPostalCode() {
|
||||||
|
return postalCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStreet() {
|
||||||
|
return street;
|
||||||
|
}
|
||||||
|
|
||||||
protected void populateContext(DirContextAdapter adapter) {
|
protected void populateContext(DirContextAdapter adapter) {
|
||||||
super.populateContext(adapter);
|
super.populateContext(adapter);
|
||||||
adapter.setAttributeValue("mail", mail);
|
adapter.setAttributeValue("carLicense", carLicense);
|
||||||
adapter.setAttributeValue("uid", uid);
|
adapter.setAttributeValue("departmentNumber", departmentNumber);
|
||||||
adapter.setAttributeValue("employeeNumber", employeeNumber);
|
|
||||||
adapter.setAttributeValue("destinationIndicator", destinationIndicator);
|
adapter.setAttributeValue("destinationIndicator", destinationIndicator);
|
||||||
|
adapter.setAttributeValue("displayName", displayName);
|
||||||
|
adapter.setAttributeValue("employeeNumber", employeeNumber);
|
||||||
|
adapter.setAttributeValue("homePhone", homePhone);
|
||||||
|
adapter.setAttributeValue("homePostalAddress", homePostalAddress);
|
||||||
|
adapter.setAttributeValue("initials", initials);
|
||||||
|
adapter.setAttributeValue("mail", mail);
|
||||||
|
adapter.setAttributeValue("mobile", mobile);
|
||||||
|
adapter.setAttributeValue("postalAddress", postalAddress);
|
||||||
|
adapter.setAttributeValue("postalCode", postalCode);
|
||||||
|
adapter.setAttributeValue("ou", ou);
|
||||||
|
adapter.setAttributeValue("o", o);
|
||||||
|
adapter.setAttributeValue("roomNumber", roomNumber);
|
||||||
|
adapter.setAttributeValue("street", street);
|
||||||
|
adapter.setAttributeValue("uid", uid);
|
||||||
adapter.setAttributeValues("objectclass", new String[] {"top", "person", "organizationalPerson", "inetOrgPerson"});
|
adapter.setAttributeValues("objectclass", new String[] {"top", "person", "organizationalPerson", "inetOrgPerson"});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,18 +152,46 @@ public class InetOrgPerson extends Person {
|
|||||||
|
|
||||||
public Essence(InetOrgPerson copyMe) {
|
public Essence(InetOrgPerson copyMe) {
|
||||||
super(copyMe);
|
super(copyMe);
|
||||||
setMail(copyMe.getMail());
|
setCarLicense(copyMe.getCarLicense());
|
||||||
setUid(copyMe.getUid());
|
setDepartmentNumber(copyMe.getDepartmentNumber());
|
||||||
setDestinationIndicator(copyMe.getDestinationIndicator());
|
setDestinationIndicator(copyMe.getDestinationIndicator());
|
||||||
|
setDisplayName(copyMe.getDisplayName());
|
||||||
setEmployeeNumber(copyMe.getEmployeeNumber());
|
setEmployeeNumber(copyMe.getEmployeeNumber());
|
||||||
|
setHomePhone(copyMe.getHomePhone());
|
||||||
|
setHomePostalAddress(copyMe.getHomePostalAddress());
|
||||||
|
setInitials(copyMe.getInitials());
|
||||||
|
setMail(copyMe.getMail());
|
||||||
|
setMobile(copyMe.getMobile());
|
||||||
|
setO(copyMe.getO());
|
||||||
|
setOu(copyMe.getOu());
|
||||||
|
setPostalAddress(copyMe.getPostalAddress());
|
||||||
|
setPostalCode(copyMe.getPostalCode());
|
||||||
|
setRoomNumber(copyMe.getRoomNumber());
|
||||||
|
setStreet(copyMe.getStreet());
|
||||||
|
setTitle(copyMe.getTitle());
|
||||||
|
setUid(copyMe.getUid());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Essence(DirContextOperations ctx) {
|
public Essence(DirContextOperations ctx) {
|
||||||
super(ctx);
|
super(ctx);
|
||||||
setMail(ctx.getStringAttribute("mail"));
|
setCarLicense(ctx.getStringAttribute("carLicense"));
|
||||||
setUid(ctx.getStringAttribute("uid"));
|
setDepartmentNumber(ctx.getStringAttribute("departmentNumber"));
|
||||||
setEmployeeNumber(ctx.getStringAttribute("employeeNumber"));
|
|
||||||
setDestinationIndicator(ctx.getStringAttribute("destinationIndicator"));
|
setDestinationIndicator(ctx.getStringAttribute("destinationIndicator"));
|
||||||
|
setDisplayName(ctx.getStringAttribute("displayName"));
|
||||||
|
setEmployeeNumber(ctx.getStringAttribute("employeeNumber"));
|
||||||
|
setHomePhone(ctx.getStringAttribute("homePhone"));
|
||||||
|
setHomePostalAddress(ctx.getStringAttribute("homePostalAddress"));
|
||||||
|
setInitials(ctx.getStringAttribute("initials"));
|
||||||
|
setMail(ctx.getStringAttribute("mail"));
|
||||||
|
setMobile(ctx.getStringAttribute("mobile"));
|
||||||
|
setO(ctx.getStringAttribute("o"));
|
||||||
|
setOu(ctx.getStringAttribute("ou"));
|
||||||
|
setPostalAddress(ctx.getStringAttribute("postalAddress"));
|
||||||
|
setPostalCode(ctx.getStringAttribute("postalCode"));
|
||||||
|
setRoomNumber(ctx.getStringAttribute("roomNumber"));
|
||||||
|
setStreet(ctx.getStringAttribute("street"));
|
||||||
|
setTitle(ctx.getStringAttribute("title"));
|
||||||
|
setUid(ctx.getStringAttribute("uid"));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected LdapUserDetailsImpl createTarget() {
|
protected LdapUserDetailsImpl createTarget() {
|
||||||
@ -95,6 +210,38 @@ public class InetOrgPerson extends Person {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setInitials(String initials) {
|
||||||
|
((InetOrgPerson) instance).initials = initials;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setO(String organization) {
|
||||||
|
((InetOrgPerson) instance).o = organization;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOu(String ou) {
|
||||||
|
((InetOrgPerson) instance).ou = ou;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoomNumber(String no) {
|
||||||
|
((InetOrgPerson) instance).roomNumber = no;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title) {
|
||||||
|
((InetOrgPerson) instance).title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCarLicense(String carLicense) {
|
||||||
|
((InetOrgPerson) instance).carLicense = carLicense;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDepartmentNumber(String departmentNumber) {
|
||||||
|
((InetOrgPerson) instance).departmentNumber = departmentNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDisplayName(String displayName) {
|
||||||
|
((InetOrgPerson) instance).displayName = displayName;
|
||||||
|
}
|
||||||
|
|
||||||
public void setEmployeeNumber(String no) {
|
public void setEmployeeNumber(String no) {
|
||||||
((InetOrgPerson) instance).employeeNumber = no;
|
((InetOrgPerson) instance).employeeNumber = no;
|
||||||
}
|
}
|
||||||
@ -102,5 +249,29 @@ public class InetOrgPerson extends Person {
|
|||||||
public void setDestinationIndicator(String destination) {
|
public void setDestinationIndicator(String destination) {
|
||||||
((InetOrgPerson) instance).destinationIndicator = destination;
|
((InetOrgPerson) instance).destinationIndicator = destination;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setHomePhone(String homePhone) {
|
||||||
|
((InetOrgPerson) instance).homePhone = homePhone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStreet(String street) {
|
||||||
|
((InetOrgPerson) instance).street = street;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPostalCode(String postalCode) {
|
||||||
|
((InetOrgPerson) instance).postalCode = postalCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPostalAddress(String postalAddress) {
|
||||||
|
((InetOrgPerson) instance).postalAddress = postalAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMobile(String mobile) {
|
||||||
|
((InetOrgPerson) instance).mobile = mobile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHomePostalAddress(String homePostalAddress) {
|
||||||
|
((InetOrgPerson) instance).homePostalAddress = homePostalAddress;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,8 @@ import java.util.Arrays;
|
|||||||
*/
|
*/
|
||||||
public class Person extends LdapUserDetailsImpl {
|
public class Person extends LdapUserDetailsImpl {
|
||||||
private String sn;
|
private String sn;
|
||||||
|
private String description;
|
||||||
|
private String telephoneNumber;
|
||||||
private List cn = new ArrayList();
|
private List cn = new ArrayList();
|
||||||
|
|
||||||
protected Person() {
|
protected Person() {
|
||||||
@ -48,9 +50,19 @@ public class Person extends LdapUserDetailsImpl {
|
|||||||
return (String[]) cn.toArray(new String[cn.size()]);
|
return (String[]) cn.toArray(new String[cn.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTelephoneNumber() {
|
||||||
|
return telephoneNumber;
|
||||||
|
}
|
||||||
|
|
||||||
protected void populateContext(DirContextAdapter adapter) {
|
protected void populateContext(DirContextAdapter adapter) {
|
||||||
adapter.setAttributeValue("sn", sn);
|
adapter.setAttributeValue("sn", sn);
|
||||||
adapter.setAttributeValues("cn", getCn());
|
adapter.setAttributeValues("cn", getCn());
|
||||||
|
adapter.setAttributeValue("description", getDescription());
|
||||||
|
adapter.setAttributeValue("telephoneNumber", getTelephoneNumber());
|
||||||
|
|
||||||
if(getPassword() != null) {
|
if(getPassword() != null) {
|
||||||
adapter.setAttributeValue("userPassword", getPassword());
|
adapter.setAttributeValue("userPassword", getPassword());
|
||||||
@ -67,6 +79,8 @@ public class Person extends LdapUserDetailsImpl {
|
|||||||
super(ctx);
|
super(ctx);
|
||||||
setCn(ctx.getStringAttributes("cn"));
|
setCn(ctx.getStringAttributes("cn"));
|
||||||
setSn(ctx.getStringAttribute("sn"));
|
setSn(ctx.getStringAttribute("sn"));
|
||||||
|
setDescription(ctx.getStringAttribute("description"));
|
||||||
|
setTelephoneNumber(ctx.getStringAttribute("telephoneNumber"));
|
||||||
Object passo = ctx.getObjectAttribute("userPassword");
|
Object passo = ctx.getObjectAttribute("userPassword");
|
||||||
|
|
||||||
if(passo != null) {
|
if(passo != null) {
|
||||||
@ -78,6 +92,8 @@ public class Person extends LdapUserDetailsImpl {
|
|||||||
public Essence(Person copyMe) {
|
public Essence(Person copyMe) {
|
||||||
super(copyMe);
|
super(copyMe);
|
||||||
setSn(copyMe.sn);
|
setSn(copyMe.sn);
|
||||||
|
setDescription(copyMe.getDescription());
|
||||||
|
setTelephoneNumber(copyMe.getTelephoneNumber());
|
||||||
((Person) instance).cn = new ArrayList(copyMe.cn);
|
((Person) instance).cn = new ArrayList(copyMe.cn);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,6 +113,14 @@ public class Person extends LdapUserDetailsImpl {
|
|||||||
((Person) instance).cn.add(value);
|
((Person) instance).cn.add(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setTelephoneNumber(String tel) {
|
||||||
|
((Person) instance).telephoneNumber = tel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String desc) {
|
||||||
|
((Person) instance).description = desc;
|
||||||
|
}
|
||||||
|
|
||||||
public LdapUserDetails createUserDetails() {
|
public LdapUserDetails createUserDetails() {
|
||||||
Person p = (Person) super.createUserDetails();
|
Person p = (Person) super.createUserDetails();
|
||||||
Assert.hasLength(p.sn);
|
Assert.hasLength(p.sn);
|
||||||
|
@ -16,7 +16,6 @@ public class InetOrgPersonTests extends TestCase {
|
|||||||
InetOrgPerson p = (InetOrgPerson) essence.createUserDetails();
|
InetOrgPerson p = (InetOrgPerson) essence.createUserDetails();
|
||||||
|
|
||||||
assertEquals("ghengis", p.getUsername());
|
assertEquals("ghengis", p.getUsername());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testUsernameIsDifferentFromContextUidIfSet() {
|
public void testUsernameIsDifferentFromContextUidIfSet() {
|
||||||
@ -32,11 +31,23 @@ public class InetOrgPersonTests extends TestCase {
|
|||||||
InetOrgPerson.Essence essence = new InetOrgPerson.Essence(createUserContext());
|
InetOrgPerson.Essence essence = new InetOrgPerson.Essence(createUserContext());
|
||||||
InetOrgPerson p = (InetOrgPerson) essence.createUserDetails();
|
InetOrgPerson p = (InetOrgPerson) essence.createUserDetails();
|
||||||
|
|
||||||
|
assertEquals("HORS1", p.getCarLicense());
|
||||||
assertEquals("ghengis@mongolia", p.getMail());
|
assertEquals("ghengis@mongolia", p.getMail());
|
||||||
assertEquals("Khan", p.getSn());
|
assertEquals("Khan", p.getSn());
|
||||||
assertEquals("Ghengis Khan", p.getCn()[0]);
|
assertEquals("Ghengis Khan", p.getCn()[0]);
|
||||||
assertEquals("00001", p.getEmployeeNumber());
|
assertEquals("00001", p.getEmployeeNumber());
|
||||||
assertEquals("West", p.getDestinationIndicator());
|
assertEquals("+442075436521", p.getTelephoneNumber());
|
||||||
|
assertEquals("Steppes", p.getHomePostalAddress());
|
||||||
|
assertEquals("+467575436521", p.getHomePhone());
|
||||||
|
assertEquals("Hordes", p.getO());
|
||||||
|
assertEquals("Horde1", p.getOu());
|
||||||
|
assertEquals("On the Move", p.getPostalAddress());
|
||||||
|
assertEquals("Changes Frequently", p.getPostalCode());
|
||||||
|
assertEquals("Yurt 1", p.getRoomNumber());
|
||||||
|
assertEquals("Westward Avenue", p.getStreet());
|
||||||
|
assertEquals("Scary", p.getDescription());
|
||||||
|
assertEquals("Ghengis McCann", p.getDisplayName());
|
||||||
|
assertEquals("G", p.getInitials());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testPasswordIsSetFromContextUserPassword() {
|
public void testPasswordIsSetFromContextUserPassword() {
|
||||||
@ -44,7 +55,29 @@ public class InetOrgPersonTests extends TestCase {
|
|||||||
InetOrgPerson p = (InetOrgPerson) essence.createUserDetails();
|
InetOrgPerson p = (InetOrgPerson) essence.createUserDetails();
|
||||||
|
|
||||||
assertEquals("pillage", p.getPassword());
|
assertEquals("pillage", p.getPassword());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testMappingBackToContextMatchesOriginalData() {
|
||||||
|
DirContextAdapter ctx1 = createUserContext();
|
||||||
|
DirContextAdapter ctx2 = new DirContextAdapter();
|
||||||
|
ctx1.setAttributeValues("objectclass", new String[] {"top", "person", "organizationalPerson", "inetOrgPerson"});
|
||||||
|
ctx2.setDn(new DistinguishedName("ignored=ignored"));
|
||||||
|
InetOrgPerson p = (InetOrgPerson) (new InetOrgPerson.Essence(ctx1)).createUserDetails();
|
||||||
|
p.populateContext(ctx2);
|
||||||
|
|
||||||
|
assertEquals(ctx1, ctx2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testCopyMatchesOriginalData() {
|
||||||
|
DirContextAdapter ctx1 = createUserContext();
|
||||||
|
DirContextAdapter ctx2 = new DirContextAdapter();
|
||||||
|
ctx2.setDn(new DistinguishedName("ignored=ignored"));
|
||||||
|
ctx1.setAttributeValues("objectclass", new String[] {"top", "person", "organizationalPerson", "inetOrgPerson"});
|
||||||
|
InetOrgPerson p = (InetOrgPerson) (new InetOrgPerson.Essence(ctx1)).createUserDetails();
|
||||||
|
InetOrgPerson p2 = (InetOrgPerson) new InetOrgPerson.Essence(p).createUserDetails();
|
||||||
|
p2.populateContext(ctx2);
|
||||||
|
|
||||||
|
assertEquals(ctx1, ctx2);
|
||||||
}
|
}
|
||||||
|
|
||||||
private DirContextAdapter createUserContext() {
|
private DirContextAdapter createUserContext() {
|
||||||
@ -53,12 +86,26 @@ public class InetOrgPersonTests extends TestCase {
|
|||||||
ctx.setDn(new DistinguishedName("ignored=ignored"));
|
ctx.setDn(new DistinguishedName("ignored=ignored"));
|
||||||
ctx.setAttributeValue("uid", "ghengis");
|
ctx.setAttributeValue("uid", "ghengis");
|
||||||
ctx.setAttributeValue("userPassword", "pillage");
|
ctx.setAttributeValue("userPassword", "pillage");
|
||||||
ctx.setAttributeValue("mail", "ghengis@mongolia");
|
ctx.setAttributeValue("carLicense", "HORS1");
|
||||||
ctx.setAttributeValue("cn", "Ghengis Khan");
|
ctx.setAttributeValue("cn", "Ghengis Khan");
|
||||||
ctx.setAttributeValue("sn", "Khan");
|
ctx.setAttributeValue("description", "Scary");
|
||||||
ctx.setAttributeValue("employeeNumber", "00001");
|
|
||||||
ctx.setAttributeValue("destinationIndicator", "West");
|
ctx.setAttributeValue("destinationIndicator", "West");
|
||||||
|
ctx.setAttributeValue("displayName", "Ghengis McCann");
|
||||||
|
ctx.setAttributeValue("homePhone", "+467575436521");
|
||||||
|
ctx.setAttributeValue("initials", "G");
|
||||||
|
ctx.setAttributeValue("employeeNumber", "00001");
|
||||||
|
ctx.setAttributeValue("homePostalAddress", "Steppes");
|
||||||
|
ctx.setAttributeValue("mail", "ghengis@mongolia");
|
||||||
|
ctx.setAttributeValue("mobile", "always");
|
||||||
ctx.setAttributeValue("o", "Hordes");
|
ctx.setAttributeValue("o", "Hordes");
|
||||||
|
ctx.setAttributeValue("ou", "Horde1");
|
||||||
|
ctx.setAttributeValue("postalAddress", "On the Move");
|
||||||
|
ctx.setAttributeValue("postalCode", "Changes Frequently");
|
||||||
|
ctx.setAttributeValue("roomNumber", "Yurt 1");
|
||||||
|
ctx.setAttributeValue("roomNumber", "Yurt 1");
|
||||||
|
ctx.setAttributeValue("sn", "Khan");
|
||||||
|
ctx.setAttributeValue("street", "Westward Avenue");
|
||||||
|
ctx.setAttributeValue("telephoneNumber", "+442075436521");
|
||||||
|
|
||||||
return ctx;
|
return ctx;
|
||||||
}
|
}
|
||||||
|
@ -116,10 +116,21 @@ public class LdapUserDetailsManagerTests extends AbstractLdapIntegrationTests {
|
|||||||
@Test
|
@Test
|
||||||
public void testCreateNewUserSucceeds() {
|
public void testCreateNewUserSucceeds() {
|
||||||
InetOrgPerson.Essence p = new InetOrgPerson.Essence();
|
InetOrgPerson.Essence p = new InetOrgPerson.Essence();
|
||||||
p.setDn("whocares");
|
p.setCarLicense("XXX");
|
||||||
p.setCn(new String[] {"Joe Smeth"});
|
p.setCn(new String[] {"Joe Smeth"});
|
||||||
|
p.setDepartmentNumber("5679");
|
||||||
|
p.setDescription("Some description");
|
||||||
|
p.setDn("whocares");
|
||||||
|
p.setEmployeeNumber("E781");
|
||||||
|
p.setInitials("J");
|
||||||
|
p.setMail("joe@smeth.com");
|
||||||
|
p.setMobile("+44776542911");
|
||||||
|
p.setOu("Joes Unit");
|
||||||
|
p.setO("Organization");
|
||||||
|
p.setRoomNumber("500X");
|
||||||
p.setSn("Smeth");
|
p.setSn("Smeth");
|
||||||
p.setUid("joe");
|
p.setUid("joe");
|
||||||
|
|
||||||
p.setAuthorities(TEST_AUTHORITIES);
|
p.setAuthorities(TEST_AUTHORITIES);
|
||||||
|
|
||||||
mgr.createUser(p.createUserDetails());
|
mgr.createUser(p.createUserDetails());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user