(t *testing.T)
| 1313 | } |
| 1314 | |
| 1315 | func TestClusterAdminAlterConfigWithErrorCode(t *testing.T) { |
| 1316 | seedBroker := NewMockBroker(t, 1) |
| 1317 | defer seedBroker.Close() |
| 1318 | |
| 1319 | seedBroker.SetHandlerByMap(map[string]MockResponse{ |
| 1320 | "MetadataRequest": NewMockMetadataResponse(t). |
| 1321 | SetController(seedBroker.BrokerID()). |
| 1322 | SetBroker(seedBroker.Addr(), seedBroker.BrokerID()), |
| 1323 | "AlterConfigsRequest": NewMockAlterConfigsResponseWithErrorCode(t), |
| 1324 | }) |
| 1325 | |
| 1326 | config := NewTestConfig() |
| 1327 | config.Version = V1_0_0_0 |
| 1328 | admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config) |
| 1329 | if err != nil { |
| 1330 | t.Fatal(err) |
| 1331 | } |
| 1332 | defer func() { |
| 1333 | _ = admin.Close() |
| 1334 | }() |
| 1335 | |
| 1336 | var value string |
| 1337 | entries := make(map[string]*string) |
| 1338 | value = "60000" |
| 1339 | entries["retention.ms"] = &value |
| 1340 | err = admin.AlterConfig(TopicResource, "my_topic", entries, false) |
| 1341 | if err == nil { |
| 1342 | t.Fatal(errors.New("ErrorCode present but no Error returned")) |
| 1343 | } |
| 1344 | } |
| 1345 | |
| 1346 | func TestClusterAdminAlterBrokerConfig(t *testing.T) { |
| 1347 | controllerBroker := NewMockBroker(t, 1) |
nothing calls this directly
no test coverage detected