(t *testing.T)
| 1439 | } |
| 1440 | |
| 1441 | func TestClusterAdminIncrementalAlterConfigWithErrorCode(t *testing.T) { |
| 1442 | seedBroker := NewMockBroker(t, 1) |
| 1443 | defer seedBroker.Close() |
| 1444 | |
| 1445 | seedBroker.SetHandlerByMap(map[string]MockResponse{ |
| 1446 | "MetadataRequest": NewMockMetadataResponse(t). |
| 1447 | SetController(seedBroker.BrokerID()). |
| 1448 | SetBroker(seedBroker.Addr(), seedBroker.BrokerID()), |
| 1449 | "IncrementalAlterConfigsRequest": NewMockIncrementalAlterConfigsResponseWithErrorCode(t), |
| 1450 | }) |
| 1451 | |
| 1452 | config := NewTestConfig() |
| 1453 | config.Version = V2_3_0_0 |
| 1454 | admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config) |
| 1455 | if err != nil { |
| 1456 | t.Fatal(err) |
| 1457 | } |
| 1458 | defer func() { |
| 1459 | _ = admin.Close() |
| 1460 | }() |
| 1461 | |
| 1462 | var value string |
| 1463 | entries := make(map[string]IncrementalAlterConfigsEntry) |
| 1464 | value = "60000" |
| 1465 | entries["retention.ms"] = IncrementalAlterConfigsEntry{ |
| 1466 | Operation: IncrementalAlterConfigsOperationSet, |
| 1467 | Value: &value, |
| 1468 | } |
| 1469 | value = "1073741824" |
| 1470 | entries["segment.bytes"] = IncrementalAlterConfigsEntry{ |
| 1471 | Operation: IncrementalAlterConfigsOperationDelete, |
| 1472 | Value: &value, |
| 1473 | } |
| 1474 | err = admin.IncrementalAlterConfig(TopicResource, "my_topic", entries, false) |
| 1475 | if err == nil { |
| 1476 | t.Fatal(errors.New("ErrorCode present but no Error returned")) |
| 1477 | } |
| 1478 | if !errors.Is(err, ErrInvalidConfig) { |
| 1479 | t.Fatal(errors.New("ErrorCode present but not wrapped into returned error")) |
| 1480 | } |
| 1481 | } |
| 1482 | |
| 1483 | func TestClusterAdminIncrementalAlterBrokerConfig(t *testing.T) { |
| 1484 | controllerBroker := NewMockBroker(t, 1) |
nothing calls this directly
no test coverage detected