(t *testing.T, om OffsetManager, coordinator *MockBroker, initialOffset int64, metadata string, )
| 65 | } |
| 66 | |
| 67 | func initPartitionOffsetManager(t *testing.T, om OffsetManager, |
| 68 | coordinator *MockBroker, initialOffset int64, metadata string, |
| 69 | ) PartitionOffsetManager { |
| 70 | fetchResponse := new(OffsetFetchResponse) |
| 71 | fetchResponse.AddBlock("my_topic", 0, &OffsetFetchResponseBlock{ |
| 72 | Err: ErrNoError, |
| 73 | Offset: initialOffset, |
| 74 | Metadata: metadata, |
| 75 | }) |
| 76 | coordinator.Returns(fetchResponse) |
| 77 | |
| 78 | pom, err := om.ManagePartition("my_topic", 0) |
| 79 | if err != nil { |
| 80 | t.Fatal(err) |
| 81 | } |
| 82 | |
| 83 | return pom |
| 84 | } |
| 85 | |
| 86 | func TestNewOffsetManager(t *testing.T) { |
| 87 | seedBroker := NewMockBroker(t, 1) |
no test coverage detected