(t *testing.T)
| 22 | } |
| 23 | |
| 24 | func TestPersonalizationPost(t *testing.T) { |
| 25 | ctx := context.Background() |
| 26 | client, requester := newClient(t) |
| 27 | p := client.Personalization() |
| 28 | params := map[string]any{"answer": 42, "feed": "user:123"} |
| 29 | _, err := p.Post(ctx, "", params, nil) |
| 30 | require.Error(t, err) |
| 31 | data := map[string]any{"foo": "bar", "baz": 42} |
| 32 | _, err = p.Post(ctx, "some_resource", params, data) |
| 33 | require.NoError(t, err) |
| 34 | expectedURL := "https://personalization.stream-io-api.com/personalization/v1.0/some_resource/?answer=42&api_key=key&feed=user%3A123" |
| 35 | expectedBody := `{"data":{"baz":42,"foo":"bar"}}` |
| 36 | testRequest(t, requester.req, http.MethodPost, expectedURL, expectedBody) |
| 37 | } |
| 38 | |
| 39 | func TestPersonalizationDelete(t *testing.T) { |
| 40 | ctx := context.Background() |
nothing calls this directly
no test coverage detected