(topic string, partitions int)
| 21 | } |
| 22 | |
| 23 | func newLocalClientWithTopic(topic string, partitions int) (*Client, func()) { |
| 24 | client, shutdown := newLocalClient() |
| 25 | if err := clientCreateTopic(client, topic, partitions); err != nil { |
| 26 | shutdown() |
| 27 | panic(err) |
| 28 | } |
| 29 | return client, func() { |
| 30 | client.DeleteTopics(context.Background(), &DeleteTopicsRequest{ |
| 31 | Topics: []string{topic}, |
| 32 | }) |
| 33 | shutdown() |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | func clientCreateTopic(client *Client, topic string, partitions int) error { |
| 38 | _, err := client.CreateTopics(context.Background(), &CreateTopicsRequest{ |
no test coverage detected