MCPcopy
hub / github.com/uber/aresdb / getMockService

Function getMockService

cluster/topology/dynamic_test.go:218–232  ·  view source on GitHub ↗
(ctrl *gomock.Controller)

Source from the content-addressed store, hash-verified

216}
217
218func getMockService(ctrl *gomock.Controller) services.Service {
219 mockService := services.NewMockService(ctrl)
220
221 mockReplication := services.NewMockServiceReplication(ctrl)
222 mockReplication.EXPECT().Replicas().Return(2).AnyTimes()
223 mockService.EXPECT().Replication().Return(mockReplication).AnyTimes()
224
225 mockSharding := services.NewMockServiceSharding(ctrl)
226 mockSharding.EXPECT().NumShards().Return(3).AnyTimes()
227 mockService.EXPECT().Sharding().Return(mockSharding).AnyTimes()
228
229 mockService.EXPECT().Instances().Return(goodInstances()).AnyTimes()
230
231 return mockService
232}
233
234func goodInstances() []services.ServiceInstance {
235 i1 := services.NewServiceInstance().SetShards(shard.NewShards(

Callers 1

updateMethod · 0.85

Calls 2

goodInstancesFunction · 0.85
ReplicasMethod · 0.65

Tested by

no test coverage detected