Package org.mockito.internal
Class MockedConstructionImpl<T>
- java.lang.Object
-
- org.mockito.internal.MockedConstructionImpl<T>
-
- All Implemented Interfaces:
java.lang.AutoCloseable,MockedConstruction<T>,ScopedMock
public final class MockedConstructionImpl<T> extends java.lang.Object implements MockedConstruction<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.mockito.MockedConstruction
MockedConstruction.Context, MockedConstruction.MockInitializer<T>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMockedConstructionImpl(MockMaker.ConstructionMockControl<T> control)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidassertNotClosed()voidclose()Closes this scoped mock and throws an exception if already closed.voidcloseOnDemand()Releases this scoped mock and is non-operational if already released.java.util.List<T>constructed()booleanisClosed()Checks if this mock is closed.
-
-
-
Field Detail
-
control
private final MockMaker.ConstructionMockControl<T> control
-
closed
private boolean closed
-
location
private final Location location
-
-
Constructor Detail
-
MockedConstructionImpl
protected MockedConstructionImpl(MockMaker.ConstructionMockControl<T> control)
-
-
Method Detail
-
constructed
public java.util.List<T> constructed()
- Specified by:
constructedin interfaceMockedConstruction<T>
-
isClosed
public boolean isClosed()
Description copied from interface:ScopedMockChecks if this mock is closed.- Specified by:
isClosedin interfaceScopedMock- Returns:
trueif this mock is closed.
-
close
public void close()
Description copied from interface:ScopedMockCloses this scoped mock and throws an exception if already closed.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceScopedMock
-
closeOnDemand
public void closeOnDemand()
Description copied from interface:ScopedMockReleases this scoped mock and is non-operational if already released.- Specified by:
closeOnDemandin interfaceScopedMock
-
assertNotClosed
private void assertNotClosed()
-
-