@@ -11,7 +11,6 @@ import (
1111
1212 "github.com/uber/cadence/common/clock"
1313 "github.com/uber/cadence/common/log"
14- "github.com/uber/cadence/common/log/tag"
1514 "github.com/uber/cadence/common/metrics"
1615 "github.com/uber/cadence/common/types"
1716 "github.com/uber/cadence/service/sharddistributor/store"
@@ -31,33 +30,19 @@ func TestMeteredStore_GetHeartbeat(t *testing.T) {
3130 }
3231
3332 tests := []struct {
34- name string
35- setupMocks func (logger * log.MockLogger )
36- error error
33+ name string
34+ error error
3735 }{
3836 {
39- name : "Success" ,
40- setupMocks : func (logger * log.MockLogger ) {},
41- error : nil ,
37+ name : "Success" ,
38+ error : nil ,
4239 },
4340 {
44- name : "NotFound" ,
45- setupMocks : func (logger * log.MockLogger ) {
46- logger .EXPECT ().Error (
47- "Executor not found." ,
48- []tag.Tag {tag .Error (store .ErrExecutorNotFound ), tag .MetricScope (int (metrics .ShardDistributorStoreGetHeartbeatScope ))},
49- ).Times (1 )
50- },
41+ name : "NotFound" ,
5142 error : store .ErrExecutorNotFound ,
5243 },
5344 {
54- name : "Failure" ,
55- setupMocks : func (logger * log.MockLogger ) {
56- logger .EXPECT ().Error (
57- "Store failed with internal error." ,
58- []tag.Tag {tag .Error (& types.InternalServiceError {}), tag .MetricScope (int (metrics .ShardDistributorStoreGetHeartbeatScope ))},
59- ).Times (1 )
60- },
45+ name : "Failure" ,
6146 error : & types.InternalServiceError {},
6247 },
6348 }
@@ -79,7 +64,6 @@ func TestMeteredStore_GetHeartbeat(t *testing.T) {
7964 mockLogger .EXPECT ().Helper ().Return (mockLogger ).AnyTimes ()
8065
8166 wrapped := NewStore (mockHandler , metricsClient , mockLogger , timeSource ).(* meteredStore )
82- tt .setupMocks (mockLogger )
8367
8468 gotHeartbeat , gotAssignedState , err := wrapped .GetHeartbeat (context .Background (), _testNamespace , _testExecutorID )
8569
0 commit comments