Skip to content

Commit a904204

Browse files
authored
Merge pull request #1791 from stanislavkozlovski/bump-default-version
fix: bump default version to 1.0.0
2 parents 5466b37 + 5ab6809 commit a904204

24 files changed

+200
-177
lines changed

admin_test.go

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func TestClusterAdmin(t *testing.T) {
1616
SetBroker(seedBroker.Addr(), seedBroker.BrokerID()),
1717
})
1818

19-
config := NewConfig()
19+
config := NewTestConfig()
2020
config.Version = V1_0_0_0
2121
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
2222
if err != nil {
@@ -38,7 +38,7 @@ func TestClusterAdminInvalidController(t *testing.T) {
3838
SetBroker(seedBroker.Addr(), seedBroker.BrokerID()),
3939
})
4040

41-
config := NewConfig()
41+
config := NewTestConfig()
4242
config.Version = V1_0_0_0
4343
_, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
4444
if err == nil {
@@ -61,7 +61,7 @@ func TestClusterAdminCreateTopic(t *testing.T) {
6161
"CreateTopicsRequest": NewMockCreateTopicsResponse(t),
6262
})
6363

64-
config := NewConfig()
64+
config := NewTestConfig()
6565
config.Version = V0_10_2_0
6666
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
6767
if err != nil {
@@ -89,7 +89,7 @@ func TestClusterAdminCreateTopicWithInvalidTopicDetail(t *testing.T) {
8989
"CreateTopicsRequest": NewMockCreateTopicsResponse(t),
9090
})
9191

92-
config := NewConfig()
92+
config := NewTestConfig()
9393
config.Version = V0_10_2_0
9494
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
9595
if err != nil {
@@ -117,7 +117,7 @@ func TestClusterAdminCreateTopicWithoutAuthorization(t *testing.T) {
117117
"CreateTopicsRequest": NewMockCreateTopicsResponse(t),
118118
})
119119

120-
config := NewConfig()
120+
config := NewTestConfig()
121121
config.Version = V0_11_0_0
122122

123123
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
@@ -148,7 +148,7 @@ func TestClusterAdminListTopics(t *testing.T) {
148148
"DescribeConfigsRequest": NewMockDescribeConfigsResponse(t),
149149
})
150150

151-
config := NewConfig()
151+
config := NewTestConfig()
152152
config.Version = V1_1_0_0
153153
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
154154
if err != nil {
@@ -198,7 +198,7 @@ func TestClusterAdminDeleteTopic(t *testing.T) {
198198
"DeleteTopicsRequest": NewMockDeleteTopicsResponse(t),
199199
})
200200

201-
config := NewConfig()
201+
config := NewTestConfig()
202202
config.Version = V0_10_2_0
203203
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
204204
if err != nil {
@@ -227,7 +227,7 @@ func TestClusterAdminDeleteEmptyTopic(t *testing.T) {
227227
"DeleteTopicsRequest": NewMockDeleteTopicsResponse(t),
228228
})
229229

230-
config := NewConfig()
230+
config := NewTestConfig()
231231
config.Version = V0_10_2_0
232232
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
233233
if err != nil {
@@ -256,7 +256,7 @@ func TestClusterAdminCreatePartitions(t *testing.T) {
256256
"CreatePartitionsRequest": NewMockCreatePartitionsResponse(t),
257257
})
258258

259-
config := NewConfig()
259+
config := NewTestConfig()
260260
config.Version = V1_0_0_0
261261
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
262262
if err != nil {
@@ -285,7 +285,7 @@ func TestClusterAdminCreatePartitionsWithDiffVersion(t *testing.T) {
285285
"CreatePartitionsRequest": NewMockCreatePartitionsResponse(t),
286286
})
287287

288-
config := NewConfig()
288+
config := NewTestConfig()
289289
config.Version = V0_10_2_0
290290
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
291291
if err != nil {
@@ -314,7 +314,7 @@ func TestClusterAdminCreatePartitionsWithoutAuthorization(t *testing.T) {
314314
"CreatePartitionsRequest": NewMockCreatePartitionsResponse(t),
315315
})
316316

317-
config := NewConfig()
317+
config := NewTestConfig()
318318
config.Version = V1_0_0_0
319319
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
320320
if err != nil {
@@ -350,7 +350,7 @@ func TestClusterAdminAlterPartitionReassignments(t *testing.T) {
350350
"AlterPartitionReassignmentsRequest": NewMockAlterPartitionReassignmentsResponse(t),
351351
})
352352

353-
config := NewConfig()
353+
config := NewTestConfig()
354354
config.Version = V2_4_0_0
355355
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
356356
if err != nil {
@@ -388,7 +388,7 @@ func TestClusterAdminAlterPartitionReassignmentsWithDiffVersion(t *testing.T) {
388388
"AlterPartitionReassignmentsRequest": NewMockAlterPartitionReassignmentsResponse(t),
389389
})
390390

391-
config := NewConfig()
391+
config := NewTestConfig()
392392
config.Version = V2_3_0_0
393393
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
394394
if err != nil {
@@ -427,7 +427,7 @@ func TestClusterAdminListPartitionReassignments(t *testing.T) {
427427
"ListPartitionReassignmentsRequest": NewMockListPartitionReassignmentsResponse(t),
428428
})
429429

430-
config := NewConfig()
430+
config := NewTestConfig()
431431
config.Version = V2_4_0_0
432432
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
433433
if err != nil {
@@ -472,7 +472,7 @@ func TestClusterAdminListPartitionReassignmentsWithDiffVersion(t *testing.T) {
472472
"ListPartitionReassignmentsRequest": NewMockListPartitionReassignmentsResponse(t),
473473
})
474474

475-
config := NewConfig()
475+
config := NewTestConfig()
476476
config.Version = V2_3_0_0
477477
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
478478
if err != nil {
@@ -508,7 +508,7 @@ func TestClusterAdminDeleteRecords(t *testing.T) {
508508
"DeleteRecordsRequest": NewMockDeleteRecordsResponse(t),
509509
})
510510

511-
config := NewConfig()
511+
config := NewTestConfig()
512512
config.Version = V1_0_0_0
513513
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
514514
if err != nil {
@@ -567,7 +567,7 @@ func TestClusterAdminDeleteRecordsWithInCorrectBroker(t *testing.T) {
567567
"DeleteRecordsRequest": NewMockDeleteRecordsResponse(t),
568568
})
569569

570-
config := NewConfig()
570+
config := NewTestConfig()
571571
config.Version = V1_0_0_0
572572
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
573573
if err != nil {
@@ -604,7 +604,7 @@ func TestClusterAdminDeleteRecordsWithDiffVersion(t *testing.T) {
604604
"DeleteRecordsRequest": NewMockDeleteRecordsResponse(t),
605605
})
606606

607-
config := NewConfig()
607+
config := NewTestConfig()
608608
config.Version = V0_10_2_0
609609
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
610610
if err != nil {
@@ -660,7 +660,7 @@ func TestClusterAdminDescribeConfig(t *testing.T) {
660660
{V2_0_0_0, 2, true},
661661
}
662662
for _, tt := range tests {
663-
config := NewConfig()
663+
config := NewTestConfig()
664664
config.Version = tt.saramaVersion
665665
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
666666
if err != nil {
@@ -715,7 +715,7 @@ func TestClusterAdminDescribeConfigWithErrorCode(t *testing.T) {
715715
"DescribeConfigsRequest": NewMockDescribeConfigsResponseWithErrorCode(t),
716716
})
717717

718-
config := NewConfig()
718+
config := NewTestConfig()
719719
config.Version = V1_1_0_0
720720
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
721721
if err != nil {
@@ -760,7 +760,7 @@ func TestClusterAdminDescribeBrokerConfig(t *testing.T) {
760760
"DescribeConfigsRequest": NewMockDescribeConfigsResponse(t),
761761
})
762762

763-
config := NewConfig()
763+
config := NewTestConfig()
764764
config.Version = V1_0_0_0
765765
admin, err := NewClusterAdmin(
766766
[]string{
@@ -800,7 +800,7 @@ func TestClusterAdminAlterConfig(t *testing.T) {
800800
"AlterConfigsRequest": NewMockAlterConfigsResponse(t),
801801
})
802802

803-
config := NewConfig()
803+
config := NewTestConfig()
804804
config.Version = V1_0_0_0
805805
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
806806
if err != nil {
@@ -833,7 +833,7 @@ func TestClusterAdminAlterConfigWithErrorCode(t *testing.T) {
833833
"AlterConfigsRequest": NewMockAlterConfigsResponseWithErrorCode(t),
834834
})
835835

836-
config := NewConfig()
836+
config := NewTestConfig()
837837
config.Version = V1_0_0_0
838838
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
839839
if err != nil {
@@ -873,7 +873,7 @@ func TestClusterAdminAlterBrokerConfig(t *testing.T) {
873873
"AlterConfigsRequest": NewMockAlterConfigsResponse(t),
874874
})
875875

876-
config := NewConfig()
876+
config := NewTestConfig()
877877
config.Version = V1_0_0_0
878878
admin, err := NewClusterAdmin(
879879
[]string{
@@ -918,7 +918,7 @@ func TestClusterAdminCreateAcl(t *testing.T) {
918918
"CreateAclsRequest": NewMockCreateAclsResponse(t),
919919
})
920920

921-
config := NewConfig()
921+
config := NewTestConfig()
922922
config.Version = V1_0_0_0
923923
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
924924
if err != nil {
@@ -951,7 +951,7 @@ func TestClusterAdminListAcls(t *testing.T) {
951951
"CreateAclsRequest": NewMockCreateAclsResponse(t),
952952
})
953953

954-
config := NewConfig()
954+
config := NewTestConfig()
955955
config.Version = V1_0_0_0
956956
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
957957
if err != nil {
@@ -997,7 +997,7 @@ func TestClusterAdminDeleteAcl(t *testing.T) {
997997
"DeleteAclsRequest": NewMockDeleteAclsResponse(t),
998998
})
999999

1000-
config := NewConfig()
1000+
config := NewTestConfig()
10011001
config.Version = V1_0_0_0
10021002
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
10031003
if err != nil {
@@ -1033,7 +1033,7 @@ func TestDescribeTopic(t *testing.T) {
10331033
SetBroker(seedBroker.Addr(), seedBroker.BrokerID()),
10341034
})
10351035

1036-
config := NewConfig()
1036+
config := NewTestConfig()
10371037
config.Version = V1_0_0_0
10381038

10391039
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
@@ -1071,7 +1071,7 @@ func TestDescribeTopicWithVersion0_11(t *testing.T) {
10711071
SetBroker(seedBroker.Addr(), seedBroker.BrokerID()),
10721072
})
10731073

1074-
config := NewConfig()
1074+
config := NewTestConfig()
10751075
config.Version = V0_11_0_0
10761076

10771077
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
@@ -1114,7 +1114,7 @@ func TestDescribeConsumerGroup(t *testing.T) {
11141114
"FindCoordinatorRequest": NewMockFindCoordinatorResponse(t).SetCoordinator(CoordinatorGroup, expectedGroupID, seedBroker),
11151115
})
11161116

1117-
config := NewConfig()
1117+
config := NewTestConfig()
11181118
config.Version = V1_0_0_0
11191119

11201120
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
@@ -1153,7 +1153,7 @@ func TestListConsumerGroups(t *testing.T) {
11531153
AddGroup("my-group", "consumer"),
11541154
})
11551155

1156-
config := NewConfig()
1156+
config := NewTestConfig()
11571157
config.Version = V1_0_0_0
11581158

11591159
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
@@ -1215,7 +1215,7 @@ func TestListConsumerGroupsMultiBroker(t *testing.T) {
12151215
AddGroup(secondGroup, "consumer"),
12161216
})
12171217

1218-
config := NewConfig()
1218+
config := NewTestConfig()
12191219
config.Version = V1_0_0_0
12201220

12211221
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
@@ -1267,7 +1267,7 @@ func TestListConsumerGroupOffsets(t *testing.T) {
12671267
"FindCoordinatorRequest": NewMockFindCoordinatorResponse(t).SetCoordinator(CoordinatorGroup, group, seedBroker),
12681268
})
12691269

1270-
config := NewConfig()
1270+
config := NewTestConfig()
12711271
config.Version = V1_0_0_0
12721272

12731273
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
@@ -1312,7 +1312,7 @@ func TestDeleteConsumerGroup(t *testing.T) {
13121312
"FindCoordinatorRequest": NewMockFindCoordinatorResponse(t).SetCoordinator(CoordinatorGroup, group, seedBroker),
13131313
})
13141314

1315-
config := NewConfig()
1315+
config := NewTestConfig()
13161316
config.Version = V1_1_0_0
13171317

13181318
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
@@ -1341,7 +1341,7 @@ func TestRefreshMetaDataWithDifferentController(t *testing.T) {
13411341
SetBroker(seedBroker2.Addr(), seedBroker2.BrokerID()),
13421342
})
13431343

1344-
config := NewConfig()
1344+
config := NewTestConfig()
13451345
config.Version = V1_1_0_0
13461346

13471347
client, err := NewClient([]string{seedBroker1.Addr()}, config)
@@ -1386,7 +1386,7 @@ func TestDescribeLogDirs(t *testing.T) {
13861386
SetLogDirs("/tmp/logs", map[string]int{"topic1": 2, "topic2": 2}),
13871387
})
13881388

1389-
config := NewConfig()
1389+
config := NewTestConfig()
13901390
config.Version = V1_0_0_0
13911391

13921392
admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)

0 commit comments

Comments
 (0)