Home
last modified time | relevance | path

Searched refs:willReturn (Results 1 – 19 of 19) sorted by relevance

/external/mockito/src/test/java/org/mockitousage/junitrule/
DStrictJUnitRuleTest.java21 import static org.mockito.BDDMockito.willReturn;
40 given(mock.simpleMethod(10)).willReturn("foo"); in ok_when_all_stubbings_used()
45 given(mock.simpleMethod(10)).willReturn("foo"); in ok_when_used_and_mismatched_argument()
55 given(mock.simpleMethod(10)).willReturn("foo"); in fails_when_unused_stubbings()
64 given(mock.simpleMethod(10)).willReturn("foo"); in test_failure_trumps_unused_stubbings()
109 willReturn("10").given(mock).simpleMethod(10) ; //used in fails_fast_when_stubbing_invoked_with_different_argument()
110 willReturn("20").given(mock).simpleMethod(20) ; //unused in fails_fast_when_stubbing_invoked_with_different_argument()
111 willReturn("30").given(mock).simpleMethod(30) ; //unused in fails_fast_when_stubbing_invoked_with_different_argument()
124 given(mock.simpleMethod(10)).willReturn("foo"); in verify_no_more_interactions_ignores_stubs()
150 given(mock.simpleMethod(10)).willReturn("foo"); in unused_stubs_with_multiple_mocks()
[all …]
/external/mockito/src/test/java/org/mockitousage/
DCompilationWarningsTest.java51 willReturn(null).given(mock(IMethods.class)).objectReturningMethodNoArgs(); in no_warnings_for_most_common_api()
52 willReturn("a", 12).given(mock(IMethods.class)).objectReturningMethodNoArgs(); in no_warnings_for_most_common_api()
53 willReturn(1000).given(mock(IMethods.class)).objectReturningMethodNoArgs(); in no_warnings_for_most_common_api()
58 … willAnswer(ignore()).willReturn(null).given(mock(IMethods.class)).objectReturningMethodNoArgs(); in no_warnings_for_most_common_api()
59 …willAnswer(ignore()).willReturn("a", 12).given(mock(IMethods.class)).objectReturningMethodNoArgs(); in no_warnings_for_most_common_api()
60 … willAnswer(ignore()).willReturn(1000).given(mock(IMethods.class)).objectReturningMethodNoArgs(); in no_warnings_for_most_common_api()
65 given(mock(IMethods.class).objectReturningMethodNoArgs()).willReturn(null); in no_warnings_for_most_common_api()
66 given(mock(IMethods.class).objectReturningMethodNoArgs()).willReturn("a", 12L); in no_warnings_for_most_common_api()
67 given(mock(IMethods.class).objectReturningMethodNoArgs()).willReturn(1000); in no_warnings_for_most_common_api()
72 given(mock(IMethods.class).objectReturningMethodNoArgs()).will(ignore()).willReturn(null); in no_warnings_for_most_common_api()
[all …]
DPlaygroundWithDemoOfUnclonedParametersProblemTest.java46 … given(importLogDao.anyImportRunningOrRunnedToday(importType, currentDate)).willReturn(false); in shouldIncludeInitialLog()
65 … given(importLogDao.anyImportRunningOrRunnedToday(importType, currentDate)).willReturn(false); in shouldAlterFinalLog()
/external/mockito/src/test/java/org/mockitousage/stubbing/
DStrictStubbingEndToEndTest.java90 given(mock.simpleMethod("1")).willReturn("one"); in unnecessary_stubbing()
104 given(mock.simpleMethod(1)).willReturn(""); in mismatch()
118 given(mock.simpleMethod(1)).willReturn(""); in used()
127 given(mock.simpleMethod(1)).willReturn(""); in unused()
131 given(mock.simpleMethod(2)).willReturn(""); in mismatch()
140 given(mock.simpleMethod(1)).willReturn(""); in unused()
144 given(mock.simpleMethod(2)).willReturn(""); in mismatch()
154 given(mock.simpleMethod("1")).willReturn("one"); in unused()
158 given(mock.simpleMethod("1")).willReturn("one"); in unused2()
DStrictStubbingTest.java57 given(mock.simpleMethod(100)).willReturn("100"); in stubbed_method_is_implicitly_verified()
66 given(mock.simpleMethod(100)).willReturn("100"); in unused_stubbed_is_not_implicitly_verified()
80 given(mock.simpleMethod(100)).willReturn("100"); in stubbing_argument_mismatch()
92 given(mock.simpleMethod(100)).willReturn("100"); in unused_stubbing()
DStubbingWarningsTest.java51 given(mock.simpleMethod(100)).willReturn("100"); in stubbing_used()
61 given(mock.simpleMethod(100)).willReturn("100"); in unused_stubbed_is_not_implicitly_verified()
72 given(mock.simpleMethod(100)).willReturn("100"); in stubbing_argument_mismatch()
88 given(mock.simpleMethod(100)).willReturn("100"); in unused_stubbing()
DDeepStubbingTest.java212 given(person.getAddress().getStreet().getName()).willReturn("Norymberska"); in shouldStubbingBasicallyWorkFine()
317 given(person.getFinalClass()).willReturn(value); in shouldFailGracefullyWhenClassIsFinal()
/external/mockito/src/test/java/org/mockito/internal/configuration/plugins/
DPluginLoaderTest.java19 import static org.mockito.BDDMockito.willReturn;
43 willReturn(null).given(initializer).loadImpl(FooPlugin.class); in loads_alternative_plugin()
45 willReturn(expected).given(initializer).loadImpl(BarPlugin.class); in loads_alternative_plugin()
56 willReturn(null).given(initializer).loadImpl(FooPlugin.class); in loads_default_plugin()
57 willReturn(null).given(initializer).loadImpl(BarPlugin.class); in loads_default_plugin()
59 willReturn(expected).given(plugins).getDefaultPlugin(FooPlugin.class); in loads_default_plugin()
/external/mockito/src/main/java/org/mockito/
DBDDMockito.java105 BDDMyOngoingStubbing<T> willReturn(T value); in willReturn() method
112 BDDMyOngoingStubbing<T> willReturn(T value, T... values); in willReturn() method
163 public BDDMyOngoingStubbing<T> willReturn(T value) { in willReturn() method in BDDMockito.BDDOngoingStubbingImpl
167 public BDDMyOngoingStubbing<T> willReturn(T value, T... values) { in willReturn() method in BDDMockito.BDDOngoingStubbingImpl
359 BDDStubber willReturn(Object toBeReturned); in willReturn() method
366 BDDStubber willReturn(Object toBeReturned, Object... nextToBeReturned); in willReturn() method
432 public BDDStubber willReturn(Object toBeReturned) { in willReturn() method in BDDMockito.BDDStubberImpl
436 public BDDStubber willReturn(Object toBeReturned, Object... nextToBeReturned) { in willReturn() method in BDDMockito.BDDStubberImpl
509 public static BDDStubber willReturn(Object toBeReturned) { in willReturn() method in BDDMockito
518 public static BDDStubber willReturn(Object toBeReturned, Object... toBeReturnedNext) { in willReturn() method in BDDMockito
/external/mockito/src/test/java/org/mockitousage/strictness/
DStrictnessPerMockTest.java55 given(lenientMock.simpleMethod(100)).willReturn("100"); in potential_stubbing_problem()
56 given(strictStubsMock.simpleMethod(100)).willReturn("100"); in potential_stubbing_problem()
73 given(lenientMock.simpleMethod(100)).willReturn("100"); in unnecessary_stubbing()
74 given(strictStubsMock.simpleMethod(100)).willReturn("100"); in unnecessary_stubbing()
93 given(lenientMock.simpleMethod(100)).willReturn("100"); in verify_no_more_invocations()
94 given(strictStubsMock.simpleMethod(100)).willReturn("100"); in verify_no_more_invocations()
/external/mockito/src/test/java/org/mockitousage/customization/
DBDDMockitoTest.java33 given(mock.simpleMethod("foo")).willReturn("bar"); in should_stub()
99 .willReturn("foo") in should_stub_consecutively()
100 .willReturn("bar"); in should_stub_consecutively()
109 .willReturn("foo", "bar", 12L, new byte[0]); in should_return_consecutively()
120 willReturn("foo").willCallRealMethod() in should_stub_consecutively_with_call_real_method()
191 willReturn("foo").given(mock).simpleMethod("bar"); in should_stub_using_do_return_style()
233 Set<?> returnedMock = given(expectedMock.isEmpty()).willReturn(false).getMock(); in should_all_stubbed_mock_reference_access()
/external/mockito/src/test/java/org/mockito/internal/util/reflection/
DParameterizedConstructorInstantiatorTest.java73 …given(resolver.resolveTypeInstances(Matchers.<Class<?>[]>anyVararg())).willReturn(new Object[]{ ob… in should_instantiate_type_if_resolver_provide_matching_types()
86 …given(resolver.resolveTypeInstances(Matchers.<Class<?>[]>anyVararg())).willReturn(new Object[]{ ob… in should_fail_if_an_argument_instance_type_do_not_match_wanted_type()
98 …given(resolver.resolveTypeInstances(Matchers.<Class<?>[]>anyVararg())).willReturn(new Object[]{ nu… in should_report_failure_if_constructor_throws_exception()
111 …given(resolver.resolveTypeInstances(Matchers.<Class<?>[]>anyVararg())).willReturn(new Object[]{ ""… in should_instantiate_type_with_vararg_constructor()
DFieldInitializerTest.java160 .willReturn(new Object[]{null}).getMock(); in can_instantiate_class_with_parameterized_constructor()
/external/mockito/src/test/java/org/mockito/internal/handler/
DMockHandlerImplTest.java83 given(mockSettings.getDefaultAnswer()).willReturn(new Returns(AWrongType.WRONG_TYPE)); in should_report_bogus_default_answer()
104 given(handler.invocationContainer.findAnswerFor(any(Invocation.class))).willReturn(value); in stub_ordinary_invocation_with_invocation_matcher()
112 … given(handler.getMockSettings().getInvocationListeners()).willReturn(Arrays.asList(listener)); in create_handler_with_listeners()
DInvocationNotifierHandlerTest.java62 given(mockHandler.handle(invocation)).willReturn("returned value"); in should_notify_all_listeners_when_calling_delegate_handler()
76 given(mockHandler.handle(invocation)).willReturn(computedException); in should_notify_all_listeners_when_called_delegate_handler_returns_ex()
/external/mockito/src/test/java/org/mockitousage/debugging/
DInvocationListenerCallbackTest.java20 import static org.mockito.BDDMockito.willReturn;
39 willReturn("basil").given(foo).giveMeSomeString("herb"); in should_call_single_listener_when_mock_return_normally()
86 given(foo.giveMeSomeString("herb")).willReturn("rosemary"); in should_call_all_listener_when_mock_return_normally()
DVerboseLoggingOfInvocationsOnMockTest.java88 given(foo.giveMeSomeString("Klipsch")).willReturn("earbuds"); in shouldPrintStubbedInvocationOnMockToStdOut()
145 given(foo.giveMeSomeString("Apple")).willReturn( in usage()
/external/mockito/src/test/java/org/mockitousage/bugs/
DGenericsMockitoAnnotationsTest.java27 …given(testCollectionSourceProvider.getCollection(new ArrayList<Integer>())).willReturn(new ArrayLi… in should_not_throw_class_cast_exception()
/external/mockito/src/test/java/org/mockito/internal/util/
DDefaultMockingDetailsTest.java183 given(mock.simpleMethod("different arg")).willReturn("foo"); in prints_invocations()