Class MockitoNewInvocationControl<T>
- java.lang.Object
-
- org.powermock.api.mockito.internal.invocation.MockitoNewInvocationControl<T>
-
- All Implemented Interfaces:
DefaultBehavior,NewInvocationControl<org.mockito.stubbing.OngoingStubbing<T>>
public class MockitoNewInvocationControl<T> extends java.lang.Object implements NewInvocationControl<org.mockito.stubbing.OngoingStubbing<T>>
-
-
Field Summary
Fields Modifier and Type Field Description private InvocationSubstitute<T>substitute
-
Constructor Summary
Constructors Constructor Description MockitoNewInvocationControl(InvocationSubstitute<T> substitute)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.mockito.stubbing.OngoingStubbing<T>expectSubstitutionLogic(java.lang.Object... arguments)Expect a call to the new instance substitution logic.InvocationSubstitute<T>getSubstitute()java.lang.Objectinvoke(java.lang.Class<?> type, java.lang.Object[] args, java.lang.Class<?>[] sig)Invoke the constructor invocation controljava.lang.Objectreplay(java.lang.Object... mocks)Replay the given objects or classes.java.lang.Objectreset(java.lang.Object... mocks)Reset the given objects or classes.voidverify(org.mockito.verification.VerificationMode verificationMode)voidverifyNoMoreInteractions()
-
-
-
Field Detail
-
substitute
private final InvocationSubstitute<T> substitute
-
-
Constructor Detail
-
MockitoNewInvocationControl
public MockitoNewInvocationControl(InvocationSubstitute<T> substitute)
-
-
Method Detail
-
invoke
public java.lang.Object invoke(java.lang.Class<?> type, java.lang.Object[] args, java.lang.Class<?>[] sig) throws java.lang.ExceptionDescription copied from interface:NewInvocationControlInvoke the constructor invocation control- Specified by:
invokein interfaceNewInvocationControl<T>- Parameters:
type- invocation target typeargs- arguments of constructor invocationsig- parameters of a constructor- Returns:
- result of invocation
- Throws:
java.lang.Exception
-
expectSubstitutionLogic
public org.mockito.stubbing.OngoingStubbing<T> expectSubstitutionLogic(java.lang.Object... arguments) throws java.lang.Exception
Description copied from interface:NewInvocationControlExpect a call to the new instance substitution logic.- Specified by:
expectSubstitutionLogicin interfaceNewInvocationControl<T>- Parameters:
arguments- constructor arguments- Returns:
- result of stubbing a constructor. Result depends on mocking framework.
- Throws:
java.lang.Exception
-
getSubstitute
public InvocationSubstitute<T> getSubstitute()
-
replay
public java.lang.Object replay(java.lang.Object... mocks)
Description copied from interface:DefaultBehaviorReplay the given objects or classes. May throw exception if replay is not needed or not supported.- Specified by:
replayin interfaceDefaultBehavior- Parameters:
mocks- The object(s) to replay. May benull.- Returns:
- the result of the replay (may be
null).
-
verify
public void verify(org.mockito.verification.VerificationMode verificationMode)
-
reset
public java.lang.Object reset(java.lang.Object... mocks)
Description copied from interface:DefaultBehaviorReset the given objects or classes. May throw exception if reset is not needed or not supported.- Specified by:
resetin interfaceDefaultBehavior- Parameters:
mocks- The object(s) to replay. May benull.- Returns:
- the result of the replay (may be
null).
-
verifyNoMoreInteractions
public void verifyNoMoreInteractions()
-
-