+++ /dev/null
-/*\r
- * Copyright 2014 gitblit.com.\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package com.gitblit.service;\r
-\r
-import static org.junit.Assert.assertFalse;\r
-import static org.junit.Assert.assertTrue;\r
-\r
-import java.util.HashMap;\r
-import java.util.Map;\r
-\r
-import org.junit.Before;\r
-import org.junit.Test;\r
-\r
-import com.gitblit.Keys;\r
-import com.gitblit.tests.mock.MemorySettings;\r
-\r
-/**\r
- * A behavior driven test for the LdapSyncService with in-memory Settings.\r
- *\r
- * @author Alfred Schmid\r
- *\r
- */\r
-public class LdapSyncServiceTest {\r
-\r
- private MemorySettings settings;\r
-\r
- @Before\r
- public void init() throws Exception {\r
- settings = getSettings();\r
- }\r
-\r
- @Test\r
- public void defaultOfUnAvailableLdapSynchronizeKeyIsLdapServiceNotReady() {\r
- LdapSyncService ldapSyncService = new LdapSyncService(settings, null);\r
- assertFalse("When key " + Keys.realm.ldap.synchronize + " is not configured ldap sync is not ready." , ldapSyncService.isReady());\r
- }\r
-\r
- @Test\r
- public void whenLdapSynchronizeKeyIsFalseLdapServiceNotReady() {\r
- LdapSyncService ldapSyncService = new LdapSyncService(settings, null);\r
- settings.put(Keys.realm.ldap.synchronize, "false");\r
- assertFalse("When key " + Keys.realm.ldap.synchronize + " is configured with value false ldap sync is not ready." , ldapSyncService.isReady());\r
- }\r
-\r
- @Test\r
- public void whenLdapSynchronizeKeyIsTrueLdapServiceIsReady() {\r
- LdapSyncService ldapSyncService = new LdapSyncService(settings, null);\r
- settings.put(Keys.realm.ldap.synchronize, "true");\r
- assertTrue("When key " + Keys.realm.ldap.synchronize + " is configured with value true ldap sync is not ready." , ldapSyncService.isReady());\r
- }\r
-\r
- private MemorySettings getSettings() {\r
- Map<String, Object> backingMap = new HashMap<String, Object>();\r
- MemorySettings ms = new MemorySettings(backingMap);\r
- return ms;\r
- }\r
-\r
-}\r
GitBlitTest.class, FederationTests.class, RpcTests.class, GitServletTest.class, GitDaemonTest.class,\r
GroovyScriptTest.class, LuceneExecutorTest.class, RepositoryModelTest.class,\r
FanoutServiceTest.class, Issue0259Test.class, Issue0271Test.class, HtpasswdAuthenticationTest.class,\r
- ModelUtilsTest.class, JnaUtilsTest.class })\r
+ ModelUtilsTest.class, JnaUtilsTest.class, LdapSyncServiceTest.class })\r
public class GitBlitSuite {\r
\r
public static final File BASEFOLDER = new File("data");\r
--- /dev/null
+/*\r
+ * Copyright 2014 gitblit.com.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package com.gitblit.tests;\r
+\r
+import static org.junit.Assert.assertFalse;\r
+import static org.junit.Assert.assertTrue;\r
+\r
+import java.util.HashMap;\r
+import java.util.Map;\r
+\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+import com.gitblit.Keys;\r
+import com.gitblit.service.LdapSyncService;\r
+import com.gitblit.tests.mock.MemorySettings;\r
+\r
+/**\r
+ * A behavior driven test for the LdapSyncService with in-memory Settings.\r
+ *\r
+ * @author Alfred Schmid\r
+ *\r
+ */\r
+public class LdapSyncServiceTest {\r
+\r
+ private MemorySettings settings;\r
+\r
+ @Before\r
+ public void init() throws Exception {\r
+ settings = getSettings();\r
+ }\r
+\r
+ @Test\r
+ public void defaultOfUnAvailableLdapSynchronizeKeyIsLdapServiceNotReady() {\r
+ LdapSyncService ldapSyncService = new LdapSyncService(settings, null);\r
+ assertFalse("When key " + Keys.realm.ldap.synchronize + " is not configured ldap sync is not ready." , ldapSyncService.isReady());\r
+ }\r
+\r
+ @Test\r
+ public void whenLdapSynchronizeKeyIsFalseLdapServiceNotReady() {\r
+ LdapSyncService ldapSyncService = new LdapSyncService(settings, null);\r
+ settings.put(Keys.realm.ldap.synchronize, "false");\r
+ assertFalse("When key " + Keys.realm.ldap.synchronize + " is configured with value false ldap sync is not ready." , ldapSyncService.isReady());\r
+ }\r
+\r
+ @Test\r
+ public void whenLdapSynchronizeKeyIsTrueLdapServiceIsReady() {\r
+ LdapSyncService ldapSyncService = new LdapSyncService(settings, null);\r
+ settings.put(Keys.realm.ldap.synchronize, "true");\r
+ assertTrue("When key " + Keys.realm.ldap.synchronize + " is configured with value true ldap sync is not ready." , ldapSyncService.isReady());\r
+ }\r
+\r
+ private MemorySettings getSettings() {\r
+ Map<String, Object> backingMap = new HashMap<String, Object>();\r
+ MemorySettings ms = new MemorySettings(backingMap);\r
+ return ms;\r
+ }\r
+\r
+}\r