@@ -161,7 +161,7 @@ func TestClusterAdminListTopics(t *testing.T) {
161
161
t .Fatal (err )
162
162
}
163
163
164
- if len (entries ) < = 0 {
164
+ if len (entries ) = = 0 {
165
165
t .Fatal (errors .New ("no resource present" ))
166
166
}
167
167
@@ -447,10 +447,10 @@ func TestClusterAdminListPartitionReassignments(t *testing.T) {
447
447
partitionStatus , ok := response ["my_topic" ]
448
448
if ! ok {
449
449
t .Fatalf ("topic missing in response" )
450
- } else {
451
- if len ( partitionStatus ) != 2 {
452
- t . Fatalf ( "partition missing in response" )
453
- }
450
+ }
451
+
452
+ if len ( partitionStatus ) != 2 {
453
+ t . Fatalf ( "partition missing in response" )
454
454
}
455
455
456
456
err = admin .Close ()
@@ -711,47 +711,49 @@ func TestClusterAdminDescribeConfig(t *testing.T) {
711
711
{V2_0_0_0 , 2 , true },
712
712
}
713
713
for _ , tt := range tests {
714
- config := NewTestConfig ()
715
- config .Version = tt .saramaVersion
716
- admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
717
- if err != nil {
718
- t .Fatal (err )
719
- }
720
- defer func () {
721
- _ = admin .Close ()
722
- }()
723
-
724
- resource := ConfigResource {
725
- Name : "r1" ,
726
- Type : TopicResource ,
727
- ConfigNames : []string {"my_topic" },
728
- }
714
+ t .Run (tt .saramaVersion .String (), func (t * testing.T ) {
715
+ config := NewTestConfig ()
716
+ config .Version = tt .saramaVersion
717
+ admin , err := NewClusterAdmin ([]string {seedBroker .Addr ()}, config )
718
+ if err != nil {
719
+ t .Fatal (err )
720
+ }
721
+ defer func () {
722
+ _ = admin .Close ()
723
+ }()
724
+
725
+ resource := ConfigResource {
726
+ Name : "r1" ,
727
+ Type : TopicResource ,
728
+ ConfigNames : []string {"my_topic" },
729
+ }
729
730
730
- entries , err := admin .DescribeConfig (resource )
731
- if err != nil {
732
- t .Fatal (err )
733
- }
731
+ entries , err := admin .DescribeConfig (resource )
732
+ if err != nil {
733
+ t .Fatal (err )
734
+ }
734
735
735
- history := seedBroker .History ()
736
- describeReq , ok := history [len (history )- 1 ].Request .(* DescribeConfigsRequest )
737
- if ! ok {
738
- t .Fatal ("failed to find DescribeConfigsRequest in mockBroker history" )
739
- }
736
+ history := seedBroker .History ()
737
+ describeReq , ok := history [len (history )- 1 ].Request .(* DescribeConfigsRequest )
738
+ if ! ok {
739
+ t .Fatal ("failed to find DescribeConfigsRequest in mockBroker history" )
740
+ }
740
741
741
- if describeReq .Version != tt .requestVersion {
742
- t .Fatalf (
743
- "requestVersion %v did not match expected %v" ,
744
- describeReq .Version , tt .requestVersion )
745
- }
742
+ if describeReq .Version != tt .requestVersion {
743
+ t .Fatalf (
744
+ "requestVersion %v did not match expected %v" ,
745
+ describeReq .Version , tt .requestVersion )
746
+ }
746
747
747
- if len (entries ) <= 0 {
748
- t .Fatal (errors .New ("no resource present" ))
749
- }
750
- if tt .includeSynonyms {
751
- if len (entries [0 ].Synonyms ) == 0 {
752
- t .Fatal ("expected synonyms to have been included" )
748
+ if len (entries ) == 0 {
749
+ t .Fatal (errors .New ("no resource present" ))
753
750
}
754
- }
751
+ if tt .includeSynonyms {
752
+ if len (entries [0 ].Synonyms ) == 0 {
753
+ t .Fatal ("expected synonyms to have been included" )
754
+ }
755
+ }
756
+ })
755
757
}
756
758
}
757
759
@@ -829,7 +831,7 @@ func TestClusterAdminDescribeBrokerConfig(t *testing.T) {
829
831
t .Fatal (err )
830
832
}
831
833
832
- if len (entries ) < = 0 {
834
+ if len (entries ) = = 0 {
833
835
t .Fatal (errors .New ("no resource present" ))
834
836
}
835
837
}
@@ -1245,7 +1247,7 @@ func TestClusterAdminListAcls(t *testing.T) {
1245
1247
if err != nil {
1246
1248
t .Fatal (err )
1247
1249
}
1248
- if len (rAcls ) < = 0 {
1250
+ if len (rAcls ) = = 0 {
1249
1251
t .Fatal ("no acls present" )
1250
1252
}
1251
1253
0 commit comments