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


Migration Rule easymock <==> mockito
Method Mapping
- public org.easymock.classextension.IMockBuilder createMockBuilder(java.lang.Class)
+ 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 T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito

Parameters:

  • mock - The mock






- List Of Real code commits has this method mapping:
Method Mapping
- public org.easymock.classextension.IMockBuilder createMockBuilder(java.lang.Class)
+ public abstract org.mockito.stubbing.OngoingStubbing thenCallRealMethod()





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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public org.easymock.classextension.IMockBuilder createMockBuilder(java.lang.Class)
- public abstract T createStrictMock()
+ 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 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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.






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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.






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract java.lang.Object get(java.lang.Object, java.lang.Object)
+ public abstract T when(T)





Documentation

+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito

Parameters:

  • mock - The mock






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract java.lang.Object get(java.lang.Object, java.lang.Object)
+ public abstract java.lang.Object get(java.lang.Object, java.lang.Object)




- List Of Real code commits has this method mapping:
Method Mapping
- public abstract java.lang.Object get(java.lang.Object, java.lang.Object)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)




- List Of Real code commits has this method mapping:
Method Mapping
- public abstract java.lang.Object get(java.lang.Object, java.lang.Object)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable





Documentation

+ public Object answer(InvocationOnMock invocation) throws Throwable

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

Parameters:

  • invocation - the invocation on the mock.






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.classextension.IMockBuilder addMockedMethod(java.lang.reflect.Method)
+ public abstract T when(T)





Documentation

- 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 when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito

Parameters:

  • mock - The mock






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.classextension.IMockBuilder addMockedMethod(java.lang.reflect.Method)
+ public static org.mockito.stubbing.Stubber doCallRealMethod()





Documentation

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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.classextension.IMockBuilder addMockedMethod(java.lang.reflect.Method)
+ public static org.mockito.stubbing.Stubber doCallRealMethod()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

- 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 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 OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned when the method is called. E.g: when(mock.someMethod()).thenReturn(10); See examples in javadoc for Mockito.when(T)

Parameters:

  • value - return value






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable





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 T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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 Object answer(InvocationOnMock invocation) throws Throwable

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

Parameters:

  • invocation - the invocation on the mock.






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer)
+ public abstract org.mockito.stubbing.OngoingStubbing then(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.


+ public OngoingStubbing then(Answer answer)

Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example: //using 'then' alias: when(mock.foo()).then(returnCoolValue()); //versus good old 'thenAnswer: when(mock.foo()).thenAnswer(byReturningCoolValue());

Parameters:

  • answer - the custom answer to execute.






- List Of Real code commits has this method mapping:
Method Mapping
- 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.






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract T given(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 BDDMyOngoingStubbing given(T methodCall)

Description:
see original Mockito.when(Object)






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(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 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static org.mockito.ArgumentCaptor forClass(java.lang.Class)





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 ArgumentCaptor forClass(Class clazz)

Description:
Build a new ArgumentCaptor. Note that an ArgumentCaptor *don't do any type checks*, it is only there to avoid casting in your code. This might however change (type checks could be added) in a future major release.






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
+ 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 T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito

Parameters:

  • mock - The mock






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
+ 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 once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


+ public OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned when the method is called. E.g: when(mock.someMethod()).thenReturn(10); See examples in javadoc for Mockito.when(T)

Parameters:

  • value - return value






- List Of Real code commits has this method mapping:
Method Mapping
- 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)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)
+ public abstract T when(T)





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 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 OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned 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


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito

Parameters:

  • mock - The mock






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expect(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract T when(T)





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 OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expect(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)





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 OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned 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


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract T when(T)





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 IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


+ public OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expect(T)
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned when the method is called. E.g: when(mock.someMethod()).thenReturn(10); See examples in javadoc for Mockito.when(T)

Parameters:

  • value - return value






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expect(T)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 IExpectationSetters times(int var1)

Description:
Expect the last invocation count times.

Parameters:

  • count - the number of invocations expected.


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expect(T)
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)





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


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters times(int)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 times(int var1)

Description:
Expect the last invocation count times.

Parameters:

  • count - the number of invocations expected.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


+ public OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned when the method is called. E.g: when(mock.someMethod()).thenReturn(10); See examples in javadoc for Mockito.when(T)

Parameters:

  • value - return value






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters times(int)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
- public static org.easymock.IExpectationSetters expect(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 times(int var1)

Description:
Expect the last invocation count times.

Parameters:

  • count - the number of invocations expected.


- 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 OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned when the method is called. E.g: when(mock.someMethod()).thenReturn(10); See examples in javadoc for Mockito.when(T)

Parameters:

  • value - return value






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract void replay()
+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract T when(T)





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 IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


+ public OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned when the method is called. E.g: when(mock.someMethod()).thenReturn(10); See examples in javadoc for Mockito.when(T)

Parameters:

  • value - return value






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters anyTimes()
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable





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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void replay(java.lang.Object...)
+ public static T verify(T, org.mockito.verification.VerificationMode)





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 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()






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract T when(T)





Documentation

- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract org.mockito.BDDMockito$BDDStubber willThrow(java.lang.Throwable...)





Documentation

- 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 BDDStubber willThrow(Throwable toBeThrown)

Description:
See original Stubber.doThrow(Throwable)






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract org.mockito.stubbing.OngoingStubbing thenThrow(java.lang.Throwable...)





Documentation

- public IExpectationSetters andThrow(Throwable var1)

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

Parameters:

  • throwable - the throwable to throw.


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)





Documentation

- public IExpectationSetters andThrow(Throwable var1)

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

Parameters:

  • throwable - the throwable to throw.


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable...)





Documentation

- public IExpectationSetters andThrow(Throwable var1)

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

Parameters:

  • throwable - the throwable to throw.


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
- public abstract org.easymock.IExpectationSetters once()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

- public IExpectationSetters andThrow(Throwable var1)

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

Parameters:

  • throwable - the throwable to throw.


- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)
+ public abstract T when(T)





Documentation

- public IExpectationSetters andThrow(Throwable var1)

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

Parameters:

  • throwable - the throwable to throw.


- public IExpectationSetters times(int var1)

Description:
Expect the last invocation count times.

Parameters:

  • count - the number of invocations expected.


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public abstract T when(T)





Documentation

- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)





Documentation

- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable





Documentation

- public IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


+ public Object answer(InvocationOnMock invocation) throws Throwable

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

Parameters:

  • invocation - the invocation on the mock.






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters atLeastOnce()
+ public abstract T when(T)





Documentation

- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters atLeastOnce()
+ public java.util.ListIterator iterator(int)





Documentation

- public IExpectationSetters atLeastOnce()

Description:
Expect the last invocation at least once.

Return Parameters:

  • this object to allow method call chaining.






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters once()
+ public abstract T when(T)





Documentation

- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters once()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


+ public OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned when the method is called. E.g: when(mock.someMethod()).thenReturn(10); See examples in javadoc for Mockito.when(T)

Parameters:

  • value - return value






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters once()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)





Documentation

- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters once()
+ public org.mockito.asm.ByteVector putInt(int)





Documentation

- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters once()
- public boolean get(int)
+ public boolean get(int)





Documentation

- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters once()
- public static void replay(java.lang.Object...)
+ public org.mockito.asm.ByteVector putInt(int)





Documentation

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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract T when(T)





Documentation

- public IExpectationSetters times(int var1)

Description:
Expect the last invocation count times.

Parameters:

  • count - the number of invocations expected.


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito

Parameters:

  • mock - The mock






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

- public IExpectationSetters times(int var1)

Description:
Expect the last invocation count times.

Parameters:

  • count - the number of invocations expected.


+ public OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned when the method is called. E.g: when(mock.someMethod()).thenReturn(10); See examples in javadoc for Mockito.when(T)

Parameters:

  • value - return value






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T answer() throws java.lang.Throwable
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable





Documentation

- public T answer() throws Throwable

Description:
is called by EasyMock to answer an expected call. The answer may be to return a value, or to throw an exception. The arguments of the call for which the answer is generated are available via EasyMock.getCurrentArguments() - be careful here, using the arguments is not refactoring-safe.

Return Parameters:

  • the value to be returned


+ public Object answer(InvocationOnMock invocation) throws Throwable

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

Parameters:

  • invocation - the invocation on the mock.






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createMock(java.lang.String, org.easymock.classextension.IMocksControl)
+ public T mock(java.lang.Class, org.mockito.MockSettings)





Documentation

- public T createMock(String var1, IMocksControl var2)

Description:
Create named mock from the provided mock control using the arguments passed to the builder.

Parameters:

  • name - the mock name
  • 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createMock(org.easymock.classextension.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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createMock(org.easymock.classextension.IMocksControl)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createMock(org.easymock.classextension.IMocksControl)
- public abstract T createNiceMock(java.lang.String)
+ 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 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createMock(org.easymock.classextension.IMocksControl)
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createMock(org.easymock.classextension.IMocksControl)
- public static void verify(java.lang.Object...)
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public static T verify(T)
+ public static org.mockito.stubbing.OngoingStubbing when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 void verify()

Description:
Deprecated.


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


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createMock(org.easymock.IMocksControl)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expect(T)
+ public static T mock(java.lang.Class)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract T when(T)





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 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 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 OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createMock(org.easymock.IMocksControl)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 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 IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createMock(org.easymock.IMocksControl)
- public static org.easymock.IExpectationSetters expect(T)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createMock(org.easymock.IMocksControl)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createMock(org.easymock.IMocksControl)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenThrow(java.lang.Throwable...)





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


+ public OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createMock(org.easymock.IMocksControl)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 IExpectationSetters anyTimes()

Description:
Expect the last invocation any times.

Return Parameters:

  • this object to allow method call chaining.


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createMock(org.easymock.MockType)
+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createMock(org.easymock.MockType)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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


+ public OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned when the method is called. E.g: when(mock.someMethod()).thenReturn(10); See examples in javadoc for Mockito.when(T)

Parameters:

  • value - return value






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createMock(org.easymock.MockType)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createMock(org.easymock.MockType)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public static T mock(java.lang.Class)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)
+ public abstract T when(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createMock(org.easymock.MockType)
- 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 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createNiceMock(java.lang.String)
- public abstract T createMock(org.easymock.IMocksControl)
+ public static T mock(java.lang.Class)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createNiceMock(java.lang.String)
- public abstract T createMock(org.easymock.IMocksControl)
+ public static T spy(T)





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 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 spy(T object)

Description:
Creates a spy of the real object. The spy calls real methods unless they are stubbed. Real spies should be used carefully and occasionally, for example when dealing with legacy code. As usual you are going to read the partial mock warning: Object oriented programming is more less tackling complexity by dividing the complexity into separate, specific, SRPy objects. How does partial mock fit into this paradigm? Well, it just doesn't... Partial mock usually means that the complexity has been moved to a different method on the same object. In most cases, this is not the way you want to design your application. However, there are rare cases when partial mocks come handy: dealing with code you cannot change easily (3rd party interfaces, interim refactoring of legacy code etc.) However, I wouldn't use partial mocks for new, test-driven & well-designed code. Example: List list = new LinkedList(); List spy = spy(list); //optionally, you can stub out some methods: when(spy.size()).thenReturn(100); //using the spy calls real methods spy.add("one"); spy.add("two"); //prints "one" - the first element of a list System.out.println(spy.get(0)); //size() method was stubbed - 100 is printed System.out.println(spy.size()); //optionally, you can verify verify(spy).add("one"); verify(spy).add("two"); Important gotcha on spying real objects! Sometimes it's impossible or impractical to use when(Object) for stubbing spies. Therefore for spies it is recommended to always use doReturn|Answer|Throw()|CallRealMethod family of methods for stubbing. Example: List list = new LinkedList(); List spy = spy(list); //Impossible: real method is called so spy.get(0) throws IndexOutOfBoundsException (the list is yet empty) when(spy.get(0)).thenReturn("foo"); //You have to use doReturn() for stubbing doReturn("foo").when(spy).get(0); Mockito *does not* delegate calls to the passed real instance, instead it actually creates a copy of it. So if you keep the real instance and interact with it, don't expect the spied to be aware of those interaction and their effect on real instance state. The corollary is that when an *unstubbed* method is called *on the spy* but *not on the real instance*, you won't see any effects on the real instance. Watch out for final methods. Mockito doesn't mock final methods so the bottom line is: when you spy on real objects + you try to stub a final method = trouble. Also you won't be able to verify those method as well. See examples in javadoc for Mockito class

Parameters:

  • object - to spy on






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createNiceMock(java.lang.String)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createNiceMock(java.lang.String)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createNiceMock(java.lang.String)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract void andStubReturn(T)
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 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 andStubReturn(T var1)

Description:
Sets a stub 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createNiceMock(java.lang.String)
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createStrictMock()
+ public abstract T when(T)





Documentation

- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createStrictMock()
+ public static org.mockito.stubbing.Stubber doCallRealMethod()





Documentation

- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createStrictMock(java.lang.String)
+ public abstract T given(T)





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 static BDDMyOngoingStubbing given(T methodCall)

Description:
see original Mockito.when(Object)






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createStrictMock(java.lang.String)
+ public abstract T when(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createStrictMock(java.lang.String)
+ public static T mock(java.lang.Class)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createStrictMock(java.lang.String)
- public static org.easymock.Capture newCapture()
+ public static T mock(java.lang.Class)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createStrictMock(java.lang.String)
- public static org.easymock.Capture newCapture()
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
+ public static T mock(java.lang.Class)
+ public abstract T given(T)
+ public abstract org.mockito.BDDMockito$BDDStubber willReturn(java.lang.Object)
+ public abstract org.mockito.stubbing.OngoingStubbing then(org.mockito.stubbing.Answer)
+ public abstract T should()
+ public void start()
+ public abstract void addListener(org.mockito.listeners.MockitoListener)





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


+ public static BDDMyOngoingStubbing given(T methodCall)

Description:
see original Mockito.when(Object)


+ public static BDDStubber willReturn(Object toBeReturned)

Description:
See original Stubber.doReturn(Object)


+ public OngoingStubbing then(Answer answer)

Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example: //using 'then' alias: when(mock.foo()).then(returnCoolValue()); //versus good old 'thenAnswer: when(mock.foo()).thenAnswer(byReturningCoolValue());

Parameters:

  • answer - the custom answer to execute.






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createStrictMock(java.lang.String)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer)
+ public static T mock(java.lang.Class)
+ public abstract T given(T)
+ public abstract org.mockito.BDDMockito$BDDStubber willAnswer(org.mockito.stubbing.Answer)





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 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 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 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 BDDMyOngoingStubbing given(T methodCall)

Description:
see original Mockito.when(Object)


+ public static BDDStubber willAnswer(Answer answer)

Description:
See original Stubber.doAnswer(Answer)






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createStrictMock(java.lang.String)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
+ public abstract T given(T)
+ public abstract org.mockito.BDDMockito$BDDStubber willReturn(java.lang.Object, java.lang.Object...)





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


+ public static BDDMyOngoingStubbing given(T methodCall)

Description:
see original Mockito.when(Object)


+ public BDDMyOngoingStubbing willReturn(T value, T... values)

Description:
See original OngoingStubbing.thenReturn(Object, Object[])






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createStrictMock(java.lang.String)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract T given(T)
+ public abstract org.mockito.BDDMockito$BDDStubber willReturn(java.lang.Object)





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 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 BDDMyOngoingStubbing given(T methodCall)

Description:
see original Mockito.when(Object)


+ public static BDDStubber willReturn(Object toBeReturned)

Description:
See original Stubber.doReturn(Object)






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createStrictMock(java.lang.String)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract org.mockito.stubbing.OngoingStubbing then(org.mockito.stubbing.Answer)
+ public abstract T should()





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 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 OngoingStubbing then(Answer answer)

Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example: //using 'then' alias: when(mock.foo()).then(returnCoolValue()); //versus good old 'thenAnswer: when(mock.foo()).thenAnswer(byReturningCoolValue());

Parameters:

  • answer - the custom answer to execute.






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createStrictMock(java.lang.String)
- public static org.easymock.IExpectationSetters expectLastCall()
- public static void replay(java.lang.Object...)
- public static void verify(java.lang.Object...)
- public static void reset(java.lang.Object...)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
+ public abstract org.mockito.stubbing.OngoingStubbing then(org.mockito.stubbing.Answer)
+ public abstract T should()
+ public abstract void shouldHaveNoMoreInteractions()





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 void replay()

Description:
Deprecated.


- public void verify()

Description:
Deprecated.


- public final void reset()

Description:
Deprecated.


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


+ public OngoingStubbing then(Answer answer)

Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example: //using 'then' alias: when(mock.foo()).then(returnCoolValue()); //versus good old 'thenAnswer: when(mock.foo()).thenAnswer(byReturningCoolValue());

Parameters:

  • answer - the custom answer to execute.






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createStrictMock(java.lang.String)
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract T createStrictMock(java.lang.String)
- public static void replay(java.lang.Object...)
- public static void verify(java.lang.Object...)
- public static void reset(java.lang.Object...)
+ public abstract void shouldHaveNoMoreInteractions()





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 void replay()

Description:
Deprecated.


- public void verify()

Description:
Deprecated.


- public final void reset()

Description:
Deprecated.






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract void andStubReturn(T)
+ public abstract T when(T)





Documentation

- public void andStubReturn(T var1)

Description:
Sets a stub 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract void andStubReturn(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

- public void andStubReturn(T var1)

Description:
Sets a stub 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract void replay()
+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract void replay()
+ public abstract org.mockito.stubbing.Stubber doNothing()





Documentation

- public void replay()

Description:
Deprecated.


+ public Stubber doNothing()

Description:
Use it for stubbing consecutive calls in Mockito.doNothing() style: doNothing(). doThrow(new RuntimeException("two")) .when(mock).someVoidMethod(); See javadoc for Mockito.doNothing()

Return Parameters:

  • stubber - to select a method for stubbing






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract void replay()
+ public abstract org.mockito.stubbing.Stubber doNothing()
+ public abstract T when(T)





Documentation

- public void replay()

Description:
Deprecated.


+ public Stubber doNothing()

Description:
Use it for stubbing consecutive calls in Mockito.doNothing() style: doNothing(). doThrow(new RuntimeException("two")) .when(mock).someVoidMethod(); See javadoc for Mockito.doNothing()

Return Parameters:

  • 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract void reset()
+ public abstract T verify(T)





Documentation

- public final void reset()

Description:
Deprecated.


+ public T verify(T var1)

Description:
Verifies interaction happened once in order. Alias to inOrder.verify(mock, times(1)) Example: InOrder inOrder = inOrder(firstMock, secondMock); inOrder.verify(firstMock).someMethod("was called first"); inOrder.verify(secondMock).someMethod("was called second"); See examples in javadoc for Mockito class

Parameters:

  • mock - to be verified






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract void verify()
+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract void verify()
- public abstract void reset()
+ public abstract T verify(T)





Documentation

- public void verify()

Description:
Deprecated.


- public final void reset()

Description:
Deprecated.


+ public T verify(T var1)

Description:
Verifies interaction happened once in order. Alias to inOrder.verify(mock, times(1)) Example: InOrder inOrder = inOrder(firstMock, secondMock); inOrder.verify(firstMock).someMethod("was called first"); inOrder.verify(secondMock).someMethod("was called second"); See examples in javadoc for Mockito class

Parameters:

  • mock - to be verified






- List Of Real code commits has this method mapping:
Method Mapping
- public boolean get(int)
+ public abstract T when(T)





Documentation

+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito

Parameters:

  • mock - The mock






- List Of Real code commits has this method mapping:
Method Mapping
- public boolean get(int)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)




- List Of Real code commits has this method mapping:
Method Mapping
- public boolean get(int)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable





Documentation

+ public Object answer(InvocationOnMock invocation) throws Throwable

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

Parameters:

  • invocation - the invocation on the mock.






- List Of Real code commits has this method mapping:
Method Mapping
- public boolean get(int)
+ public boolean get(int)




- List Of Real code commits has this method mapping:
Method Mapping
- public int getValue()
+ public V getValue()





Documentation

- public T getValue()

Description:
Return the captured value

Return Parameters:

  • What was captured


+ public T getValue()

Description:
Returns the captured value of the argument. If the method was called multiple times then it returns the latest captured value See examples in javadoc for ArgumentCaptor class.

Return Parameters:

  • captured argument value






- List Of Real code commits has this method mapping:
Method Mapping
- public java.lang.Object put(java.lang.Object, java.lang.Object)
+ public java.lang.Object put(java.lang.Object, java.lang.Object)




- List Of Real code commits has this method mapping:
Method Mapping
- public org.easymock.IMocksControl createControl()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

- public static IMocksControl createControl()

Description:
Creates a control, order checking is disabled by default.

Return Parameters:

  • the control.


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public org.easymock.IMocksControl createControl()
+ public static T mock(java.lang.Class)





Documentation

- public static IMocksControl createControl()

Description:
Creates a control, order checking is disabled by default.

Return Parameters:

  • the control.


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public org.easymock.IMocksControl createControl()
- public abstract T createMock(org.easymock.classextension.IMocksControl)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

- public static IMocksControl createControl()

Description:
Creates a control, order checking is disabled by default.

Return Parameters:

  • the control.


- 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


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.Capture newCapture()
+ public abstract T given(T)





Documentation

+ public static BDDMyOngoingStubbing given(T methodCall)

Description:
see original Mockito.when(Object)






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.Capture newCapture()
+ public abstract org.mockito.BDDMockito$BDDStubber willReturn(java.lang.Object)





Documentation

+ public static BDDStubber willReturn(Object toBeReturned)

Description:
See original Stubber.doReturn(Object)






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.Capture newCapture()
+ public abstract org.mockito.stubbing.OngoingStubbing then(org.mockito.stubbing.Answer)
+ public abstract T should()





Documentation

+ public OngoingStubbing then(Answer answer)

Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example: //using 'then' alias: when(mock.foo()).then(returnCoolValue()); //versus good old 'thenAnswer: when(mock.foo()).thenAnswer(byReturningCoolValue());

Parameters:

  • answer - the custom answer to execute.






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.Capture newCapture()
- public abstract T createStrictMock(java.lang.String)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
- public static void replay(java.lang.Object...)
+ public abstract T given(T)
+ public abstract org.mockito.BDDMockito$BDDStubber willReturn(java.lang.Object)





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 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 BDDMyOngoingStubbing given(T methodCall)

Description:
see original Mockito.when(Object)


+ public static BDDStubber willReturn(Object toBeReturned)

Description:
See original Stubber.doReturn(Object)






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.Capture newCapture()
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract T given(T)
+ public abstract org.mockito.BDDMockito$BDDStubber willReturn(java.lang.Object)





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 BDDMyOngoingStubbing given(T methodCall)

Description:
see original Mockito.when(Object)


+ public static BDDStubber willReturn(Object toBeReturned)

Description:
See original Stubber.doReturn(Object)






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.Capture newCapture()
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
- public static void replay(java.lang.Object...)
+ public abstract T given(T)
+ public abstract org.mockito.BDDMockito$BDDStubber willReturn(java.lang.Object)





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 static BDDMyOngoingStubbing given(T methodCall)

Description:
see original Mockito.when(Object)


+ public static BDDStubber willReturn(Object toBeReturned)

Description:
See original Stubber.doReturn(Object)






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
+ public abstract T verify(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 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
+ public abstract org.mockito.BDDMockito$BDDStubber willReturn(java.lang.Object)





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 static BDDStubber willReturn(Object toBeReturned)

Description:
See original Stubber.doReturn(Object)






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
+ public abstract org.mockito.BDDMockito$BDDStubber willReturn(java.lang.Object, java.lang.Object...)





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 BDDMyOngoingStubbing willReturn(T value, T... values)

Description:
See original OngoingStubbing.thenReturn(Object, Object[])






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(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 OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned when the method is called. E.g: when(mock.someMethod()).thenReturn(10); See examples in javadoc for Mockito.when(T)

Parameters:

  • value - return value






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
+ public static org.mockito.stubbing.OngoingStubbing 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
+ public static void verifyNoMoreInteractions(java.lang.Object...)





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 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);






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer)
+ public static T mock(java.lang.Class)
+ public abstract org.mockito.BDDMockito$BDDStubber willAnswer(org.mockito.stubbing.Answer)





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 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 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 BDDStubber willAnswer(Answer answer)

Description:
See original Stubber.doAnswer(Answer)






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable





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 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 T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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 Object answer(InvocationOnMock invocation) throws Throwable

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

Parameters:

  • invocation - the invocation on the mock.






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
- public abstract org.easymock.IExpectationSetters once()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


- public IExpectationSetters times(int var1)

Description:
Expect the last invocation count times.

Parameters:

  • count - the number of invocations expected.


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable





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 IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


- 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 T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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 Object answer(InvocationOnMock invocation) throws Throwable

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

Parameters:

  • invocation - the invocation on the mock.






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer)
- public boolean get(int)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable





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 IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


- 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 T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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 Object answer(InvocationOnMock invocation) throws Throwable

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

Parameters:

  • invocation - the invocation on the mock.






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 IExpectationSetters times(int var1)

Description:
Expect the last invocation count times.

Parameters:

  • count - the number of invocations expected.


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
- public abstract org.easymock.IExpectationSetters times(int)
- public abstract org.easymock.IExpectationSetters once()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 IExpectationSetters times(int var1)

Description:
Expect the last invocation count times.

Parameters:

  • count - the number of invocations expected.


- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable





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 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 T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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 Object answer(InvocationOnMock invocation) throws Throwable

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

Parameters:

  • invocation - the invocation on the mock.






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public abstract org.easymock.IExpectationSetters once()
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public abstract org.easymock.IExpectationSetters times(int)
- public abstract org.easymock.IExpectationSetters once()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 times(int var1)

Description:
Expect the last invocation count times.

Parameters:

  • count - the number of invocations expected.


- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)





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 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 T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)





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 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 T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)
+ public abstract T when(T)





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 IExpectationSetters times(int var1)

Description:
Expect the last invocation count times.

Parameters:

  • count - the number of invocations expected.


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters atLeastOnce()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)





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


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)





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 atLeastOnce()

Description:
Expect the last invocation at least once.

Return Parameters:

  • this object to allow method call chaining.


- 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 T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 times(int var1)

Description:
Expect the last invocation count times.

Parameters:

  • count - the number of invocations expected.


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters times(int)
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 times(int var1)

Description:
Expect the last invocation count times.

Parameters:

  • count - the number of invocations expected.


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters times(int)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)





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 times(int var1)

Description:
Expect the last invocation count times.

Parameters:

  • count - the number of invocations expected.


- 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 T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters times(int)
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable





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 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 T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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 Object answer(InvocationOnMock invocation) throws Throwable

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

Parameters:

  • invocation - the invocation on the mock.






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer)
- public boolean get(int)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable





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 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 T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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 Object answer(InvocationOnMock invocation) throws Throwable

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

Parameters:

  • invocation - the invocation on the mock.






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters atLeastOnce()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 times(int var1)

Description:
Expect the last invocation count times.

Parameters:

  • count - the number of invocations expected.


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters times(int)
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters times(int)
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)





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 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 T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters times(int)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters times(int)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public abstract org.easymock.IExpectationSetters once()
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)





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


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters times(int)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)





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 IExpectationSetters atLeastOnce()

Description:
Expect the last invocation at least once.

Return Parameters:

  • this object to allow method call chaining.


- 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 T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters times(int)
- public abstract org.easymock.IExpectationSetters once()
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters times(int)
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract T given(T)
+ public abstract org.mockito.BDDMockito$BDDMyOngoingStubbing willReturn(T)





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 static BDDMyOngoingStubbing given(T methodCall)

Description:
see original Mockito.when(Object)


+ public BDDMyOngoingStubbing willReturn(T value)

Description:
See original OngoingStubbing.thenReturn(Object)






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract T createMock(org.easymock.IMocksControl)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 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 T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract void replay()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract T given(T)
+ public abstract org.mockito.BDDMockito$BDDStubber willReturn(java.lang.Object)
+ public abstract org.mockito.BDDMockito$BDDStubber willThrow(java.lang.Throwable...)
+ public void start()





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 andThrow(Throwable var1)

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

Parameters:

  • throwable - the throwable to throw.


+ public static BDDMyOngoingStubbing given(T methodCall)

Description:
see original Mockito.when(Object)


+ public static BDDStubber willReturn(Object toBeReturned)

Description:
See original Stubber.doReturn(Object)


+ public static BDDStubber willThrow(Throwable toBeThrown)

Description:
See original Stubber.doThrow(Throwable)






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract org.mockito.BDDMockito$BDDStubber willThrow(java.lang.Throwable...)
+ public abstract T given(T)
+ public void start()





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 andThrow(Throwable var1)

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

Parameters:

  • throwable - the throwable to throw.


+ public static BDDStubber willThrow(Throwable toBeThrown)

Description:
See original Stubber.doThrow(Throwable)


+ public static BDDMyOngoingStubbing given(T methodCall)

Description:
see original Mockito.when(Object)






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable...)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static T createMock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public static T mock(java.lang.Class)





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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)
+ public abstract T when(T)





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 andThrow(Throwable var1)

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

Parameters:

  • throwable - the throwable to throw.


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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
- public abstract void replay()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenThrow(java.lang.Throwable...)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)





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 T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters once()
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters times(int)
+ public abstract org.mockito.BDDMockito$BDDMyOngoingStubbing willReturn(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 times(int var1)

Description:
Expect the last invocation count times.

Parameters:

  • count - the number of invocations expected.


+ public BDDMyOngoingStubbing willReturn(T value)

Description:
See original OngoingStubbing.thenReturn(Object)






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters times(int)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 times(int var1)

Description:
Expect the last invocation count times.

Parameters:

  • count - the number of invocations expected.


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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract void andStubReturn(T)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 andStubReturn(T var1)

Description:
Sets a stub 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expect(T)
- public abstract void andStubReturn(T)
- public static T createStrictMock(java.lang.Class)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public static T mock(java.lang.Class)





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 andStubReturn(T var1)

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

Parameters:

  • value - the value to return.


- public static T createStrictMock(Class toMock)

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


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


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract T when(T)





Documentation

+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito

Parameters:

  • mock - The mock






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract org.mockito.stubbing.OngoingStubbing then(org.mockito.stubbing.Answer)
+ public abstract T should()





Documentation

+ public OngoingStubbing then(Answer answer)

Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example: //using 'then' alias: when(mock.foo()).then(returnCoolValue()); //versus good old 'thenAnswer: when(mock.foo()).thenAnswer(byReturningCoolValue());

Parameters:

  • answer - the custom answer to execute.






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract org.mockito.stubbing.OngoingStubbing then(org.mockito.stubbing.Answer)
+ public abstract T should()
+ public void start()





Documentation

+ public OngoingStubbing then(Answer answer)

Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example: //using 'then' alias: when(mock.foo()).then(returnCoolValue()); //versus good old 'thenAnswer: when(mock.foo()).thenAnswer(byReturningCoolValue());

Parameters:

  • answer - the custom answer to execute.






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

+ public OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned when the method is called. E.g: when(mock.someMethod()).thenReturn(10); See examples in javadoc for Mockito.when(T)

Parameters:

  • value - return value






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Class, java.lang.Class...)





Documentation

+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable





Documentation

+ public Object answer(InvocationOnMock invocation) throws Throwable

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

Parameters:

  • invocation - the invocation on the mock.






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
+ public java.lang.Object run()




- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
+ public void start()




- List Of Real code commits has this method mapping:
Method Mapping
- 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.






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract org.mockito.stubbing.OngoingStubbing then(org.mockito.stubbing.Answer)
+ public abstract T should()





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 then(Answer answer)

Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example: //using 'then' alias: when(mock.foo()).then(returnCoolValue()); //versus good old 'thenAnswer: when(mock.foo()).thenAnswer(byReturningCoolValue());

Parameters:

  • answer - the custom answer to execute.






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)





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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void verify(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing then(org.mockito.stubbing.Answer)
+ public abstract T should()





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 verify()

Description:
Deprecated.


+ public OngoingStubbing then(Answer answer)

Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example: //using 'then' alias: when(mock.foo()).then(returnCoolValue()); //versus good old 'thenAnswer: when(mock.foo()).thenAnswer(byReturningCoolValue());

Parameters:

  • answer - the custom answer to execute.






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)
+ public abstract T when(T)





Documentation

- public IExpectationSetters andThrow(Throwable var1)

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

Parameters:

  • throwable - the throwable to throw.


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
- public abstract org.easymock.IExpectationSetters once()
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)
+ public abstract T when(T)





Documentation

- public IExpectationSetters andThrow(Throwable var1)

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

Parameters:

  • throwable - the throwable to throw.


- public IExpectationSetters once()

Description:
Expect the last invocation once. This is default in EasyMock.

Return Parameters:

  • this object to allow method call chaining.


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)
+ public abstract T when(T)
+ public java.lang.Object run()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

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






- List Of Real code commits has this method mapping:
Method Mapping
- 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 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer)
- public boolean get(int)
- public abstract java.lang.Object get(java.lang.Object, java.lang.Object)
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
+ public boolean get(int)
+ public abstract java.lang.Object get(java.lang.Object, java.lang.Object)
+ public abstract T when(T)





Documentation

- 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 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 void replay()

Description:
Deprecated.


+ public Object answer(InvocationOnMock invocation) throws Throwable

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

Parameters:

  • invocation - the invocation on the 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer)
- public boolean get(int)
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
+ public boolean get(int)
+ public abstract T when(T)





Documentation

- 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 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 void replay()

Description:
Deprecated.


+ public Object answer(InvocationOnMock invocation) throws Throwable

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

Parameters:

  • invocation - the invocation on the 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andAnswer(org.easymock.IAnswer)
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable
+ public abstract T when(T)





Documentation

- 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 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 void replay()

Description:
Deprecated.


+ public Object answer(InvocationOnMock invocation) throws Throwable

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

Parameters:

  • invocation - the invocation on the 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expect(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Throwable)
+ public abstract T when(T)





Documentation

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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters atLeastOnce()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)





Documentation

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


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void replay(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

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






- List Of Real code commits has this method mapping:
Method Mapping
- 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 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)





Documentation

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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters once()
- public static void verify(java.lang.Object...)
+ public abstract T verify(T, org.mockito.verification.VerificationMode)





Documentation

- 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 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()






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.MockControl createControl(java.lang.Class)
+ public static T mock(java.lang.Class)





Documentation

- public static MockControl createControl(Class toMock)

Description:
Deprecated.

Parameters:

  • toMock - the class of the 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.MockControl createControl(java.lang.Class)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

- public static MockControl createControl(Class toMock)

Description:
Deprecated.

Parameters:

  • toMock - the class of the 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


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static T createMock(java.lang.Class)
+ public abstract T given(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 BDDMyOngoingStubbing given(T methodCall)

Description:
see original Mockito.when(Object)






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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.






- List Of Real code commits has this method mapping:
Method Mapping
- public static T createMock(java.lang.Class)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters once()
- public static void replay(java.lang.Object...)
- public static void verify(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public abstract T verify(T)





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 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 void verify()

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






- List Of Real code commits has this method mapping:
Method Mapping
- public static T createMock(java.lang.Class)
- public abstract T createMock(org.easymock.MockType)
+ 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 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static T createMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract org.easymock.IExpectationSetters anyTimes()
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static T createMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters anyTimes()
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static T createMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expectLastCall()
- public abstract org.easymock.IExpectationSetters andThrow(java.lang.Throwable)
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenThrow(java.lang.Throwable...)
+ public abstract org.mockito.stubbing.Stubber doThrow(java.lang.Class, 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 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static T createMock(java.lang.Class)
- public static T createStrictMock(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 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static T createMock(java.lang.Class)
- public static void replay(java.lang.Object...)
+ 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 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static T createMock(java.lang.String, java.lang.Class)
+ public static T mock(java.lang.Class)





Documentation

- public static T createMock(String name, 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static T createMock(java.lang.String, java.lang.Class)
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)





Documentation

- public static T createMock(String name, Class toMock)

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


- public void replay()

Description:
Deprecated.


+ public static T mock(Class classToMock)

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

Parameters:

  • classToMock - class or interface to mock






- List Of Real code commits has this method mapping:
Method Mapping
- public static T createNiceMock(java.lang.Class)
+ 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 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static T createStrictMock(java.lang.Class)
+ public static void initMocks(java.lang.Object)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public static T createStrictMock(java.lang.Class)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

- public static T createStrictMock(Class toMock)

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


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


+ public OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned when the method is called. E.g: when(mock.someMethod()).thenReturn(10); See examples in javadoc for Mockito.when(T)

Parameters:

  • value - return value






- List Of Real code commits has this method mapping:
Method Mapping
- public static T createStrictMock(java.lang.Class)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static org.easymock.IExpectationSetters expect(T)
+ public static T mock(java.lang.Class)





Documentation

- public static T createStrictMock(Class toMock)

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


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






- List Of Real code commits has this method mapping:
Method Mapping
- public static T createStrictMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
+ public static org.mockito.stubbing.OngoingStubbing when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static T createStrictMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public static org.mockito.stubbing.OngoingStubbing when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static T createStrictMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract void andStubReturn(T)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 void andStubReturn(T var1)

Description:
Sets a stub 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


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static T createStrictMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract void andStubReturn(T)
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





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 void andStubReturn(T var1)

Description:
Sets a stub 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract T when(T)





Documentation

+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito

Parameters:

  • mock - The mock






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

+ public OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned when the method is called. E.g: when(mock.someMethod()).thenReturn(10); See examples in javadoc for Mockito.when(T)

Parameters:

  • value - return value






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)





Documentation

+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IExpectationSetters expectLastCall()
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IMocksControl createControl()
+ public static T mock(java.lang.Class)





Documentation

- public static IMocksControl createControl()

Description:
Creates a control, order checking is disabled by default.

Return Parameters:

  • the control.


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IMocksControl createControl()
- public abstract T createMock(org.easymock.IMocksControl)
+ public static T mock(java.lang.Class)





Documentation

- public static IMocksControl createControl()

Description:
Creates a control, order checking is disabled by default.

Return Parameters:

  • the control.


- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IMocksControl createNiceControl()
+ public static void initMocks(java.lang.Object)





Documentation

- public static IMocksControl createNiceControl()

Description:
Creates a control, order checking is disabled by default, and the mock objects created by this control will return 0, null or false for unexpected invocations.

Return Parameters:

  • the control.


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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IMocksControl createNiceControl()
- public abstract T createMock(java.lang.Class)
+ public static void initMocks(java.lang.Object)





Documentation

- public static IMocksControl createNiceControl()

Description:
Creates a control, order checking is disabled by default, and the mock objects created by this control will return 0, null or false for unexpected invocations.

Return Parameters:

  • the control.


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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IMocksControl createStrictControl()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)





Documentation

- public static IMocksControl createStrictControl()

Description:
Creates a control, order checking is enabled by default.

Return Parameters:

  • the control.


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IMocksControl createStrictControl()
+ public static T mock(java.lang.Class)





Documentation

- public static IMocksControl createStrictControl()

Description:
Creates a control, order checking is enabled by default.

Return Parameters:

  • the control.


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IMocksControl createStrictControl()
- public abstract T createMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)





Documentation

- public static IMocksControl createStrictControl()

Description:
Creates a control, order checking is enabled by default.

Return Parameters:

  • the control.


- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IMocksControl createStrictControl()
- public abstract T createMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

- public static IMocksControl createStrictControl()

Description:
Creates a control, order checking is enabled by default.

Return Parameters:

  • the control.


- 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


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IMocksControl createStrictControl()
- public abstract T createMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T, T...)





Documentation

- public static IMocksControl createStrictControl()

Description:
Creates a control, order checking is enabled by default.

Return Parameters:

  • the control.


- 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


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.IMocksControl createStrictControl()
- public abstract T createMock(java.lang.Class)
- public static org.easymock.IExpectationSetters expect(T)
- public abstract org.easymock.IExpectationSetters andReturn(T)
- public abstract void replay()
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

- public static IMocksControl createStrictControl()

Description:
Creates a control, order checking is enabled by default.

Return Parameters:

  • the control.


- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.MockControl createControl(java.lang.Class)
+ public static T mock(java.lang.Class)





Documentation

- public static MockControl createControl(Class toMock)

Description:
Deprecated.

Parameters:

  • toMock - the class of the 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.MockControl createControl(java.lang.Class)
+ public static T mock(java.lang.Class)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenThrow(java.lang.Throwable...)





Documentation

- public static MockControl createControl(Class toMock)

Description:
Deprecated.

Parameters:

  • toMock - the class of the 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


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static org.easymock.MockControl createControl(java.lang.Class)
- public void setDefaultMatcher(org.easymock.ArgumentsMatcher)
+ public static T mock(java.lang.Class)





Documentation

- public static MockControl createControl(Class toMock)

Description:
Deprecated.

Parameters:

  • toMock - the class of the interface to mock.


- public void setDefaultMatcher(ArgumentsMatcher matcher)

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






- List Of Real code commits has this method mapping:
Method Mapping
- public static void makeThreadSafe(java.lang.Object, boolean)
+ public abstract T when(T)





Documentation

- public void makeThreadSafe(boolean var1)

Description:
Makes the mock thread safe.

Parameters:

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


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito

Parameters:

  • mock - The mock






- List Of Real code commits has this method mapping:
Method Mapping
- public static void makeThreadSafe(java.lang.Object, boolean)
+ public abstract org.mockito.stubbing.OngoingStubbing thenThrow(java.lang.Throwable...)





Documentation

- public void makeThreadSafe(boolean var1)

Description:
Makes the mock thread safe.

Parameters:

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


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static void makeThreadSafe(java.lang.Object, boolean)
+ public static T mock(java.lang.Class)





Documentation

- public void makeThreadSafe(boolean var1)

Description:
Makes the mock thread safe.

Parameters:

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


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static void replay(java.lang.Object...)
+ public abstract T verify(T)
+ public boolean merge(org.mockito.asm.tree.analysis.Subroutine) throws org.mockito.asm.tree.analysis.AnalyzerException





Documentation

- public void replay()

Description:
Deprecated.


+ public T verify(T var1)

Description:
Verifies interaction happened once in order. Alias to inOrder.verify(mock, times(1)) Example: InOrder inOrder = inOrder(firstMock, secondMock); inOrder.verify(firstMock).someMethod("was called first"); inOrder.verify(secondMock).someMethod("was called second"); See examples in javadoc for Mockito class

Parameters:

  • mock - to be verified






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.BDDMockito$BDDMyOngoingStubbing willThrow(java.lang.Throwable...)





Documentation

- public void replay()

Description:
Deprecated.


+ public static BDDStubber willThrow(Throwable toBeThrown)

Description:
See original Stubber.doThrow(Throwable)






- List Of Real code commits has this method mapping:
Method Mapping
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static void replay(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenThrow(java.lang.Throwable...)





Documentation

- public void replay()

Description:
Deprecated.


+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static void replay(java.lang.Object...)
+ public static T mock(java.lang.Class)





Documentation

- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static void replay(java.lang.Object...)
+ public static T verify(T)





Documentation

- public void replay()

Description:
Deprecated.


+ public T verify(T var1)

Description:
Verifies interaction happened once in order. Alias to inOrder.verify(mock, times(1)) Example: InOrder inOrder = inOrder(firstMock, secondMock); inOrder.verify(firstMock).someMethod("was called first"); inOrder.verify(secondMock).someMethod("was called second"); See examples in javadoc for Mockito class

Parameters:

  • mock - to be verified






- List Of Real code commits has this method mapping:
Method Mapping
- public static void replay(java.lang.Object...)
+ public static void verifyNoMoreInteractions(java.lang.Object...)





Documentation

- public void replay()

Description:
Deprecated.


+ public void verifyNoMoreInteractions()

Description:
Verifies that no more interactions happened in order. Different from Mockito.verifyNoMoreInteractions(Object...) because the order of verification matters. Example: mock.foo(); //1st mock.bar(); //2nd mock.baz(); //3rd InOrder inOrder = inOrder(mock); inOrder.verify(mock).bar(); //2n inOrder.verify(mock).baz(); //3rd (last method) //passes because there are no more interactions after last method: inOrder.verifyNoMoreInteractions(); //however this fails because 1st method was not verified: Mockito.verifyNoMoreInteractions(mock);






- List Of Real code commits has this method mapping:
Method Mapping
- public static void replay(java.lang.Object...)
- public static void verify(java.lang.Object...)
+ public abstract T verify(T)





Documentation

- public void replay()

Description:
Deprecated.


- public void verify()

Description:
Deprecated.


+ public T verify(T var1)

Description:
Verifies interaction happened once in order. Alias to inOrder.verify(mock, times(1)) Example: InOrder inOrder = inOrder(firstMock, secondMock); inOrder.verify(firstMock).someMethod("was called first"); inOrder.verify(secondMock).someMethod("was called second"); See examples in javadoc for Mockito class

Parameters:

  • mock - to be verified






- List Of Real code commits has this method mapping:
Method Mapping
- public static void replay(java.lang.Object...)
- public static void verify(java.lang.Object...)
- public static void reset(java.lang.Object...)
+ public abstract T verify(T, org.mockito.internal.verification.api.VerificationMode)





Documentation

- public void replay()

Description:
Deprecated.


- public void verify()

Description:
Deprecated.


- public final void reset()

Description:
Deprecated.


+ public T verify(T var1, VerificationMode var2)

Description:
Verifies interaction in order. E.g: InOrder inOrder = inOrder(firstMock, secondMock); inOrder.verify(firstMock, times(2)).someMethod("was called first two times"); inOrder.verify(secondMock, atLeastOnce()).someMethod("was called second at least once"); See examples in javadoc for Mockito class

Parameters:

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






- List Of Real code commits has this method mapping:
Method Mapping
- public static void reportMatcher(org.easymock.IArgumentMatcher)
+ public static T argThat(org.hamcrest.Matcher)





Documentation

+ public static T argThat(Matcher matcher)

Description:
Allows creating custom argument matchers. In rare cases when the parameter is a primitive then you *must* use relevant intThat(), floatThat(), etc. method. This way you will avoid NullPointerException during auto-unboxing. See examples in javadoc for ArgumentMatcher class

Parameters:

  • matcher - decides whether argument matches






- List Of Real code commits has this method mapping:
Method Mapping
- public static void reset(java.lang.Object...)
+ public void reset(T...)





Documentation

- public final void reset()

Description:
Deprecated.


+ public void reset()

Description:
Specified by: reset in interface ArgumentMatcherStorage






- List Of Real code commits has this method mapping:
Method Mapping
- public static void reset(java.lang.Object...)
+ public abstract T when(T)





Documentation

- public final void reset()

Description:
Deprecated.


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito

Parameters:

  • mock - The mock






- List Of Real code commits has this method mapping:
Method Mapping
- public static void reset(java.lang.Object...)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

- public final void reset()

Description:
Deprecated.


+ public T when(T mock)

Description:
Allows to choose a method when stubbing in doThrow()|doAnswer()|doNothing()|doReturn() style Example: doThrow(new RuntimeException()) .when(mockedList).clear(); //following throws RuntimeException: mockedList.clear(); Read more about those methods: Mockito.doThrow(Throwable) Mockito.doAnswer(Answer) Mockito.doNothing() Mockito.doReturn(Object) See examples in javadoc for Mockito

Parameters:

  • 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static void reset(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

- public final void reset()

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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static void verify(java.lang.Object...)
+ public abstract T verify(T, org.mockito.internal.verification.api.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()






- List Of Real code commits has this method mapping:
Method Mapping
- 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()






- List Of Real code commits has this method mapping:
Method Mapping
- public static void verify(java.lang.Object...)
+ public abstract T when(T)





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






- List Of Real code commits has this method mapping:
Method Mapping
- public static void verify(java.lang.Object...)
+ public abstract java.lang.Object get(java.lang.Object, java.lang.Object)





Documentation

- public void verify()

Description:
Deprecated.






- List Of Real code commits has this method mapping:
Method Mapping
- public static void verify(java.lang.Object...)
+ public abstract org.mockito.stubbing.OngoingStubbing then(org.mockito.stubbing.Answer)
+ public abstract T should()





Documentation

- public void verify()

Description:
Deprecated.


+ public OngoingStubbing then(Answer answer)

Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example: //using 'then' alias: when(mock.foo()).then(returnCoolValue()); //versus good old 'thenAnswer: when(mock.foo()).thenAnswer(byReturningCoolValue());

Parameters:

  • answer - the custom answer to execute.






- List Of Real code commits has this method mapping:
Method Mapping
- public static void verify(java.lang.Object...)
+ public static org.mockito.ArgumentCaptor forClass(java.lang.Class)





Documentation

- public void verify()

Description:
Deprecated.


+ public static ArgumentCaptor forClass(Class clazz)

Description:
Build a new ArgumentCaptor. Note that an ArgumentCaptor *don't do any type checks*, it is only there to avoid casting in your code. This might however change (type checks could be added) in a future major release.






- List Of Real code commits has this method mapping:
Method Mapping
- public static void verify(java.lang.Object...)
+ public static 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






- List Of Real code commits has this method mapping:
Method Mapping
- public static void verify(java.lang.Object...)
- public static void reset(java.lang.Object...)
- public static org.easymock.IExpectationSetters expectLastCall()
- public static void replay(java.lang.Object...)
- public abstract org.easymock.IExpectationSetters andReturn(T)
+ public abstract org.mockito.stubbing.OngoingStubbing then(org.mockito.stubbing.Answer)
+ public abstract T should()





Documentation

- public void verify()

Description:
Deprecated.


- public final void reset()

Description:
Deprecated.


- public void replay()

Description:
Deprecated.


- public 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 then(Answer answer)

Description:
Sets a generic Answer for the method. This method is an alias of OngoingStubbing.thenAnswer(Answer). This alias allows more readable tests on occasion, for example: //using 'then' alias: when(mock.foo()).then(returnCoolValue()); //versus good old 'thenAnswer: when(mock.foo()).thenAnswer(byReturningCoolValue());

Parameters:

  • answer - the custom answer to execute.






- List Of Real code commits has this method mapping:
Method Mapping
- public void expectAndReturn(java.lang.Object, java.lang.Object)
+ public abstract T when(T)





Documentation

- public void expectAndReturn(V1 ignored, V2 value)

Description:
Deprecated.

Parameters:

  • ignored - an ignored 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






- List Of Real code commits has this method mapping:
Method Mapping
- public void expectAndReturn(java.lang.Object, java.lang.Object)
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

- public void expectAndReturn(V1 ignored, V2 value)

Description:
Deprecated.

Parameters:

  • ignored - an ignored 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


+ public OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned when the method is called. E.g: when(mock.someMethod()).thenReturn(10); See examples in javadoc for Mockito.when(T)

Parameters:

  • value - return value






- List Of Real code commits has this method mapping:
Method Mapping
- public void expectAndReturn(java.lang.Object, java.lang.Object)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

- public void expectAndReturn(V1 ignored, V2 value)

Description:
Deprecated.

Parameters:

  • ignored - an ignored value.


+ public OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned when the method is called. E.g: when(mock.someMethod()).thenReturn(10); See examples in javadoc for Mockito.when(T)

Parameters:

  • value - return value






- List Of Real code commits has this method mapping:
Method Mapping
- public void expectAndReturn(java.lang.Object, java.lang.Object, int)
+ public abstract T when(T)





Documentation

- public void expectAndReturn(V1 ignored, V2 value, Range range)

Description:
Deprecated.

Parameters:

  • ignored - an ignored 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






- List Of Real code commits has this method mapping:
Method Mapping
- public void expectAndReturn(java.lang.Object, java.lang.Object, int)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

- public void expectAndReturn(V1 ignored, V2 value, Range range)

Description:
Deprecated.

Parameters:

  • ignored - an ignored value.


+ public OngoingStubbing thenReturn(T value)

Description:
Sets a return value to be returned when the method is called. E.g: when(mock.someMethod()).thenReturn(10); See examples in javadoc for Mockito.when(T)

Parameters:

  • value - return value






- List Of Real code commits has this method mapping:
Method Mapping
- public void expectAndReturn(java.lang.Object, java.lang.Object, int)
- public void expectAndReturn(java.lang.Object, java.lang.Object)
- public void replay()
+ public abstract T when(T)
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(T)





Documentation

- public void expectAndReturn(V1 ignored, V2 value, Range range)

Description:
Deprecated.

Parameters:

  • ignored - an ignored value.


- public void expectAndReturn(V1 ignored, V2 value)

Description:
Deprecated.

Parameters:

  • ignored - an ignored value.


- 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






- List Of Real code commits has this method mapping:
Method Mapping
- public void push(boolean)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)




- List Of Real code commits has this method mapping:
Method Mapping
- public void push(boolean)
+ public abstract T answer(org.mockito.invocation.InvocationOnMock) throws java.lang.Throwable





Documentation

+ public Object answer(InvocationOnMock invocation) throws Throwable

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

Parameters:

  • invocation - the invocation on the mock.






- List Of Real code commits has this method mapping:
Method Mapping
- 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.






- List Of Real code commits has this method mapping:
Method Mapping
- public void replay()
+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public void replay()
+ 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






- List Of Real code commits has this method mapping:
Method Mapping
- public void replay()
+ public abstract org.mockito.stubbing.OngoingStubbing thenReturn(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






- List Of Real code commits has this method mapping:
Method Mapping
- public void set(int)
+ public abstract org.mockito.stubbing.Stubber doAnswer(org.mockito.stubbing.Answer)




- List Of Real code commits has this method mapping:
Method Mapping
- 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.






- List Of Real code commits has this method mapping:
Method Mapping
- public void setDefaultMatcher(org.easymock.ArgumentsMatcher)
+ public static T mock(java.lang.Class)





Documentation

- public void setDefaultMatcher(ArgumentsMatcher matcher)

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






- List Of Real code commits has this method mapping:
Method Mapping
- public void verify()
+ 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






- List Of Real code commits has this method mapping:
Migration Rule testng <==> junit
Method Mapping
- boolean isNull()
+ public java.lang.Object get(java.lang.Object) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException





Documentation

+ public Object get(Object target) throws IllegalArgumentException, IllegalAccessException

Description:
Attempts to retrieve the value of this field on target






- List Of Real code commits has this method mapping:
Method Mapping
- java.lang.String[] toString(java.lang.Object[], java.lang.Class[])
+ public static void assertEquals(java.lang.Object[], java.lang.Object[])





Documentation

- public String toString()

Description:
Overrides: toString in class Object


+ public static void assertEquals(Object expected, Object actual)

Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.

Parameters:

  • expected - expected value
  • actual - the value to check against expected






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract int size()
+ public static void assertNotSame(java.lang.String, java.lang.Object, java.lang.Object)





Documentation

+ public static void assertNotSame(String message, Object expected, Object actual)

Description:
Asserts that two objects do not refer to the same object. If they do refer to the same object, an AssertionError is thrown with the given message.

Parameters:

  • message - the identifying message for the AssertionError ( null okay)
  • unexpected - the object you don't expect
  • actual - the object to compare to unexpected






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract int size()
+ public static void assertTrue(java.lang.String, boolean)





Documentation

+ public static void assertTrue(String message, boolean condition)

Description:
Asserts that a condition is true. If it isn't it throws an AssertionError with the given message.

Parameters:

  • message - the identifying message for the AssertionError ( null okay)
  • condition - condition to be checked






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract int[] indices()
+ public static org.hamcrest.Matcher equalTo(T)





Documentation

+ public static Matcher equalTo(T operand)

Description:
Is the value equal to another value, as tested by the Object.equals(java.lang.Object) invokedMethod?






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract int[] indices()
+ public static void assertTrue(java.lang.String, boolean)





Documentation

+ public static void assertTrue(String message, boolean condition)

Description:
Asserts that a condition is true. If it isn't it throws an AssertionError with the given message.

Parameters:

  • message - the identifying message for the AssertionError ( null okay)
  • condition - condition to be checked






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract java.lang.Class[] getValue()
+ public abstract java.lang.Object getValue() throws org.junit.experimental.theories.PotentialAssignment$CouldNotGenerateValueException





Documentation

- public String[] getValue()

Description:
The list of variables used to fill the parameters of this method. These variables must be defined in your testng.xml file. For example @Parameters({ "xmlPath" }) @Test public void verifyXmlFile(String path) { ... } and in testng.xml: <parameter name="xmlPath" value="account.xml" />


+ public Object getValue() throws CouldNotGenerateValueException

Description:
Throws: PotentialAssignment.CouldNotGenerateValueException






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract java.lang.Class[] getValue()
+ public static void assertEquals(int, int)





Documentation

- public String[] getValue()

Description:
The list of variables used to fill the parameters of this method. These variables must be defined in your testng.xml file. For example @Parameters({ "xmlPath" }) @Test public void verifyXmlFile(String path) { ... } and in testng.xml: <parameter name="xmlPath" value="account.xml" />


+ public static void assertEquals(int expected, int actual)

Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.

Parameters:

  • expected - expected value
  • actual - the value to check against expected






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract java.lang.Class[] getValue()
- public boolean equals(java.lang.Object)
+ public static void assertEquals(int, int)





Documentation

- public String[] getValue()

Description:
The list of variables used to fill the parameters of this method. These variables must be defined in your testng.xml file. For example @Parameters({ "xmlPath" }) @Test public void verifyXmlFile(String path) { ... } and in testng.xml: <parameter name="xmlPath" value="account.xml" />


- public boolean equals(Object obj)

Description:
Overrides: equals in class Object


+ public static void assertEquals(int expected, int actual)

Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.

Parameters:

  • expected - expected value
  • actual - the value to check against expected






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract java.lang.Class[] getValue()
- public void put(org.testng.xml.XmlSuite, org.testng.ISuite)
+ public abstract java.lang.Object getValue() throws org.junit.experimental.theories.PotentialAssignment$CouldNotGenerateValueException





Documentation

- public String[] getValue()

Description:
The list of variables used to fill the parameters of this method. These variables must be defined in your testng.xml file. For example @Parameters({ "xmlPath" }) @Test public void verifyXmlFile(String path) { ... } and in testng.xml: <parameter name="xmlPath" value="account.xml" />


+ public Object getValue() throws CouldNotGenerateValueException

Description:
Throws: PotentialAssignment.CouldNotGenerateValueException






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract java.lang.Object getInstance()
+ public static void assertEquals(int, int)





Documentation

- public Object getInstance()

Description:
The instance on which this method was run.


+ public static void assertEquals(int expected, int actual)

Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.

Parameters:

  • expected - expected value
  • actual - the value to check against expected






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract java.lang.Object getInstance()
- public abstract java.lang.Class[] getValue()
- public boolean equals(java.lang.Object)
+ public static void assertEquals(int, int)





Documentation

- public Object getInstance()

Description:
The instance on which this method was run.


- public String[] getValue()

Description:
The list of variables used to fill the parameters of this method. These variables must be defined in your testng.xml file. For example @Parameters({ "xmlPath" }) @Test public void verifyXmlFile(String path) { ... } and in testng.xml: <parameter name="xmlPath" value="account.xml" />


- public boolean equals(Object obj)

Description:
Overrides: equals in class Object


+ public static void assertEquals(int expected, int actual)

Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.

Parameters:

  • expected - expected value
  • actual - the value to check against expected






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract java.lang.Object[] getInstances(boolean)
+ public static void assertTrue(java.lang.String, boolean)





Documentation

- public Object[] getInstances(boolean create)

Description:
Returns all the instances the methods will be invoked upon. This will typically be an array of one object in the absence of a @Factory annotation.

Parameters:

  • reuse - flag if a new set of instances must be returned (if set to false)


+ public static void assertTrue(String message, boolean condition)

Description:
Asserts that a condition is true. If it isn't it throws an AssertionError with the given message.

Parameters:

  • message - the identifying message for the AssertionError ( null okay)
  • condition - condition to be checked






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract java.lang.Object[] getInstances(boolean)
- public static void assertTrue(boolean, java.lang.String)
+ public static void assertTrue(java.lang.String, boolean)





Documentation

- public Object[] getInstances(boolean create)

Description:
Returns all the instances the methods will be invoked upon. This will typically be an array of one object in the absence of a @Factory annotation.

Parameters:

  • reuse - flag if a new set of instances must be returned (if set to false)


- public static void assertTrue(String message, boolean condition)

Description:
Asserts that a condition is true. If it isn't it throws an AssertionFailedError with the given message.


+ public static void assertTrue(String message, boolean condition)

Description:
Asserts that a condition is true. If it isn't it throws an AssertionError with the given message.

Parameters:

  • message - the identifying message for the AssertionError ( null okay)
  • condition - condition to be checked






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract java.lang.Object[] getInstances(boolean)
- public void assertNotEquals(double, double, double)
- public abstract int size()
+ public static void assertNotSame(java.lang.String, java.lang.Object, java.lang.Object)





Documentation

- public Object[] getInstances(boolean create)

Description:
Returns all the instances the methods will be invoked upon. This will typically be an array of one object in the absence of a @Factory annotation.

Parameters:

  • reuse - flag if a new set of instances must be returned (if set to false)


+ public static void assertNotSame(String message, Object expected, Object actual)

Description:
Asserts that two objects do not refer to the same object. If they do refer to the same object, an AssertionError is thrown with the given message.

Parameters:

  • message - the identifying message for the AssertionError ( null okay)
  • unexpected - the object you don't expect
  • actual - the object to compare to unexpected






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract java.lang.String getMessage()
+ public java.lang.String getMessage()





Documentation

- public String getMessage()

Description:
Overrides: getMessage in class Throwable


+ public String getMessage()

Description:
Returns "..." in place of common prefix and "..." in place of common suffix between expected and actual.






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract java.lang.String getMessage()
+ public static void fail(java.lang.String)





Documentation

- public String getMessage()

Description:
Overrides: getMessage in class Throwable


+ public static void fail(String message)

Description:
Fails a test with the given message.

Parameters:

  • message - the identifying message for the AssertionError ( null okay)






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract java.lang.String getType()
+ public abstract java.lang.Class getType()





Documentation

+ public Class getType()

Description:
Specified by: getType in class FrameworkMember<FrameworkField>

Return Parameters:

  • the underlying Java Field type






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract java.lang.String getType()
+ public static void assertEquals(java.lang.Object[], java.lang.Object[])





Documentation

+ public static void assertEquals(Object expected, Object actual)

Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.

Parameters:

  • expected - expected value
  • actual - the value to check against expected






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract java.lang.String getType()
- java.lang.String[] toString(java.lang.Object[], java.lang.Class[])
+ public abstract java.lang.Class getType()





Documentation

- public String toString()

Description:
Overrides: toString in class Object


+ public Class getType()

Description:
Specified by: getType in class FrameworkMember<FrameworkField>

Return Parameters:

  • the underlying Java Field type






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract org.testng.xml.XmlTest getTest()
+ public junit.framework.Test getTest()





Documentation

- public XmlTest getTest()

Description:
Specified by: getTest in interface org.testng.internal.ITestResultNotifier






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract void run(org.testng.IConfigureCallBack, org.testng.ITestResult)
+ public junit.framework.TestResult start(java.lang.String[]) throws java.lang.Exception





Documentation

- public String run(String template, Map m) throws IOException

Description:
Throws: IOException






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract void run(org.testng.IConfigureCallBack, org.testng.ITestResult)
+ public synchronized void stop()





Documentation

- public String run(String template, Map m) throws IOException

Description:
Throws: IOException






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract void run(org.testng.IConfigureCallBack, org.testng.ITestResult)
- public abstract void runTestMethod(org.testng.ITestResult)
+ public junit.framework.TestResult start(java.lang.String[]) throws java.lang.Exception
+ public synchronized void stop()





Documentation

- public String run(String template, Map m) throws IOException

Description:
Throws: IOException


- public void runTestMethod(ITestResult tr)

Description:
Invoke the test method currently being hijacked.






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract void runTestMethod(org.testng.ITestResult)
+ public junit.framework.TestResult start(java.lang.String[]) throws java.lang.Exception





Documentation

- public void runTestMethod(ITestResult tr)

Description:
Invoke the test method currently being hijacked.






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract void runTestMethod(org.testng.ITestResult)
+ public synchronized void stop()





Documentation

- public void runTestMethod(ITestResult tr)

Description:
Invoke the test method currently being hijacked.






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract void setId(java.lang.String)
+ public static org.hamcrest.Matcher equalTo(T)





Documentation

+ public static Matcher equalTo(T operand)

Description:
Is the value equal to another value, as tested by the Object.equals(java.lang.Object) invokedMethod?






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract void setParameters(java.lang.Object[])
+ org.hamcrest.Matcher build()





Documentation

- public void setParameters(Object[] parameters)

Description:
Sets parameters.

Parameters:

  • parameters - the parameters.


+ public Timeout build()

Description:
Builds a Timeout instance using the values in this builder.,






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract void shutdown()
+ public static void assertEquals(java.lang.Object[], java.lang.Object[])





Documentation

+ public static void assertEquals(Object expected, Object actual)

Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.

Parameters:

  • expected - expected value
  • actual - the value to check against expected






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract void shutdown()
+ public static void assertEquals(java.lang.String, float, float, float)





Documentation

+ public static void assertEquals(String message, float expected, float actual, float delta)

Description:
Asserts that two doubles or floats are equal to within a positive delta. If they are not, an AssertionError is thrown with the given message. If the expected value is infinity then the delta value is ignored. NaNs are considered equal: assertEquals(Double.NaN, Double.NaN, *) passes

Parameters:

  • message - the identifying message for the AssertionError ( null okay)
  • expected - expected value
  • actual - the value to check against expected
  • delta - the maximum delta between expected and actual for which both numbers are still considered equal.






- List Of Real code commits has this method mapping:
Method Mapping
- public abstract void shutdown()
- public void assertEquals(java.util.Set, java.util.Set)
+ public static void assertEquals(java.lang.Object[], java.lang.Object[])





Documentation

- public static void assertEquals(Set actual, Set expected)

Description:
Asserts that two objects are equal. If they are not an AssertionFailedError is thrown.


+ public static void assertEquals(Object expected, Object actual)

Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.

Parameters:

  • expected - expected value
  • actual - the value to check against expected






- List Of Real code commits has this method mapping:
Method Mapping
- public boolean equals(java.lang.Object)
+ public boolean equals(java.lang.Object)





Documentation

- public boolean equals(Object obj)

Description:
Overrides: equals in class Object


+ public boolean equals(Object obj)

Description:
Overrides: equals in class Object






- List Of Real code commits has this method mapping:
Method Mapping
- public boolean equals(java.lang.Object)
+ public static void assertEquals(int, int)





Documentation

- public boolean equals(Object obj)

Description:
Overrides: equals in class Object


+ public static void assertEquals(int expected, int actual)

Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.

Parameters:

  • expected - expected value
  • actual - the value to check against expected






- List Of Real code commits has this method mapping:
Method Mapping
- public boolean equals(java.lang.Object)
+ public static void assertEquals(java.lang.Object[], java.lang.Object[])





Documentation

- public boolean equals(Object obj)

Description:
Overrides: equals in class Object


+ public static void assertEquals(Object expected, Object actual)

Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.

Parameters:

  • expected - expected value
  • actual - the value to check against expected






- List Of Real code commits has this method mapping:
Method Mapping
- public boolean equals(java.lang.Object)
+ public static void assertEquals(java.lang.Object[], java.lang.Object[])
+ public static void assertTrue(boolean)





Documentation

- public boolean equals(Object obj)

Description:
Overrides: equals in class Object


+ public static void assertEquals(Object expected, Object actual)

Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.

Parameters:

  • expected - expected value
  • actual - the value to check against expected


+ public static void assertTrue(boolean condition)

Description:
Asserts that a condition is true. If it isn't it throws an AssertionError without a message.

Parameters:

  • condition - condition to be checked






- List Of Real code commits has this method mapping:
Method Mapping
- public int compareTo(java.lang.Object)
+ public static void assertEquals(int, int)





Documentation

- public int compareTo(Object o)

Description:
Specified by: compareTo in interface Comparable


+ public static void assertEquals(int expected, int actual)

Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.

Parameters:

  • expected - expected value
  • actual - the value to check against expected






- List Of Real code commits has this method mapping:
Method Mapping
- public java.lang.Object next()
+ public abstract java.lang.Class getType()





Documentation

+ public Class getType()

Description:
Specified by: getType in class FrameworkMember<FrameworkField>

Return Parameters:

  • the underlying Java Field type






- List Of Real code commits has this method mapping:
Method Mapping
- public java.lang.Object next()
+ public static void assertEquals(java.lang.Object[], java.lang.Object[])





Documentation

+ public static void assertEquals(Object expected, Object actual)

Description:
Asserts that two objects are equal. If they are not, an AssertionError without a message is thrown. If expected and actual are null, they are considered equal.

Parameters:

  • expected - expected value
  • actual - the value to check against expected






- List Of Real code commits has this method mapping:
Method Mapping
- public java.lang.String toString()
+ public java.lang.String toString()





Documentation

- public String toString()

Description:
Overrides: toString in class Object


+ public String toString()

Description:
Overrides: toString in class Object






- List Of Real code commits has this method mapping: