// NewMockIdentityManager Constructor for a identity manager.
420804
func NewMockIdentityManager(opts ...UsersOption) msp.IdentityManager {

	manager := MockIdentityManager{}

	usersOptions := UsersOptions{}

	for _, param := range opts {
		err := param(&usersOptions)
		if err != nil {
			panic(fmt.Errorf("failed to create IdentityManager: %s", err))
		}
	}
	if usersOptions.users != nil {
		manager.users = usersOptions.users
	} else {
		manager.users = make(map[string]msp.SigningIdentity)
	}

	return &manager
}
592921
func NewMockGauge(ctrl *gomock.Controller) *MockGauge {
	mock := &MockGauge{ctrl: ctrl}
	mock.recorder = &MockGaugeMockRecorder{mock}
	return mock
}
1299786
func NewMockConnectionManager(ctrl *gomock.Controller) *MockConnectionManager {
	mock := &MockConnectionManager{ctrl: ctrl}
	mock.recorder = &MockConnectionManagerMockRecorder{mock}
	return mock
}
1268420
func NewMockSupervisor(ctrl *gomock.Controller) *MockSupervisor {
	mock := &MockSupervisor{ctrl: ctrl}
	mock.recorder = &MockSupervisorMockRecorder{mock}
	return mock
}
1134139
func NewIdentityManager(orgName string, userStore msp.UserStore, cryptoSuite core.CryptoSuite, endpointConfig fab.EndpointConfig) (*IdentityManager, error) {

	netConfig := endpointConfig.NetworkConfig()
	// viper keys are case insensitive
	orgConfig, ok := netConfig.Organizations[strings.ToLower(orgName)]
	if !ok {
		return nil, errors.New("org config retrieval failed")
	}

	if orgConfig.CryptoPath == "" && len(orgConfig.Users) == 0 {
		return nil, errors.New("Either a cryptopath or an embedded list of users is required")
	}

	var mspPrivKeyStore core.KVStore
	var mspCertStore core.KVStore

	orgCryptoPathTemplate := orgConfig.CryptoPath
	if orgCryptoPathTemplate != "" {
		var err error
		if !filepath.IsAbs(orgCryptoPathTemplate) {
			orgCryptoPathTemplate = filepath.Join(endpointConfig.CryptoConfigPath(), orgCryptoPathTemplate)
		}
		mspPrivKeyStore, err = NewFileKeyStore(orgCryptoPathTemplate)
		if err != nil {
			return nil, errors.Wrap(err, "creating a private key store failed")
		}
		mspCertStore, err = NewFileCertStore(orgCryptoPathTemplate)
		if err != nil {
			return nil, errors.Wrap(err, "creating a cert store failed")
		}
	} else {
		logger.Warnf("Cryptopath not provided for organization [%s], MSP stores not created", orgName)
	}

	mgr := &IdentityManager{
		orgName:         orgName,
		orgMSPID:        orgConfig.MSPID,
		config:          endpointConfig,
		cryptoSuite:     cryptoSuite,
		mspPrivKeyStore: mspPrivKeyStore,
		mspCertStore:    mspCertStore,
		embeddedUsers:   orgConfig.Users,
		userStore:       userStore,
		// CA Client state is created lazily, when (if) needed
	}
	return mgr, nil
}
1222416
func NewMockInstanceConnector(ctrl *gomock.Controller) *MockInstanceConnector {
	mock := &MockInstanceConnector{ctrl: ctrl}
	mock.recorder = &MockInstanceConnectorMockRecorder{mock}
	return mock
}
657015
func NewMockPersistentVolumeInterface(ctrl *gomock.Controller) *MockPersistentVolumeInterface {
	mock := &MockPersistentVolumeInterface{ctrl: ctrl}
	mock.recorder = &MockPersistentVolumeInterfaceMockRecorder{mock}
	return mock
}
851845
func WithSigningManager(signingManager core.SigningManager) SDKContextParams {
	return func(ctx *Provider) {
		ctx.signingManager = signingManager
	}
}
581815
func newMockableMC(servers, username, password string, config *Config, newMcConn connGen) *Client {
	client := &Client{config: config}

	s := func(r rune) bool {
		return r == ',' || r == ';' || r == ' '
	}
	serverList := strings.FieldsFunc(servers, s)
	for _, addr := range serverList {
		client.servers = append(client.servers,
			newServer(addr, username, password, config, newMcConn))
	}

	client.config.Hasher.update(client.servers)

	return client
}
1170987
func NewMockUninstaller(ctrl *gomock.Controller) *MockUninstaller {
	mock := &MockUninstaller{ctrl: ctrl}
	mock.recorder = &MockUninstallerMockRecorder{mock}
	return mock
}
1236404
func NewMockLeadershipMachine(ctrl *gomock.Controller) *MockLeadershipMachine {
	mock := &MockLeadershipMachine{ctrl: ctrl}
	mock.recorder = &MockLeadershipMachineMockRecorder{mock}
	return mock
}
466568
func NewMockConfig(channelID string, policy fab.EventServicePolicy) *fabmocks.MockConfig {
	config := &fabmocks.MockConfig{}
	config.SetCustomChannelConfig(channelID, &fab.ChannelEndpointConfig{
		Policies: fab.ChannelPolicies{
			EventService: policy,
		},
	})
	return config
}
472632
func NewMockAccessTokenStrategy(ctrl *gomock.Controller) *MockAccessTokenStrategy {
	mock := &MockAccessTokenStrategy{ctrl: ctrl}
	mock.recorder = &MockAccessTokenStrategyMockRecorder{mock}
	return mock
}
721024
func NewMockEntityFinder(ctrl *gomock.Controller) *MockEntityFinder {
	mock := &MockEntityFinder{ctrl: ctrl}
	mock.recorder = &MockEntityFinderMockRecorder{mock}
	return mock
}
648287
func NewCertAuthority(caType CertAuthType, clusterName string, signingKeys, checkingKeys [][]byte, roles []string) CertAuthority {
	return &CertAuthorityV2{
		Kind:    KindCertAuthority,
		Version: V2,
		SubKind: string(caType),
		Metadata: Metadata{
			Name:      clusterName,
			Namespace: defaults.Namespace,
		},
		Spec: CertAuthoritySpecV2{
			Roles:        roles,
			Type:         caType,
			ClusterName:  clusterName,
			CheckingKeys: checkingKeys,
			SigningKeys:  signingKeys,
		},
	}
}
1326781
func NewMockProvideriface(ctrl *gomock.Controller) *MockProvideriface {
	mock := &MockProvideriface{ctrl: ctrl}
	mock.recorder = &MockProviderifaceMockRecorder{mock}
	return mock
}
218733
func NewMockResolver(ctrl *gomock.Controller) *MockResolver {
	mock := &MockResolver{ctrl: ctrl}
	mock.recorder = &MockResolverMockRecorder{mock}
	return mock
}