- public org.easymock.classextension.IMockBuilder createMockBuilder(java.lang.Class)
+ public abstract T when(T)
- public static IMockBuilder
Description:
Create a mock builder allowing to create a partial mock for the given class or interface.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public org.easymock.classextension.IMockBuilder createMockBuilder(java.lang.Class)
+ public abstract org.mockito.stubbing.OngoingStubbing thenCallRealMethod()
- public static IMockBuilder
Description:
Create a mock builder allowing to create a partial mock for the given class or interface.
+ public OngoingStubbing
Description:
Sets the real implementation to be called when the method is called on a mock object. As usual you are going to read the partial mock warning: Object oriented programming is more less tackling complexity by dividing the complexity into separate, specific, SRPy objects. How does partial mock fit into this paradigm? Well, it just doesn't... Partial mock usually means that the complexity has been moved to a different method on the same object. In most cases, this is not the way you want to design your application. However, there are rare cases when partial mocks come handy: dealing with code you cannot change easily (3rd party interfaces, interim refactoring of legacy code etc.) However, I wouldn't use partial mocks for new, test-driven & well-designed code.
// someMethod() must be safe (e.g. doesn't throw, doesn't have dependencies to the object state, etc.)
// if it isn't safe then you will have trouble stubbing it using this api. Use Mockito.doCallRealMethod() instead.
when(mock.someMethod()).thenCallRealMethod();
// calls real method:
mock.someMethod();
See also javadoc Mockito.spy(Object) to find out more about partial mocks. Mockito.spy() is a recommended way of creating partial mocks. The reason is it guarantees real methods are called against correctly constructed object because you're responsible for constructing the object passed to spy() method. See examples in javadoc for Mockito.when(T)
Return Parameters:
- public org.easymock.classextension.IMockBuilder createMockBuilder(java.lang.Class)
- public abstract org.easymock.classextension.IMockBuilder addMockedMethod(java.lang.reflect.Method)
- public abstract T createStrictMock()
+ public static org.mockito.stubbing.Stubber doCallRealMethod()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IMockBuilder
Description:
Create a mock builder allowing to create a partial mock for the given class or interface.
- public IMockBuilder
Description:
Adds a method to be mocked in the testing class. Each call will add a new method to the result mock. The method is searched for in the class itself as well as superclasses.
Parameters:
- public T createStrictMock()
Description:
Create a strict mock from this builder. The same builder can be called to create multiple mocks.
Return Parameters:
+ public Stubber doCallRealMethod()
Description:
Use it for stubbing consecutive calls in Mockito.doCallRealMethod() style. See javadoc for Mockito.doCallRealMethod()
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public org.easymock.classextension.IMockBuilder createMockBuilder(java.lang.Class)
- public abstract T createStrictMock()
+ public abstract T when(T)
- public static IMockBuilder
Description:
Create a mock builder allowing to create a partial mock for the given class or interface.
- public T createStrictMock()
Description:
Create a strict mock from this builder. The same builder can be called to create multiple mocks.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public org.easymock.classextension.IMockBuilder createMockBuilder(java.lang.Class)
- public abstract T createStrictMock()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenCallRealMethod()
+ public abstract org.mockito.stubbing.OngoingStubbing thenAnswer(org.mockito.stubbing.Answer>)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
- public static IMockBuilder
Description:
Create a mock builder allowing to create a partial mock for the given class or interface.
- public T createStrictMock()
Description:
Create a strict mock from this builder. The same builder can be called to create multiple mocks.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets the real implementation to be called when the method is called on a mock object. As usual you are going to read the partial mock warning: Object oriented programming is more less tackling complexity by dividing the complexity into separate, specific, SRPy objects. How does partial mock fit into this paradigm? Well, it just doesn't... Partial mock usually means that the complexity has been moved to a different method on the same object. In most cases, this is not the way you want to design your application. However, there are rare cases when partial mocks come handy: dealing with code you cannot change easily (3rd party interfaces, interim refactoring of legacy code etc.) However, I wouldn't use partial mocks for new, test-driven & well-designed code.
// someMethod() must be safe (e.g. doesn't throw, doesn't have dependencies to the object state, etc.)
// if it isn't safe then you will have trouble stubbing it using this api. Use Mockito.doCallRealMethod() instead.
when(mock.someMethod()).thenCallRealMethod();
// calls real method:
mock.someMethod();
See also javadoc Mockito.spy(Object) to find out more about partial mocks. Mockito.spy() is a recommended way of creating partial mocks. The reason is it guarantees real methods are called against correctly constructed object because you're responsible for constructing the object passed to spy() method. See examples in javadoc for Mockito.when(T)
Return Parameters:
+ public OngoingStubbing
Description:
Sets a generic Answer for the method. E.g:
when(mock.someMethod(10)).thenAnswer(new Answer<Integer>() {
public Integer answer(InvocationOnMock invocation) throws Throwable {
return (Integer) invocation.getArguments()[0];
}
}
Parameters:
+ public Object answer(InvocationOnMock invocation) throws Throwable
Description:
Specified by: answer in interface Answer<java.lang.Object>
Parameters:
- public org.easymock.classextension.IMockBuilder createMockBuilder(java.lang.Class)
- public abstract T createStrictMock()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenCallRealMethod()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IMockBuilder
Description:
Create a mock builder allowing to create a partial mock for the given class or interface.
- public T createStrictMock()
Description:
Create a strict mock from this builder. The same builder can be called to create multiple mocks.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets the real implementation to be called when the method is called on a mock object. As usual you are going to read the partial mock warning: Object oriented programming is more less tackling complexity by dividing the complexity into separate, specific, SRPy objects. How does partial mock fit into this paradigm? Well, it just doesn't... Partial mock usually means that the complexity has been moved to a different method on the same object. In most cases, this is not the way you want to design your application. However, there are rare cases when partial mocks come handy: dealing with code you cannot change easily (3rd party interfaces, interim refactoring of legacy code etc.) However, I wouldn't use partial mocks for new, test-driven & well-designed code.
// someMethod() must be safe (e.g. doesn't throw, doesn't have dependencies to the object state, etc.)
// if it isn't safe then you will have trouble stubbing it using this api. Use Mockito.doCallRealMethod() instead.
when(mock.someMethod()).thenCallRealMethod();
// calls real method:
mock.someMethod();
See also javadoc Mockito.spy(Object) to find out more about partial mocks. Mockito.spy() is a recommended way of creating partial mocks. The reason is it guarantees real methods are called against correctly constructed object because you're responsible for constructing the object passed to spy() method. See examples in javadoc for Mockito.when(T)
Return Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract T createMock(java.lang.Class)
+ public static T mock(java.lang.Class)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public abstract T createMock(java.lang.Class)
+ public static void initMocks(java.lang.Object)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
+ public static void initMocks(Object testClass)
Description:
Initializes objects annotated with Mockito annotations for given testClass: @ Mock, @ Spy, @ Captor, @ InjectMocks See examples in javadoc for MockitoAnnotations class.
- public abstract T createMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
+ public abstract T when(T)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract T createMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract java.lang.Object get(java.lang.Object, java.lang.Object)
+ public abstract T when(T)
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract java.lang.Object get(java.lang.Object, java.lang.Object)
+ public abstract java.lang.Object get(java.lang.Object, java.lang.Object)
- public abstract java.lang.Object get(java.lang.Object, java.lang.Object)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
- public abstract java.lang.Object get(java.lang.Object, java.lang.Object)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
+ public Object answer(InvocationOnMock invocation) throws Throwable
Description:
Specified by: answer in interface Answer<java.lang.Object>
Parameters:
- public abstract org.easymock.classextension.IMockBuilder addMockedMethod(java.lang.reflect.Method)
+ public abstract T when(T)
- public IMockBuilder
Description:
Adds a method to be mocked in the testing class. Each call will add a new method to the result mock. The method is searched for in the class itself as well as superclasses.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract org.easymock.classextension.IMockBuilder addMockedMethod(java.lang.reflect.Method)
+ public static org.mockito.stubbing.Stubber doCallRealMethod()
- public IMockBuilder
Description:
Adds a method to be mocked in the testing class. Each call will add a new method to the result mock. The method is searched for in the class itself as well as superclasses.
Parameters:
+ public Stubber doCallRealMethod()
Description:
Use it for stubbing consecutive calls in Mockito.doCallRealMethod() style. See javadoc for Mockito.doCallRealMethod()
Return Parameters:
- public abstract org.easymock.classextension.IMockBuilder addMockedMethod(java.lang.reflect.Method)
+ public static org.mockito.stubbing.Stubber doCallRealMethod()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IMockBuilder
Description:
Adds a method to be mocked in the testing class. Each call will add a new method to the result mock. The method is searched for in the class itself as well as superclasses.
Parameters:
+ public Stubber doCallRealMethod()
Description:
Use it for stubbing consecutive calls in Mockito.doCallRealMethod() style. See javadoc for Mockito.doCallRealMethod()
Return Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public Object answer(InvocationOnMock invocation) throws Throwable
Description:
Specified by: answer in interface Answer<java.lang.Object>
Parameters:
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
+ public abstract org.mockito.stubbing.OngoingStubbing then(org.mockito.stubbing.Answer>)
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
+ public OngoingStubbing
Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example:
//using 'then' alias:
when(mock.foo()).then(returnCoolValue());
//versus good old 'thenAnswer:
when(mock.foo()).thenAnswer(byReturningCoolValue());
Parameters:
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract T given(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public static BDDMyOngoingStubbing
Description:
see original Mockito.when(Object)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public OngoingStubbing
Description:
Sets consecutive return values to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(1, 2, 3);
Last return value in the sequence (in example: 3) determines the behavior of further consecutive calls. See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static org.mockito.ArgumentCaptor forClass(java.lang.Class)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public static ArgumentCaptor
Description:
Build a new ArgumentCaptor. Note that an ArgumentCaptor *don't do any type checks*, it is only there to avoid casting in your code. This might however change (type checks could be added) in a future major release.
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
+ public abstract T when(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)
+ public abstract T when(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public Stubber doThrow(Throwable toBeThrown)
Description:
Use it for stubbing consecutive calls in Mockito.doThrow(Throwable) style:
doThrow(new RuntimeException("one")).
doThrow(new RuntimeException("two"))
.when(mock).someVoidMethod();
See javadoc for Mockito.doThrow(Throwable)
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expect(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract T when(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expect(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets consecutive return values to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(1, 2, 3);
Last return value in the sequence (in example: 3) determines the behavior of further consecutive calls. See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract T when(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expect(T)
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expect(T)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expect(T)
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public void replay()
Description:
Deprecated.
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets consecutive return values to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(1, 2, 3);
Last return value in the sequence (in example: 3) determines the behavior of further consecutive calls. See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public void replay()
Description:
Deprecated.
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters times(int)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters times(int)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
- public static org.easymock.IExpectationSetters expect(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract void replay()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expect(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract T when(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract T when(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters anyTimes()
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
- public void replay()
Description:
Deprecated.
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenAnswer(org.mockito.stubbing.Answer>)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public OngoingStubbing
Description:
Sets a generic Answer for the method. E.g:
when(mock.someMethod(10)).thenAnswer(new Answer<Integer>() {
public Integer answer(InvocationOnMock invocation) throws Throwable {
return (Integer) invocation.getArguments()[0];
}
}
Parameters:
+ public Object answer(InvocationOnMock invocation) throws Throwable
Description:
Specified by: answer in interface Answer<java.lang.Object>
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void replay(java.lang.Object...)
+ public static T verify(T, org.mockito.verification.VerificationMode)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public T verify(T var1, VerificationMode var2)
Description:
Verifies interaction in order. E.g:
InOrder inOrder = inOrder(firstMock, secondMock);
inOrder.verify(firstMock, times(2)).someMethod("was called first two times");
inOrder.verify(secondMock, atLeastOnce()).someMethod("was called second at least once");
See examples in javadoc for Mockito class
Parameters:
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract T when(T)
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract org.mockito.BDDMockito$BDDStubber willThrow(java.lang.Throwable...)
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
+ public static BDDStubber willThrow(Throwable toBeThrown)
Description:
See original Stubber.doThrow(Throwable)
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract org.mockito.stubbing.OngoingStubbing thenThrow(java.lang.Throwable...)
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
+ private OngoingStubbing
Description:
Sets Throwable objects to be thrown when the method is called. E.g:
when(mock.someMethod()).thenThrow(new RuntimeException());
If throwables contain a checked exception then it has to match one of the checked exceptions of method signature. You can specify throwables to be thrown for consecutive calls. In that case the last throwable determines the behavior of further consecutive calls. if throwable is null then exception will be thrown. See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
+ public Stubber doThrow(Throwable toBeThrown)
Description:
Use it for stubbing consecutive calls in Mockito.doThrow(Throwable) style:
doThrow(new RuntimeException("one")).
doThrow(new RuntimeException("two"))
.when(mock).someVoidMethod();
See javadoc for Mockito.doThrow(Throwable)
Parameters:
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable...)
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
+ public Stubber doThrow(Throwable toBeThrown)
Description:
Use it for stubbing consecutive calls in Mockito.doThrow(Throwable) style:
doThrow(new RuntimeException("one")).
doThrow(new RuntimeException("two"))
.when(mock).someVoidMethod();
See javadoc for Mockito.doThrow(Throwable)
Parameters:
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
- public abstract org.easymock.IExpectationSetters once()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)
+ public abstract T when(T)
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
+ public Stubber doThrow(Throwable toBeThrown)
Description:
Use it for stubbing consecutive calls in Mockito.doThrow(Throwable) style:
doThrow(new RuntimeException("one")).
doThrow(new RuntimeException("two"))
.when(mock).someVoidMethod();
See javadoc for Mockito.doThrow(Throwable)
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public abstract T when(T)
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
+ public OngoingStubbing
Description:
Sets consecutive return values to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(1, 2, 3);
Last return value in the sequence (in example: 3) determines the behavior of further consecutive calls. See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
+ public Object answer(InvocationOnMock invocation) throws Throwable
Description:
Specified by: answer in interface Answer<java.lang.Object>
Parameters:
- public abstract org.easymock.IExpectationSetters atLeastOnce()
+ public abstract T when(T)
- public IExpectationSetters
Description:
Expect the last invocation at least once.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract org.easymock.IExpectationSetters atLeastOnce()
+ public java.util.ListIterator iterator(int)
- public IExpectationSetters
Description:
Expect the last invocation at least once.
Return Parameters:
- public abstract org.easymock.IExpectationSetters once()
+ public abstract T when(T)
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract org.easymock.IExpectationSetters once()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract org.easymock.IExpectationSetters once()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
+ public OngoingStubbing
Description:
Sets consecutive return values to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(1, 2, 3);
Last return value in the sequence (in example: 3) determines the behavior of further consecutive calls. See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract org.easymock.IExpectationSetters once()
+ public org.mockito.asm.ByteVector putInt(int)
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public abstract org.easymock.IExpectationSetters once()
- public boolean get(int)
+ public boolean get(int)
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public abstract org.easymock.IExpectationSetters once()
- public static void replay(java.lang.Object...)
+ public org.mockito.asm.ByteVector putInt(int)
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public void replay()
Description:
Deprecated.
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract T when(T)
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract T answer() throws java.lang.Throwable
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
- public T answer() throws Throwable
Description:
is called by EasyMock to answer an expected call. The answer may be to return a value, or to throw an exception. The arguments of the call for which the answer is generated are available via EasyMock.getCurrentArguments() - be careful here, using the arguments is not refactoring-safe.
Return Parameters:
+ public Object answer(InvocationOnMock invocation) throws Throwable
Description:
Specified by: answer in interface Answer<java.lang.Object>
Parameters:
- public abstract T createMock(java.lang.String, org.easymock.classextension.IMocksControl)
+ public T mock(java.lang.Class, org.mockito.MockSettings)
- public T createMock(String var1, IMocksControl var2)
Description:
Create named mock from the provided mock control using the arguments passed to the builder.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public abstract T createMock(org.easymock.classextension.IMocksControl)
+ public static T mock(java.lang.Class)
- public T createMock(IMocksControl var1)
Description:
Create mock from the provided mock control using the arguments passed to the builder.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public abstract T createMock(org.easymock.classextension.IMocksControl)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public T createMock(IMocksControl var1)
Description:
Create mock from the provided mock control using the arguments passed to the builder.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract T createMock(org.easymock.classextension.IMocksControl)
- public abstract T createNiceMock(java.lang.String)
+ public static T mock(java.lang.Class)
- public T createMock(IMocksControl var1)
Description:
Create mock from the provided mock control using the arguments passed to the builder.
Parameters:
- public T createNiceMock(String var1)
Description:
Create a named nice mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public abstract T createMock(org.easymock.classextension.IMocksControl)
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public T createMock(IMocksControl var1)
Description:
Create mock from the provided mock control using the arguments passed to the builder.
Parameters:
- public void replay()
Description:
Deprecated.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract T createMock(org.easymock.classextension.IMocksControl)
- public static void verify(java.lang.Object...)
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public static T verify(T)
+ public static org.mockito.stubbing.OngoingStubbing when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public T createMock(IMocksControl var1)
Description:
Create mock from the provided mock control using the arguments passed to the builder.
Parameters:
- public void verify()
Description:
Deprecated.
- public void replay()
Description:
Deprecated.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T verify(T var1)
Description:
Verifies interaction happened once in order. Alias to inOrder.verify(mock, times(1)) Example:
InOrder inOrder = inOrder(firstMock, secondMock);
inOrder.verify(firstMock).someMethod("was called first");
inOrder.verify(secondMock).someMethod("was called second");
See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract T createMock(org.easymock.IMocksControl)
+ public static T mock(java.lang.Class)
- public T createMock(IMocksControl var1)
Description:
Create mock from the provided mock control using the arguments passed to the builder.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public abstract T createMock(org.easymock.IMocksControl)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expect(T)
+ public static T mock(java.lang.Class)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract T when(T)
- public T createMock(IMocksControl var1)
Description:
Create mock from the provided mock control using the arguments passed to the builder.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract T createMock(org.easymock.IMocksControl)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public T createMock(IMocksControl var1)
Description:
Create mock from the provided mock control using the arguments passed to the builder.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract T createMock(org.easymock.IMocksControl)
- public static org.easymock.IExpectationSetters expect(T)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
- public T createMock(IMocksControl var1)
Description:
Create mock from the provided mock control using the arguments passed to the builder.
Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract T createMock(org.easymock.IMocksControl)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public T createMock(IMocksControl var1)
Description:
Create mock from the provided mock control using the arguments passed to the builder.
Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract T createMock(org.easymock.IMocksControl)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenThrow(java.lang.Throwable...)
- public T createMock(IMocksControl var1)
Description:
Create mock from the provided mock control using the arguments passed to the builder.
Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ private OngoingStubbing
Description:
Sets Throwable objects to be thrown when the method is called. E.g:
when(mock.someMethod()).thenThrow(new RuntimeException());
If throwables contain a checked exception then it has to match one of the checked exceptions of method signature. You can specify throwables to be thrown for consecutive calls. In that case the last throwable determines the behavior of further consecutive calls. if throwable is null then exception will be thrown. See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract T createMock(org.easymock.IMocksControl)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public T createMock(IMocksControl var1)
Description:
Create mock from the provided mock control using the arguments passed to the builder.
Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract T createMock(org.easymock.MockType)
+ public static T mock(java.lang.Class)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public abstract T createMock(org.easymock.MockType)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract T createMock(org.easymock.MockType)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract T createMock(org.easymock.MockType)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public static T mock(java.lang.Class)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)
+ public abstract T when(T)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public Stubber doThrow(Throwable toBeThrown)
Description:
Use it for stubbing consecutive calls in Mockito.doThrow(Throwable) style:
doThrow(new RuntimeException("one")).
doThrow(new RuntimeException("two"))
.when(mock).someVoidMethod();
See javadoc for Mockito.doThrow(Throwable)
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract T createMock(org.easymock.MockType)
- public static T createMock(java.lang.Class)
+ public static T mock(java.lang.Class)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public abstract T createNiceMock(java.lang.String)
+ public static T mock(java.lang.Class)
- public T createNiceMock(String var1)
Description:
Create a named nice mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public abstract T createNiceMock(java.lang.String)
- public abstract T createMock(org.easymock.IMocksControl)
+ public static T mock(java.lang.Class)
- public T createNiceMock(String var1)
Description:
Create a named nice mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
- public T createMock(IMocksControl var1)
Description:
Create mock from the provided mock control using the arguments passed to the builder.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public abstract T createNiceMock(java.lang.String)
- public abstract T createMock(org.easymock.IMocksControl)
+ public static T spy(T)
- public T createNiceMock(String var1)
Description:
Create a named nice mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
- public T createMock(IMocksControl var1)
Description:
Create mock from the provided mock control using the arguments passed to the builder.
Parameters:
+ public static T spy(T object)
Description:
Creates a spy of the real object. The spy calls real methods unless they are stubbed. Real spies should be used carefully and occasionally, for example when dealing with legacy code. As usual you are going to read the partial mock warning: Object oriented programming is more less tackling complexity by dividing the complexity into separate, specific, SRPy objects. How does partial mock fit into this paradigm? Well, it just doesn't... Partial mock usually means that the complexity has been moved to a different method on the same object. In most cases, this is not the way you want to design your application. However, there are rare cases when partial mocks come handy: dealing with code you cannot change easily (3rd party interfaces, interim refactoring of legacy code etc.) However, I wouldn't use partial mocks for new, test-driven & well-designed code. Example:
List list = new LinkedList();
List spy = spy(list);
//optionally, you can stub out some methods:
when(spy.size()).thenReturn(100);
//using the spy calls real methods
spy.add("one");
spy.add("two");
//prints "one" - the first element of a list
System.out.println(spy.get(0));
//size() method was stubbed - 100 is printed
System.out.println(spy.size());
//optionally, you can verify
verify(spy).add("one");
verify(spy).add("two");
Important gotcha on spying real objects! Sometimes it's impossible or impractical to use when(Object) for stubbing spies. Therefore for spies it is recommended to always use doReturn|Answer|Throw()|CallRealMethod family of methods for stubbing. Example:
List list = new LinkedList();
List spy = spy(list);
//Impossible: real method is called so spy.get(0) throws IndexOutOfBoundsException (the list is yet empty)
when(spy.get(0)).thenReturn("foo");
//You have to use doReturn() for stubbing
doReturn("foo").when(spy).get(0);
Mockito *does not* delegate calls to the passed real instance, instead it actually creates a copy of it. So if you keep the real instance and interact with it, don't expect the spied to be aware of those interaction and their effect on real instance state. The corollary is that when an *unstubbed* method is called *on the spy* but *not on the real instance*, you won't see any effects on the real instance. Watch out for final methods. Mockito doesn't mock final methods so the bottom line is: when you spy on real objects + you try to stub a final method = trouble. Also you won't be able to verify those method as well. See examples in javadoc for Mockito class
Parameters:
- public abstract T createNiceMock(java.lang.String)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public T createNiceMock(String var1)
Description:
Create a named nice mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract T createNiceMock(java.lang.String)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public T createNiceMock(String var1)
Description:
Create a named nice mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
- public void replay()
Description:
Deprecated.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract T createNiceMock(java.lang.String)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract void andStubReturn(T)
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public T createNiceMock(String var1)
Description:
Create a named nice mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public void andStubReturn(T var1)
Description:
Sets a stub return value that will be returned for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract T createNiceMock(java.lang.String)
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public T createNiceMock(String var1)
Description:
Create a named nice mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
- public void replay()
Description:
Deprecated.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract T createStrictMock()
+ public abstract T when(T)
- public T createStrictMock()
Description:
Create a strict mock from this builder. The same builder can be called to create multiple mocks.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract T createStrictMock()
+ public static org.mockito.stubbing.Stubber doCallRealMethod()
- public T createStrictMock()
Description:
Create a strict mock from this builder. The same builder can be called to create multiple mocks.
Return Parameters:
+ public Stubber doCallRealMethod()
Description:
Use it for stubbing consecutive calls in Mockito.doCallRealMethod() style. See javadoc for Mockito.doCallRealMethod()
Return Parameters:
- public abstract T createStrictMock(java.lang.String)
+ public abstract T given(T)
- public T createStrictMock(String var1)
Description:
Create a named strict mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
+ public static BDDMyOngoingStubbing
Description:
see original Mockito.when(Object)
- public abstract T createStrictMock(java.lang.String)
+ public abstract T when(T)
- public T createStrictMock(String var1)
Description:
Create a named strict mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract T createStrictMock(java.lang.String)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenCallRealMethod()
- public T createStrictMock(String var1)
Description:
Create a named strict mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets the real implementation to be called when the method is called on a mock object. As usual you are going to read the partial mock warning: Object oriented programming is more less tackling complexity by dividing the complexity into separate, specific, SRPy objects. How does partial mock fit into this paradigm? Well, it just doesn't... Partial mock usually means that the complexity has been moved to a different method on the same object. In most cases, this is not the way you want to design your application. However, there are rare cases when partial mocks come handy: dealing with code you cannot change easily (3rd party interfaces, interim refactoring of legacy code etc.) However, I wouldn't use partial mocks for new, test-driven & well-designed code.
// someMethod() must be safe (e.g. doesn't throw, doesn't have dependencies to the object state, etc.)
// if it isn't safe then you will have trouble stubbing it using this api. Use Mockito.doCallRealMethod() instead.
when(mock.someMethod()).thenCallRealMethod();
// calls real method:
mock.someMethod();
See also javadoc Mockito.spy(Object) to find out more about partial mocks. Mockito.spy() is a recommended way of creating partial mocks. The reason is it guarantees real methods are called against correctly constructed object because you're responsible for constructing the object passed to spy() method. See examples in javadoc for Mockito.when(T)
Return Parameters:
- public abstract T createStrictMock(java.lang.String)
+ public static T mock(java.lang.Class)
- public T createStrictMock(String var1)
Description:
Create a named strict mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public abstract T createStrictMock(java.lang.String)
- public static org.easymock.Capture newCapture()
+ public static T mock(java.lang.Class)
- public T createStrictMock(String var1)
Description:
Create a named strict mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public abstract T createStrictMock(java.lang.String)
- public static org.easymock.Capture newCapture()
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
+ public static T mock(java.lang.Class)
+ public abstract T given(T)
+ public abstract org.mockito.BDDMockito$BDDStubber willReturn(java.lang.Object)
+ public abstract org.mockito.stubbing.OngoingStubbing then(org.mockito.stubbing.Answer>)
+ public abstract T should()
+ public void start()
+ public abstract void addListener(org.mockito.listeners.MockitoListener)
- public T createStrictMock(String var1)
Description:
Create a named strict mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public static BDDMyOngoingStubbing
Description:
see original Mockito.when(Object)
+ public static BDDStubber willReturn(Object toBeReturned)
Description:
See original Stubber.doReturn(Object)
+ public OngoingStubbing
Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example:
//using 'then' alias:
when(mock.foo()).then(returnCoolValue());
//versus good old 'thenAnswer:
when(mock.foo()).thenAnswer(byReturningCoolValue());
Parameters:
- public abstract T createStrictMock(java.lang.String)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
+ public static T mock(java.lang.Class)
+ public abstract T given(T)
+ public abstract org.mockito.BDDMockito$BDDStubber willAnswer(org.mockito.stubbing.Answer>)
- public T createStrictMock(String var1)
Description:
Create a named strict mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public static BDDMyOngoingStubbing
Description:
see original Mockito.when(Object)
+ public static BDDStubber willAnswer(Answer answer)
Description:
See original Stubber.doAnswer(Answer)
- public abstract T createStrictMock(java.lang.String)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
+ public abstract T given(T)
+ public abstract org.mockito.BDDMockito$BDDStubber willReturn(java.lang.Object, java.lang.Object...)
- public T createStrictMock(String var1)
Description:
Create a named strict mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public static BDDMyOngoingStubbing
Description:
see original Mockito.when(Object)
+ public BDDMyOngoingStubbing
Description:
See original OngoingStubbing.thenReturn(Object, Object[])
- public abstract T createStrictMock(java.lang.String)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract T given(T)
+ public abstract org.mockito.BDDMockito$BDDStubber willReturn(java.lang.Object)
- public T createStrictMock(String var1)
Description:
Create a named strict mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public static BDDMyOngoingStubbing
Description:
see original Mockito.when(Object)
+ public static BDDStubber willReturn(Object toBeReturned)
Description:
See original Stubber.doReturn(Object)
- public abstract T createStrictMock(java.lang.String)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract org.mockito.stubbing.OngoingStubbing then(org.mockito.stubbing.Answer>)
+ public abstract T should()
- public T createStrictMock(String var1)
Description:
Create a named strict mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public OngoingStubbing
Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example:
//using 'then' alias:
when(mock.foo()).then(returnCoolValue());
//versus good old 'thenAnswer:
when(mock.foo()).thenAnswer(byReturningCoolValue());
Parameters:
- public abstract T createStrictMock(java.lang.String)
- public static org.easymock.IExpectationSetters expectLastCall()
- public static void replay(java.lang.Object...)
- public static void verify(java.lang.Object...)
- public static void reset(java.lang.Object...)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
+ public abstract org.mockito.stubbing.OngoingStubbing then(org.mockito.stubbing.Answer>)
+ public abstract T should()
+ public abstract void shouldHaveNoMoreInteractions()
- public T createStrictMock(String var1)
Description:
Create a named strict mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
- public void replay()
Description:
Deprecated.
- public void verify()
Description:
Deprecated.
- public final void reset()
Description:
Deprecated.
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public OngoingStubbing
Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example:
//using 'then' alias:
when(mock.foo()).then(returnCoolValue());
//versus good old 'thenAnswer:
when(mock.foo()).thenAnswer(byReturningCoolValue());
Parameters:
- public abstract T createStrictMock(java.lang.String)
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public T createStrictMock(String var1)
Description:
Create a named strict mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
- public void replay()
Description:
Deprecated.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract T createStrictMock(java.lang.String)
- public static void replay(java.lang.Object...)
- public static void verify(java.lang.Object...)
- public static void reset(java.lang.Object...)
+ public abstract void shouldHaveNoMoreInteractions()
- public T createStrictMock(String var1)
Description:
Create a named strict mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
- public void replay()
Description:
Deprecated.
- public void verify()
Description:
Deprecated.
- public final void reset()
Description:
Deprecated.
- public abstract void andStubReturn(T)
+ public abstract T when(T)
- public void andStubReturn(T var1)
Description:
Sets a stub return value that will be returned for the expected invocation.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract void andStubReturn(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public void andStubReturn(T var1)
Description:
Sets a stub return value that will be returned for the expected invocation.
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public abstract void replay()
+ public abstract T when(T)
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract void replay()
+ public abstract org.mockito.stubbing.Stubber doNothing()
- public void replay()
Description:
Deprecated.
+ public Stubber doNothing()
Description:
Use it for stubbing consecutive calls in Mockito.doNothing() style:
doNothing().
doThrow(new RuntimeException("two"))
.when(mock).someVoidMethod();
See javadoc for Mockito.doNothing()
Return Parameters:
- public abstract void replay()
+ public abstract org.mockito.stubbing.Stubber doNothing()
+ public abstract T when(T)
- public void replay()
Description:
Deprecated.
+ public Stubber doNothing()
Description:
Use it for stubbing consecutive calls in Mockito.doNothing() style:
doNothing().
doThrow(new RuntimeException("two"))
.when(mock).someVoidMethod();
See javadoc for Mockito.doNothing()
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public abstract void reset()
+ public abstract T verify(T)
- public final void reset()
Description:
Deprecated.
+ public T verify(T var1)
Description:
Verifies interaction happened once in order. Alias to inOrder.verify(mock, times(1)) Example:
InOrder inOrder = inOrder(firstMock, secondMock);
inOrder.verify(firstMock).someMethod("was called first");
inOrder.verify(secondMock).someMethod("was called second");
See examples in javadoc for Mockito class
Parameters:
- public abstract void verify()
+ public abstract T verify(T)
- public void verify()
Description:
Deprecated.
+ public T verify(T var1)
Description:
Verifies interaction happened once in order. Alias to inOrder.verify(mock, times(1)) Example:
InOrder inOrder = inOrder(firstMock, secondMock);
inOrder.verify(firstMock).someMethod("was called first");
inOrder.verify(secondMock).someMethod("was called second");
See examples in javadoc for Mockito class
Parameters:
- public abstract void verify()
- public abstract void reset()
+ public abstract T verify(T)
- public void verify()
Description:
Deprecated.
- public final void reset()
Description:
Deprecated.
+ public T verify(T var1)
Description:
Verifies interaction happened once in order. Alias to inOrder.verify(mock, times(1)) Example:
InOrder inOrder = inOrder(firstMock, secondMock);
inOrder.verify(firstMock).someMethod("was called first");
inOrder.verify(secondMock).someMethod("was called second");
See examples in javadoc for Mockito class
Parameters:
- public boolean get(int)
+ public abstract T when(T)
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public boolean get(int)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
- public boolean get(int)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
+ public Object answer(InvocationOnMock invocation) throws Throwable
Description:
Specified by: answer in interface Answer<java.lang.Object>
Parameters:
- public boolean get(int)
+ public boolean get(int)
- public int getValue()
+ public V getValue()
- public T getValue()
Description:
Return the captured value
Return Parameters:
+ public T getValue()
Description:
Returns the captured value of the argument. If the method was called multiple times then it returns the latest captured value See examples in javadoc for ArgumentCaptor class.
Return Parameters:
- public java.lang.Object put(java.lang.Object, java.lang.Object)
+ public java.lang.Object put(java.lang.Object, java.lang.Object)
- public org.easymock.IMocksControl createControl()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IMocksControl createControl()
Description:
Creates a control, order checking is disabled by default.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public org.easymock.IMocksControl createControl()
+ public static T mock(java.lang.Class)
- public static IMocksControl createControl()
Description:
Creates a control, order checking is disabled by default.
Return Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public org.easymock.IMocksControl createControl()
- public abstract T createMock(org.easymock.classextension.IMocksControl)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IMocksControl createControl()
Description:
Creates a control, order checking is disabled by default.
Return Parameters:
- public T createMock(IMocksControl var1)
Description:
Create mock from the provided mock control using the arguments passed to the builder.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.Capture newCapture()
+ public abstract T given(T)
+ public static BDDMyOngoingStubbing
Description:
see original Mockito.when(Object)
- public static org.easymock.Capture newCapture()
+ public abstract org.mockito.BDDMockito$BDDStubber willReturn(java.lang.Object)
+ public static BDDStubber willReturn(Object toBeReturned)
Description:
See original Stubber.doReturn(Object)
- public static org.easymock.Capture newCapture()
+ public abstract org.mockito.stubbing.OngoingStubbing then(org.mockito.stubbing.Answer>)
+ public abstract T should()
+ public OngoingStubbing
Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example:
//using 'then' alias:
when(mock.foo()).then(returnCoolValue());
//versus good old 'thenAnswer:
when(mock.foo()).thenAnswer(byReturningCoolValue());
Parameters:
- public static org.easymock.Capture newCapture()
- public abstract T createStrictMock(java.lang.String)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
- public static void replay(java.lang.Object...)
+ public abstract T given(T)
+ public abstract org.mockito.BDDMockito$BDDStubber willReturn(java.lang.Object)
- public T createStrictMock(String var1)
Description:
Create a named strict mock from this builder. The same builder can be called to create multiple mocks.
Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public static BDDMyOngoingStubbing
Description:
see original Mockito.when(Object)
+ public static BDDStubber willReturn(Object toBeReturned)
Description:
See original Stubber.doReturn(Object)
- public static org.easymock.Capture newCapture()
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract T given(T)
+ public abstract org.mockito.BDDMockito$BDDStubber willReturn(java.lang.Object)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public static BDDMyOngoingStubbing
Description:
see original Mockito.when(Object)
+ public static BDDStubber willReturn(Object toBeReturned)
Description:
See original Stubber.doReturn(Object)
- public static org.easymock.Capture newCapture()
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
- public static void replay(java.lang.Object...)
+ public abstract T given(T)
+ public abstract org.mockito.BDDMockito$BDDStubber willReturn(java.lang.Object)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public static BDDMyOngoingStubbing
Description:
see original Mockito.when(Object)
+ public static BDDStubber willReturn(Object toBeReturned)
Description:
See original Stubber.doReturn(Object)
- public static org.easymock.IExpectationSetters expect(T)
+ public abstract T verify(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
+ public T verify(T var1)
Description:
Verifies interaction happened once in order. Alias to inOrder.verify(mock, times(1)) Example:
InOrder inOrder = inOrder(firstMock, secondMock);
inOrder.verify(firstMock).someMethod("was called first");
inOrder.verify(secondMock).someMethod("was called second");
See examples in javadoc for Mockito class
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
+ public abstract T when(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
+ public abstract org.mockito.BDDMockito$BDDStubber willReturn(java.lang.Object)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
+ public static BDDStubber willReturn(Object toBeReturned)
Description:
See original Stubber.doReturn(Object)
- public static org.easymock.IExpectationSetters expect(T)
+ public abstract org.mockito.BDDMockito$BDDStubber willReturn(java.lang.Object, java.lang.Object...)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
+ public BDDMyOngoingStubbing
Description:
See original OngoingStubbing.thenReturn(Object, Object[])
- public static org.easymock.IExpectationSetters expect(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
+ public static org.mockito.stubbing.OngoingStubbing when(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
+ public static void verifyNoMoreInteractions(java.lang.Object...)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
+ public void verifyNoMoreInteractions()
Description:
Verifies that no more interactions happened in order. Different from Mockito.verifyNoMoreInteractions(Object...) because the order of verification matters. Example:
mock.foo(); //1st
mock.bar(); //2nd
mock.baz(); //3rd
InOrder inOrder = inOrder(mock);
inOrder.verify(mock).bar(); //2n
inOrder.verify(mock).baz(); //3rd (last method)
//passes because there are no more interactions after last method:
inOrder.verifyNoMoreInteractions();
//however this fails because 1st method was not verified:
Mockito.verifyNoMoreInteractions(mock);
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
+ public static T mock(java.lang.Class)
+ public abstract org.mockito.BDDMockito$BDDStubber willAnswer(org.mockito.stubbing.Answer>)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public static BDDStubber willAnswer(Answer answer)
Description:
See original Stubber.doAnswer(Answer)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract T createMock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract T createMock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public static T mock(java.lang.Class)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public Object answer(InvocationOnMock invocation) throws Throwable
Description:
Specified by: answer in interface Answer<java.lang.Object>
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
- public abstract org.easymock.IExpectationSetters once()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public Object answer(InvocationOnMock invocation) throws Throwable
Description:
Specified by: answer in interface Answer<java.lang.Object>
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
- public boolean get(int)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public Object answer(InvocationOnMock invocation) throws Throwable
Description:
Specified by: answer in interface Answer<java.lang.Object>
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
- public abstract org.easymock.IExpectationSetters times(int)
- public abstract org.easymock.IExpectationSetters once()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public Object answer(InvocationOnMock invocation) throws Throwable
Description:
Specified by: answer in interface Answer<java.lang.Object>
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation at least once.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public abstract org.easymock.IExpectationSetters once()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation at least once.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation at least once.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public Stubber doThrow(Throwable toBeThrown)
Description:
Use it for stubbing consecutive calls in Mockito.doThrow(Throwable) style:
doThrow(new RuntimeException("one")).
doThrow(new RuntimeException("two"))
.when(mock).someVoidMethod();
See javadoc for Mockito.doThrow(Throwable)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public abstract org.easymock.IExpectationSetters once()
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation at least once.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public abstract org.easymock.IExpectationSetters times(int)
- public abstract org.easymock.IExpectationSetters once()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation at least once.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation at least once.
Return Parameters:
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation at least once.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation at least once.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation at least once.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation at least once.
Return Parameters:
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public Stubber doThrow(Throwable toBeThrown)
Description:
Use it for stubbing consecutive calls in Mockito.doThrow(Throwable) style:
doThrow(new RuntimeException("one")).
doThrow(new RuntimeException("two"))
.when(mock).someVoidMethod();
See javadoc for Mockito.doThrow(Throwable)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)
+ public abstract T when(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
+ public Stubber doThrow(Throwable toBeThrown)
Description:
Use it for stubbing consecutive calls in Mockito.doThrow(Throwable) style:
doThrow(new RuntimeException("one")).
doThrow(new RuntimeException("two"))
.when(mock).someVoidMethod();
See javadoc for Mockito.doThrow(Throwable)
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters atLeastOnce()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation at least once.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation at least once.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public OngoingStubbing
Description:
Sets consecutive return values to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(1, 2, 3);
Last return value in the sequence (in example: 3) determines the behavior of further consecutive calls. See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation at least once.
Return Parameters:
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters times(int)
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters times(int)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters times(int)
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public Object answer(InvocationOnMock invocation) throws Throwable
Description:
Specified by: answer in interface Answer<java.lang.Object>
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
- public boolean get(int)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public Object answer(InvocationOnMock invocation) throws Throwable
Description:
Specified by: answer in interface Answer<java.lang.Object>
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters atLeastOnce()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation at least once.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters times(int)
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters times(int)
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters times(int)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation at least once.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters times(int)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public abstract org.easymock.IExpectationSetters once()
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation at least once.
Return Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public OngoingStubbing
Description:
Sets consecutive return values to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(1, 2, 3);
Last return value in the sequence (in example: 3) determines the behavior of further consecutive calls. See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters times(int)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation at least once.
Return Parameters:
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters times(int)
- public abstract org.easymock.IExpectationSetters once()
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters times(int)
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract T given(T)
+ public abstract org.mockito.BDDMockito$BDDMyOngoingStubbing willReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
+ public static BDDMyOngoingStubbing
Description:
see original Mockito.when(Object)
+ public BDDMyOngoingStubbing
Description:
See original OngoingStubbing.thenReturn(Object)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters times(int)
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract T createMock(org.easymock.IMocksControl)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public T createMock(IMocksControl var1)
Description:
Create mock from the provided mock control using the arguments passed to the builder.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract void replay()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract T given(T)
+ public abstract org.mockito.BDDMockito$BDDStubber willReturn(java.lang.Object)
+ public abstract org.mockito.BDDMockito$BDDStubber willThrow(java.lang.Throwable...)
+ public void start()
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
+ public static BDDMyOngoingStubbing
Description:
see original Mockito.when(Object)
+ public static BDDStubber willReturn(Object toBeReturned)
Description:
See original Stubber.doReturn(Object)
+ public static BDDStubber willThrow(Throwable toBeThrown)
Description:
See original Stubber.doThrow(Throwable)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract org.mockito.BDDMockito$BDDStubber willThrow(java.lang.Throwable...)
+ public abstract T given(T)
+ public void start()
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
+ public static BDDStubber willThrow(Throwable toBeThrown)
Description:
See original Stubber.doThrow(Throwable)
+ public static BDDMyOngoingStubbing
Description:
see original Mockito.when(Object)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable...)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public Stubber doThrow(Throwable toBeThrown)
Description:
Use it for stubbing consecutive calls in Mockito.doThrow(Throwable) style:
doThrow(new RuntimeException("one")).
doThrow(new RuntimeException("two"))
.when(mock).someVoidMethod();
See javadoc for Mockito.doThrow(Throwable)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static T createMock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public static T mock(java.lang.Class)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static T createNiceMock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public static T mock(java.lang.Class)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public static T createNiceMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default, and the mock object will return 0, null or false for unexpected invocations.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)
+ public abstract T when(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation at least once.
Return Parameters:
- public void replay()
Description:
Deprecated.
+ public Stubber doThrow(Throwable toBeThrown)
Description:
Use it for stubbing consecutive calls in Mockito.doThrow(Throwable) style:
doThrow(new RuntimeException("one")).
doThrow(new RuntimeException("two"))
.when(mock).someVoidMethod();
See javadoc for Mockito.doThrow(Throwable)
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
- public abstract void replay()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenThrow(java.lang.Throwable...)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ private OngoingStubbing
Description:
Sets Throwable objects to be thrown when the method is called. E.g:
when(mock.someMethod()).thenThrow(new RuntimeException());
If throwables contain a checked exception then it has to match one of the checked exceptions of method signature. You can specify throwables to be thrown for consecutive calls. In that case the last throwable determines the behavior of further consecutive calls. if throwable is null then exception will be thrown. See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets consecutive return values to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(1, 2, 3);
Last return value in the sequence (in example: 3) determines the behavior of further consecutive calls. See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets consecutive return values to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(1, 2, 3);
Last return value in the sequence (in example: 3) determines the behavior of further consecutive calls. See examples in javadoc for Mockito.when(T)
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters once()
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets consecutive return values to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(1, 2, 3);
Last return value in the sequence (in example: 3) determines the behavior of further consecutive calls. See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract org.mockito.BDDMockito$BDDMyOngoingStubbing willReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
+ public BDDMyOngoingStubbing
Description:
See original OngoingStubbing.thenReturn(Object)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters times(int)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation count times.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets consecutive return values to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(1, 2, 3);
Last return value in the sequence (in example: 3) determines the behavior of further consecutive calls. See examples in javadoc for Mockito.when(T)
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract void andStubReturn(T)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public void andStubReturn(T var1)
Description:
Sets a stub return value that will be returned for the expected invocation.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expect(T)
- public abstract void andStubReturn(T)
- public static T createStrictMock(java.lang.Class)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public static T mock(java.lang.Class)
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public void andStubReturn(T var1)
Description:
Sets a stub return value that will be returned for the expected invocation.
Parameters:
- public static T createStrictMock(Class
Description:
Creates a mock object that implements the given interface, order checking is enabled by default.
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract T when(T)
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract org.mockito.stubbing.OngoingStubbing then(org.mockito.stubbing.Answer>)
+ public abstract T should()
+ public OngoingStubbing
Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example:
//using 'then' alias:
when(mock.foo()).then(returnCoolValue());
//versus good old 'thenAnswer:
when(mock.foo()).thenAnswer(byReturningCoolValue());
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract org.mockito.stubbing.OngoingStubbing then(org.mockito.stubbing.Answer>)
+ public abstract T should()
+ public void start()
+ public OngoingStubbing
Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example:
//using 'then' alias:
when(mock.foo()).then(returnCoolValue());
//versus good old 'thenAnswer:
when(mock.foo()).thenAnswer(byReturningCoolValue());
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Class extends java.lang.Throwable>, java.lang.Class extends java.lang.Throwable>...)
+ public Stubber doThrow(Throwable toBeThrown)
Description:
Use it for stubbing consecutive calls in Mockito.doThrow(Throwable) style:
doThrow(new RuntimeException("one")).
doThrow(new RuntimeException("two"))
.when(mock).someVoidMethod();
See javadoc for Mockito.doThrow(Throwable)
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
+ public Object answer(InvocationOnMock invocation) throws Throwable
Description:
Specified by: answer in interface Answer<java.lang.Object>
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
+ public java.lang.Object run()
- public static org.easymock.IExpectationSetters expectLastCall()
+ public void start()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
+ public Object answer(InvocationOnMock invocation) throws Throwable
Description:
Specified by: answer in interface Answer<java.lang.Object>
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract org.mockito.stubbing.OngoingStubbing then(org.mockito.stubbing.Answer>)
+ public abstract T should()
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public OngoingStubbing
Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example:
//using 'then' alias:
when(mock.foo()).then(returnCoolValue());
//versus good old 'thenAnswer:
when(mock.foo()).thenAnswer(byReturningCoolValue());
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void verify(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing then(org.mockito.stubbing.Answer>)
+ public abstract T should()
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public void verify()
Description:
Deprecated.
+ public OngoingStubbing
Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example:
//using 'then' alias:
when(mock.foo()).then(returnCoolValue());
//versus good old 'thenAnswer:
when(mock.foo()).thenAnswer(byReturningCoolValue());
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)
+ public abstract T when(T)
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
+ public Stubber doThrow(Throwable toBeThrown)
Description:
Use it for stubbing consecutive calls in Mockito.doThrow(Throwable) style:
doThrow(new RuntimeException("one")).
doThrow(new RuntimeException("two"))
.when(mock).someVoidMethod();
See javadoc for Mockito.doThrow(Throwable)
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
- public abstract org.easymock.IExpectationSetters once()
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)
+ public abstract T when(T)
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
+ public Stubber doThrow(Throwable toBeThrown)
Description:
Use it for stubbing consecutive calls in Mockito.doThrow(Throwable) style:
doThrow(new RuntimeException("one")).
doThrow(new RuntimeException("two"))
.when(mock).someVoidMethod();
See javadoc for Mockito.doThrow(Throwable)
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)
+ public abstract T when(T)
+ public java.lang.Object run()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public Stubber doThrow(Throwable toBeThrown)
Description:
Use it for stubbing consecutive calls in Mockito.doThrow(Throwable) style:
doThrow(new RuntimeException("one")).
doThrow(new RuntimeException("two"))
.when(mock).someVoidMethod();
See javadoc for Mockito.doThrow(Throwable)
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
- public boolean get(int)
- public abstract java.lang.Object get(java.lang.Object, java.lang.Object)
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
+ public boolean get(int)
+ public abstract java.lang.Object get(java.lang.Object, java.lang.Object)
+ public abstract T when(T)
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
- public void replay()
Description:
Deprecated.
+ public Object answer(InvocationOnMock invocation) throws Throwable
Description:
Specified by: answer in interface Answer<java.lang.Object>
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
- public boolean get(int)
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
+ public boolean get(int)
+ public abstract T when(T)
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
- public void replay()
Description:
Deprecated.
+ public Object answer(InvocationOnMock invocation) throws Throwable
Description:
Specified by: answer in interface Answer<java.lang.Object>
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
+ public abstract T when(T)
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
- public void replay()
Description:
Deprecated.
+ public Object answer(InvocationOnMock invocation) throws Throwable
Description:
Specified by: answer in interface Answer<java.lang.Object>
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expect(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)
+ public abstract T when(T)
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public Stubber doThrow(Throwable toBeThrown)
Description:
Use it for stubbing consecutive calls in Mockito.doThrow(Throwable) style:
doThrow(new RuntimeException("one")).
doThrow(new RuntimeException("two"))
.when(mock).someVoidMethod();
See javadoc for Mockito.doThrow(Throwable)
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation at least once.
Return Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public OngoingStubbing
Description:
Sets consecutive return values to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(1, 2, 3);
Last return value in the sequence (in example: 3) determines the behavior of further consecutive calls. See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public void replay()
Description:
Deprecated.
+ public OngoingStubbing
Description:
Sets consecutive return values to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(1, 2, 3);
Last return value in the sequence (in example: 3) determines the behavior of further consecutive calls. See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public static void verify(java.lang.Object...)
+ public abstract T verify(T, org.mockito.verification.VerificationMode)
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public void verify()
Description:
Deprecated.
+ public T verify(T var1, VerificationMode var2)
Description:
Verifies interaction in order. E.g:
InOrder inOrder = inOrder(firstMock, secondMock);
inOrder.verify(firstMock, times(2)).someMethod("was called first two times");
inOrder.verify(secondMock, atLeastOnce()).someMethod("was called second at least once");
See examples in javadoc for Mockito class
Parameters:
- public static org.easymock.MockControl createControl(java.lang.Class)
+ public static T mock(java.lang.Class)
- public static MockControl
Description:
Deprecated.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static org.easymock.MockControl createControl(java.lang.Class)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static MockControl
Description:
Deprecated.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static T createMock(java.lang.Class)
+ public abstract T given(T)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
+ public static BDDMyOngoingStubbing
Description:
see original Mockito.when(Object)
- public static T createMock(java.lang.Class)
+ public static T mock(java.lang.Class)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static T createMock(java.lang.Class)
+ public static void initMocks(java.lang.Object)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
+ public static void initMocks(Object testClass)
Description:
Initializes objects annotated with Mockito annotations for given testClass: @ Mock, @ Spy, @ Captor, @ InjectMocks See examples in javadoc for MockitoAnnotations class.
- public static T createMock(java.lang.Class)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static void replay(java.lang.Object...)
- public static void verify(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public abstract T verify(T)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public void replay()
Description:
Deprecated.
- public void verify()
Description:
Deprecated.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T verify(T var1)
Description:
Verifies interaction happened once in order. Alias to inOrder.verify(mock, times(1)) Example:
InOrder inOrder = inOrder(firstMock, secondMock);
inOrder.verify(firstMock).someMethod("was called first");
inOrder.verify(secondMock).someMethod("was called second");
See examples in javadoc for Mockito class
Parameters:
- public static T createMock(java.lang.Class)
- public abstract T createMock(org.easymock.MockType)
+ public static T mock(java.lang.Class)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static T createMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static T createMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static T createMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation once. This is default in EasyMock.
Return Parameters:
- public void replay()
Description:
Deprecated.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static T createMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters anyTimes()
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public IExpectationSetters
Description:
Expect the last invocation any times.
Return Parameters:
- public void replay()
Description:
Deprecated.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static T createMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static T createMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenThrow(java.lang.Throwable...)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Class extends java.lang.Throwable>, java.lang.Class extends java.lang.Throwable>...)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ private OngoingStubbing
Description:
Sets Throwable objects to be thrown when the method is called. E.g:
when(mock.someMethod()).thenThrow(new RuntimeException());
If throwables contain a checked exception then it has to match one of the checked exceptions of method signature. You can specify throwables to be thrown for consecutive calls. In that case the last throwable determines the behavior of further consecutive calls. if throwable is null then exception will be thrown. See examples in javadoc for Mockito.when(T)
Parameters:
+ public Stubber doThrow(Throwable toBeThrown)
Description:
Use it for stubbing consecutive calls in Mockito.doThrow(Throwable) style:
doThrow(new RuntimeException("one")).
doThrow(new RuntimeException("two"))
.when(mock).someVoidMethod();
See javadoc for Mockito.doThrow(Throwable)
Parameters:
- public static T createMock(java.lang.Class)
- public static T createStrictMock(java.lang.Class)
+ public static T mock(java.lang.Class)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
- public static T createStrictMock(Class
Description:
Creates a mock object that implements the given interface, order checking is enabled by default.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static T createMock(java.lang.Class)
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
- public void replay()
Description:
Deprecated.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static T createMock(java.lang.String, java.lang.Class)
+ public static T mock(java.lang.Class)
- public static T createMock(String name, Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static T createMock(java.lang.String, java.lang.Class)
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
- public static T createMock(String name, Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
- public void replay()
Description:
Deprecated.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static T createNiceMock(java.lang.Class)
+ public static T mock(java.lang.Class)
- public static T createNiceMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default, and the mock object will return 0, null or false for unexpected invocations.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static T createNiceMock(java.lang.Class)
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
- public static T createNiceMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default, and the mock object will return 0, null or false for unexpected invocations.
- public void replay()
Description:
Deprecated.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static T createStrictMock(java.lang.Class)
+ public static T mock(java.lang.Class)
- public static T createStrictMock(Class
Description:
Creates a mock object that implements the given interface, order checking is enabled by default.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static T createStrictMock(java.lang.Class)
+ public static void initMocks(java.lang.Object)
- public static T createStrictMock(Class
Description:
Creates a mock object that implements the given interface, order checking is enabled by default.
+ public static void initMocks(Object testClass)
Description:
Initializes objects annotated with Mockito annotations for given testClass: @ Mock, @ Spy, @ Captor, @ InjectMocks See examples in javadoc for MockitoAnnotations class.
- public static T createStrictMock(java.lang.Class)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static T createStrictMock(Class
Description:
Creates a mock object that implements the given interface, order checking is enabled by default.
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static T createStrictMock(java.lang.Class)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expect(T)
+ public static T mock(java.lang.Class)
- public static T createStrictMock(Class
Description:
Creates a mock object that implements the given interface, order checking is enabled by default.
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static T createStrictMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
+ public static org.mockito.stubbing.OngoingStubbing when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static T createStrictMock(Class
Description:
Creates a mock object that implements the given interface, order checking is enabled by default.
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static T createStrictMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public static org.mockito.stubbing.OngoingStubbing when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static T createStrictMock(Class
Description:
Creates a mock object that implements the given interface, order checking is enabled by default.
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static T createStrictMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenThrow(java.lang.Throwable...)
- public static T createStrictMock(Class
Description:
Creates a mock object that implements the given interface, order checking is enabled by default.
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ private OngoingStubbing
Description:
Sets Throwable objects to be thrown when the method is called. E.g:
when(mock.someMethod()).thenThrow(new RuntimeException());
If throwables contain a checked exception then it has to match one of the checked exceptions of method signature. You can specify throwables to be thrown for consecutive calls. In that case the last throwable determines the behavior of further consecutive calls. if throwable is null then exception will be thrown. See examples in javadoc for Mockito.when(T)
Parameters:
- public static T createStrictMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract void andStubReturn(T)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static T createStrictMock(Class
Description:
Creates a mock object that implements the given interface, order checking is enabled by default.
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public void andStubReturn(T var1)
Description:
Sets a stub return value that will be returned for the expected invocation.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static T createStrictMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract void andStubReturn(T)
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static T createStrictMock(Class
Description:
Creates a mock object that implements the given interface, order checking is enabled by default.
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public void andStubReturn(T var1)
Description:
Sets a stub return value that will be returned for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static T createStrictMock(java.lang.Class)
- public static void makeThreadSafe(java.lang.Object, boolean)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenThrow(java.lang.Throwable...)
- public static T createStrictMock(Class
Description:
Creates a mock object that implements the given interface, order checking is enabled by default.
- public void makeThreadSafe(boolean var1)
Description:
Makes the mock thread safe.
Parameters:
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a throwable that will be thrown for the expected invocation.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ private OngoingStubbing
Description:
Sets Throwable objects to be thrown when the method is called. E.g:
when(mock.someMethod()).thenThrow(new RuntimeException());
If throwables contain a checked exception then it has to match one of the checked exceptions of method signature. You can specify throwables to be thrown for consecutive calls. In that case the last throwable determines the behavior of further consecutive calls. if throwable is null then exception will be thrown. See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract T when(T)
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)
+ public OngoingStubbing
Description:
Sets consecutive return values to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(1, 2, 3);
Last return value in the sequence (in example: 3) determines the behavior of further consecutive calls. See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public static T createNiceMock(java.lang.Class)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)
+ public static T mock(java.lang.Class)
- public static T createNiceMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default, and the mock object will return 0, null or false for unexpected invocations.
+ public OngoingStubbing
Description:
Sets consecutive return values to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(1, 2, 3);
Last return value in the sequence (in example: 3) determines the behavior of further consecutive calls. See examples in javadoc for Mockito.when(T)
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static org.easymock.IExpectationSetters expectLastCall()
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)
- public void replay()
Description:
Deprecated.
+ public OngoingStubbing
Description:
Sets consecutive return values to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(1, 2, 3);
Last return value in the sequence (in example: 3) determines the behavior of further consecutive calls. See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IMocksControl createControl()
+ public static T mock(java.lang.Class)
- public static IMocksControl createControl()
Description:
Creates a control, order checking is disabled by default.
Return Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static org.easymock.IMocksControl createControl()
- public abstract T createMock(org.easymock.IMocksControl)
+ public static T mock(java.lang.Class)
- public static IMocksControl createControl()
Description:
Creates a control, order checking is disabled by default.
Return Parameters:
- public T createMock(IMocksControl var1)
Description:
Create mock from the provided mock control using the arguments passed to the builder.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static org.easymock.IMocksControl createNiceControl()
+ public static void initMocks(java.lang.Object)
- public static IMocksControl createNiceControl()
Description:
Creates a control, order checking is disabled by default, and the mock objects created by this control will return 0, null or false for unexpected invocations.
Return Parameters:
+ public static void initMocks(Object testClass)
Description:
Initializes objects annotated with Mockito annotations for given testClass: @ Mock, @ Spy, @ Captor, @ InjectMocks See examples in javadoc for MockitoAnnotations class.
- public static org.easymock.IMocksControl createNiceControl()
- public abstract T createMock(java.lang.Class)
+ public static void initMocks(java.lang.Object)
- public static IMocksControl createNiceControl()
Description:
Creates a control, order checking is disabled by default, and the mock objects created by this control will return 0, null or false for unexpected invocations.
Return Parameters:
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
+ public static void initMocks(Object testClass)
Description:
Initializes objects annotated with Mockito annotations for given testClass: @ Mock, @ Spy, @ Captor, @ InjectMocks See examples in javadoc for MockitoAnnotations class.
- public static org.easymock.IMocksControl createStrictControl()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)
- public static IMocksControl createStrictControl()
Description:
Creates a control, order checking is enabled by default.
Return Parameters:
+ public OngoingStubbing
Description:
Sets consecutive return values to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(1, 2, 3);
Last return value in the sequence (in example: 3) determines the behavior of further consecutive calls. See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IMocksControl createStrictControl()
+ public static T mock(java.lang.Class)
- public static IMocksControl createStrictControl()
Description:
Creates a control, order checking is enabled by default.
Return Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static org.easymock.IMocksControl createStrictControl()
- public abstract T createMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
- public static IMocksControl createStrictControl()
Description:
Creates a control, order checking is enabled by default.
Return Parameters:
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static org.easymock.IMocksControl createStrictControl()
- public abstract T createMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IMocksControl createStrictControl()
Description:
Creates a control, order checking is enabled by default.
Return Parameters:
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IMocksControl createStrictControl()
- public abstract T createMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)
- public static IMocksControl createStrictControl()
Description:
Creates a control, order checking is enabled by default.
Return Parameters:
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
+ public OngoingStubbing
Description:
Sets consecutive return values to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(1, 2, 3);
Last return value in the sequence (in example: 3) determines the behavior of further consecutive calls. See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.IMocksControl createStrictControl()
- public abstract T createMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract void replay()
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public static IMocksControl createStrictControl()
Description:
Creates a control, order checking is enabled by default.
Return Parameters:
- public static T createMock(Class
Description:
Creates a mock object that implements the given interface, order checking is disabled by default.
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.MockControl createControl(java.lang.Class)
+ public static T mock(java.lang.Class)
- public static MockControl
Description:
Deprecated.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static org.easymock.MockControl createControl(java.lang.Class)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenThrow(java.lang.Throwable...)
- public static MockControl
Description:
Deprecated.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ private OngoingStubbing
Description:
Sets Throwable objects to be thrown when the method is called. E.g:
when(mock.someMethod()).thenThrow(new RuntimeException());
If throwables contain a checked exception then it has to match one of the checked exceptions of method signature. You can specify throwables to be thrown for consecutive calls. In that case the last throwable determines the behavior of further consecutive calls. if throwable is null then exception will be thrown. See examples in javadoc for Mockito.when(T)
Parameters:
- public static org.easymock.MockControl createControl(java.lang.Class)
- public void setDefaultMatcher(org.easymock.ArgumentsMatcher)
+ public static T mock(java.lang.Class)
- public static MockControl
Description:
Deprecated.
Parameters:
- public void setDefaultMatcher(ArgumentsMatcher matcher)
Description:
Deprecated.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static void makeThreadSafe(java.lang.Object, boolean)
+ public abstract T when(T)
- public void makeThreadSafe(boolean var1)
Description:
Makes the mock thread safe.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public static void makeThreadSafe(java.lang.Object, boolean)
+ public abstract org.mockito.stubbing.OngoingStubbing thenThrow(java.lang.Throwable...)
- public void makeThreadSafe(boolean var1)
Description:
Makes the mock thread safe.
Parameters:
+ private OngoingStubbing
Description:
Sets Throwable objects to be thrown when the method is called. E.g:
when(mock.someMethod()).thenThrow(new RuntimeException());
If throwables contain a checked exception then it has to match one of the checked exceptions of method signature. You can specify throwables to be thrown for consecutive calls. In that case the last throwable determines the behavior of further consecutive calls. if throwable is null then exception will be thrown. See examples in javadoc for Mockito.when(T)
Parameters:
- public static void makeThreadSafe(java.lang.Object, boolean)
+ public static T mock(java.lang.Class)
- public void makeThreadSafe(boolean var1)
Description:
Makes the mock thread safe.
Parameters:
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static void replay(java.lang.Object...)
+ public abstract T verify(T)
+ public boolean merge(org.mockito.asm.tree.analysis.Subroutine) throws org.mockito.asm.tree.analysis.AnalyzerException
- public void replay()
Description:
Deprecated.
+ public T verify(T var1)
Description:
Verifies interaction happened once in order. Alias to inOrder.verify(mock, times(1)) Example:
InOrder inOrder = inOrder(firstMock, secondMock);
inOrder.verify(firstMock).someMethod("was called first");
inOrder.verify(secondMock).someMethod("was called second");
See examples in javadoc for Mockito class
Parameters:
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.BDDMockito$BDDMyOngoingStubbing willThrow(java.lang.Throwable...)
- public void replay()
Description:
Deprecated.
+ public static BDDStubber willThrow(Throwable toBeThrown)
Description:
See original Stubber.doThrow(Throwable)
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public void replay()
Description:
Deprecated.
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)
- public void replay()
Description:
Deprecated.
+ public OngoingStubbing
Description:
Sets consecutive return values to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(1, 2, 3);
Last return value in the sequence (in example: 3) determines the behavior of further consecutive calls. See examples in javadoc for Mockito.when(T)
Parameters:
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenThrow(java.lang.Throwable...)
- public void replay()
Description:
Deprecated.
+ private OngoingStubbing
Description:
Sets Throwable objects to be thrown when the method is called. E.g:
when(mock.someMethod()).thenThrow(new RuntimeException());
If throwables contain a checked exception then it has to match one of the checked exceptions of method signature. You can specify throwables to be thrown for consecutive calls. In that case the last throwable determines the behavior of further consecutive calls. if throwable is null then exception will be thrown. See examples in javadoc for Mockito.when(T)
Parameters:
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
- public void replay()
Description:
Deprecated.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public static void replay(java.lang.Object...)
+ public static T verify(T)
- public void replay()
Description:
Deprecated.
+ public T verify(T var1)
Description:
Verifies interaction happened once in order. Alias to inOrder.verify(mock, times(1)) Example:
InOrder inOrder = inOrder(firstMock, secondMock);
inOrder.verify(firstMock).someMethod("was called first");
inOrder.verify(secondMock).someMethod("was called second");
See examples in javadoc for Mockito class
Parameters:
- public static void replay(java.lang.Object...)
+ public static void verifyNoMoreInteractions(java.lang.Object...)
- public void replay()
Description:
Deprecated.
+ public void verifyNoMoreInteractions()
Description:
Verifies that no more interactions happened in order. Different from Mockito.verifyNoMoreInteractions(Object...) because the order of verification matters. Example:
mock.foo(); //1st
mock.bar(); //2nd
mock.baz(); //3rd
InOrder inOrder = inOrder(mock);
inOrder.verify(mock).bar(); //2n
inOrder.verify(mock).baz(); //3rd (last method)
//passes because there are no more interactions after last method:
inOrder.verifyNoMoreInteractions();
//however this fails because 1st method was not verified:
Mockito.verifyNoMoreInteractions(mock);
- public static void replay(java.lang.Object...)
- public static void verify(java.lang.Object...)
+ public abstract T verify(T)
- public void replay()
Description:
Deprecated.
- public void verify()
Description:
Deprecated.
+ public T verify(T var1)
Description:
Verifies interaction happened once in order. Alias to inOrder.verify(mock, times(1)) Example:
InOrder inOrder = inOrder(firstMock, secondMock);
inOrder.verify(firstMock).someMethod("was called first");
inOrder.verify(secondMock).someMethod("was called second");
See examples in javadoc for Mockito class
Parameters:
- public static void replay(java.lang.Object...)
- public static void verify(java.lang.Object...)
- public static void reset(java.lang.Object...)
+ public abstract T verify(T, org.mockito.internal.verification.api.VerificationMode)
- public void replay()
Description:
Deprecated.
- public void verify()
Description:
Deprecated.
- public final void reset()
Description:
Deprecated.
+ public T verify(T var1, VerificationMode var2)
Description:
Verifies interaction in order. E.g:
InOrder inOrder = inOrder(firstMock, secondMock);
inOrder.verify(firstMock, times(2)).someMethod("was called first two times");
inOrder.verify(secondMock, atLeastOnce()).someMethod("was called second at least once");
See examples in javadoc for Mockito class
Parameters:
- public static void reportMatcher(org.easymock.IArgumentMatcher)
+ public static T argThat(org.hamcrest.Matcher)
+ public static T argThat(Matcher
Description:
Allows creating custom argument matchers. In rare cases when the parameter is a primitive then you *must* use relevant intThat(), floatThat(), etc. method. This way you will avoid NullPointerException during auto-unboxing. See examples in javadoc for ArgumentMatcher class
Parameters:
- public static void reset(java.lang.Object...)
+ public void reset(T...)
- public final void reset()
Description:
Deprecated.
+ public void reset()
Description:
Specified by: reset in interface ArgumentMatcherStorage
- public static void reset(java.lang.Object...)
+ public abstract T when(T)
- public final void reset()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public static void reset(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public final void reset()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static void reset(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public final void reset()
Description:
Deprecated.
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static void reset(java.lang.Object...)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public final void reset()
Description:
Deprecated.
- public static IExpectationSetters
Description:
Returns the expectation setter for the last expected invocation in the current thread.
Parameters:
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public static void verify(java.lang.Object...)
+ public abstract T verify(T)
- public void verify()
Description:
Deprecated.
+ public T verify(T var1)
Description:
Verifies interaction happened once in order. Alias to inOrder.verify(mock, times(1)) Example:
InOrder inOrder = inOrder(firstMock, secondMock);
inOrder.verify(firstMock).someMethod("was called first");
inOrder.verify(secondMock).someMethod("was called second");
See examples in javadoc for Mockito class
Parameters:
- public static void verify(java.lang.Object...)
+ public abstract T verify(T, org.mockito.internal.verification.api.VerificationMode)
- public void verify()
Description:
Deprecated.
+ public T verify(T var1, VerificationMode var2)
Description:
Verifies interaction in order. E.g:
InOrder inOrder = inOrder(firstMock, secondMock);
inOrder.verify(firstMock, times(2)).someMethod("was called first two times");
inOrder.verify(secondMock, atLeastOnce()).someMethod("was called second at least once");
See examples in javadoc for Mockito class
Parameters:
- public static void verify(java.lang.Object...)
+ public abstract T verify(T, org.mockito.verification.VerificationMode)
- public void verify()
Description:
Deprecated.
+ public T verify(T var1, VerificationMode var2)
Description:
Verifies interaction in order. E.g:
InOrder inOrder = inOrder(firstMock, secondMock);
inOrder.verify(firstMock, times(2)).someMethod("was called first two times");
inOrder.verify(secondMock, atLeastOnce()).someMethod("was called second at least once");
See examples in javadoc for Mockito class
Parameters:
- public static void verify(java.lang.Object...)
+ public abstract T when(T)
- public void verify()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public static void verify(java.lang.Object...)
+ public abstract java.lang.Object get(java.lang.Object, java.lang.Object)
- public void verify()
Description:
Deprecated.
- public static void verify(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing then(org.mockito.stubbing.Answer>)
+ public abstract T should()
- public void verify()
Description:
Deprecated.
+ public OngoingStubbing
Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example:
//using 'then' alias:
when(mock.foo()).then(returnCoolValue());
//versus good old 'thenAnswer:
when(mock.foo()).thenAnswer(byReturningCoolValue());
Parameters:
- public static void verify(java.lang.Object...)
+ public static org.mockito.ArgumentCaptor forClass(java.lang.Class)
- public void verify()
Description:
Deprecated.
+ public static ArgumentCaptor
Description:
Build a new ArgumentCaptor. Note that an ArgumentCaptor *don't do any type checks*, it is only there to avoid casting in your code. This might however change (type checks could be added) in a future major release.
- public static void verify(java.lang.Object...)
+ public static T verify(T)
- public void verify()
Description:
Deprecated.
+ public T verify(T var1)
Description:
Verifies interaction happened once in order. Alias to inOrder.verify(mock, times(1)) Example:
InOrder inOrder = inOrder(firstMock, secondMock);
inOrder.verify(firstMock).someMethod("was called first");
inOrder.verify(secondMock).someMethod("was called second");
See examples in javadoc for Mockito class
Parameters:
- public static void verify(java.lang.Object...)
- public static void reset(java.lang.Object...)
- public static org.easymock.IExpectationSetters expectLastCall()
- public static void replay(java.lang.Object...)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract org.mockito.stubbing.OngoingStubbing then(org.mockito.stubbing.Answer>)
+ public abstract T should()
- public void verify()
Description:
Deprecated.
- public final void reset()
Description:
Deprecated.
- public void replay()
Description:
Deprecated.
- public IExpectationSetters
Description:
Sets a return value that will be returned for the expected invocation.
Parameters:
+ public OngoingStubbing
Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example:
//using 'then' alias:
when(mock.foo()).then(returnCoolValue());
//versus good old 'thenAnswer:
when(mock.foo()).thenAnswer(byReturningCoolValue());
Parameters:
- public void expectAndReturn(java.lang.Object, java.lang.Object)
+ public abstract T when(T)
- public void expectAndReturn(V1 ignored, V2 value)
Description:
Deprecated.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public void expectAndReturn(java.lang.Object, java.lang.Object)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public void expectAndReturn(V1 ignored, V2 value)
Description:
Deprecated.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public void expectAndReturn(java.lang.Object, java.lang.Object)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public void expectAndReturn(V1 ignored, V2 value)
Description:
Deprecated.
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public void expectAndReturn(java.lang.Object, java.lang.Object, int)
+ public abstract T when(T)
- public void expectAndReturn(V1 ignored, V2 value, Range range)
Description:
Deprecated.
Parameters:
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public void expectAndReturn(java.lang.Object, java.lang.Object, int)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public void expectAndReturn(V1 ignored, V2 value, Range range)
Description:
Deprecated.
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public void expectAndReturn(java.lang.Object, java.lang.Object, int)
- public void expectAndReturn(java.lang.Object, java.lang.Object)
- public void replay()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public void expectAndReturn(V1 ignored, V2 value, Range range)
Description:
Deprecated.
Parameters:
- public void expectAndReturn(V1 ignored, V2 value)
Description:
Deprecated.
Parameters:
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public void push(boolean)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
- public void push(boolean)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
+ public Object answer(InvocationOnMock invocation) throws Throwable
Description:
Specified by: answer in interface Answer<java.lang.Object>
Parameters:
- public void push(boolean)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
+ public Object answer(InvocationOnMock invocation) throws Throwable
Description:
Specified by: answer in interface Answer<java.lang.Object>
Parameters:
- public void replay()
+ public abstract T when(T)
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
- public void replay()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public void replay()
Description:
Deprecated.
+ public T when(T mock)
Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example:
doThrow(new RuntimeException())
.when(mockedList).clear();
//following throws RuntimeException:
mockedList.clear();
Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito
Parameters:
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public void replay()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
- public void replay()
Description:
Deprecated.
+ public OngoingStubbing
Description:
Sets a return value to be returned when the method is called. E.g:
when(mock.someMethod()).thenReturn(10);
See examples in javadoc for Mockito.when(T)
Parameters:
- public void set(int)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
- public void set(int)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer extends T>)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
- public IExpectationSetters
Description:
Sets an object that will be used to calculate the answer for the expected invocation (either return a value, or throw an exception).
Parameters:
- public void setDefaultMatcher(org.easymock.ArgumentsMatcher)
+ public static T mock(java.lang.Class)
- public void setDefaultMatcher(ArgumentsMatcher matcher)
Description:
Deprecated.
+ public static T mock(Class
Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class
Parameters:
- public void verify()
+ public abstract T verify(T)
- public void verify()
Description:
Deprecated.
+ public T verify(T var1)
Description:
Verifies interaction happened once in order. Alias to inOrder.verify(mock, times(1)) Example:
InOrder inOrder = inOrder(firstMock, secondMock);
inOrder.verify(firstMock).someMethod("was called first");
inOrder.verify(secondMock).someMethod("was called second");
See examples in javadoc for Mockito class
Parameters:
- boolean isNull()
+ public java.lang.Object get(java.lang.Object) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException
+ public Object get(Object target) throws IllegalArgumentException, IllegalAccessException
Description:
Attempts to retrieve the value of this field on target
- java.lang.String[] toString(java.lang.Object[], java.lang.Class>[])
+ public static void assertEquals(java.lang.Object[], java.lang.Object[])
- public String toString()
Description:
Overrides: toString in class Object
+ public static void assertEquals(Object expected, Object actual)
Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.
Parameters:
- public abstract int size()
+ public static void assertNotSame(java.lang.String, java.lang.Object, java.lang.Object)
+ public static void assertNotSame(String message, Object expected, Object actual)
Description:
Asserts that two objects do not refer to the same object. If they do refer to the same object, an AssertionError is thrown with the given message.
Parameters:
- public abstract int size()
+ public static void assertTrue(java.lang.String, boolean)
+ public static void assertTrue(String message, boolean condition)
Description:
Asserts that a condition is true. If it isn't it throws an AssertionError with the given message.
Parameters:
- public abstract int[] indices()
+ public static org.hamcrest.Matcher equalTo(T)
+ public static Matcher
Description:
Is the value equal to another value, as tested by the Object.equals(java.lang.Object) invokedMethod?
- public abstract int[] indices()
+ public static void assertTrue(java.lang.String, boolean)
+ public static void assertTrue(String message, boolean condition)
Description:
Asserts that a condition is true. If it isn't it throws an AssertionError with the given message.
Parameters:
- public abstract java.lang.Class[] getValue()
+ public abstract java.lang.Object getValue() throws org.junit.experimental.theories.PotentialAssignment$CouldNotGenerateValueException
- public String[] getValue()
Description:
The list of variables used to fill the parameters of this method. These variables must be defined in your testng.xml file. For example @Parameters({ "xmlPath" }) @Test public void verifyXmlFile(String path) { ... } and in testng.xml: <parameter name="xmlPath" value="account.xml" />
+ public Object getValue() throws CouldNotGenerateValueException
Description:
Throws: PotentialAssignment.CouldNotGenerateValueException
- public abstract java.lang.Class[] getValue()
+ public static void assertEquals(int, int)
- public String[] getValue()
Description:
The list of variables used to fill the parameters of this method. These variables must be defined in your testng.xml file. For example @Parameters({ "xmlPath" }) @Test public void verifyXmlFile(String path) { ... } and in testng.xml: <parameter name="xmlPath" value="account.xml" />
+ public static void assertEquals(int expected, int actual)
Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.
Parameters:
- public abstract java.lang.Class[] getValue()
- public boolean equals(java.lang.Object)
+ public static void assertEquals(int, int)
- public String[] getValue()
Description:
The list of variables used to fill the parameters of this method. These variables must be defined in your testng.xml file. For example @Parameters({ "xmlPath" }) @Test public void verifyXmlFile(String path) { ... } and in testng.xml: <parameter name="xmlPath" value="account.xml" />
- public boolean equals(Object obj)
Description:
Overrides: equals in class Object
+ public static void assertEquals(int expected, int actual)
Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.
Parameters:
- public abstract java.lang.Class[] getValue()
- public void put(org.testng.xml.XmlSuite, org.testng.ISuite)
+ public abstract java.lang.Object getValue() throws org.junit.experimental.theories.PotentialAssignment$CouldNotGenerateValueException
- public String[] getValue()
Description:
The list of variables used to fill the parameters of this method. These variables must be defined in your testng.xml file. For example @Parameters({ "xmlPath" }) @Test public void verifyXmlFile(String path) { ... } and in testng.xml: <parameter name="xmlPath" value="account.xml" />
+ public Object getValue() throws CouldNotGenerateValueException
Description:
Throws: PotentialAssignment.CouldNotGenerateValueException
- public abstract java.lang.Object getInstance()
+ public static void assertEquals(int, int)
- public Object getInstance()
Description:
The instance on which this method was run.
+ public static void assertEquals(int expected, int actual)
Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.
Parameters:
- public abstract java.lang.Object getInstance()
- public abstract java.lang.Class[] getValue()
- public boolean equals(java.lang.Object)
+ public static void assertEquals(int, int)
- public Object getInstance()
Description:
The instance on which this method was run.
- public String[] getValue()
Description:
The list of variables used to fill the parameters of this method. These variables must be defined in your testng.xml file. For example @Parameters({ "xmlPath" }) @Test public void verifyXmlFile(String path) { ... } and in testng.xml: <parameter name="xmlPath" value="account.xml" />
- public boolean equals(Object obj)
Description:
Overrides: equals in class Object
+ public static void assertEquals(int expected, int actual)
Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.
Parameters:
- public abstract java.lang.Object[] getInstances(boolean)
+ public static void assertTrue(java.lang.String, boolean)
- public Object[] getInstances(boolean create)
Description:
Returns all the instances the methods will be invoked upon. This will typically be an array of one object in the absence of a @Factory annotation.
Parameters:
+ public static void assertTrue(String message, boolean condition)
Description:
Asserts that a condition is true. If it isn't it throws an AssertionError with the given message.
Parameters:
- public abstract java.lang.Object[] getInstances(boolean)
- public static void assertTrue(boolean, java.lang.String)
+ public static void assertTrue(java.lang.String, boolean)
- public Object[] getInstances(boolean create)
Description:
Returns all the instances the methods will be invoked upon. This will typically be an array of one object in the absence of a @Factory annotation.
Parameters:
- public static void assertTrue(String message, boolean condition)
Description:
Asserts that a condition is true. If it isn't it throws an AssertionFailedError with the given message.
+ public static void assertTrue(String message, boolean condition)
Description:
Asserts that a condition is true. If it isn't it throws an AssertionError with the given message.
Parameters:
- public abstract java.lang.Object[] getInstances(boolean)
- public void assertNotEquals(double, double, double)
- public abstract int size()
+ public static void assertNotSame(java.lang.String, java.lang.Object, java.lang.Object)
- public Object[] getInstances(boolean create)
Description:
Returns all the instances the methods will be invoked upon. This will typically be an array of one object in the absence of a @Factory annotation.
Parameters:
+ public static void assertNotSame(String message, Object expected, Object actual)
Description:
Asserts that two objects do not refer to the same object. If they do refer to the same object, an AssertionError is thrown with the given message.
Parameters:
- public abstract java.lang.String getMessage()
+ public java.lang.String getMessage()
- public String getMessage()
Description:
Overrides: getMessage in class Throwable
+ public String getMessage()
Description:
Returns "..." in place of common prefix and "..." in place of common suffix between expected and actual.
- public abstract java.lang.String getMessage()
+ public static void fail(java.lang.String)
- public String getMessage()
Description:
Overrides: getMessage in class Throwable
+ public static void fail(String message)
Description:
Fails a test with the given message.
Parameters:
- public abstract java.lang.String getType()
+ public abstract java.lang.Class> getType()
+ public Class> getType()
Description:
Specified by: getType in class FrameworkMember<FrameworkField>
Return Parameters:
- public abstract java.lang.String getType()
+ public static void assertEquals(java.lang.Object[], java.lang.Object[])
+ public static void assertEquals(Object expected, Object actual)
Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.
Parameters:
- public abstract java.lang.String getType()
- java.lang.String[] toString(java.lang.Object[], java.lang.Class>[])
+ public abstract java.lang.Class> getType()
- public String toString()
Description:
Overrides: toString in class Object
+ public Class> getType()
Description:
Specified by: getType in class FrameworkMember<FrameworkField>
Return Parameters:
- public abstract org.testng.xml.XmlTest getTest()
+ public junit.framework.Test getTest()
- public XmlTest getTest()
Description:
Specified by: getTest in interface org.testng.internal.ITestResultNotifier
- public abstract void run(org.testng.IConfigureCallBack, org.testng.ITestResult)
+ public junit.framework.TestResult start(java.lang.String[]) throws java.lang.Exception
- public String run(String template, Map
Description:
Throws: IOException
- public abstract void run(org.testng.IConfigureCallBack, org.testng.ITestResult)
+ public synchronized void stop()
- public String run(String template, Map
Description:
Throws: IOException
- public abstract void run(org.testng.IConfigureCallBack, org.testng.ITestResult)
- public abstract void runTestMethod(org.testng.ITestResult)
+ public junit.framework.TestResult start(java.lang.String[]) throws java.lang.Exception
+ public synchronized void stop()
- public String run(String template, Map
Description:
Throws: IOException
- public void runTestMethod(ITestResult tr)
Description:
Invoke the test method currently being hijacked.
- public abstract void runTestMethod(org.testng.ITestResult)
+ public junit.framework.TestResult start(java.lang.String[]) throws java.lang.Exception
- public void runTestMethod(ITestResult tr)
Description:
Invoke the test method currently being hijacked.
- public abstract void runTestMethod(org.testng.ITestResult)
+ public synchronized void stop()
- public void runTestMethod(ITestResult tr)
Description:
Invoke the test method currently being hijacked.
- public abstract void setId(java.lang.String)
+ public static org.hamcrest.Matcher equalTo(T)
+ public static Matcher
Description:
Is the value equal to another value, as tested by the Object.equals(java.lang.Object) invokedMethod?
- public abstract void setParameters(java.lang.Object[])
+ org.hamcrest.Matcher build()
- public void setParameters(Object[] parameters)
Description:
Sets parameters.
Parameters:
+ public Timeout build()
Description:
Builds a Timeout instance using the values in this builder.,
- public abstract void shutdown()
+ public static void assertEquals(java.lang.Object[], java.lang.Object[])
+ public static void assertEquals(Object expected, Object actual)
Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.
Parameters:
- public abstract void shutdown()
+ public static void assertEquals(java.lang.String, float, float, float)
+ public static void assertEquals(String message, float expected, float actual, float delta)
Description:
Asserts that two doubles or floats are equal to within a positive delta. If they are not, an AssertionError is thrown with the given message. If the expected value is infinity then the delta value is ignored. NaNs are considered equal: assertEquals(Double.NaN, Double.NaN, *) passes
Parameters:
- public abstract void shutdown()
- public void assertEquals(java.util.Set>, java.util.Set>)
+ public static void assertEquals(java.lang.Object[], java.lang.Object[])
- public static void assertEquals(Set actual, Set expected)
Description:
Asserts that two objects are equal. If they are not an AssertionFailedError is thrown.
+ public static void assertEquals(Object expected, Object actual)
Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.
Parameters:
- public boolean equals(java.lang.Object)
+ public boolean equals(java.lang.Object)
- public boolean equals(Object obj)
Description:
Overrides: equals in class Object
+ public boolean equals(Object obj)
Description:
Overrides: equals in class Object
- public boolean equals(java.lang.Object)
+ public static void assertEquals(int, int)
- public boolean equals(Object obj)
Description:
Overrides: equals in class Object
+ public static void assertEquals(int expected, int actual)
Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.
Parameters:
- public boolean equals(java.lang.Object)
+ public static void assertEquals(java.lang.Object[], java.lang.Object[])
- public boolean equals(Object obj)
Description:
Overrides: equals in class Object
+ public static void assertEquals(Object expected, Object actual)
Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.
Parameters:
- public boolean equals(java.lang.Object)
+ public static void assertEquals(java.lang.Object[], java.lang.Object[])
+ public static void assertTrue(boolean)
- public boolean equals(Object obj)
Description:
Overrides: equals in class Object
+ public static void assertEquals(Object expected, Object actual)
Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.
Parameters:
+ public static void assertTrue(boolean condition)
Description:
Asserts that a condition is true. If it isn't it throws an AssertionError without a message.
Parameters:
- public int compareTo(java.lang.Object)
+ public static void assertEquals(int, int)
- public int compareTo(Object o)
Description:
Specified by: compareTo in interface Comparable
+ public static void assertEquals(int expected, int actual)
Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.
Parameters:
- public java.lang.Object next()
+ public abstract java.lang.Class> getType()
+ public Class> getType()
Description:
Specified by: getType in class FrameworkMember<FrameworkField>
Return Parameters:
- public java.lang.Object next()
+ public static void assertEquals(java.lang.Object[], java.lang.Object[])
+ public static void assertEquals(Object expected, Object actual)
Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.
Parameters: