MCPcopy
hub / github.com/segmentio/kafka-go / testReaderConsumerGroupHandshake

Function testReaderConsumerGroupHandshake

reader_test.go:893–917  ·  view source on GitHub ↗
(t *testing.T, ctx context.Context, r *Reader)

Source from the content-addressed store, hash-verified

891}
892
893func testReaderConsumerGroupHandshake(t *testing.T, ctx context.Context, r *Reader) {
894 prepareReader(t, context.Background(), r, makeTestSequence(5)...)
895
896 m, err := r.ReadMessage(ctx)
897 if err != nil {
898 t.Errorf("bad err: %v", err)
899 }
900 if m.Topic != r.config.Topic {
901 t.Errorf("topic not set")
902 }
903 if m.Offset != 0 {
904 t.Errorf("offset not set")
905 }
906
907 m, err = r.ReadMessage(ctx)
908 if err != nil {
909 t.Errorf("bad err: %v", err)
910 }
911 if m.Topic != r.config.Topic {
912 t.Errorf("topic not set")
913 }
914 if m.Offset != 1 {
915 t.Errorf("offset not set")
916 }
917}
918
919func testReaderConsumerGroupVerifyOffsetCommitted(t *testing.T, ctx context.Context, r *Reader) {
920 prepareReader(t, context.Background(), r, makeTestSequence(3)...)

Callers

nothing calls this directly

Calls 3

prepareReaderFunction · 0.85
makeTestSequenceFunction · 0.85
ReadMessageMethod · 0.45

Tested by

no test coverage detected