@@ -16,7 +16,7 @@ func TestClusterAdmin(t *testing.T) {
16
16
SetBroker (seedBroker .Addr (), seedBroker .BrokerID ()),
17
17
})
18
18
19
- config := NewConfig ()
19
+ config := NewTestConfig ()
20
20
config .Version = V1_0_0_0
21
21
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
22
22
if err != nil {
@@ -38,7 +38,7 @@ func TestClusterAdminInvalidController(t *testing.T) {
38
38
SetBroker (seedBroker .Addr (), seedBroker .BrokerID ()),
39
39
})
40
40
41
- config := NewConfig ()
41
+ config := NewTestConfig ()
42
42
config .Version = V1_0_0_0
43
43
_ , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
44
44
if err == nil {
@@ -61,7 +61,7 @@ func TestClusterAdminCreateTopic(t *testing.T) {
61
61
"CreateTopicsRequest" : NewMockCreateTopicsResponse (t ),
62
62
})
63
63
64
- config := NewConfig ()
64
+ config := NewTestConfig ()
65
65
config .Version = V0_10_2_0
66
66
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
67
67
if err != nil {
@@ -89,7 +89,7 @@ func TestClusterAdminCreateTopicWithInvalidTopicDetail(t *testing.T) {
89
89
"CreateTopicsRequest" : NewMockCreateTopicsResponse (t ),
90
90
})
91
91
92
- config := NewConfig ()
92
+ config := NewTestConfig ()
93
93
config .Version = V0_10_2_0
94
94
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
95
95
if err != nil {
@@ -117,7 +117,7 @@ func TestClusterAdminCreateTopicWithoutAuthorization(t *testing.T) {
117
117
"CreateTopicsRequest" : NewMockCreateTopicsResponse (t ),
118
118
})
119
119
120
- config := NewConfig ()
120
+ config := NewTestConfig ()
121
121
config .Version = V0_11_0_0
122
122
123
123
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
@@ -148,7 +148,7 @@ func TestClusterAdminListTopics(t *testing.T) {
148
148
"DescribeConfigsRequest" : NewMockDescribeConfigsResponse (t ),
149
149
})
150
150
151
- config := NewConfig ()
151
+ config := NewTestConfig ()
152
152
config .Version = V1_1_0_0
153
153
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
154
154
if err != nil {
@@ -198,7 +198,7 @@ func TestClusterAdminDeleteTopic(t *testing.T) {
198
198
"DeleteTopicsRequest" : NewMockDeleteTopicsResponse (t ),
199
199
})
200
200
201
- config := NewConfig ()
201
+ config := NewTestConfig ()
202
202
config .Version = V0_10_2_0
203
203
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
204
204
if err != nil {
@@ -227,7 +227,7 @@ func TestClusterAdminDeleteEmptyTopic(t *testing.T) {
227
227
"DeleteTopicsRequest" : NewMockDeleteTopicsResponse (t ),
228
228
})
229
229
230
- config := NewConfig ()
230
+ config := NewTestConfig ()
231
231
config .Version = V0_10_2_0
232
232
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
233
233
if err != nil {
@@ -256,7 +256,7 @@ func TestClusterAdminCreatePartitions(t *testing.T) {
256
256
"CreatePartitionsRequest" : NewMockCreatePartitionsResponse (t ),
257
257
})
258
258
259
- config := NewConfig ()
259
+ config := NewTestConfig ()
260
260
config .Version = V1_0_0_0
261
261
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
262
262
if err != nil {
@@ -285,7 +285,7 @@ func TestClusterAdminCreatePartitionsWithDiffVersion(t *testing.T) {
285
285
"CreatePartitionsRequest" : NewMockCreatePartitionsResponse (t ),
286
286
})
287
287
288
- config := NewConfig ()
288
+ config := NewTestConfig ()
289
289
config .Version = V0_10_2_0
290
290
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
291
291
if err != nil {
@@ -314,7 +314,7 @@ func TestClusterAdminCreatePartitionsWithoutAuthorization(t *testing.T) {
314
314
"CreatePartitionsRequest" : NewMockCreatePartitionsResponse (t ),
315
315
})
316
316
317
- config := NewConfig ()
317
+ config := NewTestConfig ()
318
318
config .Version = V1_0_0_0
319
319
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
320
320
if err != nil {
@@ -350,7 +350,7 @@ func TestClusterAdminAlterPartitionReassignments(t *testing.T) {
350
350
"AlterPartitionReassignmentsRequest" : NewMockAlterPartitionReassignmentsResponse (t ),
351
351
})
352
352
353
- config := NewConfig ()
353
+ config := NewTestConfig ()
354
354
config .Version = V2_4_0_0
355
355
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
356
356
if err != nil {
@@ -388,7 +388,7 @@ func TestClusterAdminAlterPartitionReassignmentsWithDiffVersion(t *testing.T) {
388
388
"AlterPartitionReassignmentsRequest" : NewMockAlterPartitionReassignmentsResponse (t ),
389
389
})
390
390
391
- config := NewConfig ()
391
+ config := NewTestConfig ()
392
392
config .Version = V2_3_0_0
393
393
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
394
394
if err != nil {
@@ -427,7 +427,7 @@ func TestClusterAdminListPartitionReassignments(t *testing.T) {
427
427
"ListPartitionReassignmentsRequest" : NewMockListPartitionReassignmentsResponse (t ),
428
428
})
429
429
430
- config := NewConfig ()
430
+ config := NewTestConfig ()
431
431
config .Version = V2_4_0_0
432
432
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
433
433
if err != nil {
@@ -472,7 +472,7 @@ func TestClusterAdminListPartitionReassignmentsWithDiffVersion(t *testing.T) {
472
472
"ListPartitionReassignmentsRequest" : NewMockListPartitionReassignmentsResponse (t ),
473
473
})
474
474
475
- config := NewConfig ()
475
+ config := NewTestConfig ()
476
476
config .Version = V2_3_0_0
477
477
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
478
478
if err != nil {
@@ -508,7 +508,7 @@ func TestClusterAdminDeleteRecords(t *testing.T) {
508
508
"DeleteRecordsRequest" : NewMockDeleteRecordsResponse (t ),
509
509
})
510
510
511
- config := NewConfig ()
511
+ config := NewTestConfig ()
512
512
config .Version = V1_0_0_0
513
513
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
514
514
if err != nil {
@@ -567,7 +567,7 @@ func TestClusterAdminDeleteRecordsWithInCorrectBroker(t *testing.T) {
567
567
"DeleteRecordsRequest" : NewMockDeleteRecordsResponse (t ),
568
568
})
569
569
570
- config := NewConfig ()
570
+ config := NewTestConfig ()
571
571
config .Version = V1_0_0_0
572
572
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
573
573
if err != nil {
@@ -604,7 +604,7 @@ func TestClusterAdminDeleteRecordsWithDiffVersion(t *testing.T) {
604
604
"DeleteRecordsRequest" : NewMockDeleteRecordsResponse (t ),
605
605
})
606
606
607
- config := NewConfig ()
607
+ config := NewTestConfig ()
608
608
config .Version = V0_10_2_0
609
609
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
610
610
if err != nil {
@@ -660,7 +660,7 @@ func TestClusterAdminDescribeConfig(t *testing.T) {
660
660
{V2_0_0_0 , 2 , true },
661
661
}
662
662
for _ , tt := range tests {
663
- config := NewConfig ()
663
+ config := NewTestConfig ()
664
664
config .Version = tt .saramaVersion
665
665
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
666
666
if err != nil {
@@ -715,7 +715,7 @@ func TestClusterAdminDescribeConfigWithErrorCode(t *testing.T) {
715
715
"DescribeConfigsRequest" : NewMockDescribeConfigsResponseWithErrorCode (t ),
716
716
})
717
717
718
- config := NewConfig ()
718
+ config := NewTestConfig ()
719
719
config .Version = V1_1_0_0
720
720
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
721
721
if err != nil {
@@ -760,7 +760,7 @@ func TestClusterAdminDescribeBrokerConfig(t *testing.T) {
760
760
"DescribeConfigsRequest" : NewMockDescribeConfigsResponse (t ),
761
761
})
762
762
763
- config := NewConfig ()
763
+ config := NewTestConfig ()
764
764
config .Version = V1_0_0_0
765
765
admin , err := NewClusterAdmin (
766
766
[]string {
@@ -800,7 +800,7 @@ func TestClusterAdminAlterConfig(t *testing.T) {
800
800
"AlterConfigsRequest" : NewMockAlterConfigsResponse (t ),
801
801
})
802
802
803
- config := NewConfig ()
803
+ config := NewTestConfig ()
804
804
config .Version = V1_0_0_0
805
805
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
806
806
if err != nil {
@@ -833,7 +833,7 @@ func TestClusterAdminAlterConfigWithErrorCode(t *testing.T) {
833
833
"AlterConfigsRequest" : NewMockAlterConfigsResponseWithErrorCode (t ),
834
834
})
835
835
836
- config := NewConfig ()
836
+ config := NewTestConfig ()
837
837
config .Version = V1_0_0_0
838
838
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
839
839
if err != nil {
@@ -873,7 +873,7 @@ func TestClusterAdminAlterBrokerConfig(t *testing.T) {
873
873
"AlterConfigsRequest" : NewMockAlterConfigsResponse (t ),
874
874
})
875
875
876
- config := NewConfig ()
876
+ config := NewTestConfig ()
877
877
config .Version = V1_0_0_0
878
878
admin , err := NewClusterAdmin (
879
879
[]string {
@@ -918,7 +918,7 @@ func TestClusterAdminCreateAcl(t *testing.T) {
918
918
"CreateAclsRequest" : NewMockCreateAclsResponse (t ),
919
919
})
920
920
921
- config := NewConfig ()
921
+ config := NewTestConfig ()
922
922
config .Version = V1_0_0_0
923
923
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
924
924
if err != nil {
@@ -951,7 +951,7 @@ func TestClusterAdminListAcls(t *testing.T) {
951
951
"CreateAclsRequest" : NewMockCreateAclsResponse (t ),
952
952
})
953
953
954
- config := NewConfig ()
954
+ config := NewTestConfig ()
955
955
config .Version = V1_0_0_0
956
956
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
957
957
if err != nil {
@@ -997,7 +997,7 @@ func TestClusterAdminDeleteAcl(t *testing.T) {
997
997
"DeleteAclsRequest" : NewMockDeleteAclsResponse (t ),
998
998
})
999
999
1000
- config := NewConfig ()
1000
+ config := NewTestConfig ()
1001
1001
config .Version = V1_0_0_0
1002
1002
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
1003
1003
if err != nil {
@@ -1033,7 +1033,7 @@ func TestDescribeTopic(t *testing.T) {
1033
1033
SetBroker (seedBroker .Addr (), seedBroker .BrokerID ()),
1034
1034
})
1035
1035
1036
- config := NewConfig ()
1036
+ config := NewTestConfig ()
1037
1037
config .Version = V1_0_0_0
1038
1038
1039
1039
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
@@ -1071,7 +1071,7 @@ func TestDescribeTopicWithVersion0_11(t *testing.T) {
1071
1071
SetBroker (seedBroker .Addr (), seedBroker .BrokerID ()),
1072
1072
})
1073
1073
1074
- config := NewConfig ()
1074
+ config := NewTestConfig ()
1075
1075
config .Version = V0_11_0_0
1076
1076
1077
1077
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
@@ -1114,7 +1114,7 @@ func TestDescribeConsumerGroup(t *testing.T) {
1114
1114
"FindCoordinatorRequest" : NewMockFindCoordinatorResponse (t ).SetCoordinator (CoordinatorGroup , expectedGroupID , seedBroker ),
1115
1115
})
1116
1116
1117
- config := NewConfig ()
1117
+ config := NewTestConfig ()
1118
1118
config .Version = V1_0_0_0
1119
1119
1120
1120
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
@@ -1153,7 +1153,7 @@ func TestListConsumerGroups(t *testing.T) {
1153
1153
AddGroup ("my-group" , "consumer" ),
1154
1154
})
1155
1155
1156
- config := NewConfig ()
1156
+ config := NewTestConfig ()
1157
1157
config .Version = V1_0_0_0
1158
1158
1159
1159
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
@@ -1215,7 +1215,7 @@ func TestListConsumerGroupsMultiBroker(t *testing.T) {
1215
1215
AddGroup (secondGroup , "consumer" ),
1216
1216
})
1217
1217
1218
- config := NewConfig ()
1218
+ config := NewTestConfig ()
1219
1219
config .Version = V1_0_0_0
1220
1220
1221
1221
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
@@ -1267,7 +1267,7 @@ func TestListConsumerGroupOffsets(t *testing.T) {
1267
1267
"FindCoordinatorRequest" : NewMockFindCoordinatorResponse (t ).SetCoordinator (CoordinatorGroup , group , seedBroker ),
1268
1268
})
1269
1269
1270
- config := NewConfig ()
1270
+ config := NewTestConfig ()
1271
1271
config .Version = V1_0_0_0
1272
1272
1273
1273
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
@@ -1312,7 +1312,7 @@ func TestDeleteConsumerGroup(t *testing.T) {
1312
1312
"FindCoordinatorRequest" : NewMockFindCoordinatorResponse (t ).SetCoordinator (CoordinatorGroup , group , seedBroker ),
1313
1313
})
1314
1314
1315
- config := NewConfig ()
1315
+ config := NewTestConfig ()
1316
1316
config .Version = V1_1_0_0
1317
1317
1318
1318
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
@@ -1341,7 +1341,7 @@ func TestRefreshMetaDataWithDifferentController(t *testing.T) {
1341
1341
SetBroker (seedBroker2 .Addr (), seedBroker2 .BrokerID ()),
1342
1342
})
1343
1343
1344
- config := NewConfig ()
1344
+ config := NewTestConfig ()
1345
1345
config .Version = V1_1_0_0
1346
1346
1347
1347
client , err := NewClient ([]string {seedBroker1 .Addr ()}, config )
@@ -1386,7 +1386,7 @@ func TestDescribeLogDirs(t *testing.T) {
1386
1386
SetLogDirs ("/tmp/logs" , map [string ]int {"topic1" : 2 , "topic2" : 2 }),
1387
1387
})
1388
1388
1389
- config := NewConfig ()
1389
+ config := NewTestConfig ()
1390
1390
config .Version = V1_0_0_0
1391
1391
1392
1392
admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
0 commit comments