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 protected
MockedConstructionImpl(MockMaker.ConstructionMockControl<T> control)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
assertNotClosed()
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.java.util.List<T>
constructed()
boolean
isClosed()
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:
constructed
in interfaceMockedConstruction<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()
-
-