Package org.mockito.internal.stubbing
Class InvocationContainerImpl
- java.lang.Object
-
- org.mockito.internal.stubbing.InvocationContainerImpl
-
- All Implemented Interfaces:
java.io.Serializable
,InvocationContainer
public class InvocationContainerImpl extends java.lang.Object implements InvocationContainer, java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private DoAnswerStyleStubbing
doAnswerStyleStubbing
private MatchableInvocation
invocationForStubbing
private Strictness
mockStrictness
private RegisteredInvocations
registeredInvocations
private static long
serialVersionUID
private java.util.LinkedList<StubbedInvocationMatcher>
stubbed
-
Constructor Summary
Constructors Constructor Description InvocationContainerImpl(MockCreationSettings<?> mockSettings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StubbedInvocationMatcher
addAnswer(Answer<?> answer, boolean isConsecutive, Strictness stubbingStrictness)
Adds new stubbed answer and returns the invocation matcher the answer was added to.void
addAnswer(Answer<?> answer, Strictness stubbingStrictness)
void
addConsecutiveAnswer(Answer<?> answer)
(package private) java.lang.Object
answerTo(Invocation invocation)
void
clearInvocations()
private RegisteredInvocations
createRegisteredInvocations(MockCreationSettings<?> mockSettings)
StubbedInvocationMatcher
findAnswerFor(Invocation invocation)
Answer<?>
findStubbedAnswer()
java.util.List<Invocation>
getInvocations()
java.util.Collection<Stubbing>
getStubbingsAscending()
Stubbings in ascending order, most recent lastboolean
hasAnswersForStubbing()
boolean
hasInvocationForPotentialStubbing()
java.lang.Object
invokedMock()
void
resetInvocationForPotentialStubbing(MatchableInvocation invocationMatcher)
void
setAnswersForStubbing(java.util.List<Answer<?>> answers, Strictness strictness)
Sets the answers declared with 'doAnswer' style.void
setInvocationForPotentialStubbing(MatchableInvocation invocation)
void
setMethodForStubbing(MatchableInvocation invocation)
java.lang.String
toString()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
stubbed
private final java.util.LinkedList<StubbedInvocationMatcher> stubbed
-
doAnswerStyleStubbing
private final DoAnswerStyleStubbing doAnswerStyleStubbing
-
registeredInvocations
private final RegisteredInvocations registeredInvocations
-
mockStrictness
private final Strictness mockStrictness
-
invocationForStubbing
private MatchableInvocation invocationForStubbing
-
-
Constructor Detail
-
InvocationContainerImpl
public InvocationContainerImpl(MockCreationSettings<?> mockSettings)
-
-
Method Detail
-
setInvocationForPotentialStubbing
public void setInvocationForPotentialStubbing(MatchableInvocation invocation)
-
resetInvocationForPotentialStubbing
public void resetInvocationForPotentialStubbing(MatchableInvocation invocationMatcher)
-
addAnswer
public void addAnswer(Answer<?> answer, Strictness stubbingStrictness)
-
addAnswer
public StubbedInvocationMatcher addAnswer(Answer<?> answer, boolean isConsecutive, Strictness stubbingStrictness)
Adds new stubbed answer and returns the invocation matcher the answer was added to.
-
addConsecutiveAnswer
public void addConsecutiveAnswer(Answer<?> answer)
-
answerTo
java.lang.Object answerTo(Invocation invocation) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
findAnswerFor
public StubbedInvocationMatcher findAnswerFor(Invocation invocation)
-
setAnswersForStubbing
public void setAnswersForStubbing(java.util.List<Answer<?>> answers, Strictness strictness)
Sets the answers declared with 'doAnswer' style.
-
hasAnswersForStubbing
public boolean hasAnswersForStubbing()
-
hasInvocationForPotentialStubbing
public boolean hasInvocationForPotentialStubbing()
-
setMethodForStubbing
public void setMethodForStubbing(MatchableInvocation invocation)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getInvocations
public java.util.List<Invocation> getInvocations()
-
clearInvocations
public void clearInvocations()
-
getStubbingsAscending
public java.util.Collection<Stubbing> getStubbingsAscending()
Stubbings in ascending order, most recent last
-
invokedMock
public java.lang.Object invokedMock()
-
createRegisteredInvocations
private RegisteredInvocations createRegisteredInvocations(MockCreationSettings<?> mockSettings)
-
findStubbedAnswer
public Answer<?> findStubbedAnswer()
-
-