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

Function TestFuncConsumerOffsetOutOfRange

functional_consumer_test.go:24–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

22)
23
24func TestFuncConsumerOffsetOutOfRange(t *testing.T) {
25 setupFunctionalTest(t)
26 defer teardownFunctionalTest(t)
27
28 consumer, err := NewConsumer(FunctionalTestEnv.KafkaBrokerAddrs, NewFunctionalTestConfig())
29 if err != nil {
30 t.Fatal(err)
31 }
32
33 if _, err := consumer.ConsumePartition("test.1", 0, -10); !errors.Is(err, ErrOffsetOutOfRange) {
34 t.Error("Expected ErrOffsetOutOfRange, got:", err)
35 }
36
37 if _, err := consumer.ConsumePartition("test.1", 0, math.MaxInt64); !errors.Is(err, ErrOffsetOutOfRange) {
38 t.Error("Expected ErrOffsetOutOfRange, got:", err)
39 }
40
41 safeClose(t, consumer)
42}
43
44func TestConsumerHighWaterMarkOffset(t *testing.T) {
45 setupFunctionalTest(t)

Callers

nothing calls this directly

Calls 9

ConsumePartitionMethod · 0.95
setupFunctionalTestFunction · 0.85
teardownFunctionalTestFunction · 0.85
NewFunctionalTestConfigFunction · 0.85
FatalMethod · 0.80
IsMethod · 0.80
NewConsumerFunction · 0.70
safeCloseFunction · 0.70
ErrorMethod · 0.65

Tested by

no test coverage detected