Skip to content

Commit

Permalink
factor out historyReplicatorImpl for future use
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenxia committed May 8, 2024
1 parent b4a574a commit 1d0c6a3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions service/history/ndc/history_replicator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 1d0c6a3

Please sign in to comment.