(t *testing.T)
| 42 | } |
| 43 | |
| 44 | func TestClientProduce(t *testing.T) { |
| 45 | client, topic, shutdown := newLocalClientAndTopic() |
| 46 | defer shutdown() |
| 47 | |
| 48 | now := time.Now() |
| 49 | |
| 50 | res, err := client.Produce(context.Background(), &ProduceRequest{ |
| 51 | Topic: topic, |
| 52 | Partition: 0, |
| 53 | RequiredAcks: -1, |
| 54 | Records: NewRecordReader( |
| 55 | Record{Time: now, Value: NewBytes([]byte(`hello-1`))}, |
| 56 | Record{Time: now, Value: NewBytes([]byte(`hello-2`))}, |
| 57 | Record{Time: now, Value: NewBytes([]byte(`hello-3`))}, |
| 58 | ), |
| 59 | }) |
| 60 | |
| 61 | if err != nil { |
| 62 | t.Fatal(err) |
| 63 | } |
| 64 | |
| 65 | if res.Error != nil { |
| 66 | t.Error(res.Error) |
| 67 | } |
| 68 | |
| 69 | for index, err := range res.RecordErrors { |
| 70 | t.Errorf("record at index %d produced an error: %v", index, err) |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | func TestClientProduceCompressed(t *testing.T) { |
| 75 | client, topic, shutdown := newLocalClientAndTopic() |
nothing calls this directly
no test coverage detected