List Of Detected Library Migrations, Code fragments, method documentation that generated by MigrationMiner.


Migration Rule easymock <==> mockito
Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public T mock(java.lang.Class, org.mockito.MockSettings);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static void verify(java.lang.Object...);
+ public abstract T verify(T);





Documentation

- 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:

  • mock - to be verified


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public abstract org.easymock.IExpectationSetters andReturn(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expect(T);
- public abstract org.easymock.IExpectationSetters andReturn(T);
+ public abstract T verify(T, org.mockito.verification.VerificationMode);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - to be verified
  • mode - for example times(x) or atLeastOnce()


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
- public static org.easymock.IExpectationSetters expect(T);
+ public abstract T when(T);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expect(T);
+ public abstract T when(T);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public static T createMock(Class toMock)

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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public static T createMock(Class toMock)

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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expect(T);
- public abstract org.easymock.IExpectationSetters andReturn(T);
- public static void verify(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public static T createNiceMock(Class toMock)

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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expect(T);
+ public abstract T when(T);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expect(T);
+ public abstract T when(T);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expectLastCall();
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public abstract org.easymock.IExpectationSetters andReturn(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expect(T);
- public abstract org.easymock.IExpectationSetters andReturn(T);
+ public abstract T verify(T, org.mockito.verification.VerificationMode);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - to be verified
  • mode - for example times(x) or atLeastOnce()


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
- public static org.easymock.IExpectationSetters expect(T);
+ public abstract T when(T);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expect(T);
+ public abstract T when(T);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public static T createMock(Class toMock)

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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public static T createMock(Class toMock)

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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expect(T);
- public abstract org.easymock.IExpectationSetters andReturn(T);
- public static void verify(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public static T createNiceMock(Class toMock)

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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expect(T);
+ public abstract T when(T);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expect(T);
+ public abstract T when(T);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expectLastCall();
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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...);





Documentation

- public static T createStrictMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is enabled by default.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andThrow(Throwable var1)

Description:
Sets a throwable that will be thrown for the expected invocation.

Parameters:

  • throwable - the throwable to throw.


- 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:

  • mock - The mock


+ private OngoingStubbing thenThrow(Throwable throwable)

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:

  • throwables - to be thrown on method invocation


Code Fragment ( Source Link )
- public static T createStrictMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createStrictMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is enabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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...);





Documentation

- public static T createStrictMock(Class toMock)

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:

  • threadSafe - If the mock should be thread safe or not


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andThrow(Throwable var1)

Description:
Sets a throwable that will be thrown for the expected invocation.

Parameters:

  • throwable - the throwable to throw.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


+ 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:

  • mock - The mock


+ private OngoingStubbing thenThrow(Throwable throwable)

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:

  • throwables - to be thrown on method invocation


Code Fragment ( Source Link )
- 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);





Documentation

- public static IMockBuilder createMockBuilder(Class toMock)

Description:
Create a mock builder allowing to create a partial mock for the given class or interface.


- public IMockBuilder addMockedMethod(Method var1)

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:

  • method - method to be mocked


- public T createStrictMock()

Description:
Create a strict mock from this builder. The same builder can be called to create multiple mocks.

Return Parameters:

  • the newly created mock


+ public Stubber doCallRealMethod()

Description:
Use it for stubbing consecutive calls in Mockito.doCallRealMethod() style. See javadoc for Mockito.doCallRealMethod()

Return Parameters:

  • stubber - to select a method for stubbing


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IMockBuilder createMockBuilder(Class toMock)

Description:
Create a mock builder allowing to create a partial mock for the given class or interface.


- public IMockBuilder addMockedMethod(Method var1)

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:

  • method - method to be mocked


- public T createStrictMock()

Description:
Create a strict mock from this builder. The same builder can be called to create multiple mocks.

Return Parameters:

  • the newly created mock


+ public Stubber doCallRealMethod()

Description:
Use it for stubbing consecutive calls in Mockito.doCallRealMethod() style. See javadoc for Mockito.doCallRealMethod()

Return Parameters:

  • stubber - to select a method for stubbing


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IMockBuilder createMockBuilder(Class toMock)

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:

  • the newly created mock


+ 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:

  • mock - The mock


+ public OngoingStubbing thenCallRealMethod()

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:

  • iOngoingStubbing object that allows stubbing consecutive calls


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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;





Documentation

- public static IMockBuilder createMockBuilder(Class toMock)

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:

  • the newly created mock


+ 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:

  • mock - The mock


+ public OngoingStubbing thenCallRealMethod()

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:

  • iOngoingStubbing object that allows stubbing consecutive calls


+ public OngoingStubbing thenAnswer(Answer answer)

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:

  • answer - the custom answer to execute.


+ public Object answer(InvocationOnMock invocation) throws Throwable

Description:
Specified by: answer in interface Answer<java.lang.Object>

Parameters:

  • invocation - the invocation on the mock.


Code Fragment ( Source Link )
- public abstract T createStrictMock(java.lang.String);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenCallRealMethod();





Documentation

- 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:

  • name - the mock name


+ 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:

  • mock - The mock


+ public OngoingStubbing thenCallRealMethod()

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:

  • iOngoingStubbing object that allows stubbing consecutive calls


Code Fragment ( Source Link )
- 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 abstract org.mockito.stubbing.OngoingStubbing thenCallRealMethod();
+ public abstract T when(T);





Documentation

- public static IMockBuilder createMockBuilder(Class toMock)

Description:
Create a mock builder allowing to create a partial mock for the given class or interface.


- public IMockBuilder addMockedMethod(Method var1)

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:

  • method - method to be mocked


- public T createStrictMock()

Description:
Create a strict mock from this builder. The same builder can be called to create multiple mocks.

Return Parameters:

  • the newly created mock


+ public OngoingStubbing thenCallRealMethod()

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:

  • iOngoingStubbing object that allows stubbing consecutive calls


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createNiceMock(java.lang.Class);
- public static void replay(java.lang.Object...);
+ public static T mock(java.lang.Class);





Documentation

- public static T createNiceMock(Class toMock)

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 classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static T createNiceMock(java.lang.Class);
- public static void replay(java.lang.Object...);
+ public static T mock(java.lang.Class);





Documentation

- public static T createNiceMock(Class toMock)

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 classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public abstract T createNiceMock(java.lang.String);
+ public static T mock(java.lang.Class);
+ public org.mockito.InOrder inOrder(java.lang.Object...);





Documentation

- 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:

  • name - the mock name


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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 static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable...);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


- public IExpectationSetters andThrow(Throwable var1)

Description:
Sets a throwable that will be thrown for the expected invocation.

Parameters:

  • throwable - the throwable to throw.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ 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:

  • toBeThrown - to be thrown when the stubbed method is called


Code Fragment ( Source Link )
- public static void verify(java.lang.Object...);
+ public abstract T verify(T);





Documentation

- 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:

  • mock - to be verified


Code Fragment ( Source Link )
- 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.Throwable...);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


- public IExpectationSetters andThrow(Throwable var1)

Description:
Sets a throwable that will be thrown for the expected invocation.

Parameters:

  • throwable - the throwable to throw.


- public void replay()

Description:
Deprecated.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


+ 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:

  • mock - The mock


+ private OngoingStubbing thenThrow(Throwable throwable)

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:

  • throwables - to be thrown on method invocation


+ 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:

  • toBeThrown - to be thrown when the stubbed method is called


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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 abstract T when(T);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- 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 abstract T when(T);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static T createNiceMock(Class toMock)

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 thenReturn(T value, T... values)

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:

  • value - first return value
  • values - next return values


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static void replay(java.lang.Object...);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...);





Documentation

- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ public OngoingStubbing thenReturn(T value, T... values)

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:

  • value - first return value
  • values - next return values


Code Fragment ( Source Link )
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expectLastCall();
- public static void replay(java.lang.Object...);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...);





Documentation

- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value, T... values)

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:

  • value - first return value
  • values - next return values


Code Fragment ( Source Link )
- 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, T...);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value, T... values)

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:

  • value - first return value
  • values - next return values


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expectLastCall();
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public void replay()

Description:
Deprecated.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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 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);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- public void replay()

Description:
Deprecated.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expect(T);
- public abstract org.easymock.IExpectationSetters andReturn(T);
- public static T createMock(java.lang.Class);
- public static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);
+ public static T mock(java.lang.Class);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static void initMocks(java.lang.Object);





Documentation

- public static T createMock(Class toMock)

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.


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static void verify(java.lang.Object...);
+ public abstract T verify(T, org.mockito.verification.VerificationMode);





Documentation

- 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:

  • mock - to be verified
  • mode - for example times(x) or atLeastOnce()


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expect(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, T...);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value, T... values)

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:

  • value - first return value
  • values - next return values


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expect(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, T...);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value, T... values)

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:

  • value - first return value
  • values - next return values


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public abstract org.easymock.IExpectationSetters andReturn(T);
- public static void replay(java.lang.Object...);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expect(T);
- public static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value, T... values)

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:

  • value - first return value
  • values - next return values


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expect(T);
- public static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value, T... values)

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:

  • value - first return value
  • values - next return values


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expect(T);
- public static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value, T... values)

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:

  • value - first return value
  • values - next return values


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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 when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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 abstract org.mockito.stubbing.OngoingStubbing thenThrow(java.lang.Throwable...);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ private OngoingStubbing thenThrow(Throwable throwable)

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:

  • throwables - to be thrown on method invocation


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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 when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public abstract org.easymock.IExpectationSetters andReturn(T);
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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 abstract org.mockito.stubbing.OngoingStubbing thenThrow(java.lang.Throwable...);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ 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:

  • mock - The mock


+ private OngoingStubbing thenThrow(Throwable throwable)

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:

  • throwables - to be thrown on method invocation


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expectLastCall();
- public abstract org.easymock.IExpectationSetters andReturn(T);
- public static void replay(java.lang.Object...);
- public static void verify(java.lang.Object...);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public void replay()

Description:
Deprecated.


- public void verify()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expectLastCall();
- public abstract org.easymock.IExpectationSetters andReturn(T);
- public static void replay(java.lang.Object...);
- public static void verify(java.lang.Object...);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public void replay()

Description:
Deprecated.


- public void verify()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static void verify(java.lang.Object...);
+ public void verifyNoMoreInteractions(java.lang.Object...);





Documentation

- public void verify()

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);


Code Fragment ( Source Link )
- 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 static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static void verify(java.lang.Object...);
+ public abstract T verify(T, org.mockito.verification.VerificationMode);





Documentation

- 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:

  • mock - to be verified
  • mode - for example times(x) or atLeastOnce()


Code Fragment ( Source Link )
- 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 abstract T when(T);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- 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 abstract T when(T);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- 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 abstract T when(T);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expectLastCall();
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expectLastCall();
- 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 abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ public OngoingStubbing thenReturn(T value, T... values)

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:

  • value - first return value
  • values - next return values


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expectLastCall();
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expectLastCall();
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value, T... values)

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:

  • value - first return value
  • values - next return values


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static void verify(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenThrow(java.lang.Throwable...);





Documentation

- 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:

  • mock - The mock


+ private OngoingStubbing thenThrow(Throwable throwable)

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:

  • throwables - to be thrown on method invocation


Code Fragment ( Source Link )
- 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 abstract T when(T);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expectLastCall();
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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, T...);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value, T... values)

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:

  • value - first return value
  • values - next return values


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expectLastCall();
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public final void reset()

Description:
Deprecated.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public abstract T createMock(org.easymock.IMocksControl);
+ public static T mock(java.lang.Class);





Documentation

- public T createMock(IMocksControl var1)

Description:
Create mock from the provided mock control using the arguments passed to the builder.

Parameters:

  • control - IMocksControl used to create the object


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public T createMock(IMocksControl var1)

Description:
Create mock from the provided mock control using the arguments passed to the builder.

Parameters:

  • control - IMocksControl used to create the object


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public T createMock(IMocksControl var1)

Description:
Create mock from the provided mock control using the arguments passed to the builder.

Parameters:

  • control - IMocksControl used to create the object


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public abstract T createMock(org.easymock.IMocksControl);
+ public static T mock(java.lang.Class);





Documentation

- public T createMock(IMocksControl var1)

Description:
Create mock from the provided mock control using the arguments passed to the builder.

Parameters:

  • control - IMocksControl used to create the object


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static void reset(java.lang.Object...);
- 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 static void replay(java.lang.Object...);
+ 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);





Documentation

- public final void reset()

Description:
Deprecated.


- public IExpectationSetters andThrow(Throwable var1)

Description:
Sets a throwable that will be thrown for the expected invocation.

Parameters:

  • throwable - the throwable to throw.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • toBeThrown - to be thrown when the stubbed method is called


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public final void reset()

Description:
Deprecated.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public abstract T createMock(org.easymock.IMocksControl);
+ public static T mock(java.lang.Class);





Documentation

- public T createMock(IMocksControl var1)

Description:
Create mock from the provided mock control using the arguments passed to the builder.

Parameters:

  • control - IMocksControl used to create the object


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public T createMock(IMocksControl var1)

Description:
Create mock from the provided mock control using the arguments passed to the builder.

Parameters:

  • control - IMocksControl used to create the object


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public T createMock(IMocksControl var1)

Description:
Create mock from the provided mock control using the arguments passed to the builder.

Parameters:

  • control - IMocksControl used to create the object


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public abstract T createMock(org.easymock.IMocksControl);
+ public static T mock(java.lang.Class);





Documentation

- public T createMock(IMocksControl var1)

Description:
Create mock from the provided mock control using the arguments passed to the builder.

Parameters:

  • control - IMocksControl used to create the object


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static void reset(java.lang.Object...);
- 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 static void replay(java.lang.Object...);
+ 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);





Documentation

- public final void reset()

Description:
Deprecated.


- public IExpectationSetters andThrow(Throwable var1)

Description:
Sets a throwable that will be thrown for the expected invocation.

Parameters:

  • throwable - the throwable to throw.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • toBeThrown - to be thrown when the stubbed method is called


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public abstract T createMock(java.lang.Class);
+ public static void initMocks(java.lang.Object);





Documentation

- public static T createMock(Class toMock)

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.


Code Fragment ( Source Link )
- public static org.easymock.IExpectationSetters expect(T);
- public abstract org.easymock.IExpectationSetters andReturn(T);
+ public abstract T when(T);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public void replay()

Description:
Deprecated.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public abstract org.easymock.IExpectationSetters andReturn(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters atLeastOnce()

Description:
Expect the last invocation at least once.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public void push(boolean);
- public static org.easymock.IExpectationSetters expectLastCall();
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer);
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer);
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable;





Documentation

- public IExpectationSetters andAnswer(IAnswer var1)

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:

  • answer - the object used to answer the invocation.


+ public Object answer(InvocationOnMock invocation) throws Throwable

Description:
Specified by: answer in interface Answer<java.lang.Object>

Parameters:

  • invocation - the invocation on the mock.


Code Fragment ( Source Link )
- public void push(boolean);
- public static org.easymock.IExpectationSetters expectLastCall();
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer);
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer);
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable;





Documentation

- public IExpectationSetters andAnswer(IAnswer var1)

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:

  • answer - the object used to answer the invocation.


+ public Object answer(InvocationOnMock invocation) throws Throwable

Description:
Specified by: answer in interface Answer<java.lang.Object>

Parameters:

  • invocation - the invocation on the mock.


Code Fragment ( Source Link )
- 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);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


- public void replay()

Description:
Deprecated.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public abstract org.easymock.IExpectationSetters andReturn(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public void set(int);
- public static org.easymock.IExpectationSetters expectLastCall();
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer);
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer);





Documentation

- public IExpectationSetters andAnswer(IAnswer var1)

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:

  • answer - the object used to answer the invocation.


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public void set(int);
- public static org.easymock.IExpectationSetters expectLastCall();
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer);
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer);





Documentation

- public IExpectationSetters andAnswer(IAnswer var1)

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:

  • answer - the object used to answer the invocation.


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public void replay()

Description:
Deprecated.


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ 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:

  • mock - The mock


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public void set(int);
- public static org.easymock.IExpectationSetters expectLastCall();
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer);
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer);





Documentation

- public IExpectationSetters andAnswer(IAnswer var1)

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:

  • answer - the object used to answer the invocation.


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public void set(int);
- public static org.easymock.IExpectationSetters expectLastCall();
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer);
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer);





Documentation

- public IExpectationSetters andAnswer(IAnswer var1)

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:

  • answer - the object used to answer the invocation.


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters atLeastOnce()

Description:
Expect the last invocation at least once.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters atLeastOnce()

Description:
Expect the last invocation at least once.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters atLeastOnce()

Description:
Expect the last invocation at least once.

Return Parameters:

  • this object to allow method call chaining.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters times(int var1)

Description:
Expect the last invocation count times.

Parameters:

  • count - the number of invocations expected.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters atLeastOnce()

Description:
Expect the last invocation at least once.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters atLeastOnce()

Description:
Expect the last invocation at least once.

Return Parameters:

  • this object to allow method call chaining.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static void verify(java.lang.Object...);
+ public abstract T verify(T);





Documentation

- 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:

  • mock - to be verified


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters atLeastOnce()

Description:
Expect the last invocation at least once.

Return Parameters:

  • this object to allow method call chaining.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static void replay(java.lang.Object...);
+ public abstract T when(T);





Documentation

- 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:

  • mock - The mock


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters atLeastOnce()

Description:
Expect the last invocation at least once.

Return Parameters:

  • this object to allow method call chaining.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters atLeastOnce()

Description:
Expect the last invocation at least once.

Return Parameters:

  • this object to allow method call chaining.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static void replay(java.lang.Object...);
+ public abstract T when(T);
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T);





Documentation

- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters atLeastOnce()

Description:
Expect the last invocation at least once.

Return Parameters:

  • this object to allow method call chaining.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters atLeastOnce()

Description:
Expect the last invocation at least once.

Return Parameters:

  • this object to allow method call chaining.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


- public IExpectationSetters andThrow(Throwable var1)

Description:
Sets a throwable that will be thrown for the expected invocation.

Parameters:

  • throwable - the throwable to throw.


+ 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


+ 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:

  • toBeThrown - to be thrown when the stubbed method is called


Code Fragment ( Source Link )
- public static T createMock(java.lang.Class);
+ public static T mock(java.lang.Class);





Documentation

- public static T createMock(Class toMock)

Description:
Creates a mock object that implements the given interface, order checking is disabled by default.


+ public static T mock(Class classToMock)

Description:
Creates mock object of given class or interface. See examples in javadoc for Mockito class

Parameters:

  • classToMock - class or interface to mock


Code Fragment ( Source Link )
- 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);





Documentation

- public static IExpectationSetters expect(T value)

Description:
Returns the expectation setter for the last expected invocation in the current thread.

Parameters:

  • value - the parameter is used to transport the type to the ExpectationSetter. It allows writing the expected call as argument, i.e. expect(mock.getName()).andReturn("John Doe").


- public IExpectationSetters andReturn(T var1)

Description:
Sets a return value that will be returned for the expected invocation.

Parameters:

  • value - the value to return.


- public IExpectationSetters atLeastOnce()

Description:
Expect the last invocation at least once.

Return Parameters:

  • this object to allow method call chaining.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


- 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:

  • mock - The mock


+ public OngoingStubbing thenReturn(T value)

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:

  • value - return value


Code Fragment ( Source Link )
- public static void verify(java.lang.Object...);
+ public abstract T verify(T);





Documentation

- 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:

  • mock - to be verified


Code Fragment ( Source Link )
- 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);