(t *testing.T)
| 526 | } |
| 527 | |
| 528 | func TestClusterAdminCreatePartitionsWithDiffVersion(t *testing.T) { |
| 529 | seedBroker := NewMockBroker(t, 1) |
| 530 | defer seedBroker.Close() |
| 531 | |
| 532 | seedBroker.SetHandlerByMap(map[string]MockResponse{ |
| 533 | "MetadataRequest": NewMockMetadataResponse(t). |
| 534 | SetController(seedBroker.BrokerID()). |
| 535 | SetBroker(seedBroker.Addr(), seedBroker.BrokerID()), |
| 536 | "CreatePartitionsRequest": NewMockCreatePartitionsResponse(t), |
| 537 | }) |
| 538 | |
| 539 | config := NewTestConfig() |
| 540 | config.Version = V0_10_2_0 |
| 541 | admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config) |
| 542 | if err != nil { |
| 543 | t.Fatal(err) |
| 544 | } |
| 545 | |
| 546 | err = admin.CreatePartitions("my_topic", 3, nil, false) |
| 547 | if !errors.Is(err, ErrUnsupportedVersion) { |
| 548 | t.Fatal(err) |
| 549 | } |
| 550 | |
| 551 | err = admin.Close() |
| 552 | if err != nil { |
| 553 | t.Fatal(err) |
| 554 | } |
| 555 | } |
| 556 | |
| 557 | func TestClusterAdminCreatePartitionsWithoutAuthorization(t *testing.T) { |
| 558 | seedBroker := NewMockBroker(t, 1) |
nothing calls this directly
no test coverage detected