Home
last modified time | relevance | path

Searched refs:Mockito (Results 1 – 25 of 517) sorted by relevance

12345678910>>...21

/external/opencensus-java/exporters/stats/signalfx/src/test/java/io/opencensus/exporter/stats/signalfx/
DSignalFxStatsExporterWorkerThreadTest.java51 import org.mockito.Mockito;
74 Mockito.when( in setUp()
76 Mockito.any(URI.class), Mockito.anyString(), Mockito.any(OnSendErrorHandler.class))) in setUp()
85 AggregateMetricSender spy = Mockito.spy(sender); in setUp()
86 Mockito.doReturn(session).when(spy).createSession(); in setUp()
103 Mockito.when(session.setDatapoint(Mockito.any(DataPoint.class))).thenReturn(session); in senderThreadInterruptStopsLoop()
104 Mockito.when(viewManager.getAllExportedViews()).thenReturn(ImmutableSet.<View>of()); in senderThreadInterruptStopsLoop()
117 View view = Mockito.mock(View.class); in setsDatapointsFromViewOnSession()
119 Mockito.when(view.getName()).thenReturn(viewName); in setsDatapointsFromViewOnSession()
120 Mockito.when(view.getAggregation()).thenReturn(Aggregation.Mean.create()); in setsDatapointsFromViewOnSession()
[all …]
DSignalFxSessionAdaptorTest.java57 import org.mockito.Mockito;
73 Mockito.when(view.getName()).thenReturn(Name.create("view-name")); in setUp()
74 Mockito.when(view.getColumns()).thenReturn(ImmutableList.of(TagKey.create("animal"))); in setUp()
75 Mockito.when(viewData.getView()).thenReturn(view); in setUp()
154 Mockito.when(view.getAggregation()) in unsupportedAggregationYieldsNoDatapoints()
157 Mockito.when(view.getWindow()).thenReturn(AggregationWindow.Cumulative.create()); in unsupportedAggregationYieldsNoDatapoints()
164 Mockito.when(view.getAggregation()).thenReturn(Aggregation.Count.create()); in noAggregationDataYieldsNoDatapoints()
165 Mockito.when(view.getWindow()).thenReturn(AggregationWindow.Cumulative.create()); in noAggregationDataYieldsNoDatapoints()
246 Mockito.when(viewData.getAggregationMap()).thenReturn(map); in adaptViewIntoDatapoints()
247 Mockito.when(view.getAggregation()).thenReturn(Aggregation.Count.create()); in adaptViewIntoDatapoints()
[all …]
/external/mockito/src/test/java/org/mockito/
DStaticMockingExperimentTest.java23 import static org.mockito.Mockito.doReturn;
24 import static org.mockito.Mockito.times;
25 import static org.mockito.Mockito.verify;
26 import static org.mockito.Mockito.verifyNoMoreInteractions;
27 import static org.mockito.Mockito.when;
28 import static org.mockito.Mockito.withSettings;
43 Foo mock = Mockito.mock(Foo.class);
44 MockHandler handler = Mockito.mockingDetails(mock).getMockHandler();
61 …Invocation invocation = Mockito.framework().getInvocationFactory().createInvocation(mock, withSett… in verify_static_method()
72 …Invocation verification = Mockito.framework().getInvocationFactory().createInvocation(mock, withSe… in verify_static_method()
[all …]
DMockitoTest.java9 import static org.mockito.Mockito.times;
22 List mock = Mockito.mock(List.class); in shouldRemoveStubbableFromProgressAfterStubbing()
23 Mockito.when(mock.add("test")).thenReturn(true); in shouldRemoveStubbableFromProgressAfterStubbing()
31 Mockito.verify("notMock"); in shouldValidateMockWhenVerifying()
37 Mockito.verify("notMock", times(19)); in shouldValidateMockWhenVerifyingWithExpectedNumberOfInvocations()
42 Mockito.verifyNoMoreInteractions("notMock"); in shouldValidateMockWhenVerifyingNoMoreInteractions()
47 Mockito.verifyZeroInteractions("notMock"); in shouldValidateMockWhenVerifyingZeroInteractions()
53 Mockito.inOrder("notMock"); in shouldValidateMockWhenCreatingInOrderObject()
59 MockSettingsImpl<?> settings = (MockSettingsImpl<?>) Mockito.withSettings(); in shouldStartingMockSettingsContainDefaultBehavior()
62 assertThat(Mockito.RETURNS_DEFAULTS).isEqualTo(settings.getDefaultAnswer()); in shouldStartingMockSettingsContainDefaultBehavior()
DInvocationFactoryTest.java17 import static org.mockito.Mockito.spy;
18 import static org.mockito.Mockito.withSettings;
31 Invocation invocation = Mockito.framework().getInvocationFactory().createInvocation(mock, in call_method_that_throws_a_throwable()
42 Mockito.mockingDetails(mock).getMockHandler().handle(invocation); in call_method_that_throws_a_throwable()
53 Invocation invocation = Mockito.framework().getInvocationFactory().createInvocation(mock, in call_method_that_returns_a_string()
63 Object ret = Mockito.mockingDetails(mock).getMockHandler().handle(invocation); in call_method_that_returns_a_string()
69 Invocation invocation = Mockito.framework().getInvocationFactory().createInvocation(mock, in deprecated_api_still_works()
78 Object ret = Mockito.mockingDetails(mock).getMockHandler().handle(invocation); in deprecated_api_still_works()
/external/robolectric-shadows/robolectric/src/test/java/org/robolectric/shadows/
DShadowMediaPlayerTest.java42 import org.mockito.Mockito;
75 completionListener = Mockito.mock(MediaPlayer.OnCompletionListener.class); in setUp()
78 preparedListener = Mockito.mock(MediaPlayer.OnPreparedListener.class); in setUp()
81 errorListener = Mockito.mock(MediaPlayer.OnErrorListener.class); in setUp()
84 infoListener = Mockito.mock(MediaPlayer.OnInfoListener.class); in setUp()
87 seekListener = Mockito.mock(MediaPlayer.OnSeekCompleteListener.class); in setUp()
122 ShadowMediaPlayer.CreateListener createListener = Mockito in testCreateListener()
129 Mockito.verify(createListener).onCreate(newPlayer, shadow); in testCreateListener()
210 Mockito.verifyZeroInteractions(preparedListener); in testPrepareAsyncAutoCallback()
215 Mockito.verify(preparedListener).onPrepared(mediaPlayer); in testPrepareAsyncAutoCallback()
[all …]
/external/mockito/src/test/java/org/mockito/internal/util/
DMockUtilTest.java10 import org.mockito.Mockito;
20 import static org.mockito.Mockito.withSettings;
27 List<?> mock = Mockito.mock(List.class); in should_get_handler()
43 List<?> mock = Mockito.mock(List.class); in should_get_mock_settings()
50 assertTrue(MockUtil.isMock(Mockito.mock(List.class))); in should_validate_mock()
56 assertFalse(MockUtil.isSpy(Mockito.mock(List.class))); in should_validate_spy()
59 assertTrue(MockUtil.isSpy(Mockito.spy(new ArrayList()))); in should_validate_spy()
60 assertTrue(MockUtil.isSpy(Mockito.spy(ArrayList.class))); in should_validate_spy()
61 …assertTrue(MockUtil.isSpy(Mockito.mock(ArrayList.class, withSettings().defaultAnswer(Mockito.CALLS… in should_validate_spy()
66 List<?> mock = Mockito.mock(List.class); in should_redefine_MockName_if_default()
[all …]
/external/mockito/src/test/java/org/mockitousage/session/
DMockitoSessionTest.java12 import org.mockito.Mockito;
24 import static org.mockito.Mockito.mockingDetails;
25 import static org.mockito.Mockito.verify;
26 import static org.mockito.Mockito.when;
105 MockitoSession mockito = Mockito.mockitoSession().startMocking();
120 … MockitoSession mockito = Mockito.mockitoSession().strictness(Strictness.LENIENT).startMocking();
134 MockitoSession mockito = Mockito.mockitoSession().initMocks(this).startMocking();
148 MockitoSession mockito = Mockito.mockitoSession().initMocks(this).startMocking();
163 MockitoSession mockito = Mockito.mockitoSession().initMocks(this).startMocking();
178 IMethods mock2 = Mockito.mock(IMethods.class, "manual mock");
[all …]
/external/mockito/src/test/java/org/mockitousage/verification/
DVerificationStartedListenerTest.java9 import org.mockito.Mockito;
20 import static org.mockito.Mockito.mock;
21 import static org.mockito.Mockito.never;
22 import static org.mockito.Mockito.verify;
38 …List mock2 = mock(List.class, Mockito.withSettings().verificationStartedListeners(new Verification… in verified_mock_can_be_replaced()
61 …List mock = mock(List.class, Mockito.withSettings().verificationStartedListeners(new VerificationS… in verification_started_event_contains_correct_mock()
81 …List mock2 = mock(List.class, Mockito.withSettings().verificationStartedListeners(new Verification… in listeners_are_executed_in_sequence()
110 Mockito.withSettings().verificationStartedListeners(null); in shows_clean_exception_when_null_array_passed()
121Mockito.withSettings().verificationStartedListeners(mock(VerificationStartedListener.class), null); in shows_clean_exception_when_null_listener_passed()
DDescriptiveMessagesWhenTimesXVerificationFailsTest.java10 import org.mockito.Mockito;
19 import static org.mockito.Mockito.times;
32 Mockito.verify(mock, times(3)).clear(); in shouldVerifyActualNumberOfInvocationsSmallerThanWanted()
34 Mockito.verify(mock, times(100)).clear(); in shouldVerifyActualNumberOfInvocationsSmallerThanWanted()
51 Mockito.verify(mock, times(4)).clear(); in shouldVerifyActualNumberOfInvocationsLargerThanWanted()
53 Mockito.verify(mock, times(1)).clear(); in shouldVerifyActualNumberOfInvocationsLargerThanWanted()
/external/dexmaker/dexmaker-mockito-inline-extended/src/main/java/com/android/dx/mockito/inline/extended/
DExtendedMockito.java21 import org.mockito.Mockito;
66 public class ExtendedMockito extends Mockito {
78 return new StaticCapableStubber(Mockito.doAnswer(answer)); in doAnswer()
87 return new StaticCapableStubber(Mockito.doCallRealMethod()); in doCallRealMethod()
96 return new StaticCapableStubber(Mockito.doNothing()); in doNothing()
105 return new StaticCapableStubber(Mockito.doReturn(toBeReturned)); in doReturn()
114 return new StaticCapableStubber(Mockito.doReturn(toBeReturned, toBeReturnedNext)); in doReturn()
123 return new StaticCapableStubber(Mockito.doThrow(toBeThrown)); in doThrow()
134 return new StaticCapableStubber(Mockito.doThrow(toBeThrown, toBeThrownNext)); in doThrow()
143 return new StaticCapableStubber(Mockito.doThrow(toBeThrown)); in doThrow()
[all …]
DStaticMockitoSessionBuilder.java20 import org.mockito.Mockito;
29 import static org.mockito.Mockito.CALLS_REAL_METHODS;
30 import static org.mockito.Mockito.withSettings;
58 staticMockings.add(new StaticMocking<>(clazz, () -> Mockito.mock(clazz))); in mockStatic()
75 staticMockings.add(new StaticMocking<>(clazz, () -> Mockito.mock(clazz, defaultAnswer))); in mockStatic()
91 staticMockings.add(new StaticMocking<>(clazz, () -> Mockito.mock(clazz, settings))); in mockStatic()
103 staticMockings.add(new StaticMocking<>(clazz, () -> Mockito.mock(clazz, withSettings() in spyStatic()
/external/mockito/src/test/java/org/mockitousage/bugs/varargs/
DVarargsNotPlayingWithAnyObjectTest.java13 import static org.mockito.Mockito.anyObject;
14 import static org.mockito.Mockito.anyString;
15 import static org.mockito.Mockito.anyVararg;
16 import static org.mockito.Mockito.eq;
17 import static org.mockito.Mockito.never;
18 import static org.mockito.Mockito.verify;
19 import static org.mockito.Mockito.when;
/external/mockito/src/test/java/org/mockitousage/basicapi/
DUsingVarargsTest.java10 import org.mockito.Mockito;
19 import static org.mockito.Mockito.*;
119 Foo foo = Mockito.mock(Foo.class); in shouldVerifyWithAnyObject()
121 Mockito.verify(foo).varArgs((String[]) Mockito.anyObject()); in shouldVerifyWithAnyObject()
122 Mockito.verify(foo).varArgs((String) Mockito.anyObject()); in shouldVerifyWithAnyObject()
127 Foo foo = Mockito.mock(Foo.class); in shouldVerifyWithNullVarArgArray()
129 Mockito.verify(foo).varArgs((String[]) Mockito.anyObject()); in shouldVerifyWithNullVarArgArray()
130 Mockito.verify(foo).varArgs((String[]) null); in shouldVerifyWithNullVarArgArray()
DReplacingObjectMethodsTest.java11 import org.mockito.Mockito;
23 DummyClass dummyClass = Mockito.mock(DummyClass.class); in shouldProvideMockyImplementationOfToString()
25 DummyInterface dummyInterface = Mockito.mock(DummyInterface.class); in shouldProvideMockyImplementationOfToString()
31 Object mock = Mockito.mock(ObjectMethodsOverridden.class); in shouldReplaceObjectMethods()
32 Object otherMock = Mockito.mock(ObjectMethodsOverridden.class); in shouldReplaceObjectMethods()
43 Object mock = Mockito.mock(ObjectMethodsOverriddenSubclass.class); in shouldReplaceObjectMethodsWhenOverridden()
44 Object otherMock = Mockito.mock(ObjectMethodsOverriddenSubclass.class); in shouldReplaceObjectMethodsWhenOverridden()
/external/volley/src/test/java/com/android/volley/toolbox/
DImageLoaderTest.java20 import static org.mockito.Mockito.any;
21 import static org.mockito.Mockito.anyString;
22 import static org.mockito.Mockito.eq;
23 import static org.mockito.Mockito.mock;
24 import static org.mockito.Mockito.times;
25 import static org.mockito.Mockito.verify;
26 import static org.mockito.Mockito.when;
36 import org.mockito.Mockito;
79 verify(mRequestQueue, times(1)).add(Mockito.<Request<?>>any()); in getWithCacheMiss()
/external/mockito/src/test/java/org/mockitousage/misuse/
DExplicitFrameworkValidationTest.java10 import org.mockito.Mockito;
19 import static org.mockito.Mockito.verify;
20 import static org.mockito.Mockito.when;
31 Mockito.validateMockitoUsage(); in shouldValidateExplicitly()
41 Mockito.validateMockitoUsage(); in shouldDetectUnfinishedStubbing()
50 Mockito.validateMockitoUsage(); in shouldDetectMisplacedArgumentMatcher()
DDetectingMisusedMatchersTest.java19 import static org.mockito.Mockito.anyBoolean;
20 import static org.mockito.Mockito.anyInt;
21 import static org.mockito.Mockito.anyObject;
22 import static org.mockito.Mockito.mock;
23 import static org.mockito.Mockito.validateMockitoUsage;
24 import static org.mockito.Mockito.verify;
/external/mockito/src/test/java/org/mockitousage/bugs/
DShouldNotDeadlockAnswerExecutionTest.java10 import org.mockito.Mockito;
24 Service service = Mockito.mock(Service.class); in failIfMockIsSharedBetweenThreads()
30 Mockito.when(service.verySlowMethod()).thenAnswer(new LockingAnswer(counter)); in failIfMockIsSharedBetweenThreads()
49 Service service1 = Mockito.mock(Service.class); in successIfEveryThreadHasItsOwnMock()
50 Service service2 = Mockito.mock(Service.class); in successIfEveryThreadHasItsOwnMock()
56 Mockito.when(service1.verySlowMethod()).thenAnswer(new LockingAnswer(counter)); in successIfEveryThreadHasItsOwnMock()
57 Mockito.when(service2.verySlowMethod()).thenAnswer(new LockingAnswer(counter)); in successIfEveryThreadHasItsOwnMock()
/external/mockito/src/main/java/org/mockito/internal/configuration/
DSpyAnnotationEngine.java16 import org.mockito.Mockito;
22 import static org.mockito.Mockito.CALLS_REAL_METHODS;
23 import static org.mockito.Mockito.withSettings;
61 Mockito.reset(instance); in process()
75 return Mockito.mock(instance.getClass(), in spyInstance()
87 return Mockito.mock(type, settings.useConstructor()); in spyNewInstance()
105 return Mockito.mock(type, settings.useConstructor() in spyNewInstance()
112 return Mockito.mock(type, settings.spiedInstance(constructor.newInstance())); in spyNewInstance()
114 return Mockito.mock(type, settings.useConstructor()); in spyNewInstance()
/external/mockito/src/main/java/org/mockito/
DBDDMockito.java81 public class BDDMockito extends Mockito {
197 return new BDDOngoingStubbingImpl<T>(Mockito.when(methodCall)); in given()
462 return new BDDStubberImpl(Mockito.doThrow(toBeThrown)); in willThrow()
470 return new BDDStubberImpl(Mockito.doThrow(toBeThrown)); in willThrow()
478 return new BDDStubberImpl(Mockito.doThrow(toBeThrown, throwableTypes)); in willThrow()
486 return new BDDStubberImpl(Mockito.doAnswer(answer)); in willAnswer()
494 return new BDDStubberImpl(Mockito.doAnswer(answer)); in will()
502 return new BDDStubberImpl(Mockito.doNothing()); in willDoNothing()
510 return new BDDStubberImpl(Mockito.doReturn(toBeReturned)); in willReturn()
519 return new BDDStubberImpl(Mockito.doReturn(toBeReturned, toBeReturnedNext)); in willReturn()
[all …]
/external/mockito/src/test/java/org/mockitousage/matchers/
DMatchersTest.java15 import org.mockito.Mockito;
38 import static org.mockito.Mockito.any;
39 import static org.mockito.Mockito.anyBoolean;
40 import static org.mockito.Mockito.anyByte;
41 import static org.mockito.Mockito.anyChar;
42 import static org.mockito.Mockito.anyDouble;
43 import static org.mockito.Mockito.anyFloat;
44 import static org.mockito.Mockito.anyInt;
45 import static org.mockito.Mockito.anyLong;
46 import static org.mockito.Mockito.anyObject;
[all …]
/external/opencensus-java/contrib/agent/src/test/java/io/opencensus/contrib/agent/bootstrap/
DContextTrampolineTest.java19 import static org.mockito.Mockito.mock;
26 import org.mockito.Mockito;
57 Mockito.verify(mockContextStrategy).wrapInCurrentContext(runnable); in wrapInCurrentContext()
64 Mockito.verify(mockContextStrategy).saveContextForThread(thread); in saveContextForThread()
71 Mockito.verify(mockContextStrategy).attachContextForThread(thread); in attachContextForThread()
/external/mockito/src/main/java/org/mockito/internal/configuration/injection/
DSpyOnInjectedFieldsHandler.java8 import org.mockito.Mockito;
17 import static org.mockito.Mockito.withSettings;
41 Mockito.reset(instance); in processInjection()
43 Object mock = Mockito.mock(instance.getClass(), withSettings() in processInjection()
45 .defaultAnswer(Mockito.CALLS_REAL_METHODS) in processInjection()
/external/guava/guava-tests/test/com/google/common/util/concurrent/
DFutureCallbackTest.java23 import org.mockito.Mockito;
103 FutureCallback<String> callback = Mockito.mock(FutureCallback.class); in testOnSuccessThrowsRuntimeException()
105 Mockito.doThrow(exception).when(callback).onSuccess(result); in testOnSuccessThrowsRuntimeException()
108 Mockito.verify(callback).onSuccess(result); in testOnSuccessThrowsRuntimeException()
109 Mockito.verifyNoMoreInteractions(callback); in testOnSuccessThrowsRuntimeException()
118 FutureCallback<String> callback = Mockito.mock(FutureCallback.class); in testOnSuccessThrowsError()
120 Mockito.doThrow(error).when(callback).onSuccess(result); in testOnSuccessThrowsError()
128 Mockito.verify(callback).onSuccess(result); in testOnSuccessThrowsError()
129 Mockito.verifyNoMoreInteractions(callback); in testOnSuccessThrowsError()

12345678910>>...21