(t *testing.T)
| 560 | } |
| 561 | |
| 562 | func TestClusterAdminAlterPartitionReassignmentsWithDiffVersion(t *testing.T) { |
| 563 | seedBroker := NewMockBroker(t, 1) |
| 564 | defer seedBroker.Close() |
| 565 | |
| 566 | secondBroker := NewMockBroker(t, 2) |
| 567 | defer secondBroker.Close() |
| 568 | |
| 569 | seedBroker.SetHandlerByMap(map[string]MockResponse{ |
| 570 | "MetadataRequest": NewMockMetadataResponse(t). |
| 571 | SetController(secondBroker.BrokerID()). |
| 572 | SetBroker(seedBroker.Addr(), seedBroker.BrokerID()). |
| 573 | SetBroker(secondBroker.Addr(), secondBroker.BrokerID()), |
| 574 | }) |
| 575 | |
| 576 | secondBroker.SetHandlerByMap(map[string]MockResponse{ |
| 577 | "AlterPartitionReassignmentsRequest": NewMockAlterPartitionReassignmentsResponse(t), |
| 578 | }) |
| 579 | |
| 580 | config := NewTestConfig() |
| 581 | config.Version = V2_3_0_0 |
| 582 | admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config) |
| 583 | if err != nil { |
| 584 | t.Fatal(err) |
| 585 | } |
| 586 | |
| 587 | topicAssignment := make([][]int32, 0, 3) |
| 588 | |
| 589 | err = admin.AlterPartitionReassignments("my_topic", topicAssignment) |
| 590 | |
| 591 | if !strings.ContainsAny(err.Error(), ErrUnsupportedVersion.Error()) { |
| 592 | t.Fatal(err) |
| 593 | } |
| 594 | |
| 595 | err = admin.Close() |
| 596 | if err != nil { |
| 597 | t.Fatal(err) |
| 598 | } |
| 599 | } |
| 600 | |
| 601 | func TestClusterAdminListPartitionReassignments(t *testing.T) { |
| 602 | seedBroker := NewMockBroker(t, 1) |
nothing calls this directly
no test coverage detected