diff options
author | Nate Jiang <qiangjiang@google.com> | 2020-09-09 22:35:57 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-09-09 22:35:57 +0000 |
commit | 22f265e77b3c293c1a9ef2c15aae06e6b8a9e27d (patch) | |
tree | d071722bba0e28a17800b5b017f69b48355d2e1e /tests | |
parent | 3f749b85c6608dc23b9bfc4a6b8a0392587df7bc (diff) | |
parent | b4d39a8321a9c8f318ec157d7e3fd5b3725bd11c (diff) |
Merge "DeserializeData for new device without userDataStore" into rvc-qpr-dev
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/ImsiPrivacyProtectionExemptionStoreDataTest.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/ImsiPrivacyProtectionExemptionStoreDataTest.java b/tests/wifitests/src/com/android/server/wifi/ImsiPrivacyProtectionExemptionStoreDataTest.java index ec2142dbf..77d5c1933 100644 --- a/tests/wifitests/src/com/android/server/wifi/ImsiPrivacyProtectionExemptionStoreDataTest.java +++ b/tests/wifitests/src/com/android/server/wifi/ImsiPrivacyProtectionExemptionStoreDataTest.java @@ -17,6 +17,7 @@ package com.android.server.wifi; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -102,6 +103,17 @@ public class ImsiPrivacyProtectionExemptionStoreDataTest { assertSerializeDeserialize(imsiPrivacyProtectionExemptionMap); } + @Test + public void testDeserializeOnNewDeviceOrNewUser() throws Exception { + ArgumentCaptor<Map> deserializedNetworkSuggestionsMap = + ArgumentCaptor.forClass(Map.class); + mImsiPrivacyProtectionExemptionStoreData.deserializeData(null, 0, + WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION, null); + verify(mDataSource).fromDeserialized(deserializedNetworkSuggestionsMap.capture()); + assertTrue(deserializedNetworkSuggestionsMap.getValue().isEmpty()); + } + + private Map<Integer, Boolean> assertSerializeDeserialize( Map<Integer, Boolean> mImsiPrivacyProtectionExemptionMap) throws Exception { // Setup the data to serialize. |