From 1b0e0503d94d0b8c7f4c6ea70783770b9e76f5f8 Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Tue, 02 Jul 2013 21:18:46 -0400 Subject: [PATCH] Unit tests which confirm working/expected behavior (issue-259) --- src/main/java/com/gitblit/models/UserModel.java | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/gitblit/models/UserModel.java b/src/main/java/com/gitblit/models/UserModel.java index e4c659c..b480b88 100644 --- a/src/main/java/com/gitblit/models/UserModel.java +++ b/src/main/java/com/gitblit/models/UserModel.java @@ -75,17 +75,21 @@ // non-persisted fields public boolean isAuthenticated; public AccountType accountType; + + public UserPreferences userPreferences; public UserModel(String username) { this.username = username; this.isAuthenticated = true; this.accountType = AccountType.LOCAL; + this.userPreferences = new UserPreferences(this.username); } private UserModel() { this.username = "$anonymous"; this.isAuthenticated = false; this.accountType = AccountType.LOCAL; + this.userPreferences = new UserPreferences(this.username); } public boolean isLocalAccount() { @@ -602,6 +606,10 @@ return "~" + username; } + public UserPreferences getPreferences() { + return userPreferences; + } + @Override public int hashCode() { return username.hashCode(); -- Gitblit v1.9.1