Top Fields Constructors Methods
org.junit.jupiter.engine.execution

public Class DefaultTestInstances

extends Object
implements TestInstances
Class Inheritance
All Implemented Interfaces
org.junit.jupiter.api.extension.TestInstances
Annotations
@API
status:INTERNAL
since:5.4
Static Imports
org.apiguardian.api.API.Status.INTERNAL

Field Summary

Modifier and TypeField and Description
private final List<Object>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public <T> Optional<T>
findInstance(Class<T> requiredType)

Implements org.junit.jupiter.api.extension.TestInstances.findInstance.

Find the first test instance that is an instance of the supplied required type, checking from innermost to outermost.

public List<Object>
getAllInstances()

Implements org.junit.jupiter.api.extension.TestInstances.getAllInstances.

Get all test instances, ordered from outermost to innermost.

public List<Object>
getEnclosingInstances()

Implements org.junit.jupiter.api.extension.TestInstances.getEnclosingInstances.

Get the enclosing test instances, excluding the innermost test instance, ordered from outermost to innermost.

public Object
public static DefaultTestInstances
of(Object instance)

public static DefaultTestInstances
of(TestInstances testInstances, Object instance)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

instancesback to summary
private final List<Object> instances

Constructor Detail

DefaultTestInstancesback to summary
private DefaultTestInstances(List<Object> instances)

Method Detail

findInstanceback to summary
public <T> Optional<T> findInstance(Class<T> requiredType)

Implements org.junit.jupiter.api.extension.TestInstances.findInstance.

Doc from org.junit.jupiter.api.extension.TestInstances.findInstance.

Find the first test instance that is an instance of the supplied required type, checking from innermost to outermost.

Annotations
@Override
getAllInstancesback to summary
public List<Object> getAllInstances()

Implements org.junit.jupiter.api.extension.TestInstances.getAllInstances.

Doc from org.junit.jupiter.api.extension.TestInstances.getAllInstances.

Get all test instances, ordered from outermost to innermost.

Annotations
@Override
getEnclosingInstancesback to summary
public List<Object> getEnclosingInstances()

Implements org.junit.jupiter.api.extension.TestInstances.getEnclosingInstances.

Doc from org.junit.jupiter.api.extension.TestInstances.getEnclosingInstances.

Get the enclosing test instances, excluding the innermost test instance, ordered from outermost to innermost.

Annotations
@Override
getInnermostInstanceback to summary
public Object getInnermostInstance()

Implements org.junit.jupiter.api.extension.TestInstances.getInnermostInstance.

Doc from org.junit.jupiter.api.extension.TestInstances.getInnermostInstance.

Get the innermost test instance.

The innermost instance is the one closest to the test method.

Annotations
@Override
ofback to summary
public static DefaultTestInstances of(Object instance)
ofback to summary
public static DefaultTestInstances of(TestInstances testInstances, Object instance)