Merge changes from topic "am-6bdea688c28849268d6f61289e1dda00"
* changes: Merge "Fix usage of internal mockito API" am:5666119e79am:a51e37783aam:b1f9c6200aMerge "Fix usage of internal mockito API" am:5666119e79am:2b0ee6cae3Fix usage of internal mockito API am:404b021b1fam:de5e2f221d
This commit is contained in:
committed by
Android (Google) Code Review
commit
e39414c82b
@@ -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>() {
|
||||
|
||||
Reference in New Issue
Block a user