(t *testing.T)
| 720 | } |
| 721 | |
| 722 | func TestPartitionOffsetManagerMarkOffset(t *testing.T) { |
| 723 | om, testClient, broker, coordinator := initOffsetManager(t, 0) |
| 724 | defer broker.Close() |
| 725 | defer coordinator.Close() |
| 726 | pom := initPartitionOffsetManager(t, om, coordinator, 5, "original_meta") |
| 727 | |
| 728 | ocResponse := new(OffsetCommitResponse) |
| 729 | ocResponse.AddError("my_topic", 0, ErrNoError) |
| 730 | coordinator.Returns(ocResponse) |
| 731 | |
| 732 | pom.MarkOffset(100, "modified_meta") |
| 733 | offset, meta := pom.NextOffset() |
| 734 | |
| 735 | if offset != 100 { |
| 736 | t.Errorf("Expected offset 100. Actual: %v", offset) |
| 737 | } |
| 738 | if meta != "modified_meta" { |
| 739 | t.Errorf("Expected metadata \"modified_meta\". Actual: %q", meta) |
| 740 | } |
| 741 | |
| 742 | safeClose(t, pom) |
| 743 | safeClose(t, om) |
| 744 | safeClose(t, testClient) |
| 745 | } |
| 746 | |
| 747 | func TestPartitionOffsetManagerMarkOffsetWithRetention(t *testing.T) { |
| 748 | om, testClient, broker, coordinator := initOffsetManager(t, time.Hour) |
nothing calls this directly
no test coverage detected