summaryrefslogtreecommitdiff
path: root/internal/authentication/ldap_client_factory_mock_test.go
diff options
context:
space:
mode:
authorJames Elliott <james-d-elliott@users.noreply.github.com>2025-02-23 19:05:57 +1100
committerGitHub <noreply@github.com>2025-02-23 08:05:57 +0000
commit0af038e0ced689db90da480876a0bb26d78c6fb9 (patch)
tree5d97fe07636fcc5f7c6d87d6535bc5e1f0a9f2eb /internal/authentication/ldap_client_factory_mock_test.go
parent197b45521f5e3799d0b9ef1ec0000d4f83abdee9 (diff)
feat(authentication): ldap connection pooling (#7217)
This implements optional LDAP connection pooling to optimize the speed of LDAP transactions. Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Diffstat (limited to 'internal/authentication/ldap_client_factory_mock_test.go')
-rw-r--r--internal/authentication/ldap_client_factory_mock_test.go59
1 files changed, 50 insertions, 9 deletions
diff --git a/internal/authentication/ldap_client_factory_mock_test.go b/internal/authentication/ldap_client_factory_mock_test.go
index f8ce5bb81..fe0a8c2e4 100644
--- a/internal/authentication/ldap_client_factory_mock_test.go
+++ b/internal/authentication/ldap_client_factory_mock_test.go
@@ -40,22 +40,63 @@ func (m *MockLDAPClientFactory) EXPECT() *MockLDAPClientFactoryMockRecorder {
return m.recorder
}
-// DialURL mocks base method.
-func (m *MockLDAPClientFactory) DialURL(addr string, opts ...ldap.DialOpt) (LDAPClient, error) {
+// Close mocks base method.
+func (m *MockLDAPClientFactory) Close() error {
m.ctrl.T.Helper()
- varargs := []any{addr}
+ ret := m.ctrl.Call(m, "Close")
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// Close indicates an expected call of Close.
+func (mr *MockLDAPClientFactoryMockRecorder) Close() *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockLDAPClientFactory)(nil).Close))
+}
+
+// GetClient mocks base method.
+func (m *MockLDAPClientFactory) GetClient(opts ...LDAPClientFactoryOption) (ldap.Client, error) {
+ m.ctrl.T.Helper()
+ varargs := []any{}
for _, a := range opts {
varargs = append(varargs, a)
}
- ret := m.ctrl.Call(m, "DialURL", varargs...)
- ret0, _ := ret[0].(LDAPClient)
+ ret := m.ctrl.Call(m, "GetClient", varargs...)
+ ret0, _ := ret[0].(ldap.Client)
ret1, _ := ret[1].(error)
return ret0, ret1
}
-// DialURL indicates an expected call of DialURL.
-func (mr *MockLDAPClientFactoryMockRecorder) DialURL(addr any, opts ...any) *gomock.Call {
+// GetClient indicates an expected call of GetClient.
+func (mr *MockLDAPClientFactoryMockRecorder) GetClient(opts ...any) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClient", reflect.TypeOf((*MockLDAPClientFactory)(nil).GetClient), opts...)
+}
+
+// Initialize mocks base method.
+func (m *MockLDAPClientFactory) Initialize() error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "Initialize")
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// Initialize indicates an expected call of Initialize.
+func (mr *MockLDAPClientFactoryMockRecorder) Initialize() *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Initialize", reflect.TypeOf((*MockLDAPClientFactory)(nil).Initialize))
+}
+
+// ReleaseClient mocks base method.
+func (m *MockLDAPClientFactory) ReleaseClient(client ldap.Client) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ReleaseClient", client)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// ReleaseClient indicates an expected call of ReleaseClient.
+func (mr *MockLDAPClientFactoryMockRecorder) ReleaseClient(client any) *gomock.Call {
mr.mock.ctrl.T.Helper()
- varargs := append([]any{addr}, opts...)
- return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DialURL", reflect.TypeOf((*MockLDAPClientFactory)(nil).DialURL), varargs...)
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReleaseClient", reflect.TypeOf((*MockLDAPClientFactory)(nil).ReleaseClient), client)
}