(t *testing.T)
| 1195 | } |
| 1196 | |
| 1197 | func TestClusterAdminDescribeConfigWithErrorCode(t *testing.T) { |
| 1198 | seedBroker := NewMockBroker(t, 1) |
| 1199 | defer seedBroker.Close() |
| 1200 | |
| 1201 | seedBroker.SetHandlerByMap(map[string]MockResponse{ |
| 1202 | "MetadataRequest": NewMockMetadataResponse(t). |
| 1203 | SetController(seedBroker.BrokerID()). |
| 1204 | SetBroker(seedBroker.Addr(), seedBroker.BrokerID()), |
| 1205 | "DescribeConfigsRequest": NewMockDescribeConfigsResponseWithErrorCode(t), |
| 1206 | }) |
| 1207 | |
| 1208 | config := NewTestConfig() |
| 1209 | config.Version = V1_1_0_0 |
| 1210 | admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config) |
| 1211 | if err != nil { |
| 1212 | t.Fatal(err) |
| 1213 | } |
| 1214 | defer func() { |
| 1215 | _ = admin.Close() |
| 1216 | }() |
| 1217 | |
| 1218 | resource := ConfigResource{ |
| 1219 | Name: "r1", |
| 1220 | Type: TopicResource, |
| 1221 | ConfigNames: []string{"my_topic"}, |
| 1222 | } |
| 1223 | |
| 1224 | _, err = admin.DescribeConfig(resource) |
| 1225 | if err == nil { |
| 1226 | t.Fatal(errors.New("ErrorCode present but no Error returned")) |
| 1227 | } |
| 1228 | } |
| 1229 | |
| 1230 | // TestClusterAdminDescribeBrokerConfig ensures that a describe broker config |
| 1231 | // is sent to the broker in the resource struct, _not_ the controller |
nothing calls this directly
no test coverage detected