mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Close the connection only if we establish it. (#18897)
This commit is contained in:
@@ -19,6 +19,8 @@ type MockConnection struct {
|
||||
DelParams *ldap.DelRequest
|
||||
DelCalled bool
|
||||
|
||||
CloseCalled bool
|
||||
|
||||
UnauthenticatedBindCalled bool
|
||||
BindCalled bool
|
||||
|
||||
@@ -49,7 +51,9 @@ func (c *MockConnection) UnauthenticatedBind(username string) error {
|
||||
}
|
||||
|
||||
// Close mocks Close connection function
|
||||
func (c *MockConnection) Close() {}
|
||||
func (c *MockConnection) Close() {
|
||||
c.CloseCalled = true
|
||||
}
|
||||
|
||||
func (c *MockConnection) setSearchResult(result *ldap.SearchResult) {
|
||||
c.SearchResult = result
|
||||
|
||||
Reference in New Issue
Block a user