File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/main/java/org/zapodot/junit/ldap/internal Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 88import com .unboundid .ldap .sdk .LDAPConnection ;
99import com .unboundid .ldap .sdk .LDAPException ;
1010import com .unboundid .ldap .sdk .LDAPInterface ;
11+
1112import org .junit .runner .Description ;
1213import org .junit .runners .model .Statement ;
1314import org .slf4j .Logger ;
2122import javax .naming .directory .DirContext ;
2223import javax .naming .directory .InitialDirContext ;
2324import javax .naming .ldap .LdapContext ;
25+
26+ import java .io .UnsupportedEncodingException ;
27+ import java .net .URLDecoder ;
2428import java .util .Hashtable ;
2529import java .util .List ;
2630
@@ -56,7 +60,11 @@ private static InMemoryDirectoryServer createServer(final InMemoryDirectoryServe
5660 new InMemoryDirectoryServer (inMemoryDirectoryServerConfig );
5761 if (ldifs != null && !ldifs .isEmpty ()) {
5862 for (final String ldif : ldifs ) {
59- ldapServer .importFromLDIF (false , Resources .getResource (ldif ).getPath ());
63+ try {
64+ ldapServer .importFromLDIF (false , URLDecoder .decode (Resources .getResource (ldif ).getPath (), "UTF-8" ));
65+ } catch (UnsupportedEncodingException e ) {
66+ throw new IllegalStateException ("Can not URL decode path:" + Resources .getResource (ldif ).getPath (), e );
67+ }
6068 }
6169 }
6270 return ldapServer ;
You can’t perform that action at this time.
0 commit comments