(t *testing.T)
| 74 | } |
| 75 | |
| 76 | func TestCollectEvents(t *testing.T) { |
| 77 | ctx := Context() |
| 78 | testEvent1 := events.New(ctx, "test-collect-events-1", "test-event-1", |
| 79 | events.WithIdentifiers(&ttnpb.ApplicationIdentifiers{ApplicationId: "test-app"}), |
| 80 | ) |
| 81 | testEvent2 := events.New(ctx, "test-collect-events-2", "test-event-2", |
| 82 | events.WithIdentifiers(&ttnpb.GatewayIdentifiers{GatewayId: "test-gtw"}), |
| 83 | ) |
| 84 | assertions.New(t).So(CollectEvents(func() { |
| 85 | events.Publish(testEvent1) |
| 86 | events.Publish(testEvent1) |
| 87 | events.Publish(testEvent2) |
| 88 | }), should.Resemble, []events.Event{ |
| 89 | testEvent1, |
| 90 | testEvent1, |
| 91 | testEvent2, |
| 92 | }) |
| 93 | } |
| 94 | |
| 95 | func TestRedirectEvents(t *testing.T) { |
| 96 | ctx := Context() |
nothing calls this directly
no test coverage detected