(t *testing.T)
| 85 | } |
| 86 | |
| 87 | func TestBoltTopicSelectorHistory(t *testing.T) { |
| 88 | t.Parallel() |
| 89 | |
| 90 | transport := createBoltTransport(t, 0, 0) |
| 91 | ctx := t.Context() |
| 92 | |
| 93 | require.NoError(t, transport.Dispatch(ctx, &Update{Topics: []string{"https://example.com/subscribed"}, Event: Event{ID: "1"}})) |
| 94 | require.NoError(t, transport.Dispatch(ctx, &Update{Topics: []string{"https://example.com/not-subscribed"}, Event: Event{ID: "2"}})) |
| 95 | require.NoError(t, transport.Dispatch(ctx, &Update{Topics: []string{"https://example.com/subscribed-public-only"}, Private: true, Event: Event{ID: "3"}})) |
| 96 | require.NoError(t, transport.Dispatch(ctx, &Update{Topics: []string{"https://example.com/subscribed-public-only"}, Event: Event{ID: "4"}})) |
| 97 | |
| 98 | s := NewLocalSubscriber(EarliestLastEventID, transport.logger, &TopicSelectorStore{}) |
| 99 | s.SetTopics([]string{"https://example.com/subscribed", "https://example.com/subscribed-public-only"}, []string{"https://example.com/subscribed"}) |
| 100 | |
| 101 | require.NoError(t, transport.AddSubscriber(ctx, s)) |
| 102 | |
| 103 | assert.Equal(t, "1", (<-s.Receive()).ID) |
| 104 | assert.Equal(t, "4", (<-s.Receive()).ID) |
| 105 | } |
| 106 | |
| 107 | func TestBoltTransportRetrieveAllHistory(t *testing.T) { |
| 108 | t.Parallel() |
nothing calls this directly
no test coverage detected