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

Commit f94f046d authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "[Ravenwood] Make sure Mockito actually works" into main am: ea4fb335

parents 6536e104 ea4fb335
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -16,11 +16,19 @@
package com.android.ravenwoodtest.coretest;

import static org.junit.Assert.assertThrows;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.mock;

import org.junit.Test;

public class RavenwoodMockitoTest {

    private static class MockClass {
        void foo() {
            throw new RuntimeException("Unsupported!!");
        }
    }

    @Test
    public void checkMockitoClasses() {
        // DexMaker should not exist
@@ -32,4 +40,11 @@ public class RavenwoodMockitoTest {
                ClassNotFoundException.class,
                () -> Class.forName("org.mockito.Matchers"));
    }

    @Test
    public void checkMockitoActuallyWorks() {
        var mock = mock(MockClass.class);
        doNothing().when(mock).foo();
        mock.foo();
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ class Ravenizer {
            }
        }
        if (includeUnsupportedMockito(allClasses)) {
            log.w("Unsupported Mockito detected in $inJar}!")
            log.w("Unsupported Mockito detected in $inJar!")
        }

        stats.totalProcessTime = log.vTime("$executableName processing $inJar") {