diff options
Diffstat (limited to 'src/test')
9 files changed, 22 insertions, 26 deletions
diff --git a/src/test/config/test-users.conf b/src/test/config/test-users.conf index 1d01f846..4361410c 100644 --- a/src/test/config/test-users.conf +++ b/src/test/config/test-users.conf @@ -2,13 +2,9 @@ password = admin cookie = dd94709528bb1c83d08f3088d4043f4742891f4f accountType = LOCAL + emailMeOnMyTicketChanges = true role = "#admin" role = "#notfederated" -[user "sampleuser"] - password = sampleuser - cookie = 6e07ed42149fc166206319faffdfba2e2ec82e43 - accountType = LOCAL - role = "#none" [team "admins"] role = "#none" accountType = LOCAL diff --git a/src/test/java/com/gitblit/tests/AuthenticationManagerTest.java b/src/test/java/com/gitblit/tests/AuthenticationManagerTest.java index 84a2b749..f1d2711e 100644 --- a/src/test/java/com/gitblit/tests/AuthenticationManagerTest.java +++ b/src/test/java/com/gitblit/tests/AuthenticationManagerTest.java @@ -43,7 +43,7 @@ public class AuthenticationManagerTest extends GitblitUnitTest { IAuthenticationManager newAuthenticationManager() { RuntimeManager runtime = new RuntimeManager(getSettings(), GitBlitSuite.BASEFOLDER).start(); - users = new UserManager(runtime).start(); + users = new UserManager(runtime, null).start(); AuthenticationManager auth = new AuthenticationManager(runtime, users).start(); return auth; } diff --git a/src/test/java/com/gitblit/tests/BranchTicketServiceTest.java b/src/test/java/com/gitblit/tests/BranchTicketServiceTest.java index 6119b8db..cc404abf 100644 --- a/src/test/java/com/gitblit/tests/BranchTicketServiceTest.java +++ b/src/test/java/com/gitblit/tests/BranchTicketServiceTest.java @@ -54,8 +54,8 @@ public class BranchTicketServiceTest extends TicketServiceTest { IRuntimeManager runtimeManager = new RuntimeManager(settings).start(); IPluginManager pluginManager = new PluginManager(runtimeManager).start(); INotificationManager notificationManager = new NotificationManager(settings).start(); - IUserManager userManager = new UserManager(runtimeManager).start(); - IRepositoryManager repositoryManager = new RepositoryManager(runtimeManager, userManager).start(); + IUserManager userManager = new UserManager(runtimeManager, pluginManager).start(); + IRepositoryManager repositoryManager = new RepositoryManager(runtimeManager, pluginManager, userManager).start(); BranchTicketService service = new BranchTicketService( runtimeManager, diff --git a/src/test/java/com/gitblit/tests/FileTicketServiceTest.java b/src/test/java/com/gitblit/tests/FileTicketServiceTest.java index 20cde26b..6ede042a 100644 --- a/src/test/java/com/gitblit/tests/FileTicketServiceTest.java +++ b/src/test/java/com/gitblit/tests/FileTicketServiceTest.java @@ -53,8 +53,8 @@ public class FileTicketServiceTest extends TicketServiceTest { IRuntimeManager runtimeManager = new RuntimeManager(settings).start(); IPluginManager pluginManager = new PluginManager(runtimeManager).start(); INotificationManager notificationManager = new NotificationManager(settings).start(); - IUserManager userManager = new UserManager(runtimeManager).start(); - IRepositoryManager repositoryManager = new RepositoryManager(runtimeManager, userManager).start(); + IUserManager userManager = new UserManager(runtimeManager, pluginManager).start(); + IRepositoryManager repositoryManager = new RepositoryManager(runtimeManager, pluginManager, userManager).start(); FileTicketService service = new FileTicketService( runtimeManager, diff --git a/src/test/java/com/gitblit/tests/HtpasswdAuthenticationTest.java b/src/test/java/com/gitblit/tests/HtpasswdAuthenticationTest.java index 4e1c3ac1..f4e24d4e 100644 --- a/src/test/java/com/gitblit/tests/HtpasswdAuthenticationTest.java +++ b/src/test/java/com/gitblit/tests/HtpasswdAuthenticationTest.java @@ -75,15 +75,15 @@ public class HtpasswdAuthenticationTest extends GitblitUnitTest { private HtpasswdAuthProvider newHtpasswdAuthentication(IStoredSettings settings) { RuntimeManager runtime = new RuntimeManager(settings, GitBlitSuite.BASEFOLDER).start(); - UserManager users = new UserManager(runtime).start(); + UserManager users = new UserManager(runtime, null).start(); HtpasswdAuthProvider htpasswd = new HtpasswdAuthProvider(); htpasswd.setup(runtime, users); return htpasswd; } - + private AuthenticationManager newAuthenticationManager(IStoredSettings settings) { RuntimeManager runtime = new RuntimeManager(settings, GitBlitSuite.BASEFOLDER).start(); - UserManager users = new UserManager(runtime).start(); + UserManager users = new UserManager(runtime, null).start(); HtpasswdAuthProvider htpasswd = new HtpasswdAuthProvider(); htpasswd.setup(runtime, users); AuthenticationManager auth = new AuthenticationManager(runtime, users); @@ -191,7 +191,7 @@ public class HtpasswdAuthenticationTest extends GitblitUnitTest { assertEquals("leading", user.username); } - + @Test public void testAuthenticationManager() { diff --git a/src/test/java/com/gitblit/tests/LdapAuthenticationTest.java b/src/test/java/com/gitblit/tests/LdapAuthenticationTest.java index 21063d58..646f7e9f 100644 --- a/src/test/java/com/gitblit/tests/LdapAuthenticationTest.java +++ b/src/test/java/com/gitblit/tests/LdapAuthenticationTest.java @@ -68,7 +68,7 @@ public class LdapAuthenticationTest extends GitblitUnitTest { private static InMemoryDirectoryServer ds; private IUserManager userManager; - + private AuthenticationManager auth; private MemorySettings settings; @@ -97,12 +97,12 @@ public class LdapAuthenticationTest extends GitblitUnitTest { private LdapAuthProvider newLdapAuthentication(IStoredSettings settings) { RuntimeManager runtime = new RuntimeManager(settings, GitBlitSuite.BASEFOLDER).start(); - userManager = new UserManager(runtime).start(); + userManager = new UserManager(runtime, null).start(); LdapAuthProvider ldap = new LdapAuthProvider(); ldap.setup(runtime, userManager); return ldap; } - + private AuthenticationManager newAuthenticationManager(IStoredSettings settings) { RuntimeManager runtime = new RuntimeManager(settings, GitBlitSuite.BASEFOLDER).start(); AuthenticationManager auth = new AuthenticationManager(runtime, userManager); @@ -258,7 +258,7 @@ public class LdapAuthenticationTest extends GitblitUnitTest { assertNull(userThreeModel.getTeam("git_admins")); assertTrue(userThreeModel.canAdmin); } - + @Test public void testBindWithUser() { settings.put(Keys.realm.ldap.bindpattern, "CN=${username},OU=US,OU=Users,OU=UserControl,OU=MyOrganization,DC=MyDomain"); @@ -267,7 +267,7 @@ public class LdapAuthenticationTest extends GitblitUnitTest { UserModel userOneModel = auth.authenticate("UserOne", "userOnePassword".toCharArray()); assertNotNull(userOneModel); - + UserModel userOneModelFailedAuth = auth.authenticate("UserOne", "userTwoPassword".toCharArray()); assertNull(userOneModelFailedAuth); } diff --git a/src/test/java/com/gitblit/tests/LuceneExecutorTest.java b/src/test/java/com/gitblit/tests/LuceneExecutorTest.java index 319c09c1..5c319e65 100644 --- a/src/test/java/com/gitblit/tests/LuceneExecutorTest.java +++ b/src/test/java/com/gitblit/tests/LuceneExecutorTest.java @@ -49,8 +49,8 @@ public class LuceneExecutorTest extends GitblitUnitTest { MemorySettings settings = new MemorySettings();
settings.put(Keys.git.repositoriesFolder, GitBlitSuite.REPOSITORIES);
RuntimeManager runtime = new RuntimeManager(settings, GitBlitSuite.BASEFOLDER).start();
- UserManager users = new UserManager(runtime).start();
- RepositoryManager repos = new RepositoryManager(runtime, users);
+ UserManager users = new UserManager(runtime, null).start();
+ RepositoryManager repos = new RepositoryManager(runtime, null, users);
return new LuceneService(settings, repos);
}
diff --git a/src/test/java/com/gitblit/tests/RedisTicketServiceTest.java b/src/test/java/com/gitblit/tests/RedisTicketServiceTest.java index 94391a15..b782b449 100644 --- a/src/test/java/com/gitblit/tests/RedisTicketServiceTest.java +++ b/src/test/java/com/gitblit/tests/RedisTicketServiceTest.java @@ -61,8 +61,8 @@ public class RedisTicketServiceTest extends TicketServiceTest { IRuntimeManager runtimeManager = new RuntimeManager(settings).start(); IPluginManager pluginManager = new PluginManager(runtimeManager).start(); INotificationManager notificationManager = new NotificationManager(settings).start(); - IUserManager userManager = new UserManager(runtimeManager).start(); - IRepositoryManager repositoryManager = new RepositoryManager(runtimeManager, userManager).start(); + IUserManager userManager = new UserManager(runtimeManager, pluginManager).start(); + IRepositoryManager repositoryManager = new RepositoryManager(runtimeManager, pluginManager, userManager).start(); RedisTicketService service = new RedisTicketService( runtimeManager, diff --git a/src/test/java/com/gitblit/tests/RedmineAuthenticationTest.java b/src/test/java/com/gitblit/tests/RedmineAuthenticationTest.java index 6ede8313..3b6b7bba 100644 --- a/src/test/java/com/gitblit/tests/RedmineAuthenticationTest.java +++ b/src/test/java/com/gitblit/tests/RedmineAuthenticationTest.java @@ -26,7 +26,7 @@ public class RedmineAuthenticationTest extends GitblitUnitTest { RedmineAuthProvider newRedmineAuthentication(IStoredSettings settings) { RuntimeManager runtime = new RuntimeManager(settings, GitBlitSuite.BASEFOLDER).start(); - UserManager users = new UserManager(runtime).start(); + UserManager users = new UserManager(runtime, null).start(); RedmineAuthProvider redmine = new RedmineAuthProvider(); redmine.setup(runtime, users); return redmine; @@ -35,10 +35,10 @@ public class RedmineAuthenticationTest extends GitblitUnitTest { RedmineAuthProvider newRedmineAuthentication() { return newRedmineAuthentication(getSettings()); } - + AuthenticationManager newAuthenticationManager() { RuntimeManager runtime = new RuntimeManager(getSettings(), GitBlitSuite.BASEFOLDER).start(); - UserManager users = new UserManager(runtime).start(); + UserManager users = new UserManager(runtime, null).start(); RedmineAuthProvider redmine = new RedmineAuthProvider(); redmine.setup(runtime, users); redmine.setTestingCurrentUserAsJson(JSON); |