| | |
| | | */ |
| | | package com.gitblit.tests; |
| | | |
| | | import static org.junit.Assert.assertEquals; |
| | | import static org.junit.Assert.assertFalse; |
| | | import static org.junit.Assert.assertNotNull; |
| | | import static org.junit.Assert.assertNull; |
| | | import static org.junit.Assert.assertTrue; |
| | | |
| | | import java.io.File; |
| | | import java.io.FilenameFilter; |
| | | import java.io.IOException; |
| | |
| | | import com.gitblit.HtpasswdUserService; |
| | | import com.gitblit.models.UserModel; |
| | | import com.gitblit.tests.mock.MemorySettings; |
| | | import com.gitblit.tests.mock.MockRuntimeManager; |
| | | import com.gitblit.utils.StringUtils; |
| | | |
| | | /** |
| | | * Test the Htpasswd user service. |
| | | * |
| | | */ |
| | | public class HtpasswdUserServiceTest { |
| | | public class HtpasswdUserServiceTest extends GitblitUnitTest { |
| | | |
| | | private static final String RESOURCE_DIR = "src/test/resources/htpasswdUSTest/"; |
| | | private static final String KEY_SUPPORT_PLAINTEXT_PWD = "realm.htpasswd.supportPlaintextPasswords"; |
| | |
| | | private void setupUS() |
| | | { |
| | | htpwdUserService = new HtpasswdUserService(); |
| | | htpwdUserService.setup(getSettings()); |
| | | htpwdUserService.setup(new MockRuntimeManager(getSettings())); |
| | | } |
| | | |
| | | private void setupUS(boolean overrideLA) |
| | | { |
| | | htpwdUserService = new HtpasswdUserService(); |
| | | htpwdUserService.setup(getSettings(overrideLA)); |
| | | htpwdUserService.setup(new MockRuntimeManager(getSettings(overrideLA))); |
| | | } |
| | | |
| | | |