Home
last modified time | relevance | path

Searched refs:defaultAnswer (Results 1 – 21 of 21) sorted by relevance

/external/mockito/src/main/java/org/mockito/internal/creation/
DMockSettingsImpl.java81 public MockSettings defaultAnswer(Answer defaultAnswer) { in defaultAnswer() argument
82 this.defaultAnswer = defaultAnswer; in defaultAnswer()
83 if (defaultAnswer == null) { in defaultAnswer()
90 return defaultAnswer; in getDefaultAnswer()
/external/mockito/src/main/java/org/mockito/
DMockito.java1639 .defaultAnswer(RETURNS_DEFAULTS)); in mock()
1677 public static <T> T mock(Class<T> classToMock, Answer defaultAnswer) { in mock() argument
1678 return mock(classToMock, withSettings().defaultAnswer(defaultAnswer)); in mock()
1790 .defaultAnswer(CALLS_REAL_METHODS)); in spy()
1824 .defaultAnswer(CALLS_REAL_METHODS)); in spy()
2711 return new MockSettingsImpl().defaultAnswer(RETURNS_DEFAULTS); in withSettings()
DMockSettings.java143 MockSettings defaultAnswer(Answer defaultAnswer); in defaultAnswer() method
/external/mockito/src/test/java/org/mockitousage/constructor/
DCreatingMocksWithConstructorTest.java37 …Message mock = mock(Message.class, withSettings().useConstructor().defaultAnswer(CALLS_REAL_METHOD… in can_create_mock_with_constructor()
44 …ge mock = mock(AbstractMessage.class, withSettings().useConstructor().defaultAnswer(CALLS_REAL_MET… in can_mock_abstract_classes()
56 …InnerClass.class, withSettings().useConstructor().outerInstance(this).defaultAnswer(CALLS_REAL_MET… in can_mock_inner_classes()
81 …nnerClass.class, withSettings().useConstructor().outerInstance("foo").defaultAnswer(CALLS_REAL_MET… in mocking_inner_classes_with_wrong_outer_instance()
139 List list = mock(List.class, withSettings().defaultAnswer(CALLS_REAL_METHODS)); in calls_real_interface_method()
/external/mockito/src/main/java/org/mockito/internal/creation/settings/
DCreationSettings.java27 protected Answer<Object> defaultAnswer; field in CreationSettings
44 this.defaultAnswer = copy.defaultAnswer; in CreationSettings()
80 return defaultAnswer; in getDefaultAnswer()
/external/mockito/src/test/java/org/mockitousage/stubbing/
DStubbingWithDelegateVarArgsTest.java28 .defaultAnswer(delegatesTo(new FooImpl()))); in should_not_fail_when_calling_varargs_method()
35 .defaultAnswer(delegatesTo(new FooImpl()))); in should_not_fail_when_calling_varargs_method_without_arguments()
43 .defaultAnswer(delegatesTo(new FooImpl()))); in should_not_fail_when_calling_varargs_method_with_null_argument()
/external/mockito/src/test/java/org/mockitousage/serialization/
DDeepStubsSerializableTest.java18 …SampleClass sampleClass = mock(SampleClass.class, withSettings().defaultAnswer(RETURNS_DEEP_STUBS)… in should_serialize_and_deserialize_mock_created_with_deep_stubs()
33 …ListContainer deep_stubbed = mock(ListContainer.class, withSettings().defaultAnswer(RETURNS_DEEP_S… in should_serialize_and_deserialize_parameterized_class_mocked_with_deep_stubs()
47 …ListContainer deep_stubbed = mock(ListContainer.class, withSettings().defaultAnswer(RETURNS_DEEP_S… in should_discard_generics_metadata_when_serialized_then_disabling_deep_stubs_with_generics()
/external/mockito/src/test/java/org/mockito/configuration/
DMockitoConfiguration.java21 public void overrideDefaultAnswer(Answer<Object> defaultAnswer) { in overrideDefaultAnswer() argument
22 this.overriddenDefaultAnswer = defaultAnswer; in overrideDefaultAnswer()
/external/mockito/src/test/java/org/mockito/internal/handler/
DMockHandlerFactoryTest.java32 …ttings<?> settings = (MockCreationSettings<?>) new MockSettingsImpl().defaultAnswer(new Returns(nu… in handle_result_must_not_be_null_for_primitives()
50 …ttings<?> settings = (MockCreationSettings<?>) new MockSettingsImpl().defaultAnswer(new Returns(12… in valid_handle_result_is_permitted()
/external/mockito/src/main/java/org/mockito/internal/configuration/
DSpyAnnotationEngine.java77 .defaultAnswer(CALLS_REAL_METHODS) in spyInstance()
83 MockSettings settings = withSettings().defaultAnswer(CALLS_REAL_METHODS) in spyNewInstance()
DMockAnnotationProcessor.java32 mockSettings.defaultAnswer(annotation.answer()); in process()
/external/mockito/src/main/java/org/mockito/internal/stubbing/defaultanswers/
DReturnsMocks.java34 return mockitoCore.mock(clazz, new MockSettingsImpl().defaultAnswer(this)); in returnValueFor()
DReturnsDeepStubs.java108 .defaultAnswer(returnsDeepStubsAnswerUsing(returnTypeGenericMetadata)); in withSettingsUsing()
/external/mockito/src/main/java/org/mockito/internal/configuration/injection/
DSpyOnInjectedFieldsHandler.java45 .defaultAnswer(Mockito.CALLS_REAL_METHODS) in processInjection()
/external/mockito/src/test/java/org/mockitousage/basicapi/
DMocksCreationTest.java41 .defaultAnswer(RETURNS_SMART_NULLS) in shouldCombineMockNameAndSmartNulls()
DMocksSerializationTest.java281 .defaultAnswer(CALLS_REAL_METHODS) in should_serialize_with_real_object_spy()
390 …IMethods iMethods = mock(IMethods.class, withSettings().serializable().defaultAnswer(RETURNS_DEEP_… in BUG_ISSUE_399_try_some_mocks_with_current_answers()
DMocksSerializationForAnnotationTest.java260 .defaultAnswer(CALLS_REAL_METHODS) in should_serialize_with_real_object_spy()
/external/mockito/src/test/java/org/mockito/internal/util/
DMockUtilTest.java61 …assertTrue(MockUtil.isSpy(Mockito.mock(ArrayList.class, withSettings().defaultAnswer(Mockito.CALLS… in should_validate_spy()
DDefaultMockingDetailsTest.java43 …assertTrue(mockingDetails(mock(Gork.class, withSettings().defaultAnswer(Mockito.CALLS_REAL_METHODS… in should_know_spy()
/external/mockito/src/test/java/org/mockito/internal/creation/bytebuddy/
DAbstractByteBuddyMockMakerTest.java177 mockSettings.defaultAnswer(new CallsRealMethods()); in settingsWithSuperCall()
DInlineByteBuddyMockMakerTest.java262 mockSettings.defaultAnswer(new Returns("bar")); in settingsFor()