(t *testing.T)
| 42 | } |
| 43 | |
| 44 | func TestFollowMany(t *testing.T) { |
| 45 | var ( |
| 46 | client, requester = newClient(t) |
| 47 | ctx = context.Background() |
| 48 | relationships = make([]stream.FollowRelationship, 3) |
| 49 | flat, _ = newFlatFeedWithUserID(client, "123") |
| 50 | ) |
| 51 | |
| 52 | for i := range relationships { |
| 53 | other, _ := newAggregatedFeedWithUserID(client, strconv.Itoa(i)) |
| 54 | relationships[i] = stream.NewFollowRelationship(other, flat) |
| 55 | } |
| 56 | |
| 57 | err := client.FollowMany(ctx, relationships) |
| 58 | require.NoError(t, err) |
| 59 | body := `[{"source":"aggregated:0","target":"flat:123"},{"source":"aggregated:1","target":"flat:123"},{"source":"aggregated:2","target":"flat:123"}]` |
| 60 | testRequest(t, requester.req, http.MethodPost, "https://api.stream-io-api.com/api/v1.0/follow_many/?api_key=key", body) |
| 61 | |
| 62 | err = client.FollowMany(ctx, relationships, stream.WithFollowManyActivityCopyLimit(500)) |
| 63 | require.NoError(t, err) |
| 64 | body = `[{"source":"aggregated:0","target":"flat:123"},{"source":"aggregated:1","target":"flat:123"},{"source":"aggregated:2","target":"flat:123"}]` |
| 65 | testRequest(t, requester.req, http.MethodPost, "https://api.stream-io-api.com/api/v1.0/follow_many/?activity_copy_limit=500&api_key=key", body) |
| 66 | } |
| 67 | |
| 68 | func TestFollowManyActivityCopyLimit(t *testing.T) { |
| 69 | var ( |
nothing calls this directly
no test coverage detected