@@ -28,7 +28,12 @@ func TestLDAPConfigurations_Verify(t *testing.T) {
2828 }` )
2929 })
3030
31- request := & LDAP {}
31+ request := & LDAP {
32+ Hostname : "atlas-ldaps-01.ldap.myteam.com" ,
33+ Port : 636 ,
34+ BindUsername : "CN=Administrator,CN=Users,DC=atlas-ldaps-01,DC=myteam,DC=com" ,
35+ BindPassword : "admin" ,
36+ }
3237 ldap , _ , err := client .LDAPConfigurations .Verify (ctx , groupID , request )
3338 if err != nil {
3439 t .Fatalf ("LDAPConfigurations.Verify returned error: %v" , err )
@@ -133,7 +138,16 @@ func TestLDAPConfigurations_Save(t *testing.T) {
133138 }` )
134139 })
135140
136- request := & LDAP {}
141+ request := & LDAPConfiguration {
142+ LDAP : & LDAP {
143+ AuthenticationEnabled : true ,
144+ AuthorizationEnabled : true ,
145+ Hostname : "atlas-ldaps-01.ldap.myteam.com" ,
146+ Port : 636 ,
147+ BindUsername : "CN=Administrator,CN=Users,DC=atlas-ldaps-01,DC=myteam,DC=com" ,
148+ BindPassword : "admin" ,
149+ },
150+ }
137151 ldap , _ , err := client .LDAPConfigurations .Save (ctx , groupID , request )
138152 if err != nil {
139153 t .Fatalf ("LDAPConfigurations.Save returned error: %v" , err )
@@ -218,7 +232,7 @@ func TestLDAPConfigurations_Delete(t *testing.T) {
218232
219233 groupID := "535683b3794d371327b"
220234
221- mux .HandleFunc (fmt .Sprintf ("/groups/%s/userSecurity" , groupID ), func (w http.ResponseWriter , r * http.Request ) {
235+ mux .HandleFunc (fmt .Sprintf ("/groups/%s/userSecurity/ldap/userToDNMapping " , groupID ), func (w http.ResponseWriter , r * http.Request ) {
222236 testMethod (t , r , http .MethodDelete )
223237 fmt .Fprint (w , `{
224238 "ldap" : {
@@ -227,11 +241,7 @@ func TestLDAPConfigurations_Delete(t *testing.T) {
227241 "authzQueryTemplate" : "{USER}?memberOf?base",
228242 "bindUsername" : "CN=Administrator,CN=Users,DC=atlas-ldaps-01,DC=myteam,DC=com",
229243 "hostname" : "atlas-ldaps-01.ldap.myteam.com",
230- "port" : 636,
231- "userToDNMapping" : [ {
232- "match" : "(.*)",
233- "substitution" : "CN={0},CN=Users,DC=atlas-ldaps-01,DC=myteam,DC=com"
234- } ]
244+ "port" : 636
235245 }
236246 }` )
237247 })
@@ -248,13 +258,7 @@ func TestLDAPConfigurations_Delete(t *testing.T) {
248258 Hostname : "atlas-ldaps-01.ldap.myteam.com" ,
249259 Port : 636 ,
250260 BindUsername : "CN=Administrator,CN=Users,DC=atlas-ldaps-01,DC=myteam,DC=com" ,
251- UserToDNMapping : []* UserToDNMapping {
252- {
253- Match : "(.*)" ,
254- Substitution : "CN={0},CN=Users,DC=atlas-ldaps-01,DC=myteam,DC=com" ,
255- },
256- },
257- AuthzQueryTemplate : "{USER}?memberOf?base" ,
261+ AuthzQueryTemplate : "{USER}?memberOf?base" ,
258262 },
259263 }
260264
0 commit comments