diff options
author | James Moger <james.moger@gitblit.com> | 2013-11-25 00:00:41 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-11-29 11:05:51 -0500 |
commit | f19b78e12517db6c4dcbb1981423830ea39916b3 (patch) | |
tree | 018f2389bf235c25bb3a2eda73ae9ecd71d7f3a1 /src/test | |
parent | 04a98505a4ab8f48aee22800fcac193d9367d0ae (diff) | |
download | gitblit-f19b78e12517db6c4dcbb1981423830ea39916b3.tar.gz gitblit-f19b78e12517db6c4dcbb1981423830ea39916b3.zip |
Revised committer verification to require email address
Change-Id: I5298c93e03099813f5713a4effd87913429aa3dc
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/com/gitblit/tests/GitBlitTest.java | 12 | ||||
-rw-r--r-- | src/test/java/com/gitblit/tests/GitServletTest.java | 20 |
2 files changed, 10 insertions, 22 deletions
diff --git a/src/test/java/com/gitblit/tests/GitBlitTest.java b/src/test/java/com/gitblit/tests/GitBlitTest.java index c01862fe..1f81b875 100644 --- a/src/test/java/com/gitblit/tests/GitBlitTest.java +++ b/src/test/java/com/gitblit/tests/GitBlitTest.java @@ -70,13 +70,13 @@ public class GitBlitTest extends GitblitUnitTest { UserModel user = new UserModel("james");
user.displayName = "James Moger";
- assertTrue(user.is("James", null));
- assertTrue(user.is("James", ""));
- assertTrue(user.is("JaMeS", "anything"));
+ assertFalse(user.is("James", null));
+ assertFalse(user.is("James", ""));
+ assertFalse(user.is("JaMeS", "anything"));
- assertTrue(user.is("james moger", null));
- assertTrue(user.is("james moger", ""));
- assertTrue(user.is("james moger", "anything"));
+ assertFalse(user.is("james moger", null));
+ assertFalse(user.is("james moger", ""));
+ assertFalse(user.is("james moger", "anything"));
assertFalse(user.is("joe", null));
assertFalse(user.is("joe", ""));
diff --git a/src/test/java/com/gitblit/tests/GitServletTest.java b/src/test/java/com/gitblit/tests/GitServletTest.java index bc392885..ad61a676 100644 --- a/src/test/java/com/gitblit/tests/GitServletTest.java +++ b/src/test/java/com/gitblit/tests/GitServletTest.java @@ -380,27 +380,15 @@ public class GitServletTest extends GitblitUnitTest { public void testCommitterVerification() throws Exception {
UserModel user = getUser();
- // account only uses account name to verify
- testCommitterVerification(user, user.username, null, true);
- // committer email address is ignored because account does not specify email
- testCommitterVerification(user, user.username, "something", true);
- // completely different committer
testCommitterVerification(user, "joe", null, false);
+ testCommitterVerification(user, "joe", user.emailAddress, false);
+ testCommitterVerification(user, user.username, null, false);
+ testCommitterVerification(user, user.username, user.emailAddress, true);
- // test display name verification
user.displayName = "James Moger";
- testCommitterVerification(user, user.displayName, null, true);
- testCommitterVerification(user, user.displayName, "something", true);
- testCommitterVerification(user, "joe", null, false);
-
- // test email address verification
- user.emailAddress = "something";
testCommitterVerification(user, user.displayName, null, false);
- testCommitterVerification(user, user.displayName, "somethingelse", false);
+ testCommitterVerification(user, user.displayName, "something", false);
testCommitterVerification(user, user.displayName, user.emailAddress, true);
-
- // use same email address but with different committer
- testCommitterVerification(user, "joe", "somethingelse", false);
}
private void testCommitterVerification(UserModel user, String displayName, String emailAddress, boolean expectedSuccess) throws Exception {
|