Home
last modified time | relevance | path

Searched refs:thenThrow (Results 1 – 18 of 18) sorted by relevance

/external/mockito/src/main/java/org/mockito/internal/stubbing/
DBaseStubbing.java32 private OngoingStubbing<T> thenThrow(Throwable throwable) { in thenThrow() method in BaseStubbing
36 public OngoingStubbing<T> thenThrow(Throwable... throwables) { in thenThrow() method in BaseStubbing
38 return thenThrow((Throwable) null); in thenThrow()
43 stubbing = thenThrow(t); in thenThrow()
45 stubbing = stubbing.thenThrow(t); in thenThrow()
51 public OngoingStubbing<T> thenThrow(Class<? extends Throwable> throwableType) { in thenThrow() method in BaseStubbing
56 …public OngoingStubbing<T> thenThrow(Class<? extends Throwable> toBeThrown, Class<? extends Throwab… in thenThrow() method in BaseStubbing
58 thenThrow((Throwable) null); in thenThrow()
60 OngoingStubbing<T> stubbing = thenThrow(toBeThrown); in thenThrow()
62 stubbing = stubbing.thenThrow(t); in thenThrow()
/external/mockito/src/test/java/org/mockitousage/stubbing/
DStubbingWithThrowablesTest.java40 when(mock.add("throw")).thenThrow(expected); in shouldStubWithThrowable()
77 when(mock.get(1)).thenThrow(new ExceptionOne()); in shouldFailStubbingThrowableOnTheSameInvocationDueToAcceptableLimitation()
80 when(mock.get(1)).thenThrow(new ExceptionTwo()); in shouldFailStubbingThrowableOnTheSameInvocationDueToAcceptableLimitation()
91 when(reader.read()).thenThrow(ioException); in shouldAllowSettingCheckedException()
105 when(mock.add("quake")).thenThrow(error); in shouldAllowSettingError()
117 when(mock.add(null)).thenThrow((Exception) null); in shouldNotAllowNullExceptionType()
123 when(mock.add(null)).thenThrow(NaughtyException.class); in shouldInstantiateExceptionClassOnInteraction()
137 when(mock.add("monkey island")).thenThrow(new Exception()); in shouldNotAllowSettingInvalidCheckedException()
142 when(mock.add("monkey island")).thenThrow((Throwable) null); in shouldNotAllowSettingNullThrowable()
147 when(mock.add("monkey island")).thenThrow((Throwable[]) null); in shouldNotAllowSettingNullThrowableArray()
[all …]
DStubbingConsecutiveAnswersTest.java59 .thenThrow(new NullPointerException(), new RuntimeException()) in should_return_consecutive_value_and_throw_exceptions_set_by_shorten_return_methods()
61 .thenThrow(new IllegalArgumentException()); in should_return_consecutive_value_and_throw_exceptions_set_by_shorten_return_methods()
83 when(mock.simpleMethod()).thenThrow(new RuntimeException()) in should_throw_consecutively()
84 .thenThrow(new IllegalArgumentException()) in should_throw_consecutively()
85 .thenThrow(new NullPointerException()); in should_throw_consecutively()
110 when(mock.simpleMethod()).thenThrow(new RuntimeException(), in should_throw_consecutively_set_by_shorten_then_throw_method()
138 when(mock.simpleMethod()).thenThrow(IllegalArgumentException.class); in should_throw_classes()
155 when(mock.simpleMethod()).thenThrow(RuntimeException.class, in should_throw_consecutively_classes_set_by_shorten_then_throw_method()
183 .thenThrow(new IllegalArgumentException()) in should_mix_consecutive_returns_with_excepions()
185 .thenThrow(new NullPointerException()) in should_mix_consecutive_returns_with_excepions()
[all …]
DBasicStubbingTest.java63 when(mock.simpleMethod("one")).thenThrow(new RuntimeException()); in should_stubbing_not_be_treated_as_interaction()
/external/mockito/src/main/java/org/mockito/stubbing/
DOngoingStubbing.java89 OngoingStubbing<T> thenThrow(Throwable... throwables); in thenThrow() method
114 OngoingStubbing<T> thenThrow(Class<? extends Throwable> throwableType); in thenThrow() method
149 …OngoingStubbing<T> thenThrow(Class<? extends Throwable> toBeThrown, Class<? extends Throwable>... … in thenThrow() method
/external/mockito/src/test/java/org/mockitousage/
DCompilationWarningsTest.java36 … when(mock(IMethods.class).objectReturningMethodNoArgs()).thenThrow(new NullPointerException()); in no_warnings_for_most_common_api()
37 …when(mock(IMethods.class).objectReturningMethodNoArgs()).thenThrow(new NullPointerException(), new… in no_warnings_for_most_common_api()
38 … when(mock(IMethods.class).objectReturningMethodNoArgs()).thenThrow(NullPointerException.class); in no_warnings_for_most_common_api()
43 …when(mock(IMethods.class).objectReturningMethodNoArgs()).then(ignore()).thenThrow(new NullPointerE… in no_warnings_for_most_common_api()
44 …when(mock(IMethods.class).objectReturningMethodNoArgs()).then(ignore()).thenThrow(new NullPointerE… in no_warnings_for_most_common_api()
45 …when(mock(IMethods.class).objectReturningMethodNoArgs()).then(ignore()).thenThrow(NullPointerExcep… in no_warnings_for_most_common_api()
80 …when(mock(IMethods.class).objectReturningMethodNoArgs()).thenThrow(NullPointerException.class, Ill… in heap_pollution_JDK7plus_warning_avoided_BUT_now_unchecked_generic_array_creation_warnings_ON_JDK5plus_environment()
/external/mockito/src/test/java/org/mockitousage/misuse/
DInvalidUsageTest.java59 when(mock.simpleMethod()).thenThrow(new Exception()); in shouldNotAllowSettingInvalidCheckedException()
64 when(mock.simpleMethod()).thenThrow(new Throwable[] {null}); in shouldNotAllowSettingNullThrowable()
70 when(mock.simpleMethod()).thenThrow((Throwable) null); in shouldNotAllowSettingNullThrowableVararg()
75 when(mock.simpleMethod()).thenThrow(new RuntimeException(), null); in shouldNotAllowSettingNullConsecutiveThrowable()
/external/mockito/src/test/java/org/mockitousage/stacktrace/
DStackTraceFilteringTest.java125 when(mock.oneArg(true)).thenThrow(new Exception()); in shouldFilterStackTraceWhenThrowingExceptionFromMockHandler()
134 when(mock.simpleMethod()).thenThrow(new RuntimeException()); in shouldShowProperExceptionStackTrace()
/external/mockito/src/main/java/org/mockito/
DBDDMockito.java172 return new BDDOngoingStubbingImpl<T>(mockitoOngoingStubbing.thenThrow(throwables)); in willThrow()
176 return new BDDOngoingStubbingImpl<T>(mockitoOngoingStubbing.thenThrow(throwableType)); in willThrow()
180 …return new BDDOngoingStubbingImpl<T>(mockitoOngoingStubbing.thenThrow(throwableType, throwableType… in willThrow()
/external/mockito/src/test/java/org/mockitousage/bugs/
DNPEWhenMockingThrowablesTest.java28 when(mock.simpleMethod()).thenThrow(mock2); in shouldNotThrowNPE()
DNPEWhenCustomExceptionStackTraceReturnNullTest.java26 when(mock.simpleMethod()).thenThrow(new NullStackTraceException()); in shouldNotThrowNPE()
/external/mockito/src/test/java/org/mockitousage/matchers/
DVerificationAndStubbingUsingMatchersTest.java34 when(three.simpleMethod(startsWith("test"))).thenThrow(new RuntimeException()); in shouldStubUsingMatchers()
/external/mockito/src/test/java/org/mockitousage/basicapi/
DResetTest.java75 when(mock.simpleMethod("one")).thenThrow(new RuntimeException()); in shouldStubbingNotBeTreatedAsInteraction()
/external/volley/src/test/java/com/android/volley/toolbox/
DAndroidAuthenticatorTest.java56 when(mFuture.getResult()).thenThrow(new AuthenticatorException("sadness!")); in failedGetAuthToken()
/external/mockito/src/test/java/org/mockito/internal/configuration/plugins/
DPluginFinderTest.java102 when(switcher.isEnabled(anyString())).thenThrow(new RuntimeException("Boo!")); in problems_loading_impl()
/external/mockito/src/test/java/org/mockitousage/annotation/
DMockInjectionUsingConstructorTest.java60 when(calculator.countArticles("new")).thenThrow(new IllegalArgumentException()); in innerMockShouldRaiseAnExceptionThatChangesOuterMockBehavior()
/external/volley/src/test/java/com/android/volley/
DRequestQueueIntegrationTest.java197 when(mMockNetwork.performRequest(request)).thenThrow(new VolleyError()); in add_requestFinishedListenerError()
/external/guava/guava-tests/test/com/google/common/util/concurrent/
DMoreExecutorsTest.java527 when(service.awaitTermination(2, TimeUnit.SECONDS)).thenThrow(new InterruptedException()); in testAddDelayedShutdownHook_interrupted()
671 .thenThrow(new InterruptedException()); in testShutdownAndAwaitTermination_interruptedInternal()