Skip to content

Commit

Permalink
chore: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
xernobyl committed Feb 19, 2024
1 parent 97c1c0e commit 82ab31c
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/test/java/io/getstream/client/AggregatedFeedTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import io.getstream.core.options.Offset;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import java.net.URL;
import java.util.LinkedHashMap;
Expand Down Expand Up @@ -59,7 +60,7 @@ public void getEnrichedRankingVars() throws Exception {
MockHTTPClient httpClient = new MockHTTPClient();
Client client =
Client.builder(apiKey, secret)
.httpClient(httpClient)
.httpClient(new OKHTTPClientAdapter(new OkHttpClient()))//.httpClient(httpClient)
.build();

Map<String, Object> mp = new LinkedHashMap();
Expand All @@ -69,18 +70,16 @@ public void getEnrichedRankingVars() throws Exception {
mp.put("sports", 2.1);
mp.put("string", "str");

FlatFeed feed = client.flatFeed("flat", "1");
FlatFeed feed = client.flatFeed("user", "1");

EnrichmentFlags ef = new EnrichmentFlags().rankingVars(mp);

List<EnrichedActivity> result = feed.getEnrichedActivities(
new Limit(69),
new Offset(13),
new EnrichmentFlags().rankingVars(mp)).join();
ef, "popular").join();

URL feedURL = new URL(
"https://us-east-api.stream-io-api.com:443/api/v1.0/enrich/feed/flat/1/?api_key="
+ apiKey
+ "&limit=69&offset=13&ranking=rank&ranking_vars=%7B%22boolVal%22:true,%22music%22:1,%22sports%22:2.1,%22string%22:%22str%22%7D");
assertEquals(httpClient.lastRequest.getURL(), feedURL);
assertNotNull(result);
}

@Test
Expand Down

0 comments on commit 82ab31c

Please sign in to comment.