T
- type of what should be returned by this expected callpublic interface IExpectationSetters<T>
EasyMock.expect(Object)
, and by EasyMock.expectLastCall()
.Modifier and Type | Method and Description |
---|---|
IExpectationSetters<T> |
andAnswer(IAnswer<? extends T> answer)
Sets an object that will be used to calculate the answer for the expected
invocation (either return a value, or throw an exception).
|
IExpectationSetters<T> |
andDelegateTo(Object delegateTo)
Sets an object implementing the same interface as the mock.
|
IExpectationSetters<T> |
andReturn(T value)
Sets a return value that will be returned for the expected invocation.
|
void |
andStubAnswer(IAnswer<? extends T> answer)
Sets a stub object that will be used to calculate the answer for the
expected invocation (either return a value, or throw an exception).
|
void |
andStubDelegateTo(Object delegateTo)
Sets a stub object implementing the same interface as the mock.
|
void |
andStubReturn(T value)
Sets a stub return value that will be returned for the expected
invocation.
|
void |
andStubThrow(Throwable throwable)
Sets a stub throwable that will be thrown for the expected invocation.
|
IExpectationSetters<T> |
andThrow(Throwable throwable)
Sets a throwable that will be thrown for the expected invocation.
|
IExpectationSetters<T> |
andVoid()
Records a call but returns nothing.
|
IExpectationSetters<T> |
anyTimes()
Expect the last invocation any times.
|
void |
asStub()
Sets stub behavior for the expected invocation (this is needed for void
methods).
|
IExpectationSetters<T> |
atLeastOnce()
Expect the last invocation at least once.
|
IExpectationSetters<T> |
once()
Expect the last invocation once.
|
IExpectationSetters<T> |
times(int count)
Expect the last invocation
count times. |
IExpectationSetters<T> |
times(int min,
int max)
Expect the last invocation between
min and max
times. |
IExpectationSetters<T> andReturn(T value)
value
- the value to return.IExpectationSetters<T> andThrow(Throwable throwable)
throwable
- the throwable to throw.IExpectationSetters<T> andAnswer(IAnswer<? extends T> answer)
answer
- the object used to answer the invocation.IExpectationSetters<T> andDelegateTo(Object delegateTo)
delegateTo
- the object the call is delegated to.IExpectationSetters<T> andVoid()
expectLastCall().andThrow(e).andVoid()
void andStubReturn(T value)
value
- the value to return.void andStubThrow(Throwable throwable)
throwable
- the throwable to throw.void andStubAnswer(IAnswer<? extends T> answer)
answer
- the object used to answer the invocation.void andStubDelegateTo(Object delegateTo)
delegateTo
- the object the call is delegated to.void asStub()
IExpectationSetters<T> times(int count)
count
times.count
- the number of invocations expectedIExpectationSetters<T> times(int min, int max)
min
and max
times.min
- the minimum number of invocations expected.max
- the maximum number of invocations expected.IExpectationSetters<T> once()
IExpectationSetters<T> atLeastOnce()
IExpectationSetters<T> anyTimes()
Copyright © 2001–2022 EasyMock contributors. All rights reserved.