From ddf687923959229c253d468ac454be77b85599ba Mon Sep 17 00:00:00 2001 From: Gaston Thea Date: Tue, 26 Nov 2024 10:08:20 -0300 Subject: [PATCH] General info storage --- build.gradle | 2 +- .../integration/InitialChangeNumberTest.java | 1 - .../tests/integration/IntegrationTest.java | 3 - .../MySegmentsServerErrorTest.java | 1 - .../SplitFetchSpecificSplitTest.java | 1 - .../java/tests/integration/TrackTest.java | 3 - .../attributes/AttributesIntegrationTest.java | 1 - .../telemetry/TelemetryIntegrationTest.java | 1 - .../client/storage/db/GeneralInfoEntity.java | 2 - .../storage/general/GeneralInfoStorage.java | 33 ++++ .../general/GeneralInfoStorageImpl.java | 88 +++++++++ .../general/GeneralInfoStorageImplTest.java | 169 ++++++++++++++++++ 12 files changed, 291 insertions(+), 14 deletions(-) create mode 100644 src/main/java/io/split/android/client/storage/general/GeneralInfoStorage.java create mode 100644 src/main/java/io/split/android/client/storage/general/GeneralInfoStorageImpl.java create mode 100644 src/test/java/io/split/android/client/storage/general/GeneralInfoStorageImplTest.java diff --git a/build.gradle b/build.gradle index a2245db98..9e32031ee 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ apply plugin: 'kotlin-android' apply from: 'spec.gradle' ext { - splitVersion = '5.0.1' + splitVersion = '5.1.0-alpha.1' } android { diff --git a/src/androidTest/java/tests/integration/InitialChangeNumberTest.java b/src/androidTest/java/tests/integration/InitialChangeNumberTest.java index 8ae2f6c62..434fd63f9 100644 --- a/src/androidTest/java/tests/integration/InitialChangeNumberTest.java +++ b/src/androidTest/java/tests/integration/InitialChangeNumberTest.java @@ -95,7 +95,6 @@ public void firstRequestChangeNumber() throws Exception { String apiKey = apiKeyAndDb.first; SplitRoomDatabase splitRoomDatabase = DatabaseHelper.getTestDatabase(mContext); splitRoomDatabase.clearAllTables(); - splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.DATBASE_MIGRATION_STATUS, GeneralInfoEntity.DATBASE_MIGRATION_STATUS_DONE)); splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.CHANGE_NUMBER_INFO, INITIAL_CHANGE_NUMBER)); splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.SPLITS_UPDATE_TIMESTAMP, System.currentTimeMillis())); diff --git a/src/androidTest/java/tests/integration/IntegrationTest.java b/src/androidTest/java/tests/integration/IntegrationTest.java index 66f023e13..57327373b 100644 --- a/src/androidTest/java/tests/integration/IntegrationTest.java +++ b/src/androidTest/java/tests/integration/IntegrationTest.java @@ -115,7 +115,6 @@ public void testAll() throws Exception { SplitRoomDatabase splitRoomDatabase = DatabaseHelper.getTestDatabase(mContext); splitRoomDatabase.clearAllTables(); - splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.DATBASE_MIGRATION_STATUS, GeneralInfoEntity.DATBASE_MIGRATION_STATUS_DONE)); splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.CHANGE_NUMBER_INFO, 2)); SplitClient client; SplitManager manager; @@ -249,7 +248,6 @@ public void testNoReadyFromCache() throws Exception { SplitRoomDatabase splitRoomDatabase = DatabaseHelper.getTestDatabase(mContext); splitRoomDatabase.clearAllTables(); - splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.DATBASE_MIGRATION_STATUS, GeneralInfoEntity.DATBASE_MIGRATION_STATUS_DONE)); splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.CHANGE_NUMBER_INFO, -1)); SplitClient client; SplitManager manager; @@ -304,7 +302,6 @@ public void testGetTreatmentFromCache() throws Exception { mContext = InstrumentationRegistry.getInstrumentation().getContext(); mRoomDb = DatabaseHelper.getTestDatabase(mContext); mRoomDb.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.CHANGE_NUMBER_INFO, 10)); - mRoomDb.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.DATBASE_MIGRATION_STATUS, 1)); SplitChange change = Json.fromJson(mJsonChanges.get(0), SplitChange.class); List entities = new ArrayList<>(); diff --git a/src/androidTest/java/tests/integration/MySegmentsServerErrorTest.java b/src/androidTest/java/tests/integration/MySegmentsServerErrorTest.java index 25221044d..fe10d2bb4 100644 --- a/src/androidTest/java/tests/integration/MySegmentsServerErrorTest.java +++ b/src/androidTest/java/tests/integration/MySegmentsServerErrorTest.java @@ -142,7 +142,6 @@ public void test() throws Exception { SplitRoomDatabase splitRoomDatabase = DatabaseHelper.getTestDatabase(mContext); splitRoomDatabase.clearAllTables(); - splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.DATBASE_MIGRATION_STATUS, GeneralInfoEntity.DATBASE_MIGRATION_STATUS_DONE)); splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.CHANGE_NUMBER_INFO, -1)); ImpressionListenerHelper impListener = new ImpressionListenerHelper(); diff --git a/src/androidTest/java/tests/integration/SplitFetchSpecificSplitTest.java b/src/androidTest/java/tests/integration/SplitFetchSpecificSplitTest.java index 22e102082..a1a165599 100644 --- a/src/androidTest/java/tests/integration/SplitFetchSpecificSplitTest.java +++ b/src/androidTest/java/tests/integration/SplitFetchSpecificSplitTest.java @@ -106,7 +106,6 @@ public void testAll() throws Exception { SplitRoomDatabase.class) .build(); splitRoomDatabase.clearAllTables(); - splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.DATBASE_MIGRATION_STATUS, GeneralInfoEntity.DATBASE_MIGRATION_STATUS_DONE)); splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.CHANGE_NUMBER_INFO, 2)); splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.SPLITS_FILTER_QUERY_STRING, expectedQs)); splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.SPLITS_UPDATE_TIMESTAMP, System.currentTimeMillis())); diff --git a/src/androidTest/java/tests/integration/TrackTest.java b/src/androidTest/java/tests/integration/TrackTest.java index 2db076a2b..550aac3dd 100644 --- a/src/androidTest/java/tests/integration/TrackTest.java +++ b/src/androidTest/java/tests/integration/TrackTest.java @@ -35,7 +35,6 @@ import io.split.android.client.dtos.Event; import io.split.android.client.events.SplitEvent; import io.split.android.client.exceptions.SplitInstantiationException; -import io.split.android.client.storage.db.GeneralInfoEntity; import io.split.android.client.storage.db.SplitRoomDatabase; import okhttp3.mockwebserver.Dispatcher; import okhttp3.mockwebserver.MockResponse; @@ -120,7 +119,6 @@ public void test() throws Exception { String apiKey = IntegrationHelper.dummyApiKey(); SplitRoomDatabase splitRoomDatabase = DatabaseHelper.getTestDatabase(mContext); splitRoomDatabase.clearAllTables(); - splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.DATBASE_MIGRATION_STATUS, GeneralInfoEntity.DATBASE_MIGRATION_STATUS_DONE)); ImpressionListenerHelper impListener = new ImpressionListenerHelper(); @@ -220,7 +218,6 @@ public void largeNumberInPropertiesTest() throws InterruptedException, SplitInst String apiKey = IntegrationHelper.dummyApiKey(); SplitRoomDatabase splitRoomDatabase = DatabaseHelper.getTestDatabase(mContext); splitRoomDatabase.clearAllTables(); - splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.DATBASE_MIGRATION_STATUS, GeneralInfoEntity.DATBASE_MIGRATION_STATUS_DONE)); final String url = mWebServer.url("/").url().toString(); diff --git a/src/androidTest/java/tests/integration/attributes/AttributesIntegrationTest.java b/src/androidTest/java/tests/integration/attributes/AttributesIntegrationTest.java index 62b4f987a..9b9a47401 100644 --- a/src/androidTest/java/tests/integration/attributes/AttributesIntegrationTest.java +++ b/src/androidTest/java/tests/integration/attributes/AttributesIntegrationTest.java @@ -259,7 +259,6 @@ private void insertSplitsFromFileIntoDB() { return result; }).collect(Collectors.toList()); - mRoomDb.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.DATBASE_MIGRATION_STATUS, GeneralInfoEntity.DATBASE_MIGRATION_STATUS_DONE)); mRoomDb.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.CHANGE_NUMBER_INFO, 1)); mRoomDb.splitDao().insert(entities); diff --git a/src/androidTest/java/tests/integration/telemetry/TelemetryIntegrationTest.java b/src/androidTest/java/tests/integration/telemetry/TelemetryIntegrationTest.java index 50d747591..8f9e2490a 100644 --- a/src/androidTest/java/tests/integration/telemetry/TelemetryIntegrationTest.java +++ b/src/androidTest/java/tests/integration/telemetry/TelemetryIntegrationTest.java @@ -365,7 +365,6 @@ private void insertSplitsFromFileIntoDB() { return result; }).collect(Collectors.toList()); - testDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.DATBASE_MIGRATION_STATUS, GeneralInfoEntity.DATBASE_MIGRATION_STATUS_DONE)); testDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.CHANGE_NUMBER_INFO, 1)); testDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.SPLITS_UPDATE_TIMESTAMP, System.currentTimeMillis())); diff --git a/src/main/java/io/split/android/client/storage/db/GeneralInfoEntity.java b/src/main/java/io/split/android/client/storage/db/GeneralInfoEntity.java index 52a1b10f2..ce7f25696 100644 --- a/src/main/java/io/split/android/client/storage/db/GeneralInfoEntity.java +++ b/src/main/java/io/split/android/client/storage/db/GeneralInfoEntity.java @@ -12,8 +12,6 @@ public class GeneralInfoEntity { public static final String SPLITS_UPDATE_TIMESTAMP = "splitsUpdateTimestamp"; public static final String CHANGE_NUMBER_INFO = "splitChangesChangeNumber"; public static final String SPLITS_FILTER_QUERY_STRING = "splitsFilterQueryString"; - public static final String DATBASE_MIGRATION_STATUS = "databaseMigrationStatus"; - public static final int DATBASE_MIGRATION_STATUS_DONE = 1; public static final String DATABASE_ENCRYPTION_MODE = "databaseEncryptionMode"; public static final String FLAGS_SPEC = "flagsSpec"; diff --git a/src/main/java/io/split/android/client/storage/general/GeneralInfoStorage.java b/src/main/java/io/split/android/client/storage/general/GeneralInfoStorage.java new file mode 100644 index 000000000..7f8d763a9 --- /dev/null +++ b/src/main/java/io/split/android/client/storage/general/GeneralInfoStorage.java @@ -0,0 +1,33 @@ +package io.split.android.client.storage.general; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +public interface GeneralInfoStorage { + + long getSplitsUpdateTimestamp(); + + void setSplitsUpdateTimestamp(long timestamp); + + long getChangeNumber(); + + void setChangeNumber(long changeNumber); + + @NonNull + String getSplitsFilterQueryString(); + + void setSplitsFilterQueryString(String queryString); + + String getDatabaseEncryptionMode(); + + void setDatabaseEncryptionMode(String value); + + @Nullable + String getFlagsSpec(); + + void setFlagsSpec(String value); + + long getRolloutCacheLastClearTimestamp(); + + void setRolloutCacheLastClearTimestamp(long timestamp); +} diff --git a/src/main/java/io/split/android/client/storage/general/GeneralInfoStorageImpl.java b/src/main/java/io/split/android/client/storage/general/GeneralInfoStorageImpl.java new file mode 100644 index 000000000..b6c5c8423 --- /dev/null +++ b/src/main/java/io/split/android/client/storage/general/GeneralInfoStorageImpl.java @@ -0,0 +1,88 @@ +package io.split.android.client.storage.general; + +import static io.split.android.client.utils.Utils.checkNotNull; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import io.split.android.client.storage.db.GeneralInfoDao; +import io.split.android.client.storage.db.GeneralInfoEntity; + +public class GeneralInfoStorageImpl implements GeneralInfoStorage{ + + private static final String ROLLOUT_CACHE_LAST_CLEAR_TIMESTAMP = "rolloutCacheLastClearTimestamp"; + + private final GeneralInfoDao mGeneralInfoDao; + + public GeneralInfoStorageImpl(GeneralInfoDao generalInfoDao) { + mGeneralInfoDao = checkNotNull(generalInfoDao); + } + + @Override + public long getSplitsUpdateTimestamp() { + GeneralInfoEntity entity = mGeneralInfoDao.getByName(GeneralInfoEntity.SPLITS_UPDATE_TIMESTAMP); + return entity != null ? entity.getLongValue() : 0L; + } + + @Override + public void setSplitsUpdateTimestamp(long timestamp) { + mGeneralInfoDao.update(new GeneralInfoEntity(GeneralInfoEntity.SPLITS_UPDATE_TIMESTAMP, timestamp)); + } + + @Override + public long getChangeNumber() { + GeneralInfoEntity entity = mGeneralInfoDao.getByName(GeneralInfoEntity.CHANGE_NUMBER_INFO); + return entity != null ? entity.getLongValue() : -1L; + } + + @Override + public void setChangeNumber(long changeNumber) { + mGeneralInfoDao.update(new GeneralInfoEntity(GeneralInfoEntity.CHANGE_NUMBER_INFO, changeNumber)); + } + + @Override + @NonNull + public String getSplitsFilterQueryString() { + GeneralInfoEntity entity = mGeneralInfoDao.getByName(GeneralInfoEntity.SPLITS_FILTER_QUERY_STRING); + return entity != null ? entity.getStringValue() : ""; + } + + @Override + public void setSplitsFilterQueryString(String queryString) { + mGeneralInfoDao.update(new GeneralInfoEntity(GeneralInfoEntity.SPLITS_FILTER_QUERY_STRING, queryString)); + } + + @Override + public String getDatabaseEncryptionMode() { + GeneralInfoEntity entity = mGeneralInfoDao.getByName(GeneralInfoEntity.DATABASE_ENCRYPTION_MODE); + return entity != null ? entity.getStringValue() : ""; + } + + @Override + public void setDatabaseEncryptionMode(String value) { + mGeneralInfoDao.update(new GeneralInfoEntity(GeneralInfoEntity.DATABASE_ENCRYPTION_MODE, value)); + } + + @Override + @Nullable + public String getFlagsSpec() { + GeneralInfoEntity entity = mGeneralInfoDao.getByName(GeneralInfoEntity.FLAGS_SPEC); + return entity != null ? entity.getStringValue() : ""; + } + + @Override + public void setFlagsSpec(String value) { + mGeneralInfoDao.update(new GeneralInfoEntity(GeneralInfoEntity.FLAGS_SPEC, value)); + } + + @Override + public long getRolloutCacheLastClearTimestamp() { + GeneralInfoEntity entity = mGeneralInfoDao.getByName(ROLLOUT_CACHE_LAST_CLEAR_TIMESTAMP); + return entity != null ? entity.getLongValue() : 0L; + } + + @Override + public void setRolloutCacheLastClearTimestamp(long timestamp) { + mGeneralInfoDao.update(new GeneralInfoEntity(ROLLOUT_CACHE_LAST_CLEAR_TIMESTAMP, timestamp)); + } +} diff --git a/src/test/java/io/split/android/client/storage/general/GeneralInfoStorageImplTest.java b/src/test/java/io/split/android/client/storage/general/GeneralInfoStorageImplTest.java new file mode 100644 index 000000000..125823d49 --- /dev/null +++ b/src/test/java/io/split/android/client/storage/general/GeneralInfoStorageImplTest.java @@ -0,0 +1,169 @@ +package io.split.android.client.storage.general; + +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.argThat; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import org.junit.Before; +import org.junit.Test; + +import io.split.android.client.storage.db.GeneralInfoDao; +import io.split.android.client.storage.db.GeneralInfoEntity; + +public class GeneralInfoStorageImplTest { + + private GeneralInfoDao mGeneralInfoDao; + private GeneralInfoStorageImpl mGeneralInfoStorage; + + @Before + public void setUp() { + mGeneralInfoDao = mock(GeneralInfoDao.class); + mGeneralInfoStorage = new GeneralInfoStorageImpl(mGeneralInfoDao); + } + + @Test + public void setSplitsUpdateTimestampSetsValueOnDao() { + mGeneralInfoStorage.setSplitsUpdateTimestamp(123L); + + verify(mGeneralInfoDao).update(argThat(entity -> entity.getName().equals("splitsUpdateTimestamp") && entity.getLongValue() == 123L)); + } + + @Test + public void setSplitsUpdateTimestampGetsValueFromDao() { + when(mGeneralInfoDao.getByName("splitsUpdateTimestamp")).thenReturn(new GeneralInfoEntity("splitsUpdateTimestamp", 123L)); + long splitsUpdateTimestamp = mGeneralInfoStorage.getSplitsUpdateTimestamp(); + + assertEquals(123L, splitsUpdateTimestamp); + verify(mGeneralInfoDao).getByName("splitsUpdateTimestamp"); + } + + @Test + public void setChangeNumberSetsValueOnDao() { + mGeneralInfoStorage.setChangeNumber(123L); + + verify(mGeneralInfoDao).update(argThat(entity -> entity.getName().equals("splitChangesChangeNumber") && entity.getLongValue() == 123L)); + } + + @Test + public void setChangeNumberGetsValueFromDao() { + when(mGeneralInfoDao.getByName("splitChangesChangeNumber")).thenReturn(new GeneralInfoEntity("splitChangesChangeNumber", 123L)); + long changeNumber = mGeneralInfoStorage.getChangeNumber(); + + assertEquals(123L, changeNumber); + verify(mGeneralInfoDao).getByName("splitChangesChangeNumber"); + } + + @Test + public void getSplitsFilterQueryStringGetsValueFromDao() { + when(mGeneralInfoDao.getByName("splitsFilterQueryString")).thenReturn(new GeneralInfoEntity("splitsFilterQueryString", "queryString")); + String splitsFilterQueryString = mGeneralInfoStorage.getSplitsFilterQueryString(); + + assertEquals("queryString", splitsFilterQueryString); + verify(mGeneralInfoDao).getByName("splitsFilterQueryString"); + } + + @Test + public void setSplitsFilterQueryStringSetsValueOnDao() { + mGeneralInfoStorage.setSplitsFilterQueryString("queryString"); + + verify(mGeneralInfoDao).update(argThat(entity -> entity.getName().equals("splitsFilterQueryString") && entity.getStringValue().equals("queryString"))); + } + + @Test + public void getDatabaseEncryptionModeGetsValueFromDao() { + when(mGeneralInfoDao.getByName("databaseEncryptionMode")).thenReturn(new GeneralInfoEntity("databaseEncryptionMode", "value")); + String databaseEncryptionMode = mGeneralInfoStorage.getDatabaseEncryptionMode(); + + assertEquals("value", databaseEncryptionMode); + verify(mGeneralInfoDao).getByName("databaseEncryptionMode"); + } + + @Test + public void setDatabaseEncryptionModeSetsValueOnDao() { + mGeneralInfoStorage.setDatabaseEncryptionMode("value"); + + verify(mGeneralInfoDao).update(argThat(entity -> entity.getName().equals("databaseEncryptionMode") && entity.getStringValue().equals("value"))); + } + + @Test + public void getFlagsSpecGetsValueFromDao() { + when(mGeneralInfoDao.getByName("flagsSpec")).thenReturn(new GeneralInfoEntity("flagsSpec", "value")); + String flagsSpec = mGeneralInfoStorage.getFlagsSpec(); + + assertEquals("value", flagsSpec); + verify(mGeneralInfoDao).getByName("flagsSpec"); + } + + @Test + public void setFlagsSpecSetsValueOnDao() { + mGeneralInfoStorage.setFlagsSpec("value"); + + verify(mGeneralInfoDao).update(argThat(entity -> entity.getName().equals("flagsSpec") && entity.getStringValue().equals("value"))); + } + + @Test + public void getRolloutCacheLastClearTimestampGetsValueFromDao() { + when(mGeneralInfoDao.getByName("rolloutCacheLastClearTimestamp")).thenReturn(new GeneralInfoEntity("rolloutCacheLastClearTimestamp", 123L)); + long rolloutCacheLastClearTimestamp = mGeneralInfoStorage.getRolloutCacheLastClearTimestamp(); + + assertEquals(123L, rolloutCacheLastClearTimestamp); + verify(mGeneralInfoDao).getByName("rolloutCacheLastClearTimestamp"); + } + + @Test + public void setRolloutCacheLastClearTimestampSetsValueOnDao() { + mGeneralInfoStorage.setRolloutCacheLastClearTimestamp(123L); + + verify(mGeneralInfoDao).update(argThat(entity -> entity.getName().equals("rolloutCacheLastClearTimestamp") && entity.getLongValue() == 123L)); + } + + @Test + public void getChangeNumberReturnsMinusOneIfEntityIsNull() { + when(mGeneralInfoDao.getByName("splitChangesChangeNumber")).thenReturn(null); + long changeNumber = mGeneralInfoStorage.getChangeNumber(); + + assertEquals(-1L, changeNumber); + } + + @Test + public void getSplitsUpdateTimestampReturnsZeroIfEntityIsNull() { + when(mGeneralInfoDao.getByName("splitsUpdateTimestamp")).thenReturn(null); + long timestamp = mGeneralInfoStorage.getSplitsUpdateTimestamp(); + + assertEquals(0L, timestamp); + } + + @Test + public void getSplitsFilterQueryStringReturnsEmptyStringIfEntityIsNull() { + when(mGeneralInfoDao.getByName("splitsFilterQueryString")).thenReturn(null); + String queryString = mGeneralInfoStorage.getSplitsFilterQueryString(); + + assertEquals("", queryString); + } + + @Test + public void getDatabaseEncryptionModeReturnsEmptyStringIfEntityIsNull() { + when(mGeneralInfoDao.getByName("databaseEncryptionMode")).thenReturn(null); + String value = mGeneralInfoStorage.getDatabaseEncryptionMode(); + + assertEquals("", value); + } + + @Test + public void getFlagsSpecReturnsEmptyStringIfEntityIsNull() { + when(mGeneralInfoDao.getByName("flagsSpec")).thenReturn(null); + String value = mGeneralInfoStorage.getFlagsSpec(); + + assertEquals("", value); + } + + @Test + public void getRolloutCacheLastClearTimestampReturnsZeroIfEntityIsNull() { + when(mGeneralInfoDao.getByName("rolloutCacheLastClearTimestamp")).thenReturn(null); + long timestamp = mGeneralInfoStorage.getRolloutCacheLastClearTimestamp(); + + assertEquals(0L, timestamp); + } +}