MCPcopy
hub / github.com/IBM/sarama / initPartitionOffsetManager

Function initPartitionOffsetManager

offset_manager_test.go:67–84  ·  view source on GitHub ↗
(t *testing.T, om OffsetManager,
	coordinator *MockBroker, initialOffset int64, metadata string,
)

Source from the content-addressed store, hash-verified

65}
66
67func 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
86func TestNewOffsetManager(t *testing.T) {
87 seedBroker := NewMockBroker(t, 1)

Calls 4

ReturnsMethod · 0.80
FatalMethod · 0.80
ManagePartitionMethod · 0.65
AddBlockMethod · 0.45

Tested by

no test coverage detected