(t *testing.T)
| 66 | } |
| 67 | |
| 68 | func TestFollowManyActivityCopyLimit(t *testing.T) { |
| 69 | var ( |
| 70 | client, requester = newClient(t) |
| 71 | ctx = context.Background() |
| 72 | relationships = make([]stream.FollowRelationship, 3) |
| 73 | flat, _ = newFlatFeedWithUserID(client, "123") |
| 74 | ) |
| 75 | |
| 76 | for i := range relationships { |
| 77 | other, _ := newAggregatedFeedWithUserID(client, strconv.Itoa(i)) |
| 78 | relationships[i] = stream.NewFollowRelationship(other, flat, stream.WithFollowRelationshipActivityCopyLimit(i)) |
| 79 | } |
| 80 | |
| 81 | err := client.FollowMany(ctx, relationships) |
| 82 | require.NoError(t, err) |
| 83 | body := `[{"source":"aggregated:0","target":"flat:123","activity_copy_limit":0},{"source":"aggregated:1","target":"flat:123","activity_copy_limit":1},{"source":"aggregated:2","target":"flat:123","activity_copy_limit":2}]` |
| 84 | testRequest(t, requester.req, http.MethodPost, "https://api.stream-io-api.com/api/v1.0/follow_many/?api_key=key", body) |
| 85 | |
| 86 | err = client.FollowMany(ctx, relationships, stream.WithFollowManyActivityCopyLimit(123)) |
| 87 | require.NoError(t, err) |
| 88 | body = `[{"source":"aggregated:0","target":"flat:123","activity_copy_limit":0},{"source":"aggregated:1","target":"flat:123","activity_copy_limit":1},{"source":"aggregated:2","target":"flat:123","activity_copy_limit":2}]` |
| 89 | testRequest(t, requester.req, http.MethodPost, "https://api.stream-io-api.com/api/v1.0/follow_many/?activity_copy_limit=123&api_key=key", body) |
| 90 | } |
| 91 | |
| 92 | func TestUnfollowMany(t *testing.T) { |
| 93 | var ( |
nothing calls this directly
no test coverage detected