(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestClientCreatePartitions(t *testing.T) { |
| 11 | if !ktesting.KafkaIsAtLeast("1.0.1") { |
| 12 | return |
| 13 | } |
| 14 | |
| 15 | client, shutdown := newLocalClient() |
| 16 | defer shutdown() |
| 17 | |
| 18 | topic := makeTopic() |
| 19 | createTopic(t, topic, 1) |
| 20 | defer deleteTopic(t, topic) |
| 21 | |
| 22 | res, err := client.CreatePartitions(context.Background(), &CreatePartitionsRequest{ |
| 23 | Topics: []TopicPartitionsConfig{ |
| 24 | { |
| 25 | Name: topic, |
| 26 | Count: 2, |
| 27 | TopicPartitionAssignments: []TopicPartitionAssignment{ |
| 28 | { |
| 29 | BrokerIDs: []int32{1}, |
| 30 | }, |
| 31 | }, |
| 32 | }, |
| 33 | }, |
| 34 | ValidateOnly: false, |
| 35 | }) |
| 36 | if err != nil { |
| 37 | t.Fatal(err) |
| 38 | } |
| 39 | |
| 40 | if err := res.Errors[topic]; err != nil { |
| 41 | t.Error(err) |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | func TestClientCreatePartitionsNoAssignments(t *testing.T) { |
| 46 | if !ktesting.KafkaIsAtLeast("1.0.1") { |
nothing calls this directly
no test coverage detected