Remove calls to setAccount and getAccount in test

This param is now deprecated.

Test: runtest frameworks-services -p \
      com.android.server.locksettings.recoverablekeystore

Change-Id: I318edba915cb15280b884181ae868b4b07a35098
This commit is contained in:
Robert Berry
2018-03-01 13:21:07 +00:00
parent bbcd101f1a
commit 59b12b9a30

View File

@@ -27,7 +27,6 @@ import android.security.keystore.recovery.KeyChainProtectionParams;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -45,7 +44,6 @@ public class PersistentKeyChainSnapshotTest {
.getBytes(StandardCharsets.UTF_8);
private static final byte[] KEY_MATERIAL = "app_key_data".getBytes(StandardCharsets.UTF_8);
private static final byte[] PUBLIC_KEY = "public_key_data".getBytes(StandardCharsets.UTF_8);
private static final byte[] ACCOUNT = "test_account".getBytes(StandardCharsets.UTF_8);
private static final byte[] SALT = "salt".getBytes(StandardCharsets.UTF_8);
private static final int SNAPSHOT_VERSION = 2;
private static final int MAX_ATTEMPTS = 10;
@@ -130,7 +128,6 @@ public class PersistentKeyChainSnapshotTest {
WrappedApplicationKey entry = new WrappedApplicationKey.Builder()
.setAlias(ALIAS)
.setEncryptedKeyMaterial(KEY_MATERIAL)
.setAccount(ACCOUNT)
.build();
writer.writeKeyEntry(entry);
@@ -142,7 +139,6 @@ public class PersistentKeyChainSnapshotTest {
WrappedApplicationKey copy = reader.readKeyEntry();
assertThat(copy.getAlias()).isEqualTo(ALIAS);
assertThat(copy.getEncryptedKeyMaterial()).isEqualTo(KEY_MATERIAL);
assertThat(copy.getAccount()).isEqualTo(ACCOUNT);
assertThrows(
IOException.class,
@@ -194,7 +190,6 @@ public class PersistentKeyChainSnapshotTest {
appKeysList.add(new WrappedApplicationKey.Builder()
.setAlias(ALIAS)
.setEncryptedKeyMaterial(KEY_MATERIAL)
.setAccount(ACCOUNT)
.build());
KeyChainSnapshot snapshot = new KeyChainSnapshot.Builder()
@@ -256,12 +251,10 @@ public class PersistentKeyChainSnapshotTest {
appKeysList.add(new WrappedApplicationKey.Builder()
.setAlias(ALIAS)
.setEncryptedKeyMaterial(KEY_MATERIAL)
.setAccount(ACCOUNT)
.build());
appKeysList.add(new WrappedApplicationKey.Builder()
.setAlias(ALIAS2)
.setEncryptedKeyMaterial(KEY_MATERIAL)
.setAccount(ACCOUNT)
.build());