summaryrefslogtreecommitdiff
path: root/tests/TtsTests
diff options
context:
space:
mode:
authorPhilip P. Moltmann <moltmann@google.com>2018-09-06 16:44:58 -0700
committerPhilip P. Moltmann <moltmann@google.com>2018-09-06 16:45:55 -0700
commit404b021b1f962d4c98590edbb8d8acd93fea60c9 (patch)
treeebe49608927e4a802e2e1947c9f5deeed8d67f4e /tests/TtsTests
parentc9fc995e0e410f7988bb43a3eed35e52bd9d8a34 (diff)
Fix usage of internal mockito API
The StubberImpl now takes an argument. Set it to default. Test: m -j TtsTests Change-Id: Id1175bd40489c7dee2c8c0993a65836d86e38cb3
Diffstat (limited to 'tests/TtsTests')
-rw-r--r--tests/TtsTests/src/com/android/speech/tts/TextToSpeechTests.java9
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>() {