Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7566acd authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix broken tests caused by the fix on autohashing certificates (that...

Merge "Fix broken tests caused by the fix on autohashing certificates (that results in double hashing)."
parents a2475725 00110ed7
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -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
+6 −6
Original line number Diff line number Diff line
@@ -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