Skip to content

Commit

Permalink
fix StatsigCacheTest
Browse files Browse the repository at this point in the history
  • Loading branch information
kenny-statsig committed Jul 12, 2023
1 parent 69f6476 commit e6524eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/test/java/com/statsig/androidsdk/StatsigCacheTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ class StatsigCacheTest {
values.put("stickyUserExperiments", sticky)
cacheById.put("123", values)

testSharedPrefs.edit().putString("Statsig.CACHE_BY_USER", gson.toJson(cacheById))
testSharedPrefs.edit().putString("Statsig.CACHE_BY_USER", gson.toJson(cacheById)).apply()

TestUtil.startStatsigAndDontWait(app, user, StatsigOptions())
client = Statsig.client
assertTrue(client.isInitialized())
assertTrue(client.getStore().checkGate("always_on").details.reason == EvaluationReason.Cache)
assertEquals(EvaluationReason.Cache, client.getStore().checkGate("always_on").details.reason)

assertTrue(client.checkGate("always_on"))
runBlocking {
Expand All @@ -78,7 +78,7 @@ class StatsigCacheTest {
values.put("stickyUserExperiments", sticky)
cacheById.put("123", values)

testSharedPrefs.edit().putString("Statsig.CACHE_BY_USER", gson.toJson(cacheById))
testSharedPrefs.edit().putString("Statsig.CACHE_BY_USER", gson.toJson(cacheById)).apply()

TestUtil.startStatsigAndDontWait(app, user, StatsigOptions(loadCacheAsync = true))
client = Statsig.client
Expand Down

0 comments on commit e6524eb

Please sign in to comment.