@@ -35,7 +35,7 @@ func TestSelectAlgorithm(t *testing.T) {
35
35
r := & routing.Route {
36
36
Route : eskip.Route {
37
37
BackendType : eskip .LBBackend ,
38
- LBEndpoints : []string { "https://www.example.org" },
38
+ LBEndpoints : []* eskip. LBEndpoint {{ Address : "https://www.example.org" } },
39
39
},
40
40
}
41
41
@@ -65,7 +65,7 @@ func TestSelectAlgorithm(t *testing.T) {
65
65
Route : eskip.Route {
66
66
BackendType : eskip .LBBackend ,
67
67
LBAlgorithm : "roundRobin" ,
68
- LBEndpoints : []string { "https://www.example.org" },
68
+ LBEndpoints : []* eskip. LBEndpoint {{ Address : "https://www.example.org" } },
69
69
},
70
70
}
71
71
@@ -95,7 +95,7 @@ func TestSelectAlgorithm(t *testing.T) {
95
95
Route : eskip.Route {
96
96
BackendType : eskip .LBBackend ,
97
97
LBAlgorithm : "consistentHash" ,
98
- LBEndpoints : []string { "https://www.example.org" },
98
+ LBEndpoints : []* eskip. LBEndpoint {{ Address : "https://www.example.org" } },
99
99
},
100
100
}
101
101
@@ -125,7 +125,7 @@ func TestSelectAlgorithm(t *testing.T) {
125
125
Route : eskip.Route {
126
126
BackendType : eskip .LBBackend ,
127
127
LBAlgorithm : "random" ,
128
- LBEndpoints : []string { "https://www.example.org" },
128
+ LBEndpoints : []* eskip. LBEndpoint {{ Address : "https://www.example.org" } },
129
129
},
130
130
}
131
131
@@ -155,7 +155,7 @@ func TestSelectAlgorithm(t *testing.T) {
155
155
Route : eskip.Route {
156
156
BackendType : eskip .LBBackend ,
157
157
LBAlgorithm : "powerOfRandomNChoices" ,
158
- LBEndpoints : []string { "https://www.example.org" },
158
+ LBEndpoints : []* eskip. LBEndpoint {{ Address : "https://www.example.org" } },
159
159
},
160
160
}
161
161
@@ -183,7 +183,7 @@ func TestSelectAlgorithm(t *testing.T) {
183
183
Route : eskip.Route {
184
184
BackendType : eskip .LBBackend ,
185
185
LBAlgorithm : "fooBar" ,
186
- LBEndpoints : []string { "https://www.example.org" },
186
+ LBEndpoints : []* eskip. LBEndpoint {{ Address : "https://www.example.org" } },
187
187
},
188
188
}
189
189
@@ -214,13 +214,13 @@ func TestSelectAlgorithm(t *testing.T) {
214
214
Route : eskip.Route {
215
215
BackendType : eskip .LBBackend ,
216
216
LBAlgorithm : "roundRobin" ,
217
- LBEndpoints : []string { "://www.example.org" },
217
+ LBEndpoints : []* eskip. LBEndpoint {{ Address : "://www.example.org" } },
218
218
},
219
219
}
220
220
221
221
rr := p .Do ([]* routing.Route {r })
222
222
if len (rr ) != 0 {
223
- t .Fatal ("failed to drop invalid LB route" )
223
+ t .Fatalf ("failed to drop invalid LB route: %s" , rr [ 0 ]. String () )
224
224
}
225
225
})
226
226
}
@@ -270,7 +270,7 @@ func TestApply(t *testing.T) {
270
270
Route : eskip.Route {
271
271
BackendType : eskip .LBBackend ,
272
272
LBAlgorithm : tt .algorithmName ,
273
- LBEndpoints : eps ,
273
+ LBEndpoints : eskip . NewLBEndpoints ( eps ) ,
274
274
},
275
275
}
276
276
rt := p .Do ([]* routing.Route {r })
@@ -304,7 +304,7 @@ func TestConsistentHashSearch(t *testing.T) {
304
304
Route : eskip.Route {
305
305
BackendType : eskip .LBBackend ,
306
306
LBAlgorithm : ConsistentHash .String (),
307
- LBEndpoints : endpoints ,
307
+ LBEndpoints : eskip . NewLBEndpoints ( endpoints ) ,
308
308
},
309
309
}
310
310
p .Do ([]* routing.Route {r })
@@ -344,7 +344,7 @@ func TestConsistentHashBoundedLoadSearch(t *testing.T) {
344
344
Route : eskip.Route {
345
345
BackendType : eskip .LBBackend ,
346
346
LBAlgorithm : ConsistentHash .String (),
347
- LBEndpoints : endpoints ,
347
+ LBEndpoints : eskip . NewLBEndpoints ( endpoints ) ,
348
348
},
349
349
}})[0 ]
350
350
@@ -397,7 +397,7 @@ func TestConsistentHashKey(t *testing.T) {
397
397
Route : eskip.Route {
398
398
BackendType : eskip .LBBackend ,
399
399
LBAlgorithm : ConsistentHash .String (),
400
- LBEndpoints : endpoints ,
400
+ LBEndpoints : eskip . NewLBEndpoints ( endpoints ) ,
401
401
},
402
402
}})[0 ]
403
403
@@ -424,7 +424,7 @@ func TestConsistentHashBoundedLoadDistribution(t *testing.T) {
424
424
Route : eskip.Route {
425
425
BackendType : eskip .LBBackend ,
426
426
LBAlgorithm : ConsistentHash .String (),
427
- LBEndpoints : endpoints ,
427
+ LBEndpoints : eskip . NewLBEndpoints ( endpoints ) ,
428
428
},
429
429
}})[0 ]
430
430
0 commit comments