(t *testing.T)
| 177 | } |
| 178 | |
| 179 | func TestHashPartitionerConsistency(t *testing.T) { |
| 180 | partitioner := NewHashPartitioner("mytopic") |
| 181 | ep, ok := partitioner.(DynamicConsistencyPartitioner) |
| 182 | |
| 183 | if !ok { |
| 184 | t.Error("Hash partitioner does not implement DynamicConsistencyPartitioner") |
| 185 | } |
| 186 | |
| 187 | consistency := ep.MessageRequiresConsistency(&ProducerMessage{Key: StringEncoder("hi")}) |
| 188 | if !consistency { |
| 189 | t.Error("Messages with keys should require consistency") |
| 190 | } |
| 191 | consistency = ep.MessageRequiresConsistency(&ProducerMessage{}) |
| 192 | if consistency { |
| 193 | t.Error("Messages without keys should require consistency") |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | func TestHashPartitionerMinInt32(t *testing.T) { |
| 198 | partitioner := NewHashPartitioner("mytopic") |
nothing calls this directly
no test coverage detected