@@ -24,8 +24,8 @@ import (
2424 gomock "github.com/golang/mock/gomock"
2525 "github.com/stretchr/testify/assert"
2626
27- "github.com/samaritan-proxy/samaritan/pb/config/bootstrap"
2827 "github.com/samaritan-proxy/samaritan/pb/common"
28+ "github.com/samaritan-proxy/samaritan/pb/config/bootstrap"
2929 "github.com/samaritan-proxy/samaritan/pb/config/hc"
3030 "github.com/samaritan-proxy/samaritan/pb/config/protocol"
3131 "github.com/samaritan-proxy/samaritan/pb/config/service"
@@ -166,7 +166,7 @@ func TestInitDynamic(t *testing.T) {
166166 ctrl := gomock .NewController (t )
167167 defer ctrl .Finish ()
168168 d := NewMockDynamicSource (ctrl )
169- d .EXPECT ().SetSvcHook (gomock .Any ())
169+ d .EXPECT ().SetDependencyHook (gomock .Any ())
170170 d .EXPECT ().SetSvcConfigHook (gomock .Any ())
171171 d .EXPECT ().SetSvcEndpointHook (gomock .Any ())
172172 d .EXPECT ().Serve ()
@@ -180,7 +180,7 @@ func TestInitDynamic(t *testing.T) {
180180 time .Sleep (time .Millisecond * 100 ) // wait dynamic source serving.
181181}
182182
183- func TestHandleSvcUpdate (t * testing.T ) {
183+ func TestHandleDependencyUpdate (t * testing.T ) {
184184 b := & bootstrap.Bootstrap {
185185 Admin : & bootstrap.Admin {
186186 Bind : & common.Address {
@@ -198,14 +198,14 @@ func TestHandleSvcUpdate(t *testing.T) {
198198 {Name : "foo" },
199199 {Name : "bar" },
200200 }
201- c .handleSvcUpdate (added , nil )
201+ c .handleDependencyUpdate (added , nil )
202202 assert .Equal (t , 2 , len (c .sws ))
203203
204204 removed := []* service.Service {
205205 {Name : "bar" },
206206 {Name : "zoo" },
207207 }
208- c .handleSvcUpdate (nil , removed )
208+ c .handleDependencyUpdate (nil , removed )
209209 assert .Equal (t , 1 , len (c .sws ))
210210
211211 e := <- evtCh
@@ -239,7 +239,7 @@ func TestHandleSvcConfigUpdate(t *testing.T) {
239239 addedSvcs := []* service.Service {
240240 {Name : "foo" },
241241 }
242- c .handleSvcUpdate (addedSvcs , nil )
242+ c .handleDependencyUpdate (addedSvcs , nil )
243243
244244 newCfg := new (service.Config )
245245 c .handleSvcConfigUpdate ("foo" , newCfg )
@@ -252,7 +252,7 @@ func TestHandleSvcConfigUpdate(t *testing.T) {
252252 assert .NoError (t , err )
253253 evtCh := c .Subscribe ()
254254
255- c .handleSvcUpdate (
255+ c .handleDependencyUpdate (
256256 []* service.Service {{Name : "foo" }},
257257 nil ,
258258 )
@@ -308,7 +308,7 @@ func TestHandleSvEndpointUpdate(t *testing.T) {
308308 addedSvcs := []* service.Service {
309309 {Name : "foo" },
310310 }
311- c .handleSvcUpdate (addedSvcs , nil )
311+ c .handleDependencyUpdate (addedSvcs , nil )
312312
313313 added := []* service.Endpoint {
314314 {Address : & common.Address {Ip : "127.0.0.1" , Port : 8888 }},
@@ -323,7 +323,7 @@ func TestHandleSvEndpointUpdate(t *testing.T) {
323323 assert .NoError (t , err )
324324 evtCh := c .Subscribe ()
325325
326- c .handleSvcUpdate (
326+ c .handleDependencyUpdate (
327327 []* service.Service {{Name : "foo" }},
328328 nil ,
329329 )
0 commit comments