Package org.mockito.internal
Class MockedStaticImpl<T>
- java.lang.Object
-
- org.mockito.internal.MockedStaticImpl<T>
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,MockedStatic<T>
,ScopedMock
public final class MockedStaticImpl<T> extends java.lang.Object implements MockedStatic<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.mockito.MockedStatic
MockedStatic.Verification
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MockedStaticImpl(MockMaker.StaticMockControl<T> control)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
assertNotClosed()
void
clearInvocations()
void
close()
Closes this scoped mock and throws an exception if already closed.void
closeOnDemand()
Releases this scoped mock and is non-operational if already released.boolean
isClosed()
Checks if this mock is closed.void
reset()
java.lang.String
toString()
void
verify(MockedStatic.Verification verification, VerificationMode mode)
void
verify(VerificationMode mode, MockedStatic.Verification verification)
void
verifyNoInteractions()
void
verifyNoMoreInteractions()
<S> OngoingStubbing<S>
when(MockedStatic.Verification verification)
SeeMockito.when(Object)
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.mockito.MockedStatic
verify
-
-
-
-
Field Detail
-
control
private final MockMaker.StaticMockControl<T> control
-
closed
private boolean closed
-
location
private final Location location
-
-
Constructor Detail
-
MockedStaticImpl
protected MockedStaticImpl(MockMaker.StaticMockControl<T> control)
-
-
Method Detail
-
when
public <S> OngoingStubbing<S> when(MockedStatic.Verification verification)
Description copied from interface:MockedStatic
SeeMockito.when(Object)
.- Specified by:
when
in interfaceMockedStatic<T>
-
verify
public void verify(VerificationMode mode, MockedStatic.Verification verification)
Description copied from interface:MockedStatic
- Specified by:
verify
in interfaceMockedStatic<T>
-
verify
public void verify(MockedStatic.Verification verification, VerificationMode mode)
Description copied from interface:MockedStatic
- Specified by:
verify
in interfaceMockedStatic<T>
-
reset
public void reset()
Description copied from interface:MockedStatic
- Specified by:
reset
in interfaceMockedStatic<T>
-
clearInvocations
public void clearInvocations()
Description copied from interface:MockedStatic
- Specified by:
clearInvocations
in interfaceMockedStatic<T>
-
verifyNoMoreInteractions
public void verifyNoMoreInteractions()
Description copied from interface:MockedStatic
- Specified by:
verifyNoMoreInteractions
in interfaceMockedStatic<T>
-
verifyNoInteractions
public void verifyNoInteractions()
Description copied from interface:MockedStatic
- Specified by:
verifyNoInteractions
in interfaceMockedStatic<T>
-
isClosed
public boolean isClosed()
Description copied from interface:ScopedMock
Checks if this mock is closed.- Specified by:
isClosed
in interfaceScopedMock
- Returns:
true
if this mock is closed.
-
close
public void close()
Description copied from interface:ScopedMock
Closes this scoped mock and throws an exception if already closed.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceScopedMock
-
closeOnDemand
public void closeOnDemand()
Description copied from interface:ScopedMock
Releases this scoped mock and is non-operational if already released.- Specified by:
closeOnDemand
in interfaceScopedMock
-
assertNotClosed
private void assertNotClosed()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-