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

Function TestPartitionOffsetManagerNextOffset

offset_manager_test.go:641–658  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

639}
640
641func TestPartitionOffsetManagerNextOffset(t *testing.T) {
642 om, testClient, broker, coordinator := initOffsetManager(t, 0)
643 defer broker.Close()
644 defer coordinator.Close()
645 pom := initPartitionOffsetManager(t, om, coordinator, 5, "test_meta")
646
647 offset, meta := pom.NextOffset()
648 if offset != 5 {
649 t.Errorf("Expected offset 5. Actual: %v", offset)
650 }
651 if meta != "test_meta" {
652 t.Errorf("Expected metadata \"test_meta\". Actual: %q", meta)
653 }
654
655 safeClose(t, pom)
656 safeClose(t, om)
657 safeClose(t, testClient)
658}
659
660func TestPartitionOffsetManagerResetOffset(t *testing.T) {
661 om, testClient, broker, coordinator := initOffsetManager(t, 0)

Callers

nothing calls this directly

Calls 6

initOffsetManagerFunction · 0.85
safeCloseFunction · 0.70
CloseMethod · 0.65
NextOffsetMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected