Skip to content

Commit

Permalink
fix: use regular hashmap on analytics test for older java versions
Browse files Browse the repository at this point in the history
  • Loading branch information
tharropoulos committed Nov 1, 2024
1 parent 64d5f42 commit 57acd9f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/test/java/org/typesense/api/AnalyticsEventsTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.typesense.api;

import java.util.Map;
import java.util.HashMap;

import org.junit.jupiter.api.AfterEach;
import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down Expand Up @@ -32,12 +32,13 @@ void tearDown() throws Exception {

@Test
void testCreate() throws Exception {
HashMap<String, Object> eventData = new HashMap<>();
eventData.put("q", "running shoes");
eventData.put("user_id", "1234");
AnalyticsEventCreateSchema analyticsEvent = new AnalyticsEventCreateSchema()
.type("search")
.name("products_search_event")
.data(Map.of(
"q", "running shoes",
"user_id", "1234"));
.data(eventData);

AnalyticsEventCreateResponse result = this.client.analytics().events().create(analyticsEvent);
assertNotNull(result);
Expand Down

0 comments on commit 57acd9f

Please sign in to comment.