(t *testing.T)
| 136 | } |
| 137 | |
| 138 | func TestProduceSetRequestBuilding(t *testing.T) { |
| 139 | parent, ps := makeProduceSet() |
| 140 | parent.conf.Producer.RequiredAcks = WaitForAll |
| 141 | parent.conf.Producer.Timeout = 10 * time.Second |
| 142 | |
| 143 | msg := &ProducerMessage{ |
| 144 | Topic: "t1", |
| 145 | Partition: 0, |
| 146 | Key: StringEncoder(TestMessage), |
| 147 | Value: StringEncoder(TestMessage), |
| 148 | } |
| 149 | for range 10 { |
| 150 | safeAddMessage(t, ps, msg) |
| 151 | } |
| 152 | msg.Partition = 1 |
| 153 | for range 10 { |
| 154 | safeAddMessage(t, ps, msg) |
| 155 | } |
| 156 | msg.Topic = "t2" |
| 157 | for range 10 { |
| 158 | safeAddMessage(t, ps, msg) |
| 159 | } |
| 160 | |
| 161 | req := ps.buildRequest() |
| 162 | |
| 163 | if req.RequiredAcks != WaitForAll { |
| 164 | t.Error("RequiredAcks not set properly") |
| 165 | } |
| 166 | |
| 167 | if req.Timeout != 10000 { |
| 168 | t.Error("Timeout not set properly") |
| 169 | } |
| 170 | |
| 171 | if len(req.records) != 2 { |
| 172 | t.Error("Wrong number of topics in request") |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | func TestProduceSetCompressedRequestBuilding(t *testing.T) { |
| 177 | parent, ps := makeProduceSet() |
nothing calls this directly
no test coverage detected