MCPcopy Create free account
hub / github.com/GetStream/stream-go2 / TestGetEnrichedActivities

Function TestGetEnrichedActivities

client_test.go:132–148  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

130}
131
132func TestGetEnrichedActivities(t *testing.T) {
133 ctx := context.Background()
134 client, requester := newClient(t)
135 _, err := client.GetEnrichedActivitiesByID(ctx, []string{"foo", "bar", "baz"}, stream.WithEnrichReactionCounts())
136 require.NoError(t, err)
137 testRequest(t, requester.req, http.MethodGet, "https://api.stream-io-api.com/api/v1.0/enrich/activities/?api_key=key&ids=foo%2Cbar%2Cbaz&withReactionCounts=true", "")
138 _, err = client.GetEnrichedActivitiesByForeignID(
139 ctx,
140 []stream.ForeignIDTimePair{
141 stream.NewForeignIDTimePair("foo", stream.Time{}),
142 stream.NewForeignIDTimePair("bar", stream.Time{Time: time.Time{}.Add(time.Second)}),
143 },
144 stream.WithEnrichReactionCounts(),
145 )
146 require.NoError(t, err)
147 testRequest(t, requester.req, http.MethodGet, "https://api.stream-io-api.com/api/v1.0/enrich/activities/?api_key=key&foreign_ids=foo%2Cbar&timestamps=0001-01-01T00%3A00%3A00%2C0001-01-01T00%3A00%3A01&withReactionCounts=true", "")
148}
149
150func TestGetReactions(t *testing.T) {
151 ctx := context.Background()

Callers

nothing calls this directly

Calls 5

newClientFunction · 0.85
testRequestFunction · 0.85
AddMethod · 0.45

Tested by

no test coverage detected