Merge "Assert the non-presence of stamp" into rvc-dev

This commit is contained in:
Khaled Abdelmohsen
2020-03-13 19:01:16 +00:00
committed by Android (Google) Code Review

View File

@@ -28,6 +28,7 @@ import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyInt;
@@ -321,6 +322,11 @@ public class AppIntegrityManagerServiceImplTest {
// we cannot check installer cert because it seems to be device specific. // we cannot check installer cert because it seems to be device specific.
assertEquals(VERSION_CODE, appInstallMetadata.getVersionCode()); assertEquals(VERSION_CODE, appInstallMetadata.getVersionCode());
assertFalse(appInstallMetadata.isPreInstalled()); assertFalse(appInstallMetadata.isPreInstalled());
// Asserting source stamp not present.
assertFalse(appInstallMetadata.isStampPresent());
assertFalse(appInstallMetadata.isStampVerified());
assertFalse(appInstallMetadata.isStampTrusted());
assertNull(appInstallMetadata.getStampCertificateHash());
// These are hardcoded in the test apk android manifest // These are hardcoded in the test apk android manifest
Map<String, String> allowedInstallers = Map<String, String> allowedInstallers =
appInstallMetadata.getAllowedInstallersAndCertificates(); appInstallMetadata.getAllowedInstallersAndCertificates();