func (s *Test) GetThrottledLogger() log.Logger {
	return s.Logger
}
GetThrottledLogger for testing
package resource
import (
	"net"
	"github.com/golang/mock/gomock"
	"github.com/uber-go/tally"
	"go.temporal.io/api/workflowservice/v1"
	"go.temporal.io/api/workflowservicemock/v1"
	sdkclient "go.temporal.io/sdk/client"
	sdkmocks "go.temporal.io/sdk/mocks"
	"go.temporal.io/server/api/adminservice/v1"
	"go.temporal.io/server/api/adminservicemock/v1"
	"go.temporal.io/server/api/historyservice/v1"
	"go.temporal.io/server/api/historyservicemock/v1"
	"go.temporal.io/server/api/matchingservice/v1"
	"go.temporal.io/server/api/matchingservicemock/v1"
	"go.temporal.io/server/client"
	"go.temporal.io/server/common"
	"go.temporal.io/server/common/archiver"
	"go.temporal.io/server/common/archiver/provider"
	"go.temporal.io/server/common/clock"
	"go.temporal.io/server/common/cluster"
	"go.temporal.io/server/common/log"
	"go.temporal.io/server/common/membership"
	"go.temporal.io/server/common/metrics"
	"go.temporal.io/server/common/namespace"
	"go.temporal.io/server/common/persistence"
	persistenceClient "go.temporal.io/server/common/persistence/client"
	"go.temporal.io/server/common/persistence/serialization"
	esclient "go.temporal.io/server/common/persistence/visibility/store/elasticsearch/client"
	"go.temporal.io/server/common/searchattribute"
)
type (
	Test struct {
		MetricsScope             tally.Scope
		ClusterMetadata          *cluster.MockMetadata
		SearchAttributesProvider *searchattribute.MockProvider
		SearchAttributesManager  *searchattribute.MockManager
		SearchAttributesMapper   *searchattribute.MockMapper
		NamespaceCache    *namespace.MockRegistry
		TimeSource        clock.TimeSource
		PayloadSerializer serialization.Serializer
		MetricsClient     metrics.Client
		ArchivalMetadata  *archiver.MockArchivalMetadata
		ArchiverProvider  *provider.MockArchiverProvider
		MembershipMonitor       *membership.MockMonitor
		FrontendServiceResolver *membership.MockServiceResolver
		MatchingServiceResolver *membership.MockServiceResolver
		HistoryServiceResolver  *membership.MockServiceResolver
		WorkerServiceResolver   *membership.MockServiceResolver
		SDKClient            *sdkmocks.Client
		FrontendClient       *workflowservicemock.MockWorkflowServiceClient
		MatchingClient       *matchingservicemock.MockMatchingServiceClient
		HistoryClient        *historyservicemock.MockHistoryServiceClient
		RemoteAdminClient    *adminservicemock.MockAdminServiceClient
		RemoteFrontendClient *workflowservicemock.MockWorkflowServiceClient
		ClientBean           *client.MockBean
		ESClient             *esclient.MockClient
		MetadataMgr               *persistence.MockMetadataManager
		ClusterMetadataMgr        *persistence.MockClusterMetadataManager
		TaskMgr                   *persistence.MockTaskManager
		NamespaceReplicationQueue persistence.NamespaceReplicationQueue
		ShardMgr                  *persistence.MockShardManager
		ExecutionMgr              *persistence.MockExecutionManager
		PersistenceBean           *persistenceClient.MockBean
		Logger log.Logger
	}
)
var _ Resource = (*Test)(nil)
const (
	testHostName = "test_host"
)
var (
	testHostInfo = membership.NewHostInfo(testHostName, nil)
)
func NewTest(
	controller *gomock.Controller,
	serviceMetricsIndex metrics.ServiceIdx,
) *Test {
	logger := log.NewTestLogger()
	frontendClient := workflowservicemock.NewMockWorkflowServiceClient(controller)
	matchingClient := matchingservicemock.NewMockMatchingServiceClient(controller)
	historyClient := historyservicemock.NewMockHistoryServiceClient(controller)
	remoteFrontendClient := workflowservicemock.NewMockWorkflowServiceClient(controller)
	remoteAdminClient := adminservicemock.NewMockAdminServiceClient(controller)
	clusterMetadataManager := persistence.NewMockClusterMetadataManager(controller)
	clientBean := client.NewMockBean(controller)
	clientBean.EXPECT().GetFrontendClient().Return(frontendClient).AnyTimes()
	clientBean.EXPECT().GetMatchingClient(gomock.Any()).Return(matchingClient, nil).AnyTimes()
	clientBean.EXPECT().GetHistoryClient().Return(historyClient).AnyTimes()
	clientBean.EXPECT().GetRemoteAdminClient(gomock.Any()).Return(remoteAdminClient).AnyTimes()
	clientBean.EXPECT().GetRemoteFrontendClient(gomock.Any()).Return(remoteFrontendClient).AnyTimes()
	metadataMgr := persistence.NewMockMetadataManager(controller)
	taskMgr := persistence.NewMockTaskManager(controller)
	shardMgr := persistence.NewMockShardManager(controller)
	executionMgr := persistence.NewMockExecutionManager(controller)
	namespaceReplicationQueue := persistence.NewMockNamespaceReplicationQueue(controller)
	namespaceReplicationQueue.EXPECT().Start().AnyTimes()
	namespaceReplicationQueue.EXPECT().Stop().AnyTimes()
	persistenceBean := persistenceClient.NewMockBean(controller)
	persistenceBean.EXPECT().GetMetadataManager().Return(metadataMgr).AnyTimes()
	persistenceBean.EXPECT().GetTaskManager().Return(taskMgr).AnyTimes()
	persistenceBean.EXPECT().GetShardManager().Return(shardMgr).AnyTimes()
	persistenceBean.EXPECT().GetExecutionManager().Return(executionMgr).AnyTimes()
	persistenceBean.EXPECT().GetNamespaceReplicationQueue().Return(namespaceReplicationQueue).AnyTimes()
	persistenceBean.EXPECT().GetClusterMetadataManager().Return(clusterMetadataManager).AnyTimes()
	membershipMonitor := membership.NewMockMonitor(controller)
	frontendServiceResolver := membership.NewMockServiceResolver(controller)
	matchingServiceResolver := membership.NewMockServiceResolver(controller)
	historyServiceResolver := membership.NewMockServiceResolver(controller)
	workerServiceResolver := membership.NewMockServiceResolver(controller)
	membershipMonitor.EXPECT().GetResolver(common.FrontendServiceName).Return(frontendServiceResolver, nil).AnyTimes()
	membershipMonitor.EXPECT().GetResolver(common.MatchingServiceName).Return(matchingServiceResolver, nil).AnyTimes()
	membershipMonitor.EXPECT().GetResolver(common.HistoryServiceName).Return(historyServiceResolver, nil).AnyTimes()
	membershipMonitor.EXPECT().GetResolver(common.WorkerServiceName).Return(workerServiceResolver, nil).AnyTimes()
	scope := tally.NewTestScope("test", nil)
	return &Test{
		MetricsScope:             scope,
		ClusterMetadata:          cluster.NewMockMetadata(controller),
		SearchAttributesProvider: searchattribute.NewMockProvider(controller),
		SearchAttributesManager:  searchattribute.NewMockManager(controller),
		SearchAttributesMapper:   searchattribute.NewMockMapper(controller),
		NamespaceCache:    namespace.NewMockRegistry(controller),
		TimeSource:        clock.NewRealTimeSource(),
		PayloadSerializer: serialization.NewSerializer(),
		MetricsClient:     metrics.NewClient(scope, serviceMetricsIndex),
		ArchivalMetadata:  archiver.NewMockArchivalMetadata(controller),
		ArchiverProvider:  provider.NewMockArchiverProvider(controller),
		MembershipMonitor:       membershipMonitor,
		FrontendServiceResolver: frontendServiceResolver,
		MatchingServiceResolver: matchingServiceResolver,
		HistoryServiceResolver:  historyServiceResolver,
		WorkerServiceResolver:   workerServiceResolver,
		SDKClient:            &sdkmocks.Client{},
		FrontendClient:       frontendClient,
		MatchingClient:       matchingClient,
		HistoryClient:        historyClient,
		RemoteAdminClient:    remoteAdminClient,
		RemoteFrontendClient: remoteFrontendClient,
		ClientBean:           clientBean,
		ESClient:             esclient.NewMockClient(controller),
		MetadataMgr:               metadataMgr,
		ClusterMetadataMgr:        clusterMetadataManager,
		TaskMgr:                   taskMgr,
		NamespaceReplicationQueue: namespaceReplicationQueue,
		ShardMgr:                  shardMgr,
		ExecutionMgr:              executionMgr,
		PersistenceBean:           persistenceBean,
		Logger: logger,
	}
}
func (s *Test) Start() {
}
func (s *Test) Stop() {
}
func (s *Test) GetServiceName() string {
	panic("user should implement this method for test")
}
func (s *Test) GetHostName() string {
	return testHostInfo.Identity()
}
func (s *Test) GetHostInfo() *membership.HostInfo {
	return testHostInfo
}
func (s *Test) GetClusterMetadata() cluster.Metadata {
	return s.ClusterMetadata
}
func (s *Test) GetClusterMetadataManager() persistence.ClusterMetadataManager {
	return s.ClusterMetadataMgr
}
func (s *Test) GetNamespaceRegistry() namespace.Registry {
	return s.NamespaceCache
}
func (s *Test) GetTimeSource() clock.TimeSource {
	return s.TimeSource
}
func (s *Test) GetPayloadSerializer() serialization.Serializer {
	return s.PayloadSerializer
}
func (s *Test) GetMetricsClient() metrics.Client {
	return s.MetricsClient
}
func (s *Test) GetArchivalMetadata() archiver.ArchivalMetadata {
	return s.ArchivalMetadata
}
func (s *Test) GetArchiverProvider() provider.ArchiverProvider {
	return s.ArchiverProvider
}
func (s *Test) GetMembershipMonitor() membership.Monitor {
	return s.MembershipMonitor
}
func (s *Test) GetFrontendServiceResolver() membership.ServiceResolver {
	return s.FrontendServiceResolver
}
func (s *Test) GetMatchingServiceResolver() membership.ServiceResolver {
	return s.MatchingServiceResolver
}
func (s *Test) GetHistoryServiceResolver() membership.ServiceResolver {
	return s.HistoryServiceResolver
}
func (s *Test) GetWorkerServiceResolver() membership.ServiceResolver {
	return s.WorkerServiceResolver
}
func (s *Test) GetSDKClient() sdkclient.Client {
	return s.SDKClient
}
func (s *Test) GetFrontendClient() workflowservice.WorkflowServiceClient {
	return s.FrontendClient
}
func (s *Test) GetMatchingRawClient() matchingservice.MatchingServiceClient {
	return s.MatchingClient
}
func (s *Test) GetMatchingClient() matchingservice.MatchingServiceClient {
	return s.MatchingClient
}
func (s *Test) GetHistoryRawClient() historyservice.HistoryServiceClient {
	return s.HistoryClient
}
func (s *Test) GetHistoryClient() historyservice.HistoryServiceClient {
	return s.HistoryClient
}
func (s *Test) GetRemoteAdminClient(
	cluster string,
) adminservice.AdminServiceClient {
	return s.RemoteAdminClient
}
func (s *Test) GetRemoteFrontendClient(
	cluster string,
) workflowservice.WorkflowServiceClient {
	return s.RemoteFrontendClient
}
func (s *Test) GetClientBean() client.Bean {
	return s.ClientBean
}
func (s *Test) GetMetadataManager() persistence.MetadataManager {
	return s.MetadataMgr
}
func (s *Test) GetTaskManager() persistence.TaskManager {
	return s.TaskMgr
}
func (s *Test) GetNamespaceReplicationQueue() persistence.NamespaceReplicationQueue {
	return s.NamespaceReplicationQueue
}
func (s *Test) GetShardManager() persistence.ShardManager {
	return s.ShardMgr
}
func (s *Test) GetExecutionManager() persistence.ExecutionManager {
	return s.ExecutionMgr
}
func (s *Test) GetPersistenceBean() persistenceClient.Bean {
	return s.PersistenceBean
}
func (s *Test) GetLogger() log.Logger {
	return s.Logger
}