(t *testing.T)
| 462 | } |
| 463 | |
| 464 | func TestClusterAdminCreatePartitionsWithDiffVersion(t *testing.T) { |
| 465 | seedBroker := NewMockBroker(t, 1) |
| 466 | defer seedBroker.Close() |
| 467 | |
| 468 | seedBroker.SetHandlerByMap(map[string]MockResponse{ |
| 469 | "MetadataRequest": NewMockMetadataResponse(t). |
| 470 | SetController(seedBroker.BrokerID()). |
| 471 | SetBroker(seedBroker.Addr(), seedBroker.BrokerID()), |
| 472 | "CreatePartitionsRequest": NewMockCreatePartitionsResponse(t), |
| 473 | }) |
| 474 | |
| 475 | config := NewTestConfig() |
| 476 | config.Version = V0_10_2_0 |
| 477 | admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config) |
| 478 | if err != nil { |
| 479 | t.Fatal(err) |
| 480 | } |
| 481 | |
| 482 | err = admin.CreatePartitions("my_topic", 3, nil, false) |
| 483 | if !errors.Is(err, ErrUnsupportedVersion) { |
| 484 | t.Fatal(err) |
| 485 | } |
| 486 | |
| 487 | err = admin.Close() |
| 488 | if err != nil { |
| 489 | t.Fatal(err) |
| 490 | } |
| 491 | } |
| 492 | |
| 493 | func TestClusterAdminCreatePartitionsWithoutAuthorization(t *testing.T) { |
| 494 | seedBroker := NewMockBroker(t, 1) |
nothing calls this directly
no test coverage detected