Home
last modified time | relevance | path

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

123456789

/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 …]
DMoreMatchersTest.java28 when(mock.objectArgMethod(any(String.class))).thenReturn("string"); in should_help_out_with_unnecessary_casting()
69 when(mock.listArgMethod(anyListOf(String.class))).thenReturn("list"); in should_help_out_with_unnecessary_casting_of_lists()
79 when(mock.setArgMethod(anySetOf(String.class))).thenReturn("set"); in should_help_out_with_unnecessary_casting_of_sets()
89 when(mock.forMap(anyMapOf(String.class, String.class))).thenReturn("map"); in should_help_out_with_unnecessary_casting_of_maps()
99 when(mock.collectionArgMethod(anyCollectionOf(String.class))).thenReturn("collection"); in should_help_out_with_unnecessary_casting_of_collections()
109 when(mock.iterableArgMethod(anyIterableOf(String.class))).thenReturn("iterable"); in should_help_out_with_unnecessary_casting_of_iterables()
117 when(mock.objectArgMethod(isNull(LinkedList.class))).thenReturn("string"); in should_help_out_with_unnecessary_casting_of_nullity_checks()
118 when(mock.objectArgMethod(notNull(LinkedList.class))).thenReturn("string"); in should_help_out_with_unnecessary_casting_of_nullity_checks()
119 when(mock.objectArgMethod(isNotNull(LinkedList.class))).thenReturn("string"); in should_help_out_with_unnecessary_casting_of_nullity_checks()
DCustomMatchersTest.java57 when(mock.oneArg(booleanThat(new IsAnyBoolean()))).thenReturn("foo"); in shouldUseCustomBooleanMatcher()
67 when(mock.oneArg(charThat(new IsSorZ()))).thenReturn("foo"); in shouldUseCustomCharMatcher()
96 when(mock.oneArg(byteThat(new IsZeroOrOne<Byte>()))).thenReturn("byte"); in shouldUseCustomPrimitiveNumberMatchers()
97 when(mock.oneArg(shortThat(new IsZeroOrOne<Short>()))).thenReturn("short"); in shouldUseCustomPrimitiveNumberMatchers()
98 when(mock.oneArg(intThat(new IsZeroOrOne<Integer>()))).thenReturn("int"); in shouldUseCustomPrimitiveNumberMatchers()
99 when(mock.oneArg(longThat(new IsZeroOrOne<Long>()))).thenReturn("long"); in shouldUseCustomPrimitiveNumberMatchers()
100 when(mock.oneArg(floatThat(new IsZeroOrOne<Float>()))).thenReturn("float"); in shouldUseCustomPrimitiveNumberMatchers()
101 when(mock.oneArg(doubleThat(new IsZeroOrOne<Double>()))).thenReturn("double"); in shouldUseCustomPrimitiveNumberMatchers()
116 when(mock.oneArg(argThat(new ContainsFoo()))).thenReturn("foo"); in shouldUseCustomObjectMatcher()
/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/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/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/conscrypt/repackaged/openjdk/src/test/java/com/android/org/conscrypt/
DMockSessionBuilder.java76 when(session.getId()).thenReturn(id); in build()
77 when(session.isValid()).thenReturn(valid); in build()
78 when(session.isSingleUse()).thenReturn(singleUse); in build()
79 when(session.getProtocol()).thenReturn(TestUtils.getProtocols()[0]); in build()
80 when(session.getPeerHost()).thenReturn(host); in build()
81 when(session.getPeerPort()).thenReturn(port); in build()
82 when(session.getCipherSuite()).thenReturn(cipherSuite); in build()
83 when(session.toBytes()).thenReturn(encodedBytes); in build()
/external/conscrypt/openjdk/src/test/java/org/conscrypt/
DMockSessionBuilder.java75 when(session.getId()).thenReturn(id); in build()
76 when(session.isValid()).thenReturn(valid); in build()
77 when(session.isSingleUse()).thenReturn(singleUse); in build()
78 when(session.getProtocol()).thenReturn(TestUtils.getProtocols()[0]); in build()
79 when(session.getPeerHost()).thenReturn(host); in build()
80 when(session.getPeerPort()).thenReturn(port); in build()
81 when(session.getCipherSuite()).thenReturn(cipherSuite); in build()
82 when(session.toBytes()).thenReturn(encodedBytes); in build()
/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/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/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/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/mockitousage/bugs/
DCompareMatcherTest.java41 when(mock.forInteger(leq(5))).thenReturn(""); in compareNullArgument()
51 when(mock.forObject(leq(5))).thenReturn(""); in compareToNonCompareable()
61 when(mock.forInteger(leq((Integer) null))).thenReturn(""); in compareToNull()
71 when(mock.forObject(startsWith("Hello"))).thenReturn(""); in compareToStringVsInt()
78 when(mock.forObject(leq(5))).thenReturn(""); in compareToIntVsString()
103 when(mock.forObject(argThat(new TestMatcher()))).thenReturn("x"); in matchesOverloadsMustBeIgnored()
117 when(mock.forObject(argThat(new TestMatcher()))).thenReturn("x"); in matchesWithSubTypeExtendingGenericClass()
130 when(mock.forObject(argThat(new GenericMatcher<Integer>()))).thenReturn("x"); in matchesWithSubTypeGenericMethod()
/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()
/external/dagger2/producers/src/test/java/dagger/producers/monitoring/internal/
DMonitorsTest.java67 when(mockProductionComponentMonitorFactory.create(any(Object.class))).thenReturn(null); in singleMonitor_nullProductionComponentMonitor()
88 .thenReturn(mockProductionComponentMonitor); in singleMonitor_nullProducerMonitor()
90 .thenReturn(null); in singleMonitor_nullProducerMonitor()
102 .thenReturn(mockProductionComponentMonitor); in singleMonitor_throwingProductionComponentMonitor()
206 when(mockProductionComponentMonitorFactoryA.create(any(Object.class))).thenReturn(null); in multipleMonitors_nullProductionComponentMonitors()
207 when(mockProductionComponentMonitorFactoryB.create(any(Object.class))).thenReturn(null); in multipleMonitors_nullProductionComponentMonitors()
208 when(mockProductionComponentMonitorFactoryC.create(any(Object.class))).thenReturn(null); in multipleMonitors_nullProductionComponentMonitors()
241 .thenReturn(mockProductionComponentMonitorA); in multipleMonitors_someNullProductionComponentMonitors()
242 when(mockProductionComponentMonitorFactoryB.create(any(Object.class))).thenReturn(null); in multipleMonitors_someNullProductionComponentMonitors()
243 when(mockProductionComponentMonitorFactoryC.create(any(Object.class))).thenReturn(null); in multipleMonitors_someNullProductionComponentMonitors()
[all …]
/external/robolectric-shadows/robolectric/src/test/java/org/robolectric/shadows/
DShadowShortcutManagerTest.java50 when(shortcut1.getLongLabel()).thenReturn("original"); in testDynamicShortcuts_immutableShortcutDoesntGetUpdated()
52 when(shortcut2.getLongLabel()).thenReturn("updated"); in testDynamicShortcuts_immutableShortcutDoesntGetUpdated()
64 when(shortcut1.getLongLabel()).thenReturn("original"); in testShortcutWithIdenticalIdGetsUpdated()
66 when(shortcut2.getLongLabel()).thenReturn("updated"); in testShortcutWithIdenticalIdGetsUpdated()
113 when(shortcut1.getLongLabel()).thenReturn("original"); in testUpdateShortcut_dynamic()
115 when(shortcutUpdated.getLongLabel()).thenReturn("updated"); in testUpdateShortcut_dynamic()
128 when(shortcut1.getLongLabel()).thenReturn("original"); in testUpdateShortcut_pinned()
130 when(shortcutUpdated.getLongLabel()).thenReturn("updated"); in testUpdateShortcut_pinned()
142 when(shortcut1.getLongLabel()).thenReturn("original"); in testUpdateShortcutsOnlyUpdatesExistingShortcuts()
144 when(shortcutUpdated.getLongLabel()).thenReturn("updated"); in testUpdateShortcutsOnlyUpdatesExistingShortcuts()
[all …]

123456789