diff options
| author | 2018-09-07 15:27:24 +0000 | |
|---|---|---|
| committer | 2018-09-07 15:27:24 +0000 | |
| commit | 5666119e79c9e8f3cc7e90c5161409d5afdca8b5 (patch) | |
| tree | f0f46e662c6d26a12e218cd38e6639a403a63510 | |
| parent | fdd378c594c68f2bd2226315dc2838b58ed2131f (diff) | |
| parent | 404b021b1f962d4c98590edbb8d8acd93fea60c9 (diff) | |
Merge "Fix usage of internal mockito API"
| -rw-r--r-- | tests/TtsTests/src/com/android/speech/tts/TextToSpeechTests.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/TtsTests/src/com/android/speech/tts/TextToSpeechTests.java b/tests/TtsTests/src/com/android/speech/tts/TextToSpeechTests.java index 918873bf0bdd..d9bb7db17685 100644 --- a/tests/TtsTests/src/com/android/speech/tts/TextToSpeechTests.java +++ b/tests/TtsTests/src/com/android/speech/tts/TextToSpeechTests.java @@ -28,6 +28,7 @@ import org.mockito.internal.stubbing.StubberImpl; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import org.mockito.stubbing.Stubber; +import org.mockito.quality.Strictness; import junit.framework.Assert; import java.util.Locale; @@ -210,12 +211,16 @@ public class TextToSpeechTests extends InstrumentationTestCase { } public static abstract class CountDownBehaviour extends StubberImpl { + public CountDownBehaviour(Strictness strictness) { + super(strictness); + } + /** Used to mock methods that return a result. */ public abstract Stubber andReturn(Object result); } public static CountDownBehaviour doCountDown(final CountDownLatch latch) { - return new CountDownBehaviour() { + return new CountDownBehaviour(Strictness.WARN) { @Override public <T> T when(T mock) { return Mockito.doAnswer(new Answer<Void>() { @@ -229,7 +234,7 @@ public class TextToSpeechTests extends InstrumentationTestCase { @Override public Stubber andReturn(final Object result) { - return new StubberImpl() { + return new StubberImpl(Strictness.WARN) { @Override public <T> T when(T mock) { return Mockito.doAnswer(new Answer<Object>() { |