Refactor monitor and exceptions
[lgpl/argeo-commons.git] / org.argeo.security.core / ext / test / org / argeo / osgi / useradmin / LdifParserTest.java
index aabc9a0e78a9082ac0897566e83ea6c36b95e443..fecf5dd5a199a7e5cfbe3012b8481e1729ab26fa 100644 (file)
@@ -1,6 +1,7 @@
 package org.argeo.osgi.useradmin;
 
 import java.util.ArrayList;
+import java.util.Base64;
 import java.util.List;
 import java.util.SortedMap;
 
@@ -9,12 +10,10 @@ import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.ldap.LdapName;
 
-import junit.framework.TestCase;
-
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.codec.digest.DigestUtils;
 import org.argeo.util.naming.LdifParser;
 
+import junit.framework.TestCase;
+
 public class LdifParserTest extends TestCase implements BasicTestConstants {
        public void testBasicLdif() throws Exception {
                LdifParser ldifParser = new LdifParser();
@@ -30,7 +29,7 @@ public class LdifParserTest extends TestCase implements BasicTestConstants {
                assertEquals("{SHA}ieSV55Qc+eQOaYDRSha/AjzNTJE=",
                                new String(rawPwEntry));
                byte[] hashedPassword = DigestUtils.sha1("demo".getBytes());
-               assertEquals("{SHA}" + Base64.encodeBase64String(hashedPassword),
+               assertEquals("{SHA}" + Base64.getEncoder().encodeToString(hashedPassword),
                                new String(rawPwEntry));
 
                LdapName adminDn = new LdapName(ADMIN_GROUP_DN);