2019-12-06 15:15:54 +07:00
|
|
|
// Code generated by MockGen. DO NOT EDIT.
|
2020-12-03 12:23:52 +07:00
|
|
|
// Source: ldap_connection_factory.go
|
2019-12-06 15:15:54 +07:00
|
|
|
package authentication
|
|
|
|
|
|
|
|
import (
|
|
|
|
tls "crypto/tls"
|
2021-01-04 17:28:55 +07:00
|
|
|
reflect "reflect"
|
|
|
|
|
2020-12-03 12:23:52 +07:00
|
|
|
ldap "github.com/go-ldap/ldap/v3"
|
2019-12-06 15:15:54 +07:00
|
|
|
gomock "github.com/golang/mock/gomock"
|
|
|
|
)
|
|
|
|
|
2021-08-05 11:30:00 +07:00
|
|
|
// MockLDAPConnection is a mock of LDAPConnection interface.
|
2019-12-06 15:15:54 +07:00
|
|
|
type MockLDAPConnection struct {
|
|
|
|
ctrl *gomock.Controller
|
|
|
|
recorder *MockLDAPConnectionMockRecorder
|
|
|
|
}
|
|
|
|
|
2021-08-05 11:30:00 +07:00
|
|
|
// MockLDAPConnectionMockRecorder is the mock recorder for MockLDAPConnection.
|
2019-12-06 15:15:54 +07:00
|
|
|
type MockLDAPConnectionMockRecorder struct {
|
|
|
|
mock *MockLDAPConnection
|
|
|
|
}
|
|
|
|
|
2021-08-05 11:30:00 +07:00
|
|
|
// NewMockLDAPConnection creates a new mock instance.
|
2019-12-06 15:15:54 +07:00
|
|
|
func NewMockLDAPConnection(ctrl *gomock.Controller) *MockLDAPConnection {
|
|
|
|
mock := &MockLDAPConnection{ctrl: ctrl}
|
|
|
|
mock.recorder = &MockLDAPConnectionMockRecorder{mock}
|
|
|
|
return mock
|
|
|
|
}
|
|
|
|
|
2021-08-05 11:30:00 +07:00
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
2019-12-06 15:15:54 +07:00
|
|
|
func (m *MockLDAPConnection) EXPECT() *MockLDAPConnectionMockRecorder {
|
|
|
|
return m.recorder
|
|
|
|
}
|
|
|
|
|
2021-08-05 11:30:00 +07:00
|
|
|
// Bind mocks base method.
|
2019-12-06 15:15:54 +07:00
|
|
|
func (m *MockLDAPConnection) Bind(username, password string) error {
|
|
|
|
m.ctrl.T.Helper()
|
|
|
|
ret := m.ctrl.Call(m, "Bind", username, password)
|
|
|
|
ret0, _ := ret[0].(error)
|
|
|
|
return ret0
|
|
|
|
}
|
|
|
|
|
2021-08-05 11:30:00 +07:00
|
|
|
// Bind indicates an expected call of Bind.
|
2019-12-06 15:15:54 +07:00
|
|
|
func (mr *MockLDAPConnectionMockRecorder) Bind(username, password interface{}) *gomock.Call {
|
|
|
|
mr.mock.ctrl.T.Helper()
|
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Bind", reflect.TypeOf((*MockLDAPConnection)(nil).Bind), username, password)
|
|
|
|
}
|
|
|
|
|
2021-08-05 11:30:00 +07:00
|
|
|
// Close mocks base method.
|
2019-12-06 15:15:54 +07:00
|
|
|
func (m *MockLDAPConnection) Close() {
|
|
|
|
m.ctrl.T.Helper()
|
|
|
|
m.ctrl.Call(m, "Close")
|
|
|
|
}
|
|
|
|
|
2021-08-05 11:30:00 +07:00
|
|
|
// Close indicates an expected call of Close.
|
2019-12-06 15:15:54 +07:00
|
|
|
func (mr *MockLDAPConnectionMockRecorder) Close() *gomock.Call {
|
|
|
|
mr.mock.ctrl.T.Helper()
|
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockLDAPConnection)(nil).Close))
|
|
|
|
}
|
|
|
|
|
2021-08-05 11:30:00 +07:00
|
|
|
// Modify mocks base method.
|
2020-12-03 12:23:52 +07:00
|
|
|
func (m *MockLDAPConnection) Modify(modifyRequest *ldap.ModifyRequest) error {
|
2019-12-06 15:15:54 +07:00
|
|
|
m.ctrl.T.Helper()
|
|
|
|
ret := m.ctrl.Call(m, "Modify", modifyRequest)
|
|
|
|
ret0, _ := ret[0].(error)
|
|
|
|
return ret0
|
|
|
|
}
|
|
|
|
|
2021-08-05 11:30:00 +07:00
|
|
|
// Modify indicates an expected call of Modify.
|
2019-12-06 15:15:54 +07:00
|
|
|
func (mr *MockLDAPConnectionMockRecorder) Modify(modifyRequest interface{}) *gomock.Call {
|
|
|
|
mr.mock.ctrl.T.Helper()
|
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Modify", reflect.TypeOf((*MockLDAPConnection)(nil).Modify), modifyRequest)
|
|
|
|
}
|
|
|
|
|
2021-08-05 11:30:00 +07:00
|
|
|
// PasswordModify mocks base method.
|
2021-07-06 16:13:17 +07:00
|
|
|
func (m *MockLDAPConnection) PasswordModify(pwdModifyRequest *ldap.PasswordModifyRequest) error {
|
|
|
|
m.ctrl.T.Helper()
|
|
|
|
ret := m.ctrl.Call(m, "PasswordModify", pwdModifyRequest)
|
|
|
|
ret0, _ := ret[0].(error)
|
|
|
|
return ret0
|
|
|
|
}
|
|
|
|
|
2021-08-05 11:30:00 +07:00
|
|
|
// PasswordModify indicates an expected call of PasswordModify.
|
2021-07-06 16:13:17 +07:00
|
|
|
func (mr *MockLDAPConnectionMockRecorder) PasswordModify(pwdModifyRequest interface{}) *gomock.Call {
|
|
|
|
mr.mock.ctrl.T.Helper()
|
2021-08-05 11:30:00 +07:00
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PasswordModify", reflect.TypeOf((*MockLDAPConnection)(nil).PasswordModify), pwdModifyRequest)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Search mocks base method.
|
|
|
|
func (m *MockLDAPConnection) Search(searchRequest *ldap.SearchRequest) (*ldap.SearchResult, error) {
|
|
|
|
m.ctrl.T.Helper()
|
|
|
|
ret := m.ctrl.Call(m, "Search", searchRequest)
|
|
|
|
ret0, _ := ret[0].(*ldap.SearchResult)
|
|
|
|
ret1, _ := ret[1].(error)
|
|
|
|
return ret0, ret1
|
|
|
|
}
|
|
|
|
|
|
|
|
// Search indicates an expected call of Search.
|
|
|
|
func (mr *MockLDAPConnectionMockRecorder) Search(searchRequest interface{}) *gomock.Call {
|
|
|
|
mr.mock.ctrl.T.Helper()
|
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Search", reflect.TypeOf((*MockLDAPConnection)(nil).Search), searchRequest)
|
2021-07-06 16:13:17 +07:00
|
|
|
}
|
|
|
|
|
2021-08-05 11:30:00 +07:00
|
|
|
// StartTLS mocks base method.
|
2020-12-03 12:23:52 +07:00
|
|
|
func (m *MockLDAPConnection) StartTLS(config *tls.Config) error {
|
|
|
|
m.ctrl.T.Helper()
|
|
|
|
ret := m.ctrl.Call(m, "StartTLS", config)
|
|
|
|
ret0, _ := ret[0].(error)
|
|
|
|
return ret0
|
|
|
|
}
|
|
|
|
|
2021-08-05 11:30:00 +07:00
|
|
|
// StartTLS indicates an expected call of StartTLS.
|
2020-12-03 12:23:52 +07:00
|
|
|
func (mr *MockLDAPConnectionMockRecorder) StartTLS(config interface{}) *gomock.Call {
|
|
|
|
mr.mock.ctrl.T.Helper()
|
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartTLS", reflect.TypeOf((*MockLDAPConnection)(nil).StartTLS), config)
|
|
|
|
}
|
|
|
|
|
2021-08-05 11:30:00 +07:00
|
|
|
// MockLDAPConnectionFactory is a mock of LDAPConnectionFactory interface.
|
2019-12-06 15:15:54 +07:00
|
|
|
type MockLDAPConnectionFactory struct {
|
|
|
|
ctrl *gomock.Controller
|
|
|
|
recorder *MockLDAPConnectionFactoryMockRecorder
|
|
|
|
}
|
|
|
|
|
2021-08-05 11:30:00 +07:00
|
|
|
// MockLDAPConnectionFactoryMockRecorder is the mock recorder for MockLDAPConnectionFactory.
|
2019-12-06 15:15:54 +07:00
|
|
|
type MockLDAPConnectionFactoryMockRecorder struct {
|
|
|
|
mock *MockLDAPConnectionFactory
|
|
|
|
}
|
|
|
|
|
2021-08-05 11:30:00 +07:00
|
|
|
// NewMockLDAPConnectionFactory creates a new mock instance.
|
2019-12-06 15:15:54 +07:00
|
|
|
func NewMockLDAPConnectionFactory(ctrl *gomock.Controller) *MockLDAPConnectionFactory {
|
|
|
|
mock := &MockLDAPConnectionFactory{ctrl: ctrl}
|
|
|
|
mock.recorder = &MockLDAPConnectionFactoryMockRecorder{mock}
|
|
|
|
return mock
|
|
|
|
}
|
|
|
|
|
2021-08-05 11:30:00 +07:00
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
2019-12-06 15:15:54 +07:00
|
|
|
func (m *MockLDAPConnectionFactory) EXPECT() *MockLDAPConnectionFactoryMockRecorder {
|
|
|
|
return m.recorder
|
|
|
|
}
|
|
|
|
|
2021-08-05 11:30:00 +07:00
|
|
|
// DialURL mocks base method.
|
|
|
|
func (m *MockLDAPConnectionFactory) DialURL(addr string, opts ...ldap.DialOpt) (LDAPConnection, error) {
|
2019-12-06 15:15:54 +07:00
|
|
|
m.ctrl.T.Helper()
|
2021-08-05 11:30:00 +07:00
|
|
|
varargs := []interface{}{addr}
|
|
|
|
for _, a := range opts {
|
|
|
|
varargs = append(varargs, a)
|
|
|
|
}
|
|
|
|
ret := m.ctrl.Call(m, "DialURL", varargs...)
|
2019-12-06 15:15:54 +07:00
|
|
|
ret0, _ := ret[0].(LDAPConnection)
|
|
|
|
ret1, _ := ret[1].(error)
|
|
|
|
return ret0, ret1
|
|
|
|
}
|
|
|
|
|
2021-08-05 11:30:00 +07:00
|
|
|
// DialURL indicates an expected call of DialURL.
|
|
|
|
func (mr *MockLDAPConnectionFactoryMockRecorder) DialURL(addr interface{}, opts ...interface{}) *gomock.Call {
|
2019-12-06 15:15:54 +07:00
|
|
|
mr.mock.ctrl.T.Helper()
|
2021-08-05 11:30:00 +07:00
|
|
|
varargs := append([]interface{}{addr}, opts...)
|
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DialURL", reflect.TypeOf((*MockLDAPConnectionFactory)(nil).DialURL), varargs...)
|
2019-12-06 15:15:54 +07:00
|
|
|
}
|