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

Commit 9b5ad36e authored by Adrian Roos's avatar Adrian Roos
Browse files

frameworks/base/: remove usages of deprecated Mockito matchers

Upstream Mockito has deleted the deprecated matchers
in the latest version. Migrate usage to replacements
to unblock upgrade.

Test: m checkbuild
Flag: TEST_ONLY
Bug: 310268946
Change-Id: I79cef17cbbe442d03194ca165151ee5e615767b0
parent 6bed3694
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ public class TextToSpeechTests extends InstrumentationTestCase {
        blockingCallSpeak("foo bar", delegate);
        ArgumentCaptor<SynthesisRequest> req = ArgumentCaptor.forClass(SynthesisRequest.class);
        Mockito.verify(delegate, Mockito.times(1)).onSynthesizeText(req.capture(),
                Mockito.<SynthesisCallback>anyObject());
                Mockito.<SynthesisCallback>any());

        assertEquals("eng", req.getValue().getLanguage());
        assertEquals("USA", req.getValue().getCountry());
@@ -133,7 +133,7 @@ public class TextToSpeechTests extends InstrumentationTestCase {
        blockingCallSpeak("le fou barre", delegate);
        ArgumentCaptor<SynthesisRequest> req2 = ArgumentCaptor.forClass(SynthesisRequest.class);
        Mockito.verify(delegate, Mockito.times(1)).onSynthesizeText(req2.capture(),
                        Mockito.<SynthesisCallback>anyObject());
                        Mockito.<SynthesisCallback>any());

        // The params are basically unchanged.
        assertEquals("eng", req2.getValue().getLanguage());
@@ -177,7 +177,7 @@ public class TextToSpeechTests extends InstrumentationTestCase {
        blockingCallSpeak("foo bar", delegate);
        ArgumentCaptor<SynthesisRequest> req = ArgumentCaptor.forClass(SynthesisRequest.class);
        Mockito.verify(delegate, Mockito.times(1)).onSynthesizeText(req.capture(),
                Mockito.<SynthesisCallback>anyObject());
                Mockito.<SynthesisCallback>any());

        assertEquals(defaultLocale.getISO3Language(), req.getValue().getLanguage());
        assertEquals(defaultLocale.getISO3Country(), req.getValue().getCountry());
@@ -189,8 +189,8 @@ public class TextToSpeechTests extends InstrumentationTestCase {
    private void blockingCallSpeak(String speech, IDelegate mock) throws
            InterruptedException {
        final CountDownLatch latch = new CountDownLatch(1);
        doCountDown(latch).when(mock).onSynthesizeText(Mockito.<SynthesisRequest>anyObject(),
                Mockito.<SynthesisCallback>anyObject());
        doCountDown(latch).when(mock).onSynthesizeText(Mockito.<SynthesisRequest>any(),
                Mockito.<SynthesisCallback>any());
        mTts.speak(speech, TextToSpeech.QUEUE_ADD, null);

        awaitCountDown(latch, 5, TimeUnit.SECONDS);