Skip to content

Commit 2cc92da

Browse files
fix: improve test logic for LDAP connection string
1 parent 142189e commit 2cc92da

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

fe/fe-core/src/main/java/org/apache/doris/mysql/authenticate/ldap/LdapClient.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public boolean checkUpdate(String ldapPassword) {
107107
return this.ldapPassword == null || !this.ldapPassword.equals(ldapPassword);
108108
}
109109

110-
public String getURL() {
110+
private String getURL() {
111111
return ((LdapConfig.ldap_use_ssl ? "ldaps" : "ldap") + "://" + NetUtils
112112
.getHostPortInAccessibleFormat(LdapConfig.ldap_host, LdapConfig.ldap_port));
113113
}
@@ -231,6 +231,11 @@ protected String doMapFromContext(DirContextOperations ctx) {
231231
}
232232
}
233233

234+
@VisibleForTesting
235+
public String getURL() {
236+
return clientInfo.getURL();
237+
}
238+
234239
private String getUserFilter(String userFilter, String userName) {
235240
return userFilter.replaceAll("\\{login}", userName);
236241
}

fe/fe-core/src/test/java/org/apache/doris/mysql/authenticate/ldap/LdapClientTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
import mockit.Expectations;
2424
import mockit.Tested;
25-
2625
import org.junit.After;
2726
import org.junit.Assert;
2827
import org.junit.Before;

0 commit comments

Comments
 (0)