Merge "Fix broken tests caused by the fix on autohashing certificates (that results in double hashing)."

This commit is contained in:
TreeHugger Robot
2020-02-06 15:13:00 +00:00
committed by Android (Google) Code Review
2 changed files with 12 additions and 12 deletions

View File

@@ -90,18 +90,18 @@ public class AtomicFormulaTest {
}
@Test
public void testValidAtomicFormula_stringValue_appCertificateAutoHashed() {
public void testValidAtomicFormula_stringValue_appCertificateIsNotAutoHashed() {
String appCert = "cert";
StringAtomicFormula stringAtomicFormula =
new StringAtomicFormula(AtomicFormula.APP_CERTIFICATE, appCert);
assertThat(stringAtomicFormula.getKey()).isEqualTo(AtomicFormula.APP_CERTIFICATE);
assertThat(stringAtomicFormula.getValue()).doesNotMatch(appCert);
assertThat(stringAtomicFormula.getIsHashedValue()).isTrue();
assertThat(stringAtomicFormula.getValue()).matches(appCert);
assertThat(stringAtomicFormula.getIsHashedValue()).isFalse();
}
@Test
public void testValidAtomicFormula_stringValue_installerCertificateAutoHashed() {
public void testValidAtomicFormula_stringValue_installerCertificateIsNotAutoHashed() {
String installerCert = "cert";
StringAtomicFormula stringAtomicFormula =
new StringAtomicFormula(AtomicFormula.INSTALLER_CERTIFICATE,
@@ -109,8 +109,8 @@ public class AtomicFormulaTest {
assertThat(stringAtomicFormula.getKey()).isEqualTo(
AtomicFormula.INSTALLER_CERTIFICATE);
assertThat(stringAtomicFormula.getValue()).doesNotMatch(installerCert);
assertThat(stringAtomicFormula.getIsHashedValue()).isTrue();
assertThat(stringAtomicFormula.getValue()).matches(installerCert);
assertThat(stringAtomicFormula.getIsHashedValue()).isFalse();
}
@Test

View File

@@ -40,7 +40,7 @@ public class IntegrityFormulaTest {
assertThat(stringAtomicFormula.getKey()).isEqualTo(AtomicFormula.PACKAGE_NAME);
assertThat(stringAtomicFormula.getValue()).isEqualTo(packageName);
assertThat(stringAtomicFormula.getIsHashedValue()).isEqualTo(false);
assertThat(stringAtomicFormula.getIsHashedValue()).isFalse();
}
@Test
@@ -53,8 +53,8 @@ public class IntegrityFormulaTest {
(AtomicFormula.StringAtomicFormula) formula;
assertThat(stringAtomicFormula.getKey()).isEqualTo(AtomicFormula.APP_CERTIFICATE);
assertThat(stringAtomicFormula.getValue()).doesNotMatch(appCertificate);
assertThat(stringAtomicFormula.getIsHashedValue()).isEqualTo(true);
assertThat(stringAtomicFormula.getValue()).matches(appCertificate);
assertThat(stringAtomicFormula.getIsHashedValue()).isFalse();
}
@Test
@@ -68,7 +68,7 @@ public class IntegrityFormulaTest {
assertThat(stringAtomicFormula.getKey()).isEqualTo(AtomicFormula.INSTALLER_NAME);
assertThat(stringAtomicFormula.getValue()).isEqualTo(installerName);
assertThat(stringAtomicFormula.getIsHashedValue()).isEqualTo(false);
assertThat(stringAtomicFormula.getIsHashedValue()).isFalse();
}
@Test
@@ -81,8 +81,8 @@ public class IntegrityFormulaTest {
(AtomicFormula.StringAtomicFormula) formula;
assertThat(stringAtomicFormula.getKey()).isEqualTo(AtomicFormula.INSTALLER_CERTIFICATE);
assertThat(stringAtomicFormula.getValue()).doesNotMatch(installerCertificate);
assertThat(stringAtomicFormula.getIsHashedValue()).isEqualTo(true);
assertThat(stringAtomicFormula.getValue()).matches(installerCertificate);
assertThat(stringAtomicFormula.getIsHashedValue()).isFalse();
}
@Test