The following sample reads the specified properties of a user account record.
//define the list of user record properties to return with the readUserAccount results
protected UserAccountRepository userAccountRepository;
private List<String> getProperties() {
List<String> properties = new List<String>();
properties.add("username");
properties.add("active");
properties.add("password");
properties.add("contact");
properties.add("shortDescription");
properties.add("uniqueKey");
properties.add("userType");
return properties;
}
public UserAccount test_readUserAccount() throws Exception {
//it is assumed that a user record exists with the unique key equal to String, uniqueKey
UserAccount searchedUser = userAccountRepository.readUserAccount(uniqueKey, getProperties());
return searchedUser;
}