From 1d0c6a334e7ae2d9d958b7d45e4a12a0e648062d Mon Sep 17 00:00:00 2001 From: Bowen Xiao Date: Wed, 8 May 2024 16:47:40 -0700 Subject: [PATCH] factor out historyReplicatorImpl for future use --- service/history/ndc/history_replicator_test.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/service/history/ndc/history_replicator_test.go b/service/history/ndc/history_replicator_test.go index e0c69b5ea77..a4d89593142 100644 --- a/service/history/ndc/history_replicator_test.go +++ b/service/history/ndc/history_replicator_test.go @@ -41,7 +41,7 @@ import ( "github.com/uber/cadence/service/history/shard" ) -func createTestHistoryReplicator(t *testing.T) { +func createTestHistoryReplicator(t *testing.T) historyReplicatorImpl { ctrl := gomock.NewController(t) mockShard := shard.NewMockContext(ctrl) @@ -81,11 +81,16 @@ func createTestHistoryReplicator(t *testing.T) { // going back to NewHistoryReplicator mockHistoryResource.EXPECT().GetClusterMetadata().Return(cluster.Metadata{}).Times(1) - assert.NotNil(t, NewHistoryReplicator(mockShard, testExecutionCache, mockEventsReapplier, log.NewNoop())) + replicator := NewHistoryReplicator(mockShard, testExecutionCache, mockEventsReapplier, log.NewNoop()) + replicatorImpl := replicator.(*historyReplicatorImpl) + return *replicatorImpl +} + +type name struct { } func TestNewHistoryReplicator(t *testing.T) { - createTestHistoryReplicator(t) + assert.NotNil(t, createTestHistoryReplicator(t)) } func TestNewHistoryReplicator_newBranchManager(t *testing.T) {