Home
last modified time | relevance | path

Searched refs:thenReturn (Results 1 – 25 of 258) sorted by relevance

1234567891011

/external/mockito/src/test/java/org/mockitousage/matchers/
DMatchersTest.java70 when(mock.oneArg(and(eq(false), eq(false)))).thenReturn("0"); in and_overloaded()
71 when(mock.oneArg(and(eq((byte) 1), eq((byte) 1)))).thenReturn("1"); in and_overloaded()
72 when(mock.oneArg(and(eq('a'), eq('a')))).thenReturn("2"); in and_overloaded()
73 when(mock.oneArg(and(eq(1D), eq(1D)))).thenReturn("3"); in and_overloaded()
74 when(mock.oneArg(and(eq(1F), eq(1F)))).thenReturn("4"); in and_overloaded()
75 when(mock.oneArg(and(eq(1), eq(1)))).thenReturn("5"); in and_overloaded()
76 when(mock.oneArg(and(eq(1L), eq(1L)))).thenReturn("6"); in and_overloaded()
77 when(mock.oneArg(and(eq((short) 1), eq((short) 1)))).thenReturn("7"); in and_overloaded()
78 when(mock.oneArg(and(contains("a"), contains("d")))).thenReturn("8"); in and_overloaded()
79 when(mock.oneArg(and(isA(Class.class), eq(Object.class)))).thenReturn("9"); in and_overloaded()
[all …]
DAnyXMatchersAcceptNullsTest.java29 when(mock.oneArg((Object) any())).thenReturn("matched"); in shouldAcceptNullsInAnyMatcher()
36 when(mock.oneArg((Object) anyObject())).thenReturn("matched"); in shouldAcceptNullsInAnyObjectMatcher()
43 when(mock.oneArg(anyString())).thenReturn("0"); in shouldNotAcceptNullInAnyXMatchers()
44 when(mock.forList(anyListOf(String.class))).thenReturn("1"); in shouldNotAcceptNullInAnyXMatchers()
45 when(mock.forMap(anyMapOf(String.class, String.class))).thenReturn("2"); in shouldNotAcceptNullInAnyXMatchers()
46 when(mock.forCollection(anyCollectionOf(String.class))).thenReturn("3"); in shouldNotAcceptNullInAnyXMatchers()
47 when(mock.forSet(anySetOf(String.class))).thenReturn("4"); in shouldNotAcceptNullInAnyXMatchers()
59 when(mock.forInteger(anyInt())).thenReturn("0"); in shouldNotAcceptNullInAllAnyPrimitiveWrapperMatchers()
60 when(mock.forCharacter(anyChar())).thenReturn("1"); in shouldNotAcceptNullInAllAnyPrimitiveWrapperMatchers()
61 when(mock.forShort(anyShort())).thenReturn("2"); in shouldNotAcceptNullInAllAnyPrimitiveWrapperMatchers()
[all …]
/external/robolectric-shadows/robolectric/src/test/java/org/robolectric/
DSdkPickerTest.java31 when(usesSdk.getTargetSdkVersion()).thenReturn(22); in withDefaultSdkConfig_shouldUseTargetSdkFromAndroidManifest()
38 when(usesSdk.getTargetSdkVersion()).thenReturn(22); in withAllSdksConfig_shouldUseFullSdkRangeFromAndroidManifest()
39 when(usesSdk.getMinSdkVersion()).thenReturn(19); in withAllSdksConfig_shouldUseFullSdkRangeFromAndroidManifest()
40 when(usesSdk.getMaxSdkVersion()).thenReturn(23); in withAllSdksConfig_shouldUseFullSdkRangeFromAndroidManifest()
47 when(usesSdk.getTargetSdkVersion()).thenReturn(22); in withAllSdksConfigAndNoMinSdkVersion_shouldUseFullSdkRangeFromAndroidManifest()
48 when(usesSdk.getMinSdkVersion()).thenReturn(1); in withAllSdksConfigAndNoMinSdkVersion_shouldUseFullSdkRangeFromAndroidManifest()
49 when(usesSdk.getMaxSdkVersion()).thenReturn(22); in withAllSdksConfigAndNoMinSdkVersion_shouldUseFullSdkRangeFromAndroidManifest()
57 when(usesSdk.getTargetSdkVersion()).thenReturn(22); in withAllSdksConfigAndNoMaxSdkVersion_shouldUseFullSdkRangeFromAndroidManifest()
58 when(usesSdk.getMinSdkVersion()).thenReturn(19); in withAllSdksConfigAndNoMaxSdkVersion_shouldUseFullSdkRangeFromAndroidManifest()
59 when(usesSdk.getMaxSdkVersion()).thenReturn(null); in withAllSdksConfigAndNoMaxSdkVersion_shouldUseFullSdkRangeFromAndroidManifest()
[all …]
/external/robolectric-shadows/robolectric/src/test/java/org/robolectric/res/
DDrawableResourceLoaderNoRunnerTest.java59 when(mockTestFile.getName()).thenReturn("foo.png"); in shouldFindDrawableResourcesWorkWithUnixJarFilePath()
60 when(mockTestFile.getBaseName()).thenReturn("foo"); in shouldFindDrawableResourcesWorkWithUnixJarFilePath()
63 when(mockTestDir.toString()).thenReturn(JAR_PATH_ON_UNIX); in shouldFindDrawableResourcesWorkWithUnixJarFilePath()
64 when(mockTestDir.getName()).thenReturn(DRAWABLE_DIR); in shouldFindDrawableResourcesWorkWithUnixJarFilePath()
65 when(mockTestDir.listFiles()).thenReturn(new FsFile[]{mockTestFile}); in shouldFindDrawableResourcesWorkWithUnixJarFilePath()
66 when(mockTestDir.isDirectory()).thenReturn(true); in shouldFindDrawableResourcesWorkWithUnixJarFilePath()
68 when(mockTestBaseDir.listFiles()).thenReturn(new FsFile[]{mockTestDir}); in shouldFindDrawableResourcesWorkWithUnixJarFilePath()
82 when(mockTestFile.getName()).thenReturn("foo.png"); in shouldFindDrawableResourcesWorkWithUnixFilePath()
83 when(mockTestFile.getBaseName()).thenReturn("foo"); in shouldFindDrawableResourcesWorkWithUnixFilePath()
86 when(mockTestDir.toString()).thenReturn(FILE_PATH_ON_UNIX); in shouldFindDrawableResourcesWorkWithUnixFilePath()
[all …]
/external/volley/src/test/java/com/android/volley/toolbox/
DAdaptedHttpStackTest.java47 when(mHttpResponse.getStatusLine()).thenReturn(mStatusLine); in setUp()
60 when(mHttpStack.performRequest(REQUEST, ADDITIONAL_HEADERS)).thenReturn(mHttpResponse); in emptyResponse()
61 when(mStatusLine.getStatusCode()).thenReturn(12345); in emptyResponse()
62 when(mHttpResponse.getAllHeaders()).thenReturn(new org.apache.http.Header[0]); in emptyResponse()
74 when(mHttpStack.performRequest(REQUEST, ADDITIONAL_HEADERS)).thenReturn(mHttpResponse); in nonEmptyResponse()
75 when(mStatusLine.getStatusCode()).thenReturn(12345); in nonEmptyResponse()
76 when(mHttpResponse.getAllHeaders()).thenReturn(new org.apache.http.Header[0]); in nonEmptyResponse()
77 when(mHttpResponse.getEntity()).thenReturn(mHttpEntity); in nonEmptyResponse()
78 when(mHttpEntity.getContentLength()).thenReturn((long) Integer.MAX_VALUE); in nonEmptyResponse()
79 when(mHttpEntity.getContent()).thenReturn(mContent); in nonEmptyResponse()
[all …]
DAndroidAuthenticatorTest.java56 .thenReturn(mFuture); in failedGetAuthToken()
67 .thenReturn(mFuture); in resultContainsIntent()
68 when(mFuture.getResult()).thenReturn(bundle); in resultContainsIntent()
69 when(mFuture.isDone()).thenReturn(true); in resultContainsIntent()
70 when(mFuture.isCancelled()).thenReturn(false); in resultContainsIntent()
78 .thenReturn(mFuture); in missingAuthToken()
79 when(mFuture.getResult()).thenReturn(bundle); in missingAuthToken()
80 when(mFuture.isDone()).thenReturn(true); in missingAuthToken()
81 when(mFuture.isCancelled()).thenReturn(false); in missingAuthToken()
96 .thenReturn(mFuture); in goodToken()
[all …]
/external/mockito/src/test/java/org/mockitousage/internal/junit/
DUnusedStubbingsFinderTest.java54 when(mock1.simpleMethod()).thenReturn("1"); in no_unused_stubbings()
65 when(mock1.simpleMethod()).thenReturn("1"); in unused_stubbings()
74 when(mock1.simpleMethod(1)).thenReturn("1"); in some_unused_stubbings()
75 when(mock2.simpleMethod(2)).thenReturn("2"); in some_unused_stubbings()
76 when(mock2.simpleMethod(3)).thenReturn("3"); in some_unused_stubbings()
91 when(mock1.simpleMethod(1)).thenReturn("1"); in unused_and_lenient_stubbings()
92 when(mock1.simpleMethod(2)).thenReturn("2"); in unused_and_lenient_stubbings()
93 lenient().when(mock2.simpleMethod(3)).thenReturn("3"); in unused_and_lenient_stubbings()
108 when(mock1.simpleMethod(1)).thenReturn("1"); in some_unused_stubbings_by_location()
109 when(mock2.simpleMethod(2)).thenReturn("2"); in some_unused_stubbings_by_location()
[all …]
/external/javaparser/javaparser-symbol-solver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/naming/
DNameLogicDisambiguationTest.java130 when(mockedFieldA.isStatic()).thenReturn(true); in ambiguousNameToSingleStaticImportDeclaration()
131 when(mockedFieldA.getName()).thenReturn("a"); in ambiguousNameToSingleStaticImportDeclaration()
132 when(mockedC.getAllFields()).thenReturn(Arrays.asList(mockedFieldA)); in ambiguousNameToSingleStaticImportDeclaration()
146 when(mockedFieldA.isStatic()).thenReturn(true); in ambiguousNameToStaticImportOnDemandDeclaration()
147 when(mockedFieldA.getName()).thenReturn("a"); in ambiguousNameToStaticImportOnDemandDeclaration()
148 when(mockedC.getAllFields()).thenReturn(Arrays.asList(mockedFieldA)); in ambiguousNameToStaticImportOnDemandDeclaration()
214 when(mockedC.asReferenceType()).thenReturn(mockedC); in ambiguousNameInQualifiedNameRequalifiedAsTypeNameLeadingToField()
215 when(mockedC.getAllMethods()).thenReturn(Collections.emptySet()); in ambiguousNameInQualifiedNameRequalifiedAsTypeNameLeadingToField()
216 when(mockedFieldC.isStatic()).thenReturn(true); in ambiguousNameInQualifiedNameRequalifiedAsTypeNameLeadingToField()
217 when(mockedFieldC.getName()).thenReturn("d"); in ambiguousNameInQualifiedNameRequalifiedAsTypeNameLeadingToField()
[all …]
/external/dexmaker/dexmaker-mockito-inline-tests/src/main/java/com/android/dx/mockito/inline/tests/
DMockFinal.java47 when(mockClassLoader.getParent()).thenReturn(fakeParent); in mockFinalJavaMethod()
59 when(mockAttributes.getColorMode()).thenReturn(42); in mockFinalAndroidFrameworkClass()
72 when(mockService.onBind(any(Intent.class))).thenReturn(fakeBinder); in mockFinalMethodOfAndroidFrameworkClass()
91 when(mock.returnA()).thenReturn("fakeA"); in mockNonDefaultConstructorClass()
105 when(mock.returnA()).thenReturn("fakeA"); in mockNonDefaultConstructorInterface()
147 when(mockedSuper.returnA()).thenReturn("fakeA"); in mockSubClass()
148 when(mockedSuper.returnB()).thenReturn("fakeB"); in mockSubClass()
149 when(mockedSuper.returnC()).thenReturn("fakeC"); in mockSubClass()
162 when(mocked.returnA()).thenReturn("fake2A"); in mockSubClass()
163 when(mocked.returnB()).thenReturn("fake2B"); in mockSubClass()
[all …]
DMockNonPublic.java36 when(c.returnA()).thenReturn("fakeA"); in mockSingleMethod()
44 when(c.returnA()).thenReturn("fakeA"); in spySingleMethod()
52 when(c.returnA()).thenReturn("fakeA"); in spyWrappedSingleMethod()
69 when(c.returnA()).thenReturn("fakeA"); in mockDualMethod()
73 when(c.returnB()).thenReturn("fakeB"); in mockDualMethod()
83 when(c.returnA()).thenReturn("fakeA"); in spyDualMethod()
87 when(c.returnB()).thenReturn("fakeB"); in spyDualMethod()
97 when(c.returnA()).thenReturn("fakeA"); in spyWrappedDualMethod()
101 when(c.returnB()).thenReturn("fakeB"); in spyWrappedDualMethod()
294 when(c.returnA()).thenReturn("fakeA"); in mockClassWithPackagePrivateMethod()
[all …]
/external/grpc-grpc-java/alts/src/test/java/io/grpc/alts/internal/
DAltsTsiHandshakerTest.java119 when(mockServer.startServerHandshake(transportBuffer)).thenReturn(outputFrame); in processBytesFromPeerStartServer()
120 when(mockServer.isFinished()).thenReturn(false); in processBytesFromPeerStartServer()
134 when(mockServer.startServerHandshake(transportBuffer)).thenReturn(emptyOutputFrame); in processBytesFromPeerStartServerEmptyOutput()
135 when(mockServer.isFinished()).thenReturn(false); in processBytesFromPeerStartServerEmptyOutput()
147 when(mockServer.startServerHandshake(transportBuffer)).thenReturn(outputFrame); in processBytesFromPeerStartServerFinished()
148 when(mockServer.isFinished()).thenReturn(true); in processBytesFromPeerStartServerFinished()
159 when(mockServer.startServerHandshake(transportBuffer)).thenReturn(emptyOutputFrame); in processBytesFromPeerNoBytesConsumed()
160 when(mockServer.isFinished()).thenReturn(false); in processBytesFromPeerNoBytesConsumed()
175 when(mockClient.startClientHandshake()).thenReturn(outputFrame); in processBytesFromPeerClientNext()
176 when(mockClient.next(transportBuffer)).thenReturn(outputFrame); in processBytesFromPeerClientNext()
[all …]
/external/conscrypt/openjdk/src/test/java/org/conscrypt/
DMockSessionBuilder.java77 when(session.getId()).thenReturn(id); in build()
78 when(session.isValid()).thenReturn(valid); in build()
79 when(session.isSingleUse()).thenReturn(singleUse); in build()
80 when(session.getProtocol()).thenReturn(TestUtils.getProtocols()[0]); in build()
81 when(session.getPeerHost()).thenReturn(host); in build()
82 when(session.getPeerPort()).thenReturn(port); in build()
83 when(session.getCipherSuite()).thenReturn(cipherSuite); in build()
84 when(session.toBytes()).thenReturn(encodedBytes); in build()
85 when(session.toSSLSession()).thenReturn(mock(SSLSession.class)); in build()
/external/jackson-databind/src/test/java/com/fasterxml/jackson/databind/
DObjectReaderValueOfWithValueTypeTest.java43 when(objectReader.readValue((String) any())).thenReturn(pojo); in testValueOfStringWithValueType()
44 when(objectReader.forType((Class<?>) any())).thenReturn(objectReader); in testValueOfStringWithValueType()
58 when(objectReader.forType((Class<?>) any())).thenReturn(objectReader); in testValueOfByteArrayWithValueType()
59 when(objectReader.readValue((byte[]) any())).thenReturn(pojo); in testValueOfByteArrayWithValueType()
72 when(objectReader.forType((Class<?>) any())).thenReturn(objectReader); in testValueOfDataInputWithValueType()
73 when(objectReader.readValue((DataInput) any())).thenReturn(pojo); in testValueOfDataInputWithValueType()
86 when(objectReader.forType((Class<?>) any())).thenReturn(objectReader); in testValueOfFileWithValueType()
87 when(objectReader.readValue((File) any())).thenReturn(pojo); in testValueOfFileWithValueType()
100 when(objectReader.forType((Class<?>) any())).thenReturn(objectReader); in testValueOfInputStreamWithValueType()
101 when(objectReader.readValue((InputStream) any())).thenReturn(pojo); in testValueOfInputStreamWithValueType()
[all …]
/external/conscrypt/repackaged/openjdk/src/test/java/com/android/org/conscrypt/
DMockSessionBuilder.java78 when(session.getId()).thenReturn(id); in build()
79 when(session.isValid()).thenReturn(valid); in build()
80 when(session.isSingleUse()).thenReturn(singleUse); in build()
81 when(session.getProtocol()).thenReturn(TestUtils.getProtocols()[0]); in build()
82 when(session.getPeerHost()).thenReturn(host); in build()
83 when(session.getPeerPort()).thenReturn(port); in build()
84 when(session.getCipherSuite()).thenReturn(cipherSuite); in build()
85 when(session.toBytes()).thenReturn(encodedBytes); in build()
86 when(session.toSSLSession()).thenReturn(mock(SSLSession.class)); in build()
/external/guava/guava-tests/test/com/google/common/collect/
DConcurrentHashMultisetTest.java111 when(backingMap.isEmpty()).thenReturn(true);
118 when(backingMap.get(KEY)).thenReturn(new AtomicInteger(COUNT));
124 when(backingMap.get(KEY)).thenReturn(null);
132 when(backingMap.get(KEY)).thenReturn(new AtomicInteger(INITIAL_COUNT));
139 when(backingMap.get(KEY)).thenReturn(null);
140 when(backingMap.putIfAbsent(eq(KEY), isA(AtomicInteger.class))).thenReturn(null);
150 when(backingMap.get(KEY)).thenReturn(initial);
160 when(backingMap.get(KEY)).thenReturn(new AtomicInteger(INITIAL_COUNT));
180 when(backingMap.get(KEY)).thenReturn(null);
182 when(backingMap.putIfAbsent(eq(KEY), isA(AtomicInteger.class))).thenReturn(existingZero);
[all …]
/external/guava/android/guava-tests/test/com/google/common/collect/
DConcurrentHashMultisetTest.java111 when(backingMap.isEmpty()).thenReturn(true);
118 when(backingMap.get(KEY)).thenReturn(new AtomicInteger(COUNT));
124 when(backingMap.get(KEY)).thenReturn(null);
132 when(backingMap.get(KEY)).thenReturn(new AtomicInteger(INITIAL_COUNT));
139 when(backingMap.get(KEY)).thenReturn(null);
140 when(backingMap.putIfAbsent(eq(KEY), isA(AtomicInteger.class))).thenReturn(null);
150 when(backingMap.get(KEY)).thenReturn(initial);
160 when(backingMap.get(KEY)).thenReturn(new AtomicInteger(INITIAL_COUNT));
180 when(backingMap.get(KEY)).thenReturn(null);
182 when(backingMap.putIfAbsent(eq(KEY), isA(AtomicInteger.class))).thenReturn(existingZero);
[all …]
/external/mockito/src/test/java/org/mockitousage/stubbing/
DDeepStubbingTest.java80 when(sf.createSocket(anyString(), eq(80))).thenReturn(null); in myTest()
88 when(socket.getOutputStream()).thenReturn(out); in simpleCase()
101 when(socketFactory.createSocket().getOutputStream()).thenReturn(out); in oneLevelDeep()
115 when(sf1.createSocket().getOutputStream()).thenReturn(out1); in interactions()
118 when(sf2.createSocket().getOutputStream()).thenReturn(out2); in interactions()
134 when(sf.createSocket().getOutputStream()).thenReturn(out1); in withArguments()
135 when(sf.createSocket("google.com", 80).getOutputStream()).thenReturn(out2); in withArguments()
136 when(sf.createSocket("stackoverflow.com", 80).getOutputStream()).thenReturn(out3); in withArguments()
152 when(sf.createSocket(anyString(), anyInt()).getOutputStream()).thenReturn(out); in withAnyPatternArguments()
167 when(sf.createSocket(anyString(), eq(80)).getOutputStream()).thenReturn(out1); in withComplexPatternArguments()
[all …]
DStubbingConsecutiveAnswersTest.java25 .thenReturn("one") in should_return_consecutive_values()
26 .thenReturn("two") in should_return_consecutive_values()
27 .thenReturn("three"); in should_return_consecutive_values()
38 when(mock.simpleMethod()).thenReturn(null, (String[]) null); in should_return_consecutive_values_for_two_nulls()
46 when(mock.simpleMethod()).thenReturn("one", (String) null); in should_return_consecutive_values_first_var_arg_null()
55 when(mock.simpleMethod()).thenReturn("one", (String[]) null); in should_return_consecutive_values_var_arg_null()
64 when(mock.simpleMethod()).thenReturn("one", "two", null); in should_return_consecutive_values_var_args_contain_null()
74 when(mock.simpleMethod()).thenReturn("one", "two", "three"); in should_return_consecutive_values_set_by_shorten_then_return_method()
85 when(mock.simpleMethod()).thenReturn("zero") in should_return_consecutive_value_and_throw_exceptions_set_by_shorten_return_methods()
86 .thenReturn("one", "two") in should_return_consecutive_value_and_throw_exceptions_set_by_shorten_return_methods()
[all …]
/external/mockito/src/test/java/org/mockitousage/jls/
DJLS_15_12_2_5Test.java57 when(mock.oneArg(isNull())).thenReturn("ok"); in with_single_arg()
69 when(mock.oneArg((String) isNull())).thenReturn("ok"); in with_single_arg_and_matcher_cast()
78 when(mock.oneArg(isNull())).thenReturn("ok"); in with_single_arg_and_null_Object_reference()
88 when(mock.varargs(isNull())).thenReturn("ok"); in with_variable_arg()
100 when(mock.varargs((String) isNull())).thenReturn("ok"); in with_variable_arg_and_matcher_String_cast()
109 when(mock.varargs((String[]) isNull())).thenReturn("ok"); in with_variable_arg_and_matcher_String_array_cast()
118 when(mock.varargs(isNull())).thenReturn("ok"); in with_variable_arg_and_null_Object_array()
128 when(mock.varargs(isNull())).thenReturn("ok"); in with_variable_arg_and_null_Object_arg()
191 when(mock.oneArg(isNull())).thenReturn("ok"); in with_single_arg()
200 when(mock.oneArg(isNull())).thenReturn("ok"); in with_single_arg_and_null_Object_reference()
[all …]
/external/mockito/src/test/java/org/mockitousage/examples/use/
DExampleTest.java31 when(mockCalculator.countArticles("Guardian")).thenReturn(12); in managerCountsArticlesAndSavesThemInTheDatabase()
32 when(mockCalculator.countArticlesInPolish(anyString())).thenReturn(5); in managerCountsArticlesAndSavesThemInTheDatabase()
64 when(mockCalculator.countNumberOfRelatedArticles(articleOne)).thenReturn(1); in managerUpdatesNumberOfRelatedArticles()
65 when(mockCalculator.countNumberOfRelatedArticles(articleTwo)).thenReturn(12); in managerUpdatesNumberOfRelatedArticles()
66 when(mockCalculator.countNumberOfRelatedArticles(articleThree)).thenReturn(0); in managerUpdatesNumberOfRelatedArticles()
68 …when(mockDatabase.getArticlesFor("Guardian")).thenReturn(Arrays.asList(articleOne, articleTwo, art… in managerUpdatesNumberOfRelatedArticles()
82 when(mockCalculator.countNumberOfRelatedArticles(articleOne)).thenReturn(1); in shouldPersistRecalculatedArticle()
83 when(mockCalculator.countNumberOfRelatedArticles(articleTwo)).thenReturn(12); in shouldPersistRecalculatedArticle()
85 … when(mockDatabase.getArticlesFor("Guardian")).thenReturn(Arrays.asList(articleOne, articleTwo)); in shouldPersistRecalculatedArticle()
/external/mockito/src/test/java/org/mockito/internal/junit/
DArgMismatchFinderTest.java34 when(mock1.simpleMethod(1)).thenReturn("1"); in no_mismatch_when_mock_different()
47 when(mock1.simpleMethod(1)).thenReturn("1"); in no_mismatch_when_method_different()
60 when(mock1.simpleMethod(1)).thenReturn("1"); in no_mismatch_when_stubbing_used()
74 when(mock1.simpleMethod(1)).thenReturn("1"); in stubbing_mismatch()
87 when(mock1.simpleMethod(1)).thenReturn("1"); in single_mismatch_with_multiple_invocations()
102 when(mock1.simpleMethod(1)).thenReturn("1"); in single_invocation_with_multiple_stubs()
103 when(mock1.simpleMethod(2)).thenReturn("2"); in single_invocation_with_multiple_stubs()
118 when(mock1.simpleMethod(1)).thenReturn("1"); //unused in mismatch_reports_only_unstubbed_invocations()
119 when(mock1.simpleMethod(2)).thenReturn("2"); //used in mismatch_reports_only_unstubbed_invocations()
/external/dagger2/javatests/dagger/producers/monitoring/
DTimingRecordersTest.java77 when(mockProductionComponentTimingRecorderFactory.create(any(Object.class))).thenReturn(null); in singleRecorder_nullProductionComponentTimingRecorder()
99 .thenReturn(mockProductionComponentTimingRecorder); in singleRecorder_nullProducerTimingRecorder()
102 .thenReturn(null); in singleRecorder_nullProducerTimingRecorder()
114 .thenReturn(mockProductionComponentTimingRecorder); in singleRecorder_throwingProductionComponentTimingRecorder()
189 when(mockProductionComponentTimingRecorderFactoryA.create(any(Object.class))).thenReturn(null); in multipleRecorders_nullProductionComponentTimingRecorders()
190 when(mockProductionComponentTimingRecorderFactoryB.create(any(Object.class))).thenReturn(null); in multipleRecorders_nullProductionComponentTimingRecorders()
191 when(mockProductionComponentTimingRecorderFactoryC.create(any(Object.class))).thenReturn(null); in multipleRecorders_nullProductionComponentTimingRecorders()
223 .thenReturn(mockProductionComponentTimingRecorderA); in multipleRecorders_someNullProductionComponentTimingRecorders()
224 when(mockProductionComponentTimingRecorderFactoryB.create(any(Object.class))).thenReturn(null); in multipleRecorders_someNullProductionComponentTimingRecorders()
225 when(mockProductionComponentTimingRecorderFactoryC.create(any(Object.class))).thenReturn(null); in multipleRecorders_someNullProductionComponentTimingRecorders()
[all …]
/external/grpc-grpc-java/netty/src/test/java/io/grpc/netty/
DNettyStreamTestBase.java91 when(channel.alloc()).thenReturn(UnpooledByteBufAllocator.DEFAULT); in setUp()
92 when(channel.pipeline()).thenReturn(pipeline); in setUp()
93 when(channel.eventLoop()).thenReturn(eventLoop); in setUp()
94 when(channel.newPromise()).thenReturn(new DefaultChannelPromise(channel)); in setUp()
95 when(channel.voidPromise()).thenReturn(new DefaultChannelPromise(channel)); in setUp()
98 when(channel.write(any())).thenReturn(completedPromise); in setUp()
99 when(channel.writeAndFlush(any())).thenReturn(completedPromise); in setUp()
100 when(writeQueue.enqueue(any(QueuedCommand.class), anyBoolean())).thenReturn(completedPromise); in setUp()
101 when(pipeline.firstContext()).thenReturn(ctx); in setUp()
102 when(eventLoop.inEventLoop()).thenReturn(true); in setUp()
[all …]
/external/dexmaker/dexmaker-mockito-tests/src/main/java/com/android/dx/mockito/tests/
DGeneralMocking.java78 when(t.returnA()).thenReturn("B"); in mockClass()
88 when(t.returnA()).thenReturn("B"); in mockInterface()
99 when(t.returnA()).thenReturn("B"); in spyClass()
112 when(t.returnA()).thenReturn("B"); in spyNewClass()
191 when(t.concat("a", "b")).thenReturn("match"); in callInterfaceWithoutMatcher()
201 when(t.concat(eq("a"), anyString())).thenReturn("match"); in callInterfaceWithMatcher()
211 when(t.concat(eq("a"), (String) isNull())).thenReturn("match"); in callInterfaceWithNullMatcher()
221 when(t.concat("a", "b")).thenReturn("match"); in callClassWithoutMatcher()
231 when(t.concat(eq("a"), anyString())).thenReturn("match"); in callClassWithMatcher()
241 when(t.concat(eq("a"), (String) isNull())).thenReturn("match"); in callClassWithNullMatcher()
[all …]
/external/mockito/src/test/java/org/concurrentmockito/
DThreadsShareGenerouslyStubbedMockTest.java32 .thenReturn("foo") in performTest()
33 .thenReturn("bar") in performTest()
34 .thenReturn("baz") in performTest()
35 .thenReturn("foo") in performTest()
36 .thenReturn("bar") in performTest()
37 .thenReturn("baz"); in performTest()

1234567891011