public GreenMailUser setUser(String email, String password) {
return setUser(email, email, password);
}
public GreenMailUser setUser(String email, String login, String password) {
GreenMailUser user = managers.getUserManager().getUser(email);
if (null == user) {
try {
managers.getUserManager().createUser(email, login, password);
} catch (UserException e) {
throw new RuntimeException(e);
}
} else {
user.setPassword(password);
}
return user;
}