-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: expose user obj constructor with both userid and customID (#360)
create a user object with a userid and customids More: https://statsigconnect.slack.com/archives/C07ETLMDKC4/p1725876639552919
- Loading branch information
1 parent
51c9206
commit 8a1451a
Showing
3 changed files
with
74 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.statsig.sdk; | ||
|
||
import org.junit.Test; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class StatsigUserTestJava { | ||
@Test | ||
public void testInitializeUserIDAndCustomID() { | ||
String userId = "test123"; | ||
Map<String, String> customIds = new HashMap<>(); | ||
customIds.put("k1", "v1"); | ||
customIds.put("k2", "v2"); | ||
|
||
StatsigUser user = new StatsigUser(userId, customIds); | ||
|
||
assertEquals(userId, user.getUserID()); | ||
assertEquals(customIds, user.getCustomIDs()); | ||
} | ||
} |